Paper/Spigot-Server-Patches/0011-Allow-nerfed-mobs-to-jump.patch

61 lines
2.6 KiB
Diff
Raw Normal View History

2016-06-09 03:57:14 +00:00
From 61f10185ed47a235d07f9c59ff107cc23818d2cc Mon Sep 17 00:00:00 2001
2015-01-29 21:25:50 +00:00
From: Zach Brown <zach.brown@destroystokyo.com>
2016-02-29 23:09:49 +00:00
Date: Tue, 1 Mar 2016 13:24:16 -0600
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 9a72ef7..a44bbed 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -100,4 +100,9 @@ public class PaperWorldConfig {
fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 900);
log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
}
+
+ public boolean nerfedMobsShouldJump;
+ private void nerfedMobsShouldJump() {
+ nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
2016-06-09 03:57:14 +00:00
index d600fd7..bbf7f02 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
2016-05-12 02:07:46 +00:00
@@ -44,6 +44,7 @@ public abstract class EntityInsentient extends EntityLiving {
2016-06-09 03:57:14 +00:00
private boolean bE;
2016-02-29 23:09:49 +00:00
private Entity leashHolder;
2016-06-09 03:57:14 +00:00
private NBTTagCompound bG;
2016-02-29 23:09:49 +00:00
+ public PathfinderGoalFloat goalFloat; // Paper
public EntityInsentient(World world) {
super(world);
2016-06-09 03:57:14 +00:00
@@ -654,6 +655,12 @@ public abstract class EntityInsentient extends EntityLiving {
// Spigot Start
if ( this.fromMobSpawner )
{
2016-02-29 23:09:49 +00:00
+ // Paper start - Allow nerfed mobs to jump and float
+ if (goalFloat != null) {
+ if (goalFloat.a()) goalFloat.e();
+ this.g.b();
+ }
2016-02-29 23:09:49 +00:00
+ // 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
2016-06-09 03:57:14 +00:00
index e3b4058..c16ad2c 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
@@ -6,6 +6,7 @@ public class PathfinderGoalFloat extends PathfinderGoal {
public PathfinderGoalFloat(EntityInsentient entityinsentient) {
this.a = entityinsentient;
+ if (entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper
this.a(4);
2016-02-29 23:09:49 +00:00
((Navigation) entityinsentient.getNavigation()).c(true);
}
--
2016-06-09 03:57:14 +00:00
2.8.3