mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 20:52:12 -07:00
Only log for passenger / vehicle world mismatch
Exception thrown may corrupt passenger/vehicle state
This commit is contained in:
@@ -15,7 +15,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
protected boolean addPassenger(Entity entity) { // CraftBukkit
|
protected boolean addPassenger(Entity entity) { // CraftBukkit
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (entity.level != this.level) {
|
+ if (entity.level != this.level) {
|
||||||
+ throw new IllegalArgumentException("Entity passenger world must match");
|
+ LOGGER.error("Entity passenger world must match, cannot add " + entity + " as passenger to " + this, new Throwable());
|
||||||
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
if (entity == this) throw new IllegalArgumentException("Entities cannot become a passenger of themselves"); // Paper - issue 572
|
if (entity == this) throw new IllegalArgumentException("Entities cannot become a passenger of themselves"); // Paper - issue 572
|
||||||
|
Reference in New Issue
Block a user