diff --git a/bukkit/src/main/java/net/william278/husktowns/listener/BukkitInteractListener.java b/bukkit/src/main/java/net/william278/husktowns/listener/BukkitInteractListener.java index 7d433000..2ac3d753 100644 --- a/bukkit/src/main/java/net/william278/husktowns/listener/BukkitInteractListener.java +++ b/bukkit/src/main/java/net/william278/husktowns/listener/BukkitInteractListener.java @@ -62,7 +62,7 @@ default void onPlayerInteract(@NotNull PlayerInteractEvent e) { : block.getBlockData() instanceof Switch ? Operation.Type.REDSTONE_INTERACT : Operation.Type.BLOCK_INTERACT, getPosition(block.getLocation()), - e.getHand() != EquipmentSlot.OFF_HAND + e.getHand() == EquipmentSlot.OFF_HAND ))) { e.setUseInteractedBlock(Event.Result.DENY); if (e.getItem() != null && e.getItem().getType() != Material.AIR) { diff --git a/bukkit/src/main/java/net/william278/husktowns/listener/BukkitPlaceListener.java b/bukkit/src/main/java/net/william278/husktowns/listener/BukkitPlaceListener.java index 078c360b..33769960 100644 --- a/bukkit/src/main/java/net/william278/husktowns/listener/BukkitPlaceListener.java +++ b/bukkit/src/main/java/net/william278/husktowns/listener/BukkitPlaceListener.java @@ -26,11 +26,12 @@ public interface BukkitPlaceListener extends BukkitListener { default void onPlayerPlaceBlock(@NotNull BlockPlaceEvent e) { if (getListener().handler().cancelOperation(Operation.of( BukkitUser.adapt(e.getPlayer()), - getPlugin().getSpecialTypes().isFarmBlock(e.getBlock().getType().getKey().toString()) + getPlugin().getSpecialTypes().isFarmBlock(e.getBlockPlaced().getType().getKey().toString()) ? Operation.Type.FARM_BLOCK_PLACE : Operation.Type.BLOCK_PLACE, getPosition(e.getBlock().getLocation())) )) { e.setCancelled(true); + e.setBuild(false); } } diff --git a/common/src/main/java/net/william278/husktowns/claim/Flag.java b/common/src/main/java/net/william278/husktowns/claim/Flag.java index e0550b4a..da04be0f 100644 --- a/common/src/main/java/net/william278/husktowns/claim/Flag.java +++ b/common/src/main/java/net/william278/husktowns/claim/Flag.java @@ -61,6 +61,7 @@ public enum Flag { Operation.Type.CONTAINER_OPEN ), PUBLIC_FARM_ACCESS( + Operation.Type.BLOCK_INTERACT, Operation.Type.FARM_BLOCK_BREAK, Operation.Type.FARM_BLOCK_PLACE, Operation.Type.FARM_BLOCK_INTERACT,