From 77d030879a10d7e69bf5412d20f2dc633bfca739 Mon Sep 17 00:00:00 2001 From: Dmck2b Date: Mon, 20 Jan 2014 20:20:00 +0000 Subject: [PATCH] Allow disabling of ZombiePigmen spawning in portals --- ...f-ZombiePigmen-spawning-in-portal-bl.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 CraftBukkit-Patches/0099-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch diff --git a/CraftBukkit-Patches/0099-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch b/CraftBukkit-Patches/0099-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch new file mode 100644 index 0000000000..c31a40b8bb --- /dev/null +++ b/CraftBukkit-Patches/0099-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch @@ -0,0 +1,38 @@ +From 59dff65fcf4037b97e692fb7b20af04327e09862 Mon Sep 17 00:00:00 2001 +From: Dmck2b +Date: Mon, 20 Jan 2014 20:18:23 +0000 +Subject: [PATCH] Allow toggling of ZombiePigmen spawning in portal blocks + + +diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java +index 75b833a..4f5bea9 100644 +--- a/src/main/java/net/minecraft/server/BlockPortal.java ++++ b/src/main/java/net/minecraft/server/BlockPortal.java +@@ -15,7 +15,7 @@ public class BlockPortal extends BlockHalfTransparent { + + public void a(World world, int i, int j, int k, Random random) { + super.a(world, i, j, k, random); +- if (world.worldProvider.d() && world.getGameRules().getBoolean("doMobSpawning") && random.nextInt(2000) < world.difficulty.a()) { ++ if (world.spigotConfig.enableZombiePigmenPortalSpawns && world.worldProvider.d() && world.getGameRules().getBoolean("doMobSpawning") && random.nextInt(2000) < world.difficulty.a()) { // Spigot + int l; + + for (l = j; !World.a((IBlockAccess) world, i, l, k) && l > 0; --l) { +diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +index 50d3069..d1caf8c 100644 +--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java ++++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +@@ -257,4 +257,11 @@ public class SpigotWorldConfig + nerfSpawnerMobs = getBoolean( "nerf-spawner-mobs", false ); + log( "Nerfing mobs spawned from spawners " + nerfSpawnerMobs ); + } ++ ++ public boolean enableZombiePigmenPortalSpawns; ++ private void enableZombiePigmenPortalSpawns() ++ { ++ enableZombiePigmenPortalSpawns = getBoolean( "enable-zombie-pigmen-portal-spawns", true ); ++ log( "Allow Zombie Pigmen to spawn from portal blocks " + enableZombiePigmenPortalSpawns ); ++ } + } +-- +1.8.4.msysgit.0 +