2016-03-01 00:23:45 +00:00
|
|
|
From c7cfdc300957ebda374251b5487800eba6d437b6 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +00: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 Spawner's
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2016-02-29 21:33:06 +00:00
|
|
|
index 5955732..eb552e2 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2016-02-29 21:33:06 +00:00
|
|
|
@@ -145,6 +145,7 @@ public abstract class Entity implements ICommandListener {
|
2014-07-21 20:46:54 +00:00
|
|
|
public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
|
|
|
|
public final boolean defaultActivationState;
|
2014-12-21 01:09:49 +00:00
|
|
|
public long activatedTick = Integer.MIN_VALUE;
|
2014-07-21 20:46:54 +00:00
|
|
|
+ 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
|
2016-02-29 21:33:06 +00:00
|
|
|
index ba69133..7d4bb9f 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2016-02-29 21:33:06 +00:00
|
|
|
@@ -626,6 +626,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
2014-07-21 20:46:54 +00:00
|
|
|
this.world.methodProfiler.a("checkDespawn");
|
2016-02-29 21:33:06 +00:00
|
|
|
this.L();
|
2014-07-21 20:46:54 +00:00
|
|
|
this.world.methodProfiler.b();
|
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( this.fromMobSpawner )
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
this.world.methodProfiler.a("sensing");
|
2016-02-29 21:33:06 +00:00
|
|
|
this.bu.a();
|
2014-07-21 20:46:54 +00:00
|
|
|
this.world.methodProfiler.b();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
2016-02-29 21:33:06 +00:00
|
|
|
index 01cbd71..efe792b 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
2016-02-29 21:33:06 +00:00
|
|
|
@@ -94,7 +94,12 @@ public abstract class MobSpawnerAbstract {
|
|
|
|
if (this.spawnData.b().d() == 1 && this.spawnData.b().hasKeyOfType("id", 8) && entity instanceof EntityInsentient) {
|
|
|
|
((EntityInsentient) entity).prepare(world.D(new BlockPosition(entity)), (GroupDataEntity) null);
|
|
|
|
}
|
|
|
|
-
|
2014-07-21 20:46:54 +00:00
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( entity.world.spigotConfig.nerfSpawnerMobs )
|
|
|
|
+ {
|
|
|
|
+ entity.fromMobSpawner = true;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
2016-02-29 21:33:06 +00:00
|
|
|
ChunkRegionLoader.a(entity, world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
|
|
|
|
world.triggerEffect(2004, blockposition, 0);
|
|
|
|
if (entityinsentient != null) {
|
2014-07-21 20:46:54 +00:00
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2016-02-29 21:33:06 +00:00
|
|
|
index 6df2186..3854195 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2016-02-29 21:33:06 +00:00
|
|
|
@@ -210,4 +210,11 @@ public class SpigotWorldConfig
|
2014-07-21 20:46:54 +00: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 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2016-02-29 21:33:06 +00:00
|
|
|
2.5.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|