Files
MinecraftForge/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch
T
Mithion e13dff305e Ender Teleport Changes
Renamed Ender Teleport Event and added it in to ender pearls.
2013-03-23 14:12:42 -04:00

29 lines
1.4 KiB
Diff

--- ../src_base/minecraft/net/minecraft/entity/item/EntityEnderPearl.java
+++ ../src_work/minecraft/net/minecraft/entity/item/EntityEnderPearl.java
@@ -8,6 +8,8 @@
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.living.EnderTeleportEvent;
public class EntityEnderPearl extends EntityThrowable
{
@@ -50,9 +52,13 @@
if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj)
{
- this.getThrower().setPositionAndUpdate(this.posX, this.posY, this.posZ);
- this.getThrower().fallDistance = 0.0F;
- this.getThrower().attackEntityFrom(DamageSource.fall, 5);
+ EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ);
+ if (!MinecraftForge.EVENT_BUS.post(event)){
+ this.getThrower().setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
+ this.getThrower().fallDistance = 0.0F;
+ this.getThrower().attackEntityFrom(DamageSource.fall, 5);
+ }
+
}
}