Archiviert
13
0

SPIGOT-5136: EntityPortalEvent getting called on interdimensional entity teleports

Dieser Commit ist enthalten in:
md_5 2019-07-05 10:09:11 +10:00
Ursprung 604c8bf07e
Commit fca41573a3

Datei anzeigen

@ -573,9 +573,8 @@
+ this.setOnFire(entityCombustEvent.getDuration(), false); + this.setOnFire(entityCombustEvent.getDuration(), false);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} + }
+
- this.damageEntity(DamageSource.LIGHTNING, 5.0F);
+ // CraftBukkit start + // CraftBukkit start
+ if (thisBukkitEntity instanceof Hanging) { + if (thisBukkitEntity instanceof Hanging) {
+ HangingBreakByEntityEvent hangingEvent = new HangingBreakByEntityEvent((Hanging) thisBukkitEntity, stormBukkitEntity); + HangingBreakByEntityEvent hangingEvent = new HangingBreakByEntityEvent((Hanging) thisBukkitEntity, stormBukkitEntity);
@ -584,8 +583,9 @@
+ if (hangingEvent.isCancelled()) { + if (hangingEvent.isCancelled()) {
+ return; + return;
+ } + }
+ } }
+
- this.damageEntity(DamageSource.LIGHTNING, 5.0F);
+ if (this.isFireProof()) { + if (this.isFireProof()) {
+ return; + return;
+ } + }
@ -652,13 +652,15 @@
d0 *= 8.0D; d0 *= 8.0D;
d1 *= 8.0D; d1 *= 8.0D;
} }
@@ -2088,6 +2442,25 @@ @@ -2088,6 +2442,28 @@
vec3d = shapedetector_shape.velocity; vec3d = shapedetector_shape.velocity;
f = (float) shapedetector_shape.yaw; f = (float) shapedetector_shape.yaw;
} }
+ } // CraftBukkit + } // CraftBukkit
+ +
+ // CraftBukkit start + // CraftBukkit start
+ // SPIGOT-5136 - don't fire event for CraftEntity.teleport
+ if (location == null) {
+ Location enter = this.getBukkitEntity().getLocation(); + Location enter = this.getBukkitEntity().getLocation();
+ Location exit = new Location(worldserver1.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()); + Location exit = new Location(worldserver1.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ +
@ -671,6 +673,7 @@
+ exit = event.getTo(); + exit = event.getTo();
+ worldserver1 = ((CraftWorld) exit.getWorld()).getHandle(); + worldserver1 = ((CraftWorld) exit.getWorld()).getHandle();
+ blockposition = new BlockPosition(exit.getX(), exit.getY(), exit.getZ()); + blockposition = new BlockPosition(exit.getX(), exit.getY(), exit.getZ());
+ }
+ +
+ this.dimension = dimensionmanager; + this.dimension = dimensionmanager;
+ this.decouple(); + this.decouple();
@ -678,7 +681,7 @@
this.world.getMethodProfiler().exitEnter("reloading"); this.world.getMethodProfiler().exitEnter("reloading");
Entity entity = this.getEntityType().a((World) worldserver1); Entity entity = this.getEntityType().a((World) worldserver1);
@@ -2097,6 +2470,14 @@ @@ -2097,6 +2473,14 @@
entity.setPositionRotation(blockposition, entity.yaw + f, entity.pitch); entity.setPositionRotation(blockposition, entity.yaw + f, entity.pitch);
entity.setMot(vec3d); entity.setMot(vec3d);
worldserver1.addEntityTeleport(entity); worldserver1.addEntityTeleport(entity);
@ -693,7 +696,7 @@
} }
this.dead = true; this.dead = true;
@@ -2298,7 +2679,26 @@ @@ -2298,7 +2682,26 @@
} }
public void a(AxisAlignedBB axisalignedbb) { public void a(AxisAlignedBB axisalignedbb) {