Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
TFC chests are not vanilla ones but must behave like them. Fixes #220
  • Loading branch information
alcatrazEscapee committed Aug 3, 2019
1 parent 4b4601f commit 0e2c2d1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/net/dries007/tfc/objects/te/TEChestTFC.java
Expand Up @@ -7,21 +7,25 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;

import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import mcp.MethodsReturnNonnullByDefault;
import net.dries007.tfc.api.types.Tree;
import net.dries007.tfc.objects.blocks.wood.BlockChestTFC;

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class TEChestTFC extends TileEntityChest
{
Expand Down Expand Up @@ -68,4 +72,10 @@ protected boolean isChestAt(@Nonnull BlockPos posIn)
Block block = this.world.getBlockState(posIn).getBlock();
return block instanceof BlockChestTFC && ((BlockChestTFC) block).wood == getWood() && ((BlockChest) block).chestType == getChestType();
}

@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate)
{
return oldState.getBlock() != newSate.getBlock();
}
}

0 comments on commit 0e2c2d1

Please sign in to comment.