From 4924569e9531787ef2d14b4b9671aa36f1c19476 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 4 Jan 2012 09:17:05 +0100 Subject: [PATCH] Vector.getMidpoint should not modify the current Vector. Thanks TomyLobo for noticing. By: Erik Broes --- paper-api/src/main/java/org/bukkit/util/Vector.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/util/Vector.java b/paper-api/src/main/java/org/bukkit/util/Vector.java index 215e2222a6..4ff0b501fa 100644 --- a/paper-api/src/main/java/org/bukkit/util/Vector.java +++ b/paper-api/src/main/java/org/bukkit/util/Vector.java @@ -220,9 +220,9 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @return a new midpoint vector */ public Vector getMidpoint(Vector other) { - x = (x + other.x) / 2; - y = (y + other.y) / 2; - z = (z + other.z) / 2; + double x = (this.x + other.x) / 2; + double y = (this.y + other.y) / 2; + double z = (this.z + other.z) / 2; return new Vector(x, y, z); }