2018-12-08 11:09:55 +01:00
|
|
|
From 0b7b250edea62c25ecaa5abf3a83298d4365d9ef Mon Sep 17 00:00:00 2001
|
2015-01-29 22:25:50 +01:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
2016-03-01 00:09:49 +01:00
|
|
|
Date: Tue, 1 Mar 2016 13:24:16 -0600
|
2014-06-29 20:34:16 +02:00
|
|
|
Subject: [PATCH] Allow nerfed mobs to jump
|
|
|
|
|
|
|
|
|
2016-03-19 03:10:20 +01:00
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-12-08 11:09:55 +01:00
|
|
|
index a55163a45..341038fc4 100644
|
2016-03-19 03:10:20 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-07-24 02:24:44 +02:00
|
|
|
@@ -87,4 +87,9 @@ public class PaperWorldConfig {
|
2016-11-17 03:23:38 +01:00
|
|
|
fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
|
2016-03-19 03:10:20 +01:00
|
|
|
log("Fishing time ranges are between " + fishingMinTicks +" and " + fishingMaxTicks + " ticks");
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean nerfedMobsShouldJump;
|
|
|
|
+ private void nerfedMobsShouldJump() {
|
|
|
|
+ nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
|
|
|
|
+ }
|
|
|
|
}
|
2016-12-21 04:57:07 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java
|
2018-12-08 11:09:55 +01:00
|
|
|
index 74a40671e..5d6260ded 100644
|
2016-12-21 04:57:07 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/ControllerJump.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ControllerJump.java
|
2018-09-01 00:56:57 +02:00
|
|
|
@@ -12,6 +12,7 @@ public class ControllerJump {
|
2016-12-21 04:57:07 +01:00
|
|
|
this.a = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public void jumpIfSet() { this.b(); } // Paper - OBFHELPER
|
|
|
|
public void b() {
|
2018-07-15 03:53:17 +02:00
|
|
|
this.b.o(this.a);
|
2016-12-21 04:57:07 +01:00
|
|
|
this.a = false;
|
2014-06-29 20:34:16 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2018-12-08 11:09:55 +01:00
|
|
|
index 7cf459d26..9d4d8c697 100644
|
2014-06-29 20:34:16 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2018-07-15 03:53:17 +02:00
|
|
|
@@ -32,6 +32,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
|
|
private final EntityAIBodyControl b;
|
|
|
|
protected NavigationAbstract navigation;
|
|
|
|
public PathfinderGoalSelector goalSelector;
|
2017-06-11 19:03:07 +02:00
|
|
|
+ @Nullable public PathfinderGoalFloat goalFloat; // Paper
|
2018-07-15 03:53:17 +02:00
|
|
|
public PathfinderGoalSelector targetSelector;
|
|
|
|
private EntityLiving goalTarget;
|
|
|
|
private final EntitySenses bC;
|
2018-12-08 11:09:55 +01:00
|
|
|
@@ -646,6 +647,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
2017-06-11 19:03:07 +02:00
|
|
|
// Spigot Start
|
|
|
|
if ( this.fromMobSpawner )
|
|
|
|
{
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Allow nerfed mobs to jump and float
|
2015-07-14 19:51:38 +02:00
|
|
|
+ if (goalFloat != null) {
|
2016-12-21 04:57:07 +01:00
|
|
|
+ if (goalFloat.validConditions()) goalFloat.update();
|
|
|
|
+ this.getControllerJump().jumpIfSet();
|
2015-07-14 19:51:38 +02:00
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2017-06-11 19:03:07 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Spigot End
|
2015-07-14 19:51:38 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
2018-12-08 11:09:55 +01:00
|
|
|
index 15c04f890..7db180fa9 100644
|
2015-07-14 19:51:38 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
2018-09-01 00:56:57 +02:00
|
|
|
@@ -5,14 +5,17 @@ public class PathfinderGoalFloat extends PathfinderGoal {
|
2015-07-14 19:51:38 +02:00
|
|
|
|
|
|
|
public PathfinderGoalFloat(EntityInsentient entityinsentient) {
|
|
|
|
this.a = entityinsentient;
|
2017-10-31 16:13:55 +01:00
|
|
|
+ if (entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper
|
2015-07-14 19:51:38 +02:00
|
|
|
this.a(4);
|
2018-07-22 07:27:46 +02:00
|
|
|
entityinsentient.getNavigation().d(true);
|
2015-07-14 19:51:38 +02:00
|
|
|
}
|
2016-12-21 04:57:07 +01:00
|
|
|
|
|
|
|
+ public boolean validConditions() { return this.a(); } // Paper - OBFHELPER
|
|
|
|
public boolean a() {
|
2018-07-22 07:27:46 +02:00
|
|
|
return this.a.isInWater() && this.a.bY() > 0.4D || this.a.ax();
|
2016-12-21 04:57:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+ public void update() { this.e(); } // Paper - OBFHELPER
|
|
|
|
public void e() {
|
|
|
|
if (this.a.getRandom().nextFloat() < 0.8F) {
|
|
|
|
this.a.getControllerJump().a();
|
2014-06-29 20:34:16 +02:00
|
|
|
--
|
2018-12-08 11:09:55 +01:00
|
|
|
2.19.2
|
2014-06-29 20:34:16 +02:00
|
|
|
|