Skip to content

Commit

Permalink
Improve entity rotation, fixes #1397
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Apr 18, 2016
1 parent c316d87 commit f348cff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Expand Up @@ -2638,7 +2638,7 @@ public void registerCoreMembers() {

// <--[command]
// @Name Rotate
// @Syntax rotate (<entity>|...) (yaw:<value>) (pitch:<value>) (duration:<duration>) (frequency:<duration>)
// @Syntax rotate (cancel) (<entity>|...) (yaw:<#.#>) (pitch:<#.#>) (infinite/duration:<duration>) (frequency:<duration>)
// @Required 1
// @Stable stable
// @Short Rotates a list of entities.
Expand All @@ -2653,7 +2653,7 @@ public void registerCoreMembers() {
// TODO: Document Command Details
// -->
registerCoreMember(RotateCommand.class,
"ROTATE", "rotate (cancel) (<entity>|...) (yaw:<value>) (pitch:<value>) (duration:<duration>) (infinite/frequency:<duration>)", 0);
"ROTATE", "rotate (cancel) (<entity>|...) (yaw:<#.#>) (pitch:<#.#>) (infinite/duration:<duration>) (frequency:<duration>)", 0);


// <--[command]
Expand Down
Expand Up @@ -30,13 +30,13 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
if (!scriptEntry.hasObject("cancel")
&& (arg.matches("cancel") || arg.matches("stop"))) {

scriptEntry.addObject("cancel", "");
scriptEntry.addObject("cancel", new Element("true"));
}

else if (!scriptEntry.hasObject("infinite")
&& arg.matches("infinite")) {

scriptEntry.addObject("infinite", "");
scriptEntry.addObject("infinite", new Element("true"));
}

else if (!scriptEntry.hasObject("duration")
Expand Down
Expand Up @@ -74,11 +74,11 @@ private static void look(Entity entity, float yaw, float pitch) {
while (yaw >= 180.0F) {
yaw -= 360.0F;
}
livingHandle.aK = yaw;
livingHandle.aO = yaw;
if (!(handle instanceof EntityHuman)) {
livingHandle.aI = yaw;
livingHandle.aM = yaw;
}
livingHandle.aL = yaw;
livingHandle.aP = yaw;
}
handle.pitch = pitch;
}
Expand Down

0 comments on commit f348cff

Please sign in to comment.