Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-16 19:40:07 +01:00
64ed429884
This is a pretty tiny update with very little changed. Recommended to update from 1.16.2 ASAP as 1.16.2 is now no longer supported. Plugins should mostly remain working as the NMS revision did not change.
99 Zeilen
4.9 KiB
Diff
99 Zeilen
4.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
Date: Tue, 1 Mar 2016 13:24:16 -0600
|
|
Subject: [PATCH] Allow nerfed mobs to jump and take water damage
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index 7d9976ce6bf86e6fdfd0c7770104cee0db363a6d..6d6a68cb1b952da8308ac9ce5b54694bc9ba0e30 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -92,4 +92,9 @@ public class PaperWorldConfig {
|
|
fishingMaxTicks = getInt("fishing-time-range.MaximumTicks", 600);
|
|
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/ControllerJump.java b/src/main/java/net/minecraft/server/ControllerJump.java
|
|
index 2e869004c8c6b8bfbb002fb4eda04519d50390c8..22eb89df768819f0a18f91b806b56acec8489281 100644
|
|
--- a/src/main/java/net/minecraft/server/ControllerJump.java
|
|
+++ b/src/main/java/net/minecraft/server/ControllerJump.java
|
|
@@ -13,6 +13,7 @@ public class ControllerJump {
|
|
this.a = true;
|
|
}
|
|
|
|
+ public final void jumpIfSet() { this.b(); } // Paper - OBFHELPER
|
|
public void b() {
|
|
this.b.setJumping(this.a);
|
|
this.a = false;
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
|
index 0f26aacfec892709052b7c2684b553ffe2e16ff6..bf3173881a0884d105bca724f3c0b1323c355170 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -1019,6 +1019,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
return this.isInWater() || this.isInRain();
|
|
}
|
|
|
|
+ public final boolean isInWaterOrRainOrBubble() { return aF(); } // Paper - OBFHELPER
|
|
public boolean aF() {
|
|
return this.isInWater() || this.isInRain() || this.k();
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
index abafe6d3ee2f2662f0c2b62cc697606b3d7b47e0..5df3ca8c0a272392cec2cf10b15494f9f63d171c 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
@@ -33,6 +33,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
private final EntityAIBodyControl c;
|
|
protected NavigationAbstract navigation;
|
|
public PathfinderGoalSelector goalSelector;
|
|
+ @Nullable public PathfinderGoalFloat goalFloat; // Paper
|
|
public PathfinderGoalSelector targetSelector;
|
|
private EntityLiving goalTarget;
|
|
private final EntitySenses bo;
|
|
@@ -719,7 +720,17 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
@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
|
|
+ if (goalFloat != null) {
|
|
+ if (goalFloat.validConditions()) goalFloat.update();
|
|
+ this.getControllerJump().jumpIfSet();
|
|
+ }
|
|
+ if ((this instanceof EntityBlaze || this instanceof EntityEnderman) && isInWaterOrRainOrBubble()) {
|
|
+ damageEntity(DamageSource.DROWN, 1.0F);
|
|
+ }
|
|
+ return;
|
|
+ }
|
|
+ // Paper end
|
|
this.world.getMethodProfiler().enter("sensing");
|
|
this.bo.a();
|
|
this.world.getMethodProfiler().exit();
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
|
index 8e41e7a159a9eabd955c5110c6c2458f5348f2f9..cb633bec6e977ba0af388d3c9b005a2dcb91bb87 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
|
@@ -8,15 +8,18 @@ public class PathfinderGoalFloat extends PathfinderGoal {
|
|
|
|
public PathfinderGoalFloat(EntityInsentient entityinsentient) {
|
|
this.a = entityinsentient;
|
|
+ if (entityinsentient.getWorld().paperConfig.nerfedMobsShouldJump) entityinsentient.goalFloat = this; // Paper
|
|
this.a(EnumSet.of(PathfinderGoal.Type.JUMP));
|
|
entityinsentient.getNavigation().d(true);
|
|
}
|
|
|
|
+ public final boolean validConditions() { return this.a(); } // Paper - OBFHELPER
|
|
@Override
|
|
public boolean a() {
|
|
return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aP();
|
|
}
|
|
|
|
+ public void update() { this.e(); } // Paper - OBFHELPER
|
|
@Override
|
|
public void e() {
|
|
if (this.a.getRandom().nextFloat() < 0.8F) {
|