mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 06:24:43 +00:00
29 lines
1.4 KiB
Diff
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);
|
|
+ }
|
|
+
|
|
}
|
|
}
|
|
|