2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockEnderPortal.java
|
|
|
|
+++ b/net/minecraft/server/BlockEnderPortal.java
|
2019-04-26 10:03:32 +02:00
|
|
|
@@ -1,5 +1,10 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
package net.minecraft.server;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-26 10:03:32 +02:00
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.event.entity.EntityPortalEnterEvent;
|
|
|
|
+import org.bukkit.event.player.PlayerTeleportEvent;
|
|
|
|
+// CraftBukkit end
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
2016-02-29 22:32:46 +01:00
|
|
|
public class BlockEnderPortal extends BlockTileEntity {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2018-07-15 02:00:00 +02:00
|
|
|
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D);
|
2019-05-12 03:15:48 +02:00
|
|
|
@@ -21,7 +26,16 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2018-07-15 02:00:00 +02:00
|
|
|
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
2019-04-23 04:00:00 +02:00
|
|
|
if (!world.isClientSide && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
|
2019-05-12 03:15:48 +02:00
|
|
|
- entity.a(world.worldProvider.getDimensionManager() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END);
|
2014-11-25 22:32:16 +01: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);
|
2019-04-26 10:03:32 +02:00
|
|
|
+
|
|
|
|
+ if (entity instanceof EntityPlayer) {
|
2019-05-12 03:15:48 +02:00
|
|
|
+ ((EntityPlayer) entity).a(world.worldProvider.getDimensionManager().getType() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END, PlayerTeleportEvent.TeleportCause.END_PORTAL);
|
2019-04-26 10:03:32 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
2019-05-12 03:15:48 +02:00
|
|
|
+ entity.a(world.worldProvider.getDimensionManager().getType() == DimensionManager.THE_END ? DimensionManager.OVERWORLD : DimensionManager.THE_END);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2019-05-12 03:15:48 +02:00
|
|
|
}
|