3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/nms-patches/BlockEnderPortal.patch

23 Zeilen
1.2 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockEnderPortal.java
+++ b/net/minecraft/server/BlockEnderPortal.java
2018-07-15 02:00:00 +02:00
@@ -2,6 +2,8 @@
import java.util.Random;
+import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
+
2016-02-29 22:32:46 +01:00
public class BlockEnderPortal extends BlockTileEntity {
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);
@@ -28,6 +30,10 @@
2018-07-15 02:00:00 +02:00
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
2018-12-25 22:00:00 +01:00
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.getShape(world, blockposition), OperatorBoolean.AND)) {
+ // 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-08-26 04:00:00 +02:00
entity.a(DimensionManager.THE_END);
}