summaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch')
-rw-r--r--patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch b/patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch
new file mode 100644
index 0000000000..bd6c93d1d0
--- /dev/null
+++ b/patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch
@@ -0,0 +1,18 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Alfie Cleveland <[email protected]>
+Date: Sun, 8 Jan 2017 04:31:36 +0000
+Subject: [PATCH] Don't allow entities to ride themselves - #572
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
+index d40c4706918aa2cebc1422fba1a09c83e75e6bf7..368a6d73c94addcf948e7cf8f3a026ab2017731e 100644
+--- a/src/main/java/net/minecraft/world/entity/Entity.java
++++ b/src/main/java/net/minecraft/world/entity/Entity.java
+@@ -2418,6 +2418,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
+ }
+
+ protected boolean addPassenger(Entity entity) { // CraftBukkit
++ if (entity == this) throw new IllegalArgumentException("Entities cannot become a passenger of themselves"); // Paper - issue 572
+ if (entity.getVehicle() != this) {
+ throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
+ } else {