From 05a263826e7bc0eea3ba7d739f7b72dc2695a25e Mon Sep 17 00:00:00 2001 From: Nedelosk Date: Mon, 10 Oct 2016 10:13:17 +0200 Subject: [PATCH] Fix #1438 Crash after Breaking Chest --- src/main/java/forestry/apiculture/genetics/BeeRoot.java | 2 +- src/main/java/forestry/core/genetics/Individual.java | 6 +----- .../java/forestry/core/genetics/IndividualLiving.java | 8 ++------ 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/main/java/forestry/apiculture/genetics/BeeRoot.java b/src/main/java/forestry/apiculture/genetics/BeeRoot.java index f34ebfa23..b5f80c505 100644 --- a/src/main/java/forestry/apiculture/genetics/BeeRoot.java +++ b/src/main/java/forestry/apiculture/genetics/BeeRoot.java @@ -180,7 +180,7 @@ public class BeeRoot extends SpeciesRoot implements IBeeRoot { @Override public IBee getMember(ItemStack stack) { - if (!isMember(stack)) { + if (!isMember(stack) || !stack.hasTagCompound()) { return null; } diff --git a/src/main/java/forestry/core/genetics/Individual.java b/src/main/java/forestry/core/genetics/Individual.java index ade433a23..cd85cd0b7 100755 --- a/src/main/java/forestry/core/genetics/Individual.java +++ b/src/main/java/forestry/core/genetics/Individual.java @@ -26,11 +26,7 @@ public abstract class Individual implements IIndividual { } protected Individual(@Nonnull NBTTagCompound nbt) { - if(nbt.hasKey("IsAnalyzed")){ - isAnalyzed = nbt.getBoolean("IsAnalyzed"); - }else{ - isAnalyzed = false; - } + isAnalyzed = nbt.getBoolean("IsAnalyzed"); } @Override diff --git a/src/main/java/forestry/core/genetics/IndividualLiving.java b/src/main/java/forestry/core/genetics/IndividualLiving.java index dc7a4e6fb..3bcaa6b0f 100755 --- a/src/main/java/forestry/core/genetics/IndividualLiving.java +++ b/src/main/java/forestry/core/genetics/IndividualLiving.java @@ -32,12 +32,8 @@ public abstract class IndividualLiving extends Individual implements IIndividual protected IndividualLiving(@Nonnull NBTTagCompound nbt) { super(nbt); - if(nbt.hasKey("Health")){ - health = nbt.getInteger("Health"); - } - if(nbt.hasKey("MaxH")){ - maxHealth = nbt.getInteger("MaxH"); - } + health = nbt.getInteger("Health"); + maxHealth = nbt.getInteger("MaxH"); } @Override