diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-26 08:32:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-28 17:16:30 +1100 |
commit | 24557bc2b37deb6a0edf497d547471832457b1dd (patch) | |
tree | c560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/BlockPortal.patch | |
parent | a4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff) | |
download | craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip |
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/BlockPortal.patch')
-rw-r--r-- | nms-patches/BlockPortal.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/nms-patches/BlockPortal.patch b/nms-patches/BlockPortal.patch new file mode 100644 index 00000000..d575fc78 --- /dev/null +++ b/nms-patches/BlockPortal.patch @@ -0,0 +1,53 @@ +--- ../work/decompile-bb26c12b/net/minecraft/server/BlockPortal.java 2014-11-27 08:59:46.553422499 +1100 ++++ src/main/java/net/minecraft/server/BlockPortal.java 2014-11-27 08:42:10.172850872 +1100 +@@ -2,6 +2,8 @@ + + import java.util.Random; + ++import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit ++ + public class BlockPortal extends BlockHalfTransparent { + + public static final BlockStateEnum AXIS = BlockStateEnum.of("axis", EnumAxis.class, new EnumAxis[] { EnumAxis.X, EnumAxis.Z}); +@@ -24,7 +26,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); ++ // 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); + + if (entity != null) { + entity.portalCooldown = entity.ar(); +@@ -66,14 +69,16 @@ + PortalCreator portalcreator = new PortalCreator(world, blockposition, EnumAxis.X); + + if (portalcreator.b() && PortalCreator.a(portalcreator) == 0) { +- portalcreator.c(); +- return true; ++ // CraftBukkit start - return portalcreator ++ return portalcreator.c(); ++ // return true; + } else { + PortalCreator portalcreator1 = new PortalCreator(world, blockposition, EnumAxis.Z); + + if (portalcreator1.b() && PortalCreator.a(portalcreator1) == 0) { +- portalcreator1.c(); +- return true; ++ return portalcreator1.c(); ++ // return true; ++ // CraftBukkit end + } else { + return false; + } +@@ -104,6 +109,10 @@ + + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { + if (entity.vehicle == null && entity.passenger == null) { ++ // 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.aq(); + } + |