Skip to content

Commit

Permalink
Fix #1438 Crash after Breaking Chest
Browse files Browse the repository at this point in the history
  • Loading branch information
Nedelosk committed Oct 10, 2016
1 parent 61aa8bd commit 05a2638
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/forestry/apiculture/genetics/BeeRoot.java
Expand Up @@ -180,7 +180,7 @@ public boolean isMated(ItemStack stack) {

@Override
public IBee getMember(ItemStack stack) {
if (!isMember(stack)) {
if (!isMember(stack) || !stack.hasTagCompound()) {
return null;
}

Expand Down
6 changes: 1 addition & 5 deletions src/main/java/forestry/core/genetics/Individual.java
Expand Up @@ -26,11 +26,7 @@ protected Individual() {
}

protected Individual(@Nonnull NBTTagCompound nbt) {
if(nbt.hasKey("IsAnalyzed")){
isAnalyzed = nbt.getBoolean("IsAnalyzed");
}else{
isAnalyzed = false;
}
isAnalyzed = nbt.getBoolean("IsAnalyzed");
}

@Override
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/forestry/core/genetics/IndividualLiving.java
Expand Up @@ -32,12 +32,8 @@ protected IndividualLiving(int newHealth) {

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
Expand Down

0 comments on commit 05a2638

Please sign in to comment.