@@ -19,14 +19,6 @@
|
||||
if (entityplayer.playerConnection.a().isConnected() && entityplayer.world == this.world && !entityplayer.isSleeping()) {
|
||||
- if (this.random.nextFloat() < 0.05F && this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING)) {
|
||||
- EntityEndermite entityendermite = (EntityEndermite) EntityTypes.ENDERMITE.a(this.world);
|
||||
-
|
||||
- entityendermite.setPlayerSpawned(true);
|
||||
- entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
|
||||
- this.world.addEntity(entityendermite);
|
||||
- }
|
||||
-
|
||||
- if (entityliving.isPassenger()) {
|
||||
- entityliving.stopRiding();
|
||||
+ // CraftBukkit start - Fire PlayerTeleportEvent
|
||||
+ org.bukkit.craftbukkit.entity.CraftPlayer player = entityplayer.getBukkitEntity();
|
||||
+ org.bukkit.Location location = getBukkitEntity().getLocation();
|
||||
@@ -39,12 +31,17 @@
|
||||
+ if (!teleEvent.isCancelled() && !entityplayer.playerConnection.isDisconnected()) {
|
||||
+ if (this.random.nextFloat() < 0.05F && this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING)) {
|
||||
+ EntityEndermite entityendermite = (EntityEndermite) EntityTypes.ENDERMITE.a(this.world);
|
||||
+
|
||||
|
||||
- entityendermite.setPlayerSpawned(true);
|
||||
+ entityendermite.setPlayerSpawned(true);
|
||||
+ entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
|
||||
entityendermite.setPositionRotation(entityliving.locX(), entityliving.locY(), entityliving.locZ(), entityliving.yaw, entityliving.pitch);
|
||||
- this.world.addEntity(entityendermite);
|
||||
- }
|
||||
+ this.world.addEntity(entityendermite, CreatureSpawnEvent.SpawnReason.ENDER_PEARL);
|
||||
+ }
|
||||
+
|
||||
|
||||
- if (entityliving.isPassenger()) {
|
||||
- entityliving.stopRiding();
|
||||
+ if (entityliving.isPassenger()) {
|
||||
+ entityliving.stopRiding();
|
||||
+ }
|
||||
@@ -56,10 +53,10 @@
|
||||
+ CraftEventFactory.entityDamage = null;
|
||||
}
|
||||
-
|
||||
- entityliving.enderTeleportTo(this.locX, this.locY, this.locZ);
|
||||
- entityliving.enderTeleportTo(this.locX(), this.locY(), this.locZ());
|
||||
- entityliving.fallDistance = 0.0F;
|
||||
- entityliving.damageEntity(DamageSource.FALL, 5.0F);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
} else if (entityliving != null) {
|
||||
entityliving.enderTeleportTo(this.locX, this.locY, this.locZ);
|
||||
entityliving.enderTeleportTo(this.locX(), this.locY(), this.locZ());
|
||||
|
||||
Reference in New Issue
Block a user