Paper/CraftBukkit-Patches/0073-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch

39 lines
1.9 KiB
Diff
Raw Normal View History

2015-03-08 12:04:41 +01:00
From fe1565b904440fd4a243cba36b8e27a93e7daf0d Mon Sep 17 00:00:00 2001
From: Dmck2b <dmck2b+github@gmail.com>
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
2015-02-28 12:36:22 +01:00
index 030f4e9..4dc40eb 100644
--- a/src/main/java/net/minecraft/server/BlockPortal.java
+++ b/src/main/java/net/minecraft/server/BlockPortal.java
2015-02-28 12:36:22 +01:00
@@ -18,7 +18,7 @@ public class BlockPortal extends BlockHalfTransparent {
2014-11-28 02:17:45 +01:00
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
super.b(world, blockposition, iblockdata, random);
- if (world.worldProvider.d() && world.getGameRules().getBoolean("doMobSpawning") && random.nextInt(2000) < world.getDifficulty().a()) {
+ if (world.spigotConfig.enableZombiePigmenPortalSpawns && world.worldProvider.d() && world.getGameRules().getBoolean("doMobSpawning") && random.nextInt(2000) < world.getDifficulty().a()) { // Spigot
int i = blockposition.getY();
2014-11-28 02:17:45 +01:00
BlockPosition blockposition1;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
2015-02-26 11:40:16 +01:00
index 891812a..1971dbf 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -259,4 +259,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 );
+ }
}
--
2014-11-28 02:17:45 +01:00
2.1.0