mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-04 07:27:59 +01:00
Implement fix better
This commit is contained in:
parent
042a0b5ba6
commit
c0f61381b7
@ -728,11 +728,13 @@ public class NPCCommands {
|
||||
flags = "t",
|
||||
permission = "npc.vulnerable")
|
||||
public void vulnerable(CommandContext args, CommandSender sender, NPC npc) {
|
||||
boolean vulnerable = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (args.hasFlag('t'))
|
||||
npc.data().set(NPC.DEFAULT_PROTECTED_METADATA, !vulnerable);
|
||||
else
|
||||
npc.data().setPersistent(NPC.DEFAULT_PROTECTED_METADATA, !vulnerable);
|
||||
boolean vulnerable = !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (args.hasFlag('t')) {
|
||||
npc.data().set(NPC.DEFAULT_PROTECTED_METADATA, vulnerable);
|
||||
} else {
|
||||
vulnerable = !npc.data().getPersistent(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
npc.data().setPersistent(NPC.DEFAULT_PROTECTED_METADATA, vulnerable);
|
||||
}
|
||||
String key = vulnerable ? Messages.VULNERABLE_SET : Messages.VULNERABLE_STOPPED;
|
||||
Messaging.sendTr(sender, key, npc.getName());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user