mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-31 22:30:15 +00:00
Add self-riding check to Entity#addPassenger
This commit is contained in:
parent
0ba6b90135
commit
633ac8b31c
1 changed files with 1 additions and 0 deletions
|
@ -662,6 +662,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|||
@Override
|
||||
public boolean addPassenger(org.bukkit.entity.Entity passenger) {
|
||||
Preconditions.checkArgument(passenger != null, "passenger == null");
|
||||
Preconditions.checkArgument(!this.equals(passenger), "Entity cannot ride itself.");
|
||||
|
||||
return ((CraftEntity) passenger).getHandle().startRiding(getHandle(), true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue