2015-05-25 18:37:24 +08:00
|
|
|
--- a/net/minecraft/server/BlockEnderPortal.java
|
|
|
|
+++ b/net/minecraft/server/BlockEnderPortal.java
|
2018-07-15 08:00:00 +08:00
|
|
|
@@ -2,6 +2,8 @@
|
|
|
|
|
2014-11-26 05:32:16 +08:00
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
+import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
|
|
|
|
+
|
2016-03-01 05:32:46 +08:00
|
|
|
public class BlockEnderPortal extends BlockTileEntity {
|
2014-11-26 05:32:16 +08:00
|
|
|
|
2018-07-15 08:00:00 +08:00
|
|
|
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D);
|
|
|
|
@@ -28,6 +30,10 @@
|
2014-11-26 05:32:16 +08:00
|
|
|
|
2018-07-15 08:00:00 +08:00
|
|
|
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
|
|
|
if (!world.isClientSide && !entity.isPassenger() && !entity.isVehicle() && entity.bm() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.g(world, blockposition), OperatorBoolean.AND)) {
|
2014-11-26 05:32:16 +08:00
|
|
|
+ // 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
|
2018-07-15 08:00:00 +08:00
|
|
|
entity.d(1);
|
2014-11-26 05:32:16 +08:00
|
|
|
}
|
|
|
|
|