Prevents consumption of dye when clicking plugin signs

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

View File

@ -48,15 +48,15 @@ An in-game description of available commands is available through the /bwb comma
- encryptbook \<key> \[encryption style] - Encrypts the book the player is holding. "key" is required and can be any
phrase or number excluding spaces. "style" is not required. Possible values are "DNA" or ""
- /formatbook - Formats the held written book (converts color and formatting codes to the corresponding formatted text)
- /givebook \<file name or number> \<playername> \[# of copies (num)] \[signed (true/false)] - Gives the selected player a
book from your personal directory
- /givepublicbook \<file name or number> \<playername> \[# of copies (num)] \[signed (true/false)] - Same as givebook, but
uses books from the public directory
- /givebook \<file name or number> \<playername> \[# of copies (num)] \[signed (true/false)] - Gives the selected player
a book from your personal directory
- /givepublicbook \<file name or number> \<playername> \[# of copies (num)] \[signed (true/false)] - Same as givebook,
but uses books from the public directory
- /loadbook \<file name or number> \[# of copies] \[signed (true/false)] - Creates a book from the specified file and
gives it to the player. If no file is specified, a list of available files is returned. If true is specified, the book
will be signed, if false it will be unsigned
- /loadpublicbook \<file name or number> \[# of copies] \[signed (true/false)] - Same as loadbook, but views files in the
public directory
- /loadpublicbook \<file name or number> \[# of copies] \[signed (true/false)] - Same as loadbook, but views files in
the public directory
- /reload - Reloads BwB's configuration file
- /savebook \[overwrite (true/false)] - Saves the book the player is holding to a text file in a private directory. If
true is specified, a book of the same name by the same author will be overwritten by the new book

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)) {