From 6361efc825e5bf05fee382912ba0600db50063f0 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Sun, 10 May 2015 13:07:07 +0200 Subject: [PATCH] Add an extra check to projectile loading that ensures that the contained item is still valid, in case something got scrambled. --- src/main/java/tconstruct/library/entity/ProjectileBase.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/tconstruct/library/entity/ProjectileBase.java b/src/main/java/tconstruct/library/entity/ProjectileBase.java index 3151718c..85d1189e 100644 --- a/src/main/java/tconstruct/library/entity/ProjectileBase.java +++ b/src/main/java/tconstruct/library/entity/ProjectileBase.java @@ -605,6 +605,11 @@ public abstract class ProjectileBase extends EntityArrow implements IEntityAddit this.returnStack = ItemStack.loadItemStackFromNBT(tags.getCompoundTag("Throwable")); onGround = tags.getByte("onGround") == 1; //doNotRetrieve = tags.getBoolean("Retrieval"); + + // ensure that nothing can crash because something went wrong in the world... + if(this.returnStack == null || !(this.returnStack.getItem() instanceof ToolCore)) { + this.setDead(); + } } @Override