Add an extra check to projectile loading that ensures that the contained item is still valid, in case something got scrambled.

This commit is contained in:
Bernhard Bonigl committed 2015-05-10 13:07:07 +02:00
1 parent 291db565ee
commit 6361efc825
1 file changed
+5
@@ -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