Files
CatServer/patches/net/minecraft/block/BlockEndPortal.java.patch
2018-09-08 09:15:34 +08:00

24 lines
1.0 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockEndPortal.java
+++ ../src-work/minecraft/net/minecraft/block/BlockEndPortal.java
@@ -3,6 +3,9 @@
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
+
+import org.bukkit.event.entity.EntityPortalEnterEvent;
+
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
@@ -68,6 +71,10 @@
{
if (!entityIn.isRiding() && !entityIn.isBeingRidden() && entityIn.isNonBoss() && !worldIn.isRemote && entityIn.getEntityBoundingBox().intersectsWith(state.getBoundingBox(worldIn, pos).offset(pos)))
{
+ // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entityIn.getBukkitEntity(), new org.bukkit.Location(worldIn.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
+ worldIn.getServer().getPluginManager().callEvent(event);
+ // CraftBukkit end
entityIn.changeDimension(1);
}
}