Files
2019-02-24 22:29:41 +08:00

73 lines
3.0 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
@@ -42,14 +42,14 @@
protected static final AxisAlignedBB WEST_CHEST_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0625D, 0.9375D, 0.875D, 0.9375D);
protected static final AxisAlignedBB EAST_CHEST_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 1.0D, 0.875D, 0.9375D);
protected static final AxisAlignedBB NOT_CONNECTED_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.875D, 0.9375D);
- public final BlockChest.Type chestType;
+ public final Type chestType;
- protected BlockChest(BlockChest.Type chestTypeIn)
+ protected BlockChest(Type chestTypeIn)
{
super(Material.WOOD);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
this.chestType = chestTypeIn;
- this.setCreativeTab(chestTypeIn == BlockChest.Type.TRAP ? CreativeTabs.REDSTONE : CreativeTabs.DECORATIONS);
+ this.setCreativeTab(chestTypeIn == Type.TRAP ? CreativeTabs.REDSTONE : CreativeTabs.DECORATIONS);
}
public boolean isOpaqueCube(IBlockState state)
@@ -424,11 +424,11 @@
{
playerIn.displayGUIChest(ilockablecontainer);
- if (this.chestType == BlockChest.Type.BASIC)
+ if (this.chestType == Type.BASIC)
{
playerIn.addStat(StatList.CHEST_OPENED);
}
- else if (this.chestType == BlockChest.Type.TRAP)
+ else if (this.chestType == Type.TRAP)
{
playerIn.addStat(StatList.TRAPPED_CHEST_TRIGGERED);
}
@@ -470,7 +470,7 @@
if (block == this)
{
- if (this.isBlocked(worldIn, blockpos))
+ if (!allowBlocking && this.isBlocked(worldIn, blockpos)) // Forge: fix MC-99321
{
return null;
}
@@ -503,7 +503,7 @@
public boolean canProvidePower(IBlockState state)
{
- return this.chestType == BlockChest.Type.TRAP;
+ return this.chestType == Type.TRAP;
}
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
@@ -538,7 +538,7 @@
private boolean isBelowSolidBlock(World worldIn, BlockPos pos)
{
- return worldIn.getBlockState(pos.up()).isNormalCube();
+ return worldIn.getBlockState(pos.up()).doesSideBlockChestOpening(worldIn, pos.up(), EnumFacing.DOWN);
}
private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos)
@@ -608,4 +608,10 @@
BASIC,
TRAP;
}
+
+ /* ======================================== FORGE START =====================================*/
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ return !isDoubleChest(world, pos) && super.rotateBlock(world, pos, axis);
+ }
}