2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2020-02-09 04:19:54 +00:00
|
|
|
Subject: [PATCH] Allow nerfed mobs to jump and take water damage
|
2014-06-29 18:34:16 +00:00
|
|
|
|
|
|
|
|
2016-03-19 02:10:20 +00:00
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-05-06 09:48:49 +00:00
|
|
|
index 7d9976ce6bf86e6fdfd0c7770104cee0db363a6d..6d6a68cb1b952da8308ac9ce5b54694bc9ba0e30 100644
|
2016-03-19 02:10:20 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-10-26 22:55:58 +00:00
|
|
|
@@ -92,4 +92,9 @@ public class PaperWorldConfig {
|
2016-11-17 02:23:38 +00:00
|
|
|
fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
|
2016-03-19 02:10:20 +00: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 03:57:07 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java
|
2020-08-02 05:39:36 +00:00
|
|
|
index 2e869004c8c6b8bfbb002fb4eda04519d50390c8..22eb89df768819f0a18f91b806b56acec8489281 100644
|
2016-12-21 03:57:07 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ControllerJump.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ControllerJump.java
|
2019-01-01 03:15:55 +00:00
|
|
|
@@ -13,6 +13,7 @@ public class ControllerJump {
|
2016-12-21 03:57:07 +00:00
|
|
|
this.a = true;
|
|
|
|
}
|
|
|
|
|
2020-08-02 05:39:36 +00:00
|
|
|
+ public final void jumpIfSet() { this.b(); } // Paper - OBFHELPER
|
2016-12-21 03:57:07 +00:00
|
|
|
public void b() {
|
2019-04-24 01:00:24 +00:00
|
|
|
this.b.setJumping(this.a);
|
2016-12-21 03:57:07 +00:00
|
|
|
this.a = false;
|
2020-02-09 04:19:54 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2020-09-10 22:02:39 +00:00
|
|
|
index 7fe3c37feef31762014f0c77e1bbb3c3a12a0797..b0dc450870483c0c97784a52c7d32d56e0a10fc4 100644
|
2020-02-09 04:19:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2020-09-10 22:02:39 +00:00
|
|
|
@@ -1019,6 +1019,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-02-09 04:19:54 +00:00
|
|
|
return this.isInWater() || this.isInRain();
|
|
|
|
}
|
|
|
|
|
2020-08-25 02:22:08 +00:00
|
|
|
+ public final boolean isInWaterOrRainOrBubble() { return aF(); } // Paper - OBFHELPER
|
|
|
|
public boolean aF() {
|
2020-06-25 09:27:25 +00:00
|
|
|
return this.isInWater() || this.isInRain() || this.k();
|
2020-02-09 04:19:54 +00:00
|
|
|
}
|
2014-06-29 18:34:16 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2020-09-10 22:02:39 +00:00
|
|
|
index 5da6528672d0f14766ca99ce5d2cc40b5035896c..f56701240ab819d31bb631684a4ee49a9a28a19b 100644
|
2014-06-29 18:34:16 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
2020-06-25 09:27:25 +00:00
|
|
|
@@ -33,6 +33,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
2019-04-24 01:00:24 +00:00
|
|
|
private final EntityAIBodyControl c;
|
2018-07-15 01:53:17 +00:00
|
|
|
protected NavigationAbstract navigation;
|
|
|
|
public PathfinderGoalSelector goalSelector;
|
2017-06-11 17:03:07 +00:00
|
|
|
+ @Nullable public PathfinderGoalFloat goalFloat; // Paper
|
2018-07-15 01:53:17 +00:00
|
|
|
public PathfinderGoalSelector targetSelector;
|
|
|
|
private EntityLiving goalTarget;
|
2020-08-25 02:22:08 +00:00
|
|
|
private final EntitySenses bo;
|
2020-06-25 09:27:25 +00:00
|
|
|
@@ -719,7 +720,17 @@ public abstract class EntityInsentient extends EntityLiving {
|
2020-02-21 17:52:20 +00:00
|
|
|
@Override
|
|
|
|
protected final void doTick() {
|
|
|
|
++this.ticksFarFromPlayer;
|
|
|
|
- if (!this.aware) return; // CraftBukkit
|
|
|
|
+ if (!this.aware) { // Paper start - Allow nerfed mobs to jump, float and take water damage
|
2015-07-14 17:51:38 +00:00
|
|
|
+ if (goalFloat != null) {
|
2016-12-21 03:57:07 +00:00
|
|
|
+ if (goalFloat.validConditions()) goalFloat.update();
|
|
|
|
+ this.getControllerJump().jumpIfSet();
|
2015-07-14 17:51:38 +00:00
|
|
|
+ }
|
2020-02-09 04:19:54 +00:00
|
|
|
+ if ((this instanceof EntityBlaze || this instanceof EntityEnderman) && isInWaterOrRainOrBubble()) {
|
|
|
|
+ damageEntity(DamageSource.DROWN, 1.0F);
|
|
|
|
+ }
|
2020-02-21 17:52:20 +00:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
this.world.getMethodProfiler().enter("sensing");
|
2020-08-25 02:22:08 +00:00
|
|
|
this.bo.a();
|
2020-02-21 17:52:20 +00:00
|
|
|
this.world.getMethodProfiler().exit();
|
2015-07-14 17:51:38 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
2020-08-25 02:22:08 +00:00
|
|
|
index 8e41e7a159a9eabd955c5110c6c2458f5348f2f9..cb633bec6e977ba0af388d3c9b005a2dcb91bb87 100644
|
2015-07-14 17:51:38 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
2020-06-25 09:27:25 +00:00
|
|
|
@@ -8,15 +8,18 @@ public class PathfinderGoalFloat extends PathfinderGoal {
|
2015-07-14 17:51:38 +00:00
|
|
|
|
|
|
|
public PathfinderGoalFloat(EntityInsentient entityinsentient) {
|
|
|
|
this.a = entityinsentient;
|
2017-10-31 15:13:55 +00:00
|
|
|
+ if (entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper
|
2019-04-24 01:00:24 +00:00
|
|
|
this.a(EnumSet.of(PathfinderGoal.Type.JUMP));
|
2018-07-22 05:27:46 +00:00
|
|
|
entityinsentient.getNavigation().d(true);
|
2015-07-14 17:51:38 +00:00
|
|
|
}
|
2019-05-06 00:57:14 +00:00
|
|
|
|
|
|
|
+ public final boolean validConditions() { return this.a(); } // Paper - OBFHELPER
|
|
|
|
@Override
|
|
|
|
public boolean a() {
|
2020-08-25 02:22:08 +00:00
|
|
|
return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aP();
|
2016-12-21 03:57:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ public void update() { this.e(); } // Paper - OBFHELPER
|
2019-04-24 01:00:24 +00:00
|
|
|
@Override
|
2016-12-21 03:57:07 +00:00
|
|
|
public void e() {
|
|
|
|
if (this.a.getRandom().nextFloat() < 0.8F) {
|