diff options
Diffstat (limited to 'nms-patches/BlockPortal.patch')
-rw-r--r-- | nms-patches/BlockPortal.patch | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/nms-patches/BlockPortal.patch b/nms-patches/BlockPortal.patch index d3d3a650..3ac6f992 100644 --- a/nms-patches/BlockPortal.patch +++ b/nms-patches/BlockPortal.patch @@ -10,17 +10,17 @@ public class BlockPortal extends BlockHalfTransparent { public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockStateEnum.of("axis", EnumDirection.EnumAxis.class, new EnumDirection.EnumAxis[] { EnumDirection.EnumAxis.X, EnumDirection.EnumAxis.Z}); -@@ -25,7 +28,8 @@ +@@ -42,7 +45,8 @@ } - if (i > 0 && !world.getType(blockposition1.up()).getBlock().isOccluding()) { -- Entity entity = ItemMonsterEgg.a(world, 57, (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D); + if (i > 0 && !world.getType(blockposition1.up()).l()) { +- Entity entity = ItemMonsterEgg.a(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D); + // CraftBukkit - set spawn reason to NETHER_PORTAL -+ Entity entity = ItemMonsterEgg.spawnCreature(world, 57, (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); ++ Entity entity = ItemMonsterEgg.spawnCreature(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); if (entity != null) { - entity.portalCooldown = entity.aq(); -@@ -67,14 +71,16 @@ + entity.portalCooldown = entity.aC(); +@@ -68,14 +72,16 @@ BlockPortal.Shape blockportal_shape = new BlockPortal.Shape(world, blockposition, EnumDirection.EnumAxis.X); if (blockportal_shape.d() && blockportal_shape.e == 0) { @@ -41,18 +41,18 @@ } else { return false; } -@@ -105,6 +111,10 @@ +@@ -106,6 +112,10 @@ public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { - if (entity.vehicle == null && entity.passenger == null) { + if (!entity.isPassenger() && !entity.isVehicle() && entity.aV()) { + // 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.d(blockposition); + entity.e(blockposition); } -@@ -185,6 +195,7 @@ +@@ -251,6 +261,7 @@ private BlockPosition position; private int height; private int width; @@ -60,7 +60,7 @@ public Shape(World world, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) { this.a = world; -@@ -243,6 +254,10 @@ +@@ -309,6 +320,10 @@ } protected int c() { @@ -71,7 +71,7 @@ int i; label56: -@@ -263,11 +278,21 @@ +@@ -329,11 +344,21 @@ block = this.a.getType(blockposition.shift(this.d)).getBlock(); if (block != Blocks.OBSIDIAN) { break label56; @@ -93,7 +93,7 @@ } } } -@@ -277,6 +302,11 @@ +@@ -343,6 +368,11 @@ if (this.a.getType(this.position.shift(this.c, i).up(this.height)).getBlock() != Blocks.OBSIDIAN) { this.height = 0; break; @@ -105,7 +105,7 @@ } } -@@ -298,7 +328,27 @@ +@@ -364,7 +394,27 @@ return this.position != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21; } @@ -134,7 +134,7 @@ for (int i = 0; i < this.width; ++i) { BlockPosition blockposition = this.position.shift(this.c, i); -@@ -307,6 +357,7 @@ +@@ -373,6 +423,7 @@ } } |