From 4424f8b9aed368d8bbb8d2196c39b2d7ac03e4ce Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 7 Oct 2018 13:20:56 +0800 Subject: [PATCH] QoL enhancements for waypoints triggers --- .../waypoint/triggers/AnimationTrigger.java | 10 +++---- .../triggers/AnimationTriggerPrompt.java | 15 +++++++---- .../trait/waypoint/triggers/ChatTrigger.java | 10 +++---- .../waypoint/triggers/ChatTriggerPrompt.java | 11 +++++--- .../trait/waypoint/triggers/DelayTrigger.java | 2 +- .../waypoint/triggers/DelayTriggerPrompt.java | 16 +++++++++--- .../trait/waypoint/triggers/SpeedTrigger.java | 6 ++--- .../waypoint/triggers/SpeedTriggerPrompt.java | 16 +++++++++--- .../waypoint/triggers/TeleportTrigger.java | 2 +- .../triggers/TeleportTriggerPrompt.java | 5 ++++ .../waypoint/triggers/TriggerAddPrompt.java | 26 ++++++++++++++++--- .../waypoint/triggers/TriggerEditPrompt.java | 14 +++++++--- .../triggers/WaypointTriggerPrompt.java | 6 +++-- .../java/net/citizensnpcs/util/Messages.java | 2 ++ .../src/main/resources/messages_en.properties | 6 +++-- .../v1_8_R3/util/PlayerControllerLook.java | 6 ++--- 16 files changed, 109 insertions(+), 44 deletions(-) diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/AnimationTrigger.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/AnimationTrigger.java index 93e9040ff..492f2c355 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/AnimationTrigger.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/AnimationTrigger.java @@ -3,10 +3,6 @@ package net.citizensnpcs.trait.waypoint.triggers; import java.util.Collection; import java.util.List; -import net.citizensnpcs.api.npc.NPC; -import net.citizensnpcs.api.persistence.Persist; -import net.citizensnpcs.util.PlayerAnimation; - import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -14,6 +10,10 @@ import org.bukkit.entity.Player; import com.google.common.base.Joiner; import com.google.common.collect.Lists; +import net.citizensnpcs.api.npc.NPC; +import net.citizensnpcs.api.persistence.Persist; +import net.citizensnpcs.util.PlayerAnimation; + public class AnimationTrigger implements WaypointTrigger { @Persist(required = true) private List animations; @@ -27,7 +27,7 @@ public class AnimationTrigger implements WaypointTrigger { @Override public String description() { - return String.format("Animation Trigger [animating %s]", Joiner.on(", ").join(animations)); + return String.format("[[Animation]] animating %s", Joiner.on(", ").join(animations)); } @Override diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/AnimationTriggerPrompt.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/AnimationTriggerPrompt.java index f400b0537..054012999 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/AnimationTriggerPrompt.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/AnimationTriggerPrompt.java @@ -2,11 +2,6 @@ package net.citizensnpcs.trait.waypoint.triggers; import java.util.List; -import net.citizensnpcs.api.util.Messaging; -import net.citizensnpcs.util.Messages; -import net.citizensnpcs.util.PlayerAnimation; -import net.citizensnpcs.util.Util; - import org.bukkit.command.CommandSender; import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.Prompt; @@ -15,6 +10,11 @@ import org.bukkit.conversations.StringPrompt; import com.google.common.base.Joiner; import com.google.common.collect.Lists; +import net.citizensnpcs.api.util.Messaging; +import net.citizensnpcs.util.Messages; +import net.citizensnpcs.util.PlayerAnimation; +import net.citizensnpcs.util.Util; + public class AnimationTriggerPrompt extends StringPrompt implements WaypointTriggerPrompt { private final List animations = Lists.newArrayList(); @@ -37,6 +37,11 @@ public class AnimationTriggerPrompt extends StringPrompt implements WaypointTrig return this; } + @Override + public WaypointTrigger createFromShortInput(ConversationContext context, String input) { + return null; + } + @Override public String getPromptText(ConversationContext context) { Messaging.sendTr((CommandSender) context.getForWhom(), Messages.ANIMATION_TRIGGER_PROMPT, getValidAnimations()); diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/ChatTrigger.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/ChatTrigger.java index 3dcc59faa..c974a3cfa 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/ChatTrigger.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/ChatTrigger.java @@ -3,10 +3,6 @@ package net.citizensnpcs.trait.waypoint.triggers; import java.util.Collection; import java.util.List; -import net.citizensnpcs.api.npc.NPC; -import net.citizensnpcs.api.persistence.Persist; -import net.citizensnpcs.api.util.Messaging; - import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -14,6 +10,10 @@ import org.bukkit.entity.Player; import com.google.common.base.Joiner; import com.google.common.collect.Lists; +import net.citizensnpcs.api.npc.NPC; +import net.citizensnpcs.api.persistence.Persist; +import net.citizensnpcs.api.util.Messaging; + public class ChatTrigger implements WaypointTrigger { @Persist(required = true) private List lines; @@ -30,7 +30,7 @@ public class ChatTrigger implements WaypointTrigger { @Override public String description() { - return String.format("Chat Trigger [radius %d, %s]", radius, Joiner.on(", ").join(lines)); + return String.format("[[Chat]] [radius %d, %s]", radius, Joiner.on(", ").join(lines)); } @Override diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/ChatTriggerPrompt.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/ChatTriggerPrompt.java index 0b1a224ca..bab15ec49 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/ChatTriggerPrompt.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/ChatTriggerPrompt.java @@ -2,9 +2,6 @@ package net.citizensnpcs.trait.waypoint.triggers; import java.util.List; -import net.citizensnpcs.api.util.Messaging; -import net.citizensnpcs.util.Messages; - import org.bukkit.command.CommandSender; import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.Prompt; @@ -12,6 +9,9 @@ import org.bukkit.conversations.StringPrompt; import com.google.common.collect.Lists; +import net.citizensnpcs.api.util.Messaging; +import net.citizensnpcs.util.Messages; + public class ChatTriggerPrompt extends StringPrompt implements WaypointTriggerPrompt { private final List lines = Lists.newArrayList(); private double radius = -1; @@ -39,6 +39,11 @@ public class ChatTriggerPrompt extends StringPrompt implements WaypointTriggerPr return this; } + @Override + public WaypointTrigger createFromShortInput(ConversationContext context, String input) { + return null; + } + @Override public String getPromptText(ConversationContext context) { Messaging.sendTr((CommandSender) context.getForWhom(), Messages.CHAT_TRIGGER_PROMPT); diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/DelayTrigger.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/DelayTrigger.java index 283682971..85d4ca166 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/DelayTrigger.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/DelayTrigger.java @@ -22,7 +22,7 @@ public class DelayTrigger implements WaypointTrigger { @Override public String description() { - return String.format("Delay for %d ticks", delay); + return String.format("[[Delay]] for [[%d]] ticks", delay); } public int getDelay() { diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/DelayTriggerPrompt.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/DelayTriggerPrompt.java index c4db6d383..5bdc92a44 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/DelayTriggerPrompt.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/DelayTriggerPrompt.java @@ -1,12 +1,12 @@ package net.citizensnpcs.trait.waypoint.triggers; -import net.citizensnpcs.api.util.Messaging; -import net.citizensnpcs.util.Messages; - import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.NumericPrompt; import org.bukkit.conversations.Prompt; +import net.citizensnpcs.api.util.Messaging; +import net.citizensnpcs.util.Messages; + public class DelayTriggerPrompt extends NumericPrompt implements WaypointTriggerPrompt { @Override protected Prompt acceptValidatedInput(ConversationContext context, Number input) { @@ -15,6 +15,16 @@ public class DelayTriggerPrompt extends NumericPrompt implements WaypointTrigger return (Prompt) context.getSessionData(WaypointTriggerPrompt.RETURN_PROMPT_KEY); } + @Override + public WaypointTrigger createFromShortInput(ConversationContext context, String input) { + try { + int delay = Math.max(Integer.parseInt(input), 0); + return new DelayTrigger(delay); + } catch (NumberFormatException ex) { + return null; + } + } + @Override public String getPromptText(ConversationContext context) { return Messaging.tr(Messages.DELAY_TRIGGER_PROMPT); diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/SpeedTrigger.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/SpeedTrigger.java index 9efe26bb4..a1cbc3dc8 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/SpeedTrigger.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/SpeedTrigger.java @@ -1,10 +1,10 @@ package net.citizensnpcs.trait.waypoint.triggers; +import org.bukkit.Location; + import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.persistence.Persist; -import org.bukkit.Location; - public class SpeedTrigger implements WaypointTrigger { @Persist private float speed = 1F; @@ -18,7 +18,7 @@ public class SpeedTrigger implements WaypointTrigger { @Override public String description() { - return String.format("Speed change to %f", speed); + return String.format("[[Speed]] change to %f", speed); } public float getSpeed() { diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/SpeedTriggerPrompt.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/SpeedTriggerPrompt.java index 01b003af6..1cbcd7667 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/SpeedTriggerPrompt.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/SpeedTriggerPrompt.java @@ -1,12 +1,12 @@ package net.citizensnpcs.trait.waypoint.triggers; -import net.citizensnpcs.api.util.Messaging; -import net.citizensnpcs.util.Messages; - import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.NumericPrompt; import org.bukkit.conversations.Prompt; +import net.citizensnpcs.api.util.Messaging; +import net.citizensnpcs.util.Messages; + public class SpeedTriggerPrompt extends NumericPrompt implements WaypointTriggerPrompt { @Override protected Prompt acceptValidatedInput(ConversationContext context, Number input) { @@ -15,6 +15,16 @@ public class SpeedTriggerPrompt extends NumericPrompt implements WaypointTrigger return (Prompt) context.getSessionData(WaypointTriggerPrompt.RETURN_PROMPT_KEY); } + @Override + public WaypointTrigger createFromShortInput(ConversationContext context, String input) { + try { + float speed = (float) Math.max(Double.parseDouble(input), 0); + return new SpeedTrigger(speed); + } catch (NumberFormatException ex) { + return null; + } + } + @Override public String getPromptText(ConversationContext context) { return Messaging.tr(Messages.SPEED_TRIGGER_PROMPT); diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TeleportTrigger.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TeleportTrigger.java index cd3f8cbbc..fd2a9017c 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TeleportTrigger.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TeleportTrigger.java @@ -19,7 +19,7 @@ public class TeleportTrigger implements WaypointTrigger { @Override public String description() { - return String.format("Teleport to [%s, %d, %d, %d]", location.getWorld().getName(), location.getBlockX(), + return String.format("[[Teleport]] to [%s, %d, %d, %d]", location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()); } diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TeleportTriggerPrompt.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TeleportTriggerPrompt.java index c7779d6b0..9adabf8b7 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TeleportTriggerPrompt.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TeleportTriggerPrompt.java @@ -48,6 +48,11 @@ public class TeleportTriggerPrompt extends RegexPrompt implements WaypointTrigge return (Prompt) context.getSessionData(WaypointTriggerPrompt.RETURN_PROMPT_KEY); } + @Override + public WaypointTrigger createFromShortInput(ConversationContext context, String input) { + return null; + } + @Override public String getPromptText(ConversationContext context) { return Messaging.tr(Messages.WAYPOINT_TRIGGER_TELEPORT_PROMPT); diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TriggerAddPrompt.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TriggerAddPrompt.java index 38c9ab33a..715e4c8e3 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TriggerAddPrompt.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TriggerAddPrompt.java @@ -1,14 +1,16 @@ package net.citizensnpcs.trait.waypoint.triggers; -import net.citizensnpcs.api.util.Messaging; -import net.citizensnpcs.trait.waypoint.WaypointEditor; -import net.citizensnpcs.util.Messages; - import org.bukkit.command.CommandSender; import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.Prompt; import org.bukkit.conversations.StringPrompt; +import com.google.common.base.Joiner; + +import net.citizensnpcs.api.util.Messaging; +import net.citizensnpcs.trait.waypoint.WaypointEditor; +import net.citizensnpcs.util.Messages; + public class TriggerAddPrompt extends StringPrompt { private final WaypointEditor editor; @@ -23,12 +25,22 @@ public class TriggerAddPrompt extends StringPrompt { context.setSessionData("said", false); return (Prompt) context.getSessionData("previous"); } + String[] split = input.split(" "); + input = split[0]; + split[0] = null; Prompt prompt = WaypointTriggerRegistry.getTriggerPromptFrom(input); + String extraInput = Joiner.on(' ').skipNulls().join(split); if (prompt == null) { Messaging.sendErrorTr((CommandSender) context.getForWhom(), Messages.WAYPOINT_TRIGGER_EDITOR_INVALID_TRIGGER, input); context.setSessionData("said", false); return this; + } else if (extraInput.length() > 0) { + WaypointTrigger returned = ((WaypointTriggerPrompt) prompt).createFromShortInput(context, extraInput); + if (returned != null) { + context.setSessionData(WaypointTriggerPrompt.CREATED_TRIGGER_KEY, returned); + return this; + } } return prompt; } @@ -36,12 +48,18 @@ public class TriggerAddPrompt extends StringPrompt { @Override public String getPromptText(ConversationContext context) { WaypointTrigger returned = (WaypointTrigger) context.getSessionData(WaypointTriggerPrompt.CREATED_TRIGGER_KEY); + if (returned != null) { if (editor.getCurrentWaypoint() != null) { editor.getCurrentWaypoint().addTrigger(returned); context.setSessionData(WaypointTriggerPrompt.CREATED_TRIGGER_KEY, null); Messaging.sendTr((CommandSender) context.getForWhom(), Messages.WAYPOINT_TRIGGER_ADDED_SUCCESSFULLY, returned.description()); + String base = ""; + for (WaypointTrigger trigger : editor.getCurrentWaypoint().getTriggers()) { + base += "\n - " + trigger.description(); + } + Messaging.sendTr((CommandSender) context.getForWhom(), Messages.WAYPOINT_TRIGGER_LIST, base); } else { Messaging.sendErrorTr((CommandSender) context.getForWhom(), Messages.WAYPOINT_TRIGGER_EDITOR_INACTIVE); } diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TriggerEditPrompt.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TriggerEditPrompt.java index e92f8a394..412f7beea 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TriggerEditPrompt.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/TriggerEditPrompt.java @@ -2,6 +2,8 @@ package net.citizensnpcs.trait.waypoint.triggers; import org.bukkit.command.CommandSender; import org.bukkit.conversations.Conversation; +import org.bukkit.conversations.ConversationAbandonedEvent; +import org.bukkit.conversations.ConversationAbandonedListener; import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.ConversationFactory; import org.bukkit.conversations.Prompt; @@ -41,20 +43,26 @@ public class TriggerEditPrompt extends StringPrompt { if (context.getSessionData("said") == Boolean.TRUE) return ""; context.setSessionData("said", true); - String base = Messaging.tr(Messages.WAYPOINT_TRIGGER_EDITOR_PROMPT); + String base = ""; if (editor.getCurrentWaypoint() != null) { Waypoint waypoint = editor.getCurrentWaypoint(); for (WaypointTrigger trigger : waypoint.getTriggers()) { base += "\n - " + trigger.description(); } } - Messaging.send((CommandSender) context.getForWhom(), base); + Messaging.sendTr((CommandSender) context.getForWhom(), Messages.WAYPOINT_TRIGGER_EDITOR_PROMPT, base); return ""; } public static Conversation start(Player player, WaypointEditor editor) { final Conversation conversation = new ConversationFactory(CitizensAPI.getPlugin()).withLocalEcho(false) - .withEscapeSequence("exit").withEscapeSequence("triggers").withEscapeSequence("/npc path") + .addConversationAbandonedListener(new ConversationAbandonedListener() { + @Override + public void conversationAbandoned(ConversationAbandonedEvent event) { + event.getContext().getForWhom() + .sendRawMessage(Messaging.tr(Messages.WAYPOINT_TRIGGER_EDITOR_EXIT)); + } + }).withEscapeSequence("exit").withEscapeSequence("triggers").withEscapeSequence("/npc path") .withModality(false).withFirstPrompt(new TriggerEditPrompt(editor)).buildConversation(player); conversation.begin(); return conversation; diff --git a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/WaypointTriggerPrompt.java b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/WaypointTriggerPrompt.java index 745a83da5..ba56ab2ec 100644 --- a/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/WaypointTriggerPrompt.java +++ b/main/src/main/java/net/citizensnpcs/trait/waypoint/triggers/WaypointTriggerPrompt.java @@ -5,14 +5,16 @@ import org.bukkit.conversations.Prompt; /** * Marker interface for waypoint trigger prompts. - * + * * Prompts are expected to return to the prompt specified under the {@link #RETURN_PROMPT_KEY} key in the * {@link ConversationContext} and to set the specified trigger under {@link #CREATED_TRIGGER_KEY} prior to returning. - * + * * If the returned trigger is null then the prompt is assumed to have failed and an error message will be * displayed. */ public interface WaypointTriggerPrompt extends Prompt { + public WaypointTrigger createFromShortInput(ConversationContext context, String input); + static final String CREATED_TRIGGER_KEY = "created-trigger"; static final String RETURN_PROMPT_KEY = "return-to"; } diff --git a/main/src/main/java/net/citizensnpcs/util/Messages.java b/main/src/main/java/net/citizensnpcs/util/Messages.java index 7d1cb7471..3a957ec43 100644 --- a/main/src/main/java/net/citizensnpcs/util/Messages.java +++ b/main/src/main/java/net/citizensnpcs/util/Messages.java @@ -298,9 +298,11 @@ public class Messages { public static final String WAYPOINT_TRIGGER_ADDED_SUCCESSFULLY = "citizens.editors.waypoints.triggers.add.added"; public static final String WAYPOINT_TRIGGER_CHAT_INVALID_RADIUS = "citizens.editors.waypoints.triggers.chat.invalid-radius"; public static final String WAYPOINT_TRIGGER_CHAT_NO_RADIUS = "citizens.editors.waypoints.triggers.chat.missing-radius"; + public static final String WAYPOINT_TRIGGER_EDITOR_EXIT = "citizens.editors.waypoints.triggers.main.exit"; public static final String WAYPOINT_TRIGGER_EDITOR_INACTIVE = "citizens.editors.waypoints.triggers.main.missing-waypoint"; public static final String WAYPOINT_TRIGGER_EDITOR_INVALID_TRIGGER = "citizens.editors.waypoints.triggers.add.invalid-trigger"; public static final String WAYPOINT_TRIGGER_EDITOR_PROMPT = "citizens.editors.waypoints.triggers.main.prompt"; + public static final String WAYPOINT_TRIGGER_LIST = "citizens.editors.waypoints.triggers.list"; public static final String WAYPOINT_TRIGGER_REMOVE_INDEX_OUT_OF_RANGE = "citizens.editors.waypoints.triggers.remove.index-out-of-range"; public static final String WAYPOINT_TRIGGER_REMOVE_INVALID_NUMBER = "citizens.editors.waypoints.triggers.remove.not-a-number"; public static final String WAYPOINT_TRIGGER_REMOVE_PROMPT = "citizens.editors.waypoints.triggers.remove.prompt"; diff --git a/main/src/main/resources/messages_en.properties b/main/src/main/resources/messages_en.properties index 33c95e3c9..3138def38 100644 --- a/main/src/main/resources/messages_en.properties +++ b/main/src/main/resources/messages_en.properties @@ -254,10 +254,11 @@ citizens.editors.waypoints.linear.range-exceeded=Previous waypoint is {0} blocks citizens.editors.waypoints.linear.removed-waypoint=[[Removed]] a waypoint ([[{0}]] remaining) ([[{1}]]) citizens.editors.waypoints.linear.showing-markers=[[Showing]] waypoint markers. citizens.editors.waypoints.linear.waypoints-cleared=Waypoints cleared. -citizens.editors.waypoints.triggers.add.added=[[Added]] waypoint trigger successfully ({0}). +citizens.editors.waypoints.triggers.add.added=Added waypoint trigger successfully ({0}). citizens.editors.waypoints.triggers.add.invalid-trigger=Couldn''t create a trigger by the name [[{0}]]. citizens.editors.waypoints.triggers.add.prompt=Enter in a trigger name to add or type [[back]] to return to the edit prompt. Valid trigger names are {0}. citizens.editors.waypoints.triggers.animation.added=Animation [[{0}]] added. +citizens.editors.waypoints.triggers.list=Current triggers are:{0} citizens.editors.waypoints.triggers.animation.prompt=Enter in animations to perform - valid animations are {0}.
Type in [[finish]] to finish the animation trigger or [[back]] to return to the previous prompt. citizens.editors.waypoints.triggers.animation.invalid-animation=Invalid animation [[{0}]]. Valid animations are {1}. citizens.editors.waypoints.triggers.chat.invalid-radius=The radius must be a number. @@ -265,7 +266,8 @@ citizens.editors.waypoints.triggers.chat.missing-radius=No radius supplied. citizens.editors.waypoints.triggers.chat.prompt=Enter in chat lines to say.
Type in [[radius (radius)]] to set the block radius to broadcast the messages.
Type [[finish]] to finish the chat trigger or [[back]] to return to the previous prompt. citizens.editors.waypoints.triggers.delay.prompt=Enter the delay in [[server ticks]] to use. (20 ticks = 1 second) citizens.editors.waypoints.triggers.main.missing-waypoint=Not editing a waypoint. -citizens.editors.waypoints.triggers.main.prompt=Entered the waypoint trigger editor.
Type [[add]] to begin adding triggers and [[remove]] to remove triggers.
Type [[triggers]] to enter the waypoint trigger editor.
Current triggers are: +citizens.editors.waypoints.triggers.main.exit=Exited the waypoint trigger editor. +citizens.editors.waypoints.triggers.main.prompt=- Waypoint Trigger Editor -
Type [[add]] or [[remove]] to edit triggers.
Type [[triggers]] or [[exit]] to exit this editor.
Current triggers are:{0} citizens.editors.waypoints.triggers.remove.index-out-of-range=Index must be in the range [[1-{0}]]. citizens.editors.waypoints.triggers.remove.not-a-number=Index must be a number. citizens.editors.waypoints.triggers.remove.prompt=Enter in the index of the trigger to delete or [[back]] to return to the edit prompt. Current triggers are: diff --git a/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/PlayerControllerLook.java b/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/PlayerControllerLook.java index 79225ecfd..a5a58196f 100644 --- a/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/PlayerControllerLook.java +++ b/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/util/PlayerControllerLook.java @@ -1,9 +1,8 @@ package net.citizensnpcs.nms.v1_8_R3.util; import net.citizensnpcs.nms.v1_8_R3.entity.EntityHumanNPC; -import net.minecraft.server.v1_8_R3.Entity; -import net.minecraft.server.v1_8_R3.EntityLiving; -import net.minecraft.server.v1_8_R3.MathHelper; +import net.minecraft.server.v1_13_R2.EntityLiving; +import net.minecraft.server.v1_13_R2.MathHelper; public class PlayerControllerLook { private final EntityHumanNPC a; @@ -42,7 +41,6 @@ public class PlayerControllerLook { while (this.a.aK < -180F) { this.a.aK += 360F; } - System.out.println(this.a.aK); } else { // this.a.aK = a(this.a.aK, this.a.aI, 10.0F); }