Fix /npc passive flipped message

This commit is contained in:
fullwall 2024-03-08 12:16:31 +08:00
parent e757344d41
commit 6642923b49

View File

@ -2025,9 +2025,9 @@ public class NPCCommands {
permission = "citizens.npc.passive") permission = "citizens.npc.passive")
public void passive(CommandContext args, CommandSender sender, NPC npc, @Flag("set") Boolean set) public void passive(CommandContext args, CommandSender sender, NPC npc, @Flag("set") Boolean set)
throws CommandException { throws CommandException {
boolean passive = set != null ? set : !npc.data().get(NPC.Metadata.DAMAGE_OTHERS, true); boolean damageOthers = set != null ? set : !npc.data().get(NPC.Metadata.DAMAGE_OTHERS, true);
npc.data().setPersistent(NPC.Metadata.DAMAGE_OTHERS, passive); npc.data().setPersistent(NPC.Metadata.DAMAGE_OTHERS, damageOthers);
Messaging.sendTr(sender, passive ? Messages.PASSIVE_SET : Messages.PASSIVE_UNSET, npc.getName()); Messaging.sendTr(sender, damageOthers ? Messages.PASSIVE_UNSET : Messages.PASSIVE_SET, npc.getName());
} }
@Command( @Command(