Prevents consumption of dye when clicking plugin signs

This commit is contained in:
2022-08-20 14:54:40 +02:00
parent f1a8db4f5e
commit e893684dec
2 changed files with 8 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
@@ -96,6 +97,7 @@ public class SignEventListener implements Listener {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && (Tag.SIGNS.isTagged(clickedBlockType) ||
Tag.WALL_SIGNS.isTagged(clickedBlockType))) {
event.setUseItemInHand(Event.Result.DENY);
//The player right-clicked a sign
Sign sign = (Sign) event.getClickedBlock().getState();
if (signLineEquals(sign, 0, "[BwB]", ChatColor.DARK_GREEN)) {