3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 04:50:05 +01:00
Paper/nms-patches/BlockEnderPortal.patch
2017-06-08 18:00:00 +10:00

23 Zeilen
1.1 KiB
Diff

--- a/net/minecraft/server/BlockEnderPortal.java
+++ b/net/minecraft/server/BlockEnderPortal.java
@@ -4,6 +4,8 @@
import java.util.Random;
import javax.annotation.Nullable;
+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);
@@ -37,6 +39,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.bf() && !world.isClientSide && entity.getBoundingBox().c(iblockdata.e(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.b(1);
}