summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockEnderPortal.patch
blob: 0e141d998e514553450ef0088189cd5af8d15b3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/net/minecraft/server/BlockEnderPortal.java
+++ b/net/minecraft/server/BlockEnderPortal.java
@@ -3,6 +3,8 @@
 import java.util.List;
 import java.util.Random;
 
+import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
+
 public class BlockEnderPortal extends BlockTileEntity {
 
     protected static final AxisAlignedBB a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D);
@@ -36,6 +38,10 @@
 
     public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
         if (!entity.isPassenger() && !entity.isVehicle() && entity.aV() && !world.isClientSide && entity.getBoundingBox().b(iblockdata.c(world, blockposition).a(blockposition))) {
+            // CraftBukkit start - Entity in portal
+            EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+            world.getServer().getPluginManager().callEvent(event);
+            // CraftBukkit end
             entity.c(1);
         }