diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 705381f9f3..8f5c0587ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; +import com.google.common.base.Preconditions; import java.util.List; import java.util.Set; import java.util.UUID; @@ -301,6 +302,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } public boolean setPassenger(org.bukkit.entity.Entity passenger) { + Preconditions.checkArgument(!this.equals(passenger), "Entity cannot ride itself."); if (passenger instanceof CraftEntity) { ((CraftEntity) passenger).getHandle().mount(getHandle()); return true;