diff --git a/src/main/java/me/Danker/features/BlockPlacingFlowers.java b/src/main/java/me/Danker/features/BlockPlacingFlowers.java index 55df3694..e1180fa9 100644 --- a/src/main/java/me/Danker/features/BlockPlacingFlowers.java +++ b/src/main/java/me/Danker/features/BlockPlacingFlowers.java @@ -22,6 +22,13 @@ public class BlockPlacingFlowers { Blocks.double_plant )); + ArrayList flowerWeapons = new ArrayList<>(Arrays.asList( + "Flower of Truth", + "Spirit Sceptre", + "Bouquet of Lies", + "Fire Freeze Staff" + )); + @SubscribeEvent public void onInteract(PlayerInteractEvent event) { if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; @@ -30,22 +37,16 @@ public void onInteract(PlayerInteractEvent event) { if (ModConfig.flowerWeapons && event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); - - if (flowerPlaceable.contains(block)) { - if (item.getDisplayName().contains("Flower of Truth")) { - event.setCanceled(true); - } - if (item.getDisplayName().contains("Spirit Sceptre")) { - event.setCanceled(true); - } - if (item.getDisplayName().contains("Bouquet of Lies")) { - event.setCanceled(true); - } - if (item.getDisplayName().contains("Fire Freeze Staff")) { - event.setCanceled(true); + Block blockUnder = Minecraft.getMinecraft().theWorld.getBlockState(event.pos.down().offset(event.face)).getBlock(); + + if (flowerPlaceable.contains(block) || flowerPlaceable.contains(blockUnder)) { + for (String weapon : flowerWeapons) { + if(item.getDisplayName().contains(weapon)){ + event.setCanceled(true); + break; + } } } } } - -} \ No newline at end of file +}