Fixes for shulker boxes and AnyChest in 1.11
Fixes IBlockData used being the default for a shulker box, closes #55 Corrected using wrong method to check if blocked in 1.11.2. Something something NMS version bumps.
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>1.11-R0.1-SNAPSHOT</version>
|
<version>1.11.2-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@@ -69,10 +69,11 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
||||||
World world = player.world;
|
World world = player.world;
|
||||||
BlockPosition blockPosition = new BlockPosition(b.getX(), b.getY(), b.getZ());
|
BlockPosition blockPosition = new BlockPosition(b.getX(), b.getY(), b.getZ());
|
||||||
Block block = world.getType(blockPosition).getBlock();
|
IBlockData blockData = world.getType(blockPosition);
|
||||||
|
Block block = blockData.getBlock();
|
||||||
|
|
||||||
if (block instanceof BlockShulkerBox) {
|
if (block instanceof BlockShulkerBox) {
|
||||||
return isBlockedShulkerBox(world, blockPosition, block);
|
return isBlockedShulkerBox(world, blockPosition, blockData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block instanceof BlockEnderChest) {
|
if (block instanceof BlockEnderChest) {
|
||||||
@@ -107,7 +108,7 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isBlockedShulkerBox(World world, BlockPosition blockPosition, Block block) {
|
private boolean isBlockedShulkerBox(World world, BlockPosition blockPosition, IBlockData blockData) {
|
||||||
// For reference, look at net.minecraft.server.BlockShulkerBox
|
// For reference, look at net.minecraft.server.BlockShulkerBox
|
||||||
TileEntity tile = world.getTileEntity(blockPosition);
|
TileEntity tile = world.getTileEntity(blockPosition);
|
||||||
|
|
||||||
@@ -115,17 +116,21 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
IBlockData iBlockData = block.getBlockData();
|
EnumDirection enumDirection = blockData.get(BlockShulkerBox.a);
|
||||||
|
|
||||||
EnumDirection enumDirection = iBlockData.get(BlockShulkerBox.a);
|
|
||||||
if (((TileEntityShulkerBox) tile).p() == TileEntityShulkerBox.AnimationPhase.CLOSED) {
|
if (((TileEntityShulkerBox) tile).p() == TileEntityShulkerBox.AnimationPhase.CLOSED) {
|
||||||
AxisAlignedBB axisAlignedBB = BlockShulkerBox.j.b(0.5F * enumDirection.getAdjacentX(),
|
AxisAlignedBB axisAlignedBB = Block.j.b(0.5F * enumDirection.getAdjacentX(),
|
||||||
0.5F * enumDirection.getAdjacentY(), 0.5F * enumDirection.getAdjacentZ())
|
0.5F * enumDirection.getAdjacentY(), 0.5F * enumDirection.getAdjacentZ())
|
||||||
.a(enumDirection.getAdjacentX(), enumDirection.getAdjacentY(),
|
.a(enumDirection.getAdjacentX(), enumDirection.getAdjacentY(),
|
||||||
enumDirection.getAdjacentZ());
|
enumDirection.getAdjacentZ());
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 1.11.2
|
||||||
|
return world.a(axisAlignedBB.a(blockPosition.shift(enumDirection)));
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 1.11
|
||||||
return world.b(axisAlignedBB.a(blockPosition.shift(enumDirection)));
|
return world.b(axisAlignedBB.a(blockPosition.shift(enumDirection)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user