From 6c971f840e8bd3c20d6ad7952f4ab50c985f74c1 Mon Sep 17 00:00:00 2001 From: MetallicGoat Date: Thu, 18 Jan 2024 23:12:26 -0500 Subject: [PATCH] fix possible issues with legacy mc versions --- .../specialItems/customitems/handlers/TowerHandler.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/metallicgoat/specialItems/customitems/handlers/TowerHandler.java b/src/main/java/me/metallicgoat/specialItems/customitems/handlers/TowerHandler.java index dfc4527..88e4d16 100644 --- a/src/main/java/me/metallicgoat/specialItems/customitems/handlers/TowerHandler.java +++ b/src/main/java/me/metallicgoat/specialItems/customitems/handlers/TowerHandler.java @@ -143,10 +143,11 @@ private void placeBlock(Arena arena, boolean isLadder, Block block, DyeColor col } else { final BlockState state = block.getState(); - final org.bukkit.material.Ladder legacyLadder = new org.bukkit.material.Ladder(); - legacyLadder.setFacingDirection(this.direction.getOppositeFace()); - state.setData(legacyLadder); - state.update(); + + if (state.getData() instanceof org.bukkit.material.Ladder) { + ((org.bukkit.material.Ladder) state.getData()).setFacingDirection(this.direction.getOppositeFace()); + state.update(); + } } }