2015-09-01 10:07:28 +02:00
|
|
|
From 3f74786e9e903c56de3e8cde33ae1a7bf1f14707 Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02: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
|
2015-09-01 10:07:28 +02:00
|
|
|
index b96c6d6..027b1f1 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2015-09-01 10:07:28 +02:00
|
|
|
@@ -121,6 +121,7 @@ public abstract class Entity implements ICommandListener {
|
2014-07-21 22:46:54 +02:00
|
|
|
public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
|
|
|
|
public final boolean defaultActivationState;
|
2014-12-21 02:09:49 +01:00
|
|
|
public long activatedTick = Integer.MIN_VALUE;
|
2014-07-21 22:46:54 +02: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
|
2015-09-01 10:07:28 +02:00
|
|
|
index 0608c3f..a8a327d 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2015-04-16 12:19:45 +02:00
|
|
|
@@ -457,6 +457,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
2014-07-21 22:46:54 +02:00
|
|
|
this.world.methodProfiler.a("checkDespawn");
|
2014-11-28 02:17:45 +01:00
|
|
|
this.D();
|
2014-07-21 22:46:54 +02:00
|
|
|
this.world.methodProfiler.b();
|
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( this.fromMobSpawner )
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
this.world.methodProfiler.a("sensing");
|
2015-02-28 12:36:22 +01:00
|
|
|
this.bk.a();
|
2014-07-21 22:46:54 +02: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
|
2015-07-27 14:20:54 +02:00
|
|
|
index 35ed213..6004e23 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
2014-12-02 07:02:15 +01:00
|
|
|
@@ -144,6 +144,12 @@ public abstract class MobSpawnerAbstract {
|
2014-11-28 02:17:45 +01:00
|
|
|
SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ());
|
2014-07-21 22:46:54 +02:00
|
|
|
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
|
|
|
|
}
|
2015-02-28 12:36:22 +01:00
|
|
|
@@ -191,6 +197,12 @@ public abstract class MobSpawnerAbstract {
|
2014-11-28 02:17:45 +01:00
|
|
|
SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ());
|
2014-07-21 22:46:54 +02:00
|
|
|
if (!event.isCancelled()) {
|
2014-11-28 02:17:45 +01:00
|
|
|
entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
|
2014-07-21 22:46:54 +02:00
|
|
|
+ // Spigot Start
|
|
|
|
+ if ( entity.world.spigotConfig.nerfSpawnerMobs )
|
|
|
|
+ {
|
|
|
|
+ entity.fromMobSpawner = true;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
}
|
|
|
|
// Spigot end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2015-05-26 11:16:27 +02:00
|
|
|
index f6fc0a2..20800ed 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2015-05-26 11:16:27 +02:00
|
|
|
@@ -254,4 +254,11 @@ public class SpigotWorldConfig
|
2014-07-21 22:46:54 +02: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 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2015-05-09 22:23:26 +02:00
|
|
|
2.1.4
|
2014-07-21 22:46:54 +02:00
|
|
|
|