mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
42 lines
2.1 KiB
Diff
42 lines
2.1 KiB
Diff
From 53a1a850a555488db35540f52498a6d96a4d8479 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 50d324ff4..0b744b2d7 100644
|
|
--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
|
|
+++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java
|
|
@@ -155,6 +155,12 @@ public abstract class MobSpawnerAbstract {
|
|
if (this.nextSpawnData.getEntity().e() == 1 && this.nextSpawnData.getEntity().hasKeyOfType("id", 8)) {
|
|
((EntityInsentient) entity).prepare(worldserver, worldserver.getDamageScaler(entity.getChunkCoordinates()), EnumMobSpawn.SPAWNER, (GroupDataEntity) null, (NBTTagCompound) null);
|
|
}
|
|
+ // Spigot Start
|
|
+ if ( entityinsentient.level.spigotConfig.nerfSpawnerMobs )
|
|
+ {
|
|
+ entityinsentient.aware = false;
|
|
+ }
|
|
+ // Spigot End
|
|
}
|
|
|
|
if (!worldserver.addAllEntitiesSafely(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) { // CraftBukkit
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
index d3a4779c2..5168469c3 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
@@ -237,4 +237,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.25.1
|
|
|