0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/spigot.git synced 2024-11-21 22:06:13 +00:00
spigot/CraftBukkit-Patches/0031-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch
2024-10-23 02:15:00 +11:00

39 lines
2.1 KiB
Diff

From 62e00ce9a7e03f9dead2f3826c0198d0ffaabefd 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/world/level/block/BlockPortal.java b/src/main/java/net/minecraft/world/level/block/BlockPortal.java
index ff133edc8f..d205566b20 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockPortal.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockPortal.java
@@ -80,7 +80,7 @@ public class BlockPortal extends Block implements Portal {
@Override
protected void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
- if (worldserver.dimensionType().natural() && worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && randomsource.nextInt(2000) < worldserver.getDifficulty().getId()) {
+ if (worldserver.spigotConfig.enableZombiePigmenPortalSpawns && worldserver.dimensionType().natural() && worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && randomsource.nextInt(2000) < worldserver.getDifficulty().getId()) { // Spigot
while (worldserver.getBlockState(blockposition).is((Block) this)) {
blockposition = blockposition.below();
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 3e398c4e06..d4eb3ccdab 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -269,4 +269,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 );
+ }
}
--
2.47.0