From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: LemonCaramel Date: Sun, 23 May 2021 17:49:51 +0900 Subject: [PATCH] More Lidded Block API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java index dcae26b698d31a8b0107b0f9757efa34f53b030a..c0e7ae7ae38d55088e1b6ae6c80b849fd740cb1a 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java @@ -59,4 +59,11 @@ public class CraftBarrel extends CraftLootable implements Bar } getTileEntity().openersCounter.opened = false; } + + // Paper start - More Lidded Block API + @Override + public boolean isOpen() { + return getTileEntity().openersCounter.opened; + } + // Paper end - More Lidded Block API } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java index f48b830a9ae8160388cb0d0220a44b1ec9f0d214..5045507871db402305a43430194b4c5e965300ad 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -79,4 +79,11 @@ public class CraftChest extends CraftLootable implements Chest } getTileEntity().openersCounter.opened = false; } + + // Paper start - More Lidded Block API + @Override + public boolean isOpen() { + return getTileEntity().openersCounter.opened; + } + // Paper end - More Lidded Block API } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java index 25add8bee6ea35beeb205dd828759304346e4f48..599f6747dfa140e40fef26ed4d8244bfe87b7cdf 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java @@ -14,4 +14,33 @@ public class CraftEnderChest extends CraftBlockEntityState implem if (getTileEntity().opened) { Level world = getTileEntity().getLevel(); world.blockEvent(getPosition(), getTileEntity().getBlockState().getBlock(), 1, 0); - world.playSound(null, getPosition(), SoundEvents.SHULKER_BOX_OPEN, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); + world.playSound(null, getPosition(), SoundEvents.SHULKER_BOX_CLOSE, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); // Paper - More Lidded Block API (Wrong sound) } getTileEntity().opened = false; } + + // Paper start - More Lidded Block API + @Override + public boolean isOpen() { + return getTileEntity().opened; + } + // Paper end - More Lidded Block API }