diff --git a/src/main/java/com/futhark/block/RuneBlock.java b/src/main/java/com/futhark/block/RuneBlock.java index 2e7db7a..6c48d35 100644 --- a/src/main/java/com/futhark/block/RuneBlock.java +++ b/src/main/java/com/futhark/block/RuneBlock.java @@ -27,9 +27,20 @@ public class RuneBlock extends Block { if (server != null) { StateSaverAndLoader serverState = StateSaverAndLoader.getServerState(server); player.sendMessage(Text.literal(String.format("Clicked rune %s Total Runes in World: %d", serverState.runes.get(pos), serverState.totalNumberOfRunes))); - world.playSound(player, pos, SoundEvents.BLOCK_AMETHYST_BLOCK_CHIME, SoundCategory.BLOCKS, 1f, 1f); } return ActionResult.SUCCESS; } + + @Override + public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { + super.onBreak(world, pos, state, player); + + MinecraftServer server = world.getServer(); + if (server != null) { + StateSaverAndLoader serverState = StateSaverAndLoader.getServerState(server); + serverState.runes.remove(pos); + serverState.totalNumberOfRunes -= 1; + } + } }