diff --git a/src/main/java/org/squiddev/cctweaks/core/network/bridge/NetworkBinding.java b/src/main/java/org/squiddev/cctweaks/core/network/bridge/NetworkBinding.java index e0af1868..497c94e1 100644 --- a/src/main/java/org/squiddev/cctweaks/core/network/bridge/NetworkBinding.java +++ b/src/main/java/org/squiddev/cctweaks/core/network/bridge/NetworkBinding.java @@ -127,8 +127,6 @@ public boolean load(NBTTagCompound tag) { if (tag.hasKey(ID)) { setId(tag.getInteger(ID)); loaded = true; - } else { - removeId(); } return loaded; diff --git a/src/main/java/org/squiddev/cctweaks/turtle/ToolManipulatorPeripheral.java b/src/main/java/org/squiddev/cctweaks/turtle/ToolManipulatorPeripheral.java index ab42e4b9..40c98f48 100644 --- a/src/main/java/org/squiddev/cctweaks/turtle/ToolManipulatorPeripheral.java +++ b/src/main/java/org/squiddev/cctweaks/turtle/ToolManipulatorPeripheral.java @@ -350,7 +350,7 @@ public Object[] execute() throws LuaException { boolean result = TurtleRegistry.instance.canSwing(access, player, stack, direction, hit); if (result) return new Object[]{true}; - if (hit.entityHit != null) { + if (hit != null && hit.entityHit != null) { @SuppressWarnings("unchecked") Multimap map = stack.getAttributeModifiers(); for (AttributeModifier modifier : map.get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName())) { if (modifier.getAmount() > 0) { @@ -360,7 +360,7 @@ public Object[] execute() throws LuaException { } } - if (hit.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + if (hit != null && hit.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { Block block = access.getWorld().getBlockState(hit.getBlockPos()).getBlock(); if (block.canHarvestBlock(access.getWorld(), hit.getBlockPos(), player)) { return new Object[]{true};