diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java index f4b480e304..6063f0e1fd 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java @@ -73,4 +73,11 @@ public class CraftBarrel extends CraftLootable implements Bar public CraftBarrel copy(Location location) { return new CraftBarrel(this, location); } + + // Paper start - More Lidded Block API + @Override + public boolean isOpen() { + return getTileEntity().openersCounter.opened; + } + // Paper end - More Lidded Block API } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java index 2b6a93a944..6e98a00d52 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -92,4 +92,11 @@ public class CraftChest extends CraftLootable implements Chest public CraftChest copy(Location location) { return new CraftChest(this, location); } + + // Paper start - More Lidded Block API + @Override + public boolean isOpen() { + return getTileEntity().openersCounter.opened; + } + // Paper end - More Lidded Block API } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java index 07b63ce5f5..b64adbba3e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java @@ -51,4 +51,11 @@ public class CraftEnderChest extends CraftBlockEntityState implem if (this.getTileEntity().opened && this.getWorldHandle() instanceof net.minecraft.world.level.Level) { net.minecraft.world.level.Level world = this.getTileEntity().getLevel(); world.blockEvent(this.getPosition(), this.getTileEntity().getBlockState().getBlock(), 1, 0); - world.playSound(null, this.getPosition(), SoundEvents.SHULKER_BOX_OPEN, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); + world.playSound(null, this.getPosition(), SoundEvents.SHULKER_BOX_CLOSE, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); // Paper - More Lidded Block API (Wrong sound) } this.getTileEntity().opened = false; } @@ -73,4 +73,11 @@ public class CraftShulkerBox extends CraftLootable implem public CraftShulkerBox copy(Location location) { return new CraftShulkerBox(this, location); } + + // Paper start - More Lidded Block API + @Override + public boolean isOpen() { + return getTileEntity().opened; + } + // Paper end - More Lidded Block API }