2014-04-30 14:13:37 +00:00
|
|
|
From a50f4baccd5284833cff597dad3bdaa0f3ee471d Mon Sep 17 00:00:00 2001
|
2014-04-12 04:18:37 +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
|
2014-04-18 17:08:19 +00:00
|
|
|
index 998fd36..c4bdccf 100644
|
2014-04-12 04:18:37 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2014-04-18 17:08:19 +00:00
|
|
|
@@ -120,6 +120,7 @@ public abstract class Entity {
|
2014-04-12 04:18:37 +00:00
|
|
|
public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
|
|
|
|
public final boolean defaultActivationState;
|
|
|
|
public long activatedTick = 0;
|
|
|
|
+ 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
|
2014-04-30 14:13:37 +00:00
|
|
|
index 11450ac..e146143 100644
|
2014-04-12 04:18:37 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2014-04-30 14:13:37 +00:00
|
|
|
@@ -425,6 +425,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
2014-04-12 04:18:37 +00:00
|
|
|
this.world.methodProfiler.a("checkDespawn");
|
|
|
|
this.w();
|
|
|
|
this.world.methodProfiler.b();
|
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( this.fromMobSpawner )
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
this.world.methodProfiler.a("sensing");
|
|
|
|
this.bq.a();
|
|
|
|
this.world.methodProfiler.b();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
index b97ac4b..23f09f7 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
@@ -136,6 +136,12 @@ public abstract class MobSpawnerAbstract {
|
|
|
|
SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b(), this.c(), this.d());
|
|
|
|
if (!event.isCancelled()) {
|
|
|
|
entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
|
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( entity.world.spigotConfig.nerfSpawnerMobs )
|
|
|
|
+ {
|
|
|
|
+ entity.fromMobSpawner = true;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|
|
|
|
@@ -181,6 +187,12 @@ public abstract class MobSpawnerAbstract {
|
|
|
|
SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b(), this.c(), this.d());
|
|
|
|
if (!event.isCancelled()) {
|
|
|
|
this.a().addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
|
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( entity.world.spigotConfig.nerfSpawnerMobs )
|
|
|
|
+ {
|
|
|
|
+ entity.fromMobSpawner = true;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2014-04-18 23:22:44 +00:00
|
|
|
index b8e144d..d7766bb 100644
|
2014-04-12 04:18:37 +00:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2014-04-18 23:22:44 +00:00
|
|
|
@@ -252,4 +252,11 @@ public class SpigotWorldConfig
|
2014-04-12 04:18:37 +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 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2014-04-18 17:08:19 +00:00
|
|
|
1.9.1
|
2014-04-12 04:18:37 +00:00
|
|
|
|