Update upstream B/CB
This commit is contained in:
@@ -17,21 +17,23 @@ index 1381d234e..00208ff45 100644
|
||||
private final class BooleanWrapper {
|
||||
private boolean value = true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 87813d59c..0a05da58f 100644
|
||||
index c39281247..a664c145d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
|
||||
public void setVelocity(Vector vel) {
|
||||
public void setVelocity(Vector velocity) {
|
||||
Preconditions.checkArgument(velocity != null, "velocity");
|
||||
velocity.checkFinite();
|
||||
+
|
||||
+ // Paper start - Warn server owners when plugins try to set super high velocities
|
||||
+ if (!(this instanceof org.bukkit.entity.Projectile) && isUnsafeVelocity(vel)) {
|
||||
+ CraftServer.excessiveVelEx = new Exception("Excessive velocity set detected: tried to set velocity of entity " + entity.getName() + " id #" + getEntityId() + " to (" + vel.getX() + "," + vel.getY() + "," + vel.getZ() + ").");
|
||||
+ if (!(this instanceof org.bukkit.entity.Projectile) && isUnsafeVelocity(velocity)) {
|
||||
+ CraftServer.excessiveVelEx = new Exception("Excessive velocity set detected: tried to set velocity of entity " + entity.getName() + " id #" + getEntityId() + " to (" + velocity.getX() + "," + velocity.getY() + "," + velocity.getZ() + ").");
|
||||
+ }
|
||||
+ // Paper end
|
||||
entity.motX = vel.getX();
|
||||
entity.motY = vel.getY();
|
||||
entity.motZ = vel.getZ();
|
||||
+
|
||||
entity.motX = velocity.getX();
|
||||
entity.motY = velocity.getY();
|
||||
entity.motZ = velocity.getZ();
|
||||
entity.velocityChanged = true;
|
||||
}
|
||||
|
||||
@@ -54,8 +56,6 @@ index 87813d59c..0a05da58f 100644
|
||||
+
|
||||
+ if (x > 4 || x < -4 || y > 4 || y < -4 || z > 4 || z < -4) {
|
||||
+ return true;
|
||||
+ } else if (x != x || y != y || z != z) { // NaN check
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 7ced523cd..2892f31f0 100644
|
||||
index d4fc6c4a2..41aaf61ad 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
|
||||
@@ -51,7 +51,7 @@ index 7ced523cd..2892f31f0 100644
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
double[] adouble1 = adouble;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
index 0fd29b17e..18e7cf2ad 100644
|
||||
index edc22d6c3..70a196461 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
||||
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
|
||||
@@ -101,7 +101,7 @@ index bc6383669..ca9eb2f3b 100644
|
||||
if (i >= 0 && i < this.list.size()) {
|
||||
NBTBase nbtbase = (NBTBase) this.list.get(i);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 3d114cfea..d207092ed 100644
|
||||
index 4fc95c86b..aa820465d 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -118,7 +118,7 @@ index 3d114cfea..d207092ed 100644
|
||||
flag = true;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 6375b5c40..87813d59c 100644
|
||||
index ce773218c..c39281247 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -132,38 +132,6 @@ index 6375b5c40..87813d59c 100644
|
||||
+ Location origin = getHandle().origin;
|
||||
+ return origin == null ? null : origin.clone();
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
|
||||
index b0a7f6392..56666f1f8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CraftFallingBlock extends CraftEntity implements FallingBlock {
|
||||
// Second field for EntityFallingBlock
|
||||
getHandle().ticksLived = value;
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public org.bukkit.Location getSourceLoc() {
|
||||
+ return getOrigin();
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
|
||||
index c493c9c0c..93843aa50 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
|
||||
@@ -0,0 +0,0 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {
|
||||
|
||||
return null;
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public org.bukkit.Location getSourceLoc() {
|
||||
+ return getOrigin();
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
--
|
||||
Reference in New Issue
Block a user