mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 02:55:45 +01:00
Update quick-select and talk items to material names (#1710)
also add back-support for if the original IDs are used (there's no good generic legacy ID upverter, but recognizing the old default numbers should suffice for 99% of servers). Should be cross-compatible with all supported minecraft versions, but is *required* in particular for 1.13
This commit is contained in:
parent
7d7bf356de
commit
7c348bff13
@ -114,7 +114,7 @@ public class Settings {
|
||||
QUICK_SELECT("npc.selection.quick-select", false),
|
||||
REMOVE_PLAYERS_FROM_PLAYER_LIST("npc.player.remove-from-list", true),
|
||||
SAVE_TASK_DELAY("storage.save-task.delay", 20 * 60 * 60),
|
||||
SELECTION_ITEM("npc.selection.item", "280"),
|
||||
SELECTION_ITEM("npc.selection.item", "stick"),
|
||||
SELECTION_MESSAGE("npc.selection.message", "<b>You selected <a><npc><b>!"),
|
||||
SERVER_OWNS_NPCS("npc.server-ownership", false),
|
||||
STORAGE_FILE("storage.file", "saves.yml"),
|
||||
@ -122,7 +122,7 @@ public class Settings {
|
||||
SUBPLUGIN_FOLDER("subplugins.folder", "plugins"),
|
||||
TALK_CLOSE_MAXIMUM_COOLDOWN("npc.text.max-talk-cooldown", 5),
|
||||
TALK_CLOSE_MINIMUM_COOLDOWN("npc.text.min-talk-cooldown", 10),
|
||||
TALK_ITEM("npc.text.talk-item", "340"),
|
||||
TALK_ITEM("npc.text.talk-item", "book"),
|
||||
TELEPORT_DELAY("npc.teleport-delay", -1),
|
||||
USE_BOAT_CONTROLS("npc.controllable.use-boat-controls", true),
|
||||
USE_NEW_PATHFINDER("npc.pathfinding.use-new-finder", false),
|
||||
|
@ -237,8 +237,17 @@ public class Util {
|
||||
if (parts.contains("*"))
|
||||
return true;
|
||||
for (String part : Splitter.on(',').split(parts)) {
|
||||
if ((SpigotUtil.isUsing1_13API() ? Material.matchMaterial(part, true)
|
||||
: Material.matchMaterial(part)) == player.getInventory().getItemInHand().getType()) {
|
||||
Material matchMaterial = SpigotUtil.isUsing1_13API() ? Material.matchMaterial(part, true)
|
||||
: Material.matchMaterial(part);
|
||||
if (matchMaterial == null) {
|
||||
if (part.equals("280")) {
|
||||
matchMaterial = Material.STICK;
|
||||
}
|
||||
else if (part.equals("340")) {
|
||||
matchMaterial = Material.BOOK;
|
||||
}
|
||||
}
|
||||
if (matchMaterial == player.getInventory().getItemInHand().getType()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user