2019-12-18 08:00:00 +11:00
|
|
|
From efc684e04968a183d0a57692ebe54e14135aa063 Mon Sep 17 00:00:00 2001
|
2017-05-18 20:43:42 +10:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2017-06-11 08:37:33 +10:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2019-12-11 09:00:00 +11:00
|
|
|
index fe9f3bf2..b3282876 100644
|
2017-06-11 08:37:33 +10:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2019-12-11 09:00:00 +11:00
|
|
|
@@ -170,6 +170,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
|
2019-05-29 19:49:51 +10:00
|
|
|
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
|
2017-06-11 08:37:33 +10:00
|
|
|
public final boolean defaultActivationState;
|
|
|
|
public long activatedTick = Integer.MIN_VALUE;
|
|
|
|
+ public boolean fromMobSpawner;
|
|
|
|
public void inactiveTick() { }
|
|
|
|
// Spigot end
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2019-12-18 08:00:00 +11:00
|
|
|
index 89210909..e1398652 100644
|
2017-06-11 08:37:33 +10:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2019-12-11 09:00:00 +11:00
|
|
|
@@ -639,6 +639,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
|
|
@Override
|
|
|
|
protected final void doTick() {
|
|
|
|
++this.ticksFarFromPlayer;
|
2017-06-11 08:37:33 +10:00
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( this.fromMobSpawner )
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
2019-04-23 12:00:00 +10:00
|
|
|
this.world.getMethodProfiler().enter("sensing");
|
2019-12-11 09:00:00 +11:00
|
|
|
this.bw.a();
|
2019-04-23 12:00:00 +10:00
|
|
|
this.world.getMethodProfiler().exit();
|
2017-05-18 20:43:42 +10:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
2019-12-11 09:00:00 +11:00
|
|
|
index 5ccb976a..e0b2a1b8 100644
|
2017-05-18 20:43:42 +10:00
|
|
|
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
2019-12-11 09:00:00 +11:00
|
|
|
@@ -129,7 +129,12 @@ public abstract class MobSpawnerAbstract {
|
2019-04-23 12:00:00 +10:00
|
|
|
((EntityInsentient) entity).prepare(world, world.getDamageScaler(new BlockPosition(entity)), EnumMobSpawn.SPAWNER, (GroupDataEntity) null, (NBTTagCompound) null);
|
|
|
|
}
|
2017-05-18 20:43:42 +10:00
|
|
|
}
|
2017-06-11 08:37:33 +10:00
|
|
|
-
|
2017-05-18 20:43:42 +10:00
|
|
|
+ // Spigot Start
|
2017-06-11 08:37:33 +10:00
|
|
|
+ if ( entity.world.spigotConfig.nerfSpawnerMobs )
|
|
|
|
+ {
|
|
|
|
+ entity.fromMobSpawner = true;
|
2017-05-18 20:43:42 +10:00
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
2019-04-23 12:00:00 +10:00
|
|
|
this.a(entity);
|
2017-05-18 20:43:42 +10:00
|
|
|
world.triggerEffect(2004, blockposition, 0);
|
2019-04-23 12:00:00 +10:00
|
|
|
if (entity instanceof EntityInsentient) {
|
2017-05-18 20:43:42 +10:00
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2019-12-14 10:40:44 +11:00
|
|
|
index d8678f2c..87adb772 100644
|
2017-05-18 20:43:42 +10:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2019-12-14 10:40:44 +11:00
|
|
|
@@ -237,4 +237,11 @@ public class SpigotWorldConfig
|
2017-05-18 20:43:42 +10:00
|
|
|
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 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2019-04-23 09:33:25 +10:00
|
|
|
2.20.1
|
2017-05-18 20:43:42 +10:00
|
|
|
|