Implement new metadata for /wp disableteleport

This commit is contained in:
fullwall 2020-12-26 17:01:27 +08:00
parent b9e6418d52
commit 79f048fe0c
2 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,7 @@ public class WaypointCommands {
permission = "citizens.waypoints.disableteleport") permission = "citizens.waypoints.disableteleport")
public void disableTeleporting(CommandContext args, CommandSender sender, NPC npc) throws CommandException { public void disableTeleporting(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
npc.getNavigator().getDefaultParameters().stuckAction(null); npc.getNavigator().getDefaultParameters().stuckAction(null);
npc.data().setPersistent(NPC.DISABLE_DEFAULT_STUCK_ACTION_METADATA, true);
Messaging.sendTr(sender, Messages.WAYPOINT_TELEPORTING_DISABLED); Messaging.sendTr(sender, Messages.WAYPOINT_TELEPORTING_DISABLED);
} }

View File

@ -56,6 +56,9 @@ public class CitizensNavigator implements Navigator, Runnable {
public CitizensNavigator(NPC npc) { public CitizensNavigator(NPC npc) {
this.npc = npc; this.npc = npc;
if (npc.data().get(NPC.DISABLE_DEFAULT_STUCK_ACTION_METADATA, false)) {
defaultParams.stuckAction(null);
}
defaultParams.examiner(new SwimmingExaminer(npc)); defaultParams.examiner(new SwimmingExaminer(npc));
} }