mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
42 lines
2 KiB
Diff
42 lines
2 KiB
Diff
From f3b47c5815f4fef07a344849cf30d4b484a94d1b Mon Sep 17 00:00:00 2001
|
|
From: md_5 <git@md-5.net>
|
|
Date: Sun, 2 Feb 2014 16:55:46 +0000
|
|
Subject: [PATCH] Add Option to Nerf Mobs from Spawners
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
|
|
index 20f8b6d1b..98b044d32 100644
|
|
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
|
|
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
|
|
@@ -151,6 +151,12 @@ public abstract class MobSpawnerAbstract {
|
|
if (mobspawnerdata.getEntityToSpawn().size() == 1 && mobspawnerdata.getEntityToSpawn().contains("id", 8)) {
|
|
((EntityInsentient) entity).finalizeSpawn(worldserver, worldserver.getCurrentDifficultyAt(entity.blockPosition()), EnumMobSpawn.SPAWNER, (GroupDataEntity) null, (NBTTagCompound) null);
|
|
}
|
|
+ // Spigot Start
|
|
+ if ( entityinsentient.level().spigotConfig.nerfSpawnerMobs )
|
|
+ {
|
|
+ entityinsentient.aware = false;
|
|
+ }
|
|
+ // Spigot End
|
|
}
|
|
|
|
// CraftBukkit start
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
index 457a8e84b..3e398c4e0 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
@@ -262,4 +262,11 @@ public class SpigotWorldConfig
|
|
zombieAggressiveTowardsVillager = getBoolean( "zombie-aggressive-towards-villager", true );
|
|
log( "Zombie Aggressive Towards Villager: " + zombieAggressiveTowardsVillager );
|
|
}
|
|
+
|
|
+ public boolean nerfSpawnerMobs;
|
|
+ private void nerfSpawnerMobs()
|
|
+ {
|
|
+ nerfSpawnerMobs = getBoolean( "nerf-spawner-mobs", false );
|
|
+ log( "Nerfing mobs spawned from spawners: " + nerfSpawnerMobs );
|
|
+ }
|
|
}
|
|
--
|
|
2.40.1
|
|
|