mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Fix a crash that sometimes happens when placing down container blocks
Closes #437
This commit is contained in:
parent
073eb2168a
commit
fc4484cc73
1 changed files with 3 additions and 3 deletions
|
@ -23,8 +23,6 @@ import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.item.EnumRarity;
|
import net.minecraft.item.EnumRarity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTBase;
|
import net.minecraft.nbt.NBTBase;
|
||||||
|
@ -216,10 +214,12 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
|
||||||
if(tile instanceof TileEntityBase){
|
if(tile instanceof TileEntityBase){
|
||||||
TileEntityBase base = (TileEntityBase)tile;
|
TileEntityBase base = (TileEntityBase)tile;
|
||||||
NBTTagCompound compound = stack.getTagCompound().getCompoundTag("Data");
|
NBTTagCompound compound = stack.getTagCompound().getCompoundTag("Data");
|
||||||
|
if(compound != null){
|
||||||
base.readSyncableNBT(compound, TileEntityBase.NBTType.SAVE_BLOCK);
|
base.readSyncableNBT(compound, TileEntityBase.NBTType.SAVE_BLOCK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player){
|
public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player){
|
||||||
|
|
Loading…
Reference in a new issue