mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-26 11:07:59 +01:00
Allow chat messages for any equipment slot
This commit is contained in:
parent
8ebfc31fce
commit
b640788033
@ -47,18 +47,15 @@ public class EquipmentEditor extends Editor {
|
||||
public void onPlayerChat(final AsyncPlayerChatEvent event) {
|
||||
if (!event.getPlayer().equals(player))
|
||||
return;
|
||||
EquipmentSlot slot = null;
|
||||
if (event.getMessage().contains("helmet")
|
||||
&& event.getPlayer().hasPermission("citizens.npc.edit.equip.any-helmet")) {
|
||||
slot = EquipmentSlot.HELMET;
|
||||
}
|
||||
if (event.getMessage().contains("offhand")
|
||||
&& event.getPlayer().hasPermission("citizens.npc.edit.equip.offhand")) {
|
||||
slot = EquipmentSlot.OFF_HAND;
|
||||
}
|
||||
EquipmentSlot slot = Util.matchEnum(EquipmentSlot.values(), event.getMessage());
|
||||
if (slot == null) {
|
||||
return;
|
||||
}
|
||||
if (!event.getPlayer().hasPermission("citizens.npc.edit.equip." + slot.name().toLowerCase().replace(" ", ""))
|
||||
&& (slot != EquipmentSlot.HELMET
|
||||
|| !event.getPlayer().hasPermission("citizens.npc.edit.equip.any-helmet"))) {
|
||||
return;
|
||||
}
|
||||
final EquipmentSlot finalSlot = slot;
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user