#1390: Improve internal handling of damage sources
By: Doc <nachito94@msn.com>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityEnderPearl.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityEnderPearl.java
|
||||
@@ -18,6 +18,14 @@
|
||||
@@ -18,6 +18,13 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
@@ -15,7 +14,7 @@
|
||||
public class EntityEnderPearl extends EntityProjectileThrowable {
|
||||
|
||||
public EntityEnderPearl(EntityTypes<? extends EntityEnderPearl> entitytypes, World world) {
|
||||
@@ -54,23 +62,34 @@
|
||||
@@ -54,23 +61,34 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer) entity;
|
||||
|
||||
if (entityplayer.connection.isAcceptingMessages() && entityplayer.level() == this.level() && !entityplayer.isSleeping()) {
|
||||
@@ -57,13 +56,13 @@
|
||||
- entity.hurt(this.damageSources().fall(), 5.0F);
|
||||
+ entityplayer.connection.teleport(teleEvent.getTo());
|
||||
+ entity.resetFallDistance();
|
||||
+ entity.hurt(this.damageSources().fall().customCausingEntity(this), 5.0F); // CraftBukkit
|
||||
+ entity.hurt(this.damageSources().fall().customEntityDamager(this), 5.0F); // CraftBukkit
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.level().playSound((EntityHuman) null, this.getX(), this.getY(), this.getZ(), SoundEffects.PLAYER_TELEPORT, SoundCategory.PLAYERS);
|
||||
}
|
||||
} else if (entity != null) {
|
||||
@@ -78,7 +97,7 @@
|
||||
@@ -78,7 +96,7 @@
|
||||
entity.resetFallDistance();
|
||||
}
|
||||
|
||||
@@ -72,7 +71,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -88,7 +107,7 @@
|
||||
@@ -88,7 +106,7 @@
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
if (entity instanceof EntityPlayer && !entity.isAlive() && this.level().getGameRules().getBoolean(GameRules.RULE_ENDER_PEARLS_VANISH_ON_DEATH)) {
|
||||
@@ -81,7 +80,7 @@
|
||||
} else {
|
||||
super.tick();
|
||||
}
|
||||
@@ -100,7 +119,7 @@
|
||||
@@ -100,7 +118,7 @@
|
||||
public Entity changeDimension(WorldServer worldserver) {
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user