mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Should fix IndexOutOfBoundsException when copying
fixes#2290
This commit is contained in:
parent
4c8457ad14
commit
ed10877431
@ -10,6 +10,8 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.util.EulerAngle;
|
import org.bukkit.util.EulerAngle;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public final class ReplicatingEntityWrapper extends EntityWrapper {
|
public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||||
|
|
||||||
private final short depth;
|
private final short depth;
|
||||||
@ -38,9 +40,9 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
|||||||
if (depth == 0) {
|
if (depth == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Entity passenger = entity.getPassengers().get(0);
|
List<Entity> passengers = entity.getPassengers();
|
||||||
if (passenger != null) {
|
if (passengers.size() > 0) {
|
||||||
this.base.passenger = new ReplicatingEntityWrapper(passenger, depth);
|
this.base.passenger = new ReplicatingEntityWrapper(passengers.get(0), depth);
|
||||||
}
|
}
|
||||||
this.base.fall = entity.getFallDistance();
|
this.base.fall = entity.getFallDistance();
|
||||||
this.base.fire = (short) entity.getFireTicks();
|
this.base.fire = (short) entity.getFireTicks();
|
||||||
|
Loading…
Reference in New Issue
Block a user