尝试添加异常处理
This commit is contained in:
parent
714e452d53
commit
08a6ac6c95
1 changed files with 9 additions and 1 deletions
|
@ -320,7 +320,15 @@ public class DroneEntity extends PathfinderMob implements GeoEntity {
|
||||||
super.die(source);
|
super.die(source);
|
||||||
|
|
||||||
String id = this.entityData.get(CONTROLLER);
|
String id = this.entityData.get(CONTROLLER);
|
||||||
Player player = this.level().getPlayerByUUID(UUID.fromString(id));
|
|
||||||
|
UUID uuid;
|
||||||
|
try {
|
||||||
|
uuid = UUID.fromString(id);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player = this.level().getPlayerByUUID(uuid);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.getInventory().items.stream().filter(stack -> stack.getItem() == TargetModItems.MONITOR.get())
|
player.getInventory().items.stream().filter(stack -> stack.getItem() == TargetModItems.MONITOR.get())
|
||||||
.forEach(stack -> {
|
.forEach(stack -> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue