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 9d0c272b1d89a96b0b63603fa8e4649f11fb6c51..d5fdf4504a0ca76fb0483f4ae5861c93fb622b2d 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java @@ -58,4 +58,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 82b3f3b3aced73ce136b6b94fe212972ac6090ef..b4bc5cbb71007b4d1a27bb841ff787a95e9ecbdc 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -78,4 +78,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 6513acb46591b2903d1baf18c23ed1fc8c2a731f..b8ab67fd1820613520203f708f2f267587ace67b 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java @@ -36,4 +36,11 @@ public class CraftEnderChest extends CraftBlockEntityState implem if (getTileEntity().opened && getWorldHandle() instanceof net.minecraft.world.level.Level) { net.minecraft.world.level.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 }