diff --git a/src/main/java/ch/njol/skript/expressions/ExprVectorYawPitch.java b/src/main/java/ch/njol/skript/expressions/ExprVectorYawPitch.java
deleted file mode 100644
index 902770e2af0..00000000000
--- a/src/main/java/ch/njol/skript/expressions/ExprVectorYawPitch.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- * This file is part of Skript.
- *
- * Skript is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Skript is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Skript. If not, see .
- *
- * Copyright Peter Güttinger, SkriptLang team and contributors
- */
-package ch.njol.skript.expressions;
-
-import org.bukkit.event.Event;
-import org.bukkit.util.Vector;
-import org.eclipse.jdt.annotation.Nullable;
-
-import ch.njol.skript.classes.Changer;
-import ch.njol.skript.classes.Changer.ChangeMode;
-import ch.njol.skript.doc.Description;
-import ch.njol.skript.doc.Examples;
-import ch.njol.skript.doc.Name;
-import ch.njol.skript.doc.Since;
-import ch.njol.skript.expressions.base.SimplePropertyExpression;
-import ch.njol.skript.lang.Expression;
-import ch.njol.skript.lang.SkriptParser.ParseResult;
-import ch.njol.util.Kleenean;
-import ch.njol.util.VectorMath;
-import ch.njol.util.coll.CollectionUtils;
-
-/**
- * @author bi0qaw
- */
-@Name("Vectors - Yaw and Pitch")
-@Description("Gets or sets the yaw or pitch value of a vector.")
-@Examples({"set {_v} to vector -1, 1, 1",
- "send \"%vector yaw of {_v}%, %vector pitch of {_v}%\"",
- "add 45 to vector yaw of {_v}",
- "subtract 45 from vector pitch of {_v}",
- "send \"%vector yaw of {_v}%, %vector pitch of {_v}%\"",
- "set vector yaw of {_v} to -45",
- "set vector pitch of {_v} to 45",
- "send \"%vector yaw of {_v}%, %vector pitch of {_v}%\"",})
-@Since("2.2-dev28")
-public class ExprVectorYawPitch extends SimplePropertyExpression {
-
- static {
- register(ExprVectorYawPitch.class, Number.class, "[vector] (0¦yaw|1¦pitch)", "vectors");
- }
-
- private boolean usesYaw;
-
- @Override
- public boolean init(Expression>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
- super.init(exprs, matchedPattern, isDelayed, parseResult);
- usesYaw = parseResult.mark == 0;
- return true;
- }
-
- @Override
- public Number convert(Vector vector) {
- if (usesYaw)
- return VectorMath.skriptYaw(VectorMath.getYaw(vector));
- return VectorMath.skriptPitch(VectorMath.getPitch(vector));
- }
-
- @Override
- @SuppressWarnings("null")
- public Class>[] acceptChange(ChangeMode mode) {
- if ((mode == ChangeMode.SET || mode == ChangeMode.ADD || mode == ChangeMode.REMOVE)
- && getExpr().isSingle() && Changer.ChangerUtils.acceptsChange(getExpr(), ChangeMode.SET, Vector.class))
- return CollectionUtils.array(Number.class);
- return null;
- }
-
- @Override
- public void change(Event e, @Nullable Object[] delta, ChangeMode mode) {
- assert delta != null;
- Vector v = getExpr().getSingle(e);
- if (v == null)
- return;
- float n = ((Number) delta[0]).floatValue();
- float yaw = VectorMath.getYaw(v);
- float pitch = VectorMath.getPitch(v);
- switch (mode) {
- case ADD:
- if (usesYaw)
- yaw += n;
- else
- pitch -= n; // Negative because of Minecraft's / Skript's upside down pitch
- v = VectorMath.fromYawAndPitch(yaw, pitch);
- getExpr().change(e, new Vector[]{v}, ChangeMode.SET);
- break;
- case REMOVE:
- n = -n;
- //$FALL-THROUGH$
- case SET:
- if (usesYaw)
- yaw = VectorMath.fromSkriptYaw(n);
- else
- pitch = VectorMath.fromSkriptPitch(n);
- v = VectorMath.fromYawAndPitch(yaw, pitch);
- getExpr().change(e, new Vector[]{v}, ChangeMode.SET);
- }
- }
-
- @Override
- protected String getPropertyName() {
- return usesYaw ? "yaw" : "pitch";
- }
-
- @Override
- public Class extends Number> getReturnType() {
- return Number.class;
- }
-
-}
diff --git a/src/main/java/ch/njol/skript/expressions/ExprYawPitch.java b/src/main/java/ch/njol/skript/expressions/ExprYawPitch.java
index 91ed60e1693..e7aa8a5eef3 100644
--- a/src/main/java/ch/njol/skript/expressions/ExprYawPitch.java
+++ b/src/main/java/ch/njol/skript/expressions/ExprYawPitch.java
@@ -18,6 +18,7 @@
*/
package ch.njol.skript.expressions;
+import ch.njol.util.VectorMath;
import org.bukkit.Location;
import org.bukkit.event.Event;
@@ -31,90 +32,130 @@
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
import ch.njol.util.coll.CollectionUtils;
+import org.bukkit.util.Vector;
-/**
- * @author Peter Güttinger
- */
@Name("Yaw / Pitch")
-@Description("The yaw or pitch of a location. You likely won't need this expression ever if you don't know what this means.")
-@Examples("log \"%player%: %location of player%, %player's yaw%, %player's pitch%\" to \"playerlocs.log\"")
-@Since("2.0")
-public class ExprYawPitch extends SimplePropertyExpression {
-
- public static boolean randomSK = true;
-
+@Description("The yaw or pitch of a location or vector.")
+@Examples({"log \"%player%: %location of player%, %player's yaw%, %player's pitch%\" to \"playerlocs.log\"",
+ "set {_yaw} to yaw of player",
+ "set {_p} to pitch of target entity"})
+@Since("2.0, 2.2-dev28 (vector yaw/pitch)")
+public class ExprYawPitch extends SimplePropertyExpression