Cleanup 'nerfed spawner mobs can float' patch

This commit is contained in:
Zach Brown 2016-12-20 21:57:07 -06:00
parent cd80c0a2f7
commit 4bfa933c52
5 changed files with 43 additions and 21 deletions

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add configurable despawn distances for living entities
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 021c01b2b..92f38a450 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 59654bcc9..21f5df3c0 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Allow nerfed mobs to jump
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 7b2b95dfa..021c01b2b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
@ -18,15 +18,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java
index 4f2fa59ac..8af52a61f 100644
--- a/src/main/java/net/minecraft/server/ControllerJump.java
+++ b/src/main/java/net/minecraft/server/ControllerJump.java
@@ -0,0 +0,0 @@ public class ControllerJump {
this.a = true;
}
+ public void jumpIfSet() { this.b(); } // Paper - OBFHELPER
public void b() {
this.b.l(this.a);
this.a = false;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 7430fe4ce..59654bcc9 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
private boolean bD;
private Entity leashHolder;
private NBTTagCompound bF;
+ private NBTTagCompound bG;
+ public PathfinderGoalFloat goalFloat; // Paper
public EntityInsentient(World world) {
@ -37,23 +48,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
{
+ // Paper start - Allow nerfed mobs to jump and float
+ if (goalFloat != null) {
+ if (goalFloat.a()) goalFloat.e();
+ this.g.b();
+ if (goalFloat.validConditions()) goalFloat.update();
+ this.getControllerJump().jumpIfSet();
+ }
+ // Paper end
return;
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index e3b405856..2d27aa63a 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
@@ -0,0 +0,0 @@ public class PathfinderGoalFloat extends PathfinderGoal {
public PathfinderGoalFloat(EntityInsentient entityinsentient) {
this.a = entityinsentient;
+ if (entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper
+ if (entityinsentient.fromMobSpawner && entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper
this.a(4);
((Navigation) entityinsentient.getNavigation()).c(true);
}
+ public boolean validConditions() { return this.a(); } // Paper - OBFHELPER
public boolean a() {
return this.a.isInWater() || this.a.ao();
}
+ public void update() { this.e(); } // Paper - OBFHELPER
public void e() {
if (this.a.getRandom().nextFloat() < 0.8F) {
this.a.getControllerJump().a();
--

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Paper config files
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
index 000000000..3d0a00512
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -0,0 +0,0 @@
@ -176,7 +176,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
index 000000000..dae60dcce
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +0,0 @@
@ -253,7 +253,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 7336aed80..c6a834580 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@ -268,7 +268,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
DedicatedServer.LOGGER.info("Generating keypair");
this.a(MinecraftEncryption.b());
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index a32abf0fa..dcd6fc13f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
@ -289,7 +289,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 50799950f..f4b0871ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
@ -316,7 +316,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 21170f377..30b6f3477 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -0,0 +0,0 @@ public class Main {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 82146dedb..f1823af4d 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit start
public boolean fauxSleeping;
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 21f5df3c0..a7283d36d 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
double d1 = entityhuman.locY - this.locY;
double d2 = entityhuman.locZ - this.locZ;
diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 5af51cc0a..7531c9ba9 100644
--- a/src/main/java/net/minecraft/server/EntitySilverfish.java
+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
@@ -0,0 +0,0 @@ public class EntitySilverfish extends EntityMonster {
@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return false;
}
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 17bf3e410..a05fad54f 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
j = MathHelper.floor(entityhuman.locZ / 16.0D);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index c5c4fad6f..64120c76c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (d3 < 0.0D || d4 < d3 * d3) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 877a0c88d..5e9834c67 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -53,6 +53,7 @@ import ChunkProviderHell
import CommandAbstract
import CommandScoreboard
import CommandWhitelist
import ControllerJump
import DataBits
import DataConverterMaterialId
import DataInspectorBlockEntity