Add option to disable zombie aggressiveness towards villagers

This commit is contained in:
nitricspace
2025-01-09 18:20:37 -08:00
committed by granny
parent 62d07882c6
commit 45acfd3f2a
10 changed files with 81 additions and 127 deletions

View File

@@ -30,7 +30,7 @@ index da4b7400d6148ff5e412076bdccab295aaa72bad..b5011af774484b6ed35ee83b4a562ddd
/* Drop global time updates
if (this.tickCount % 20 == 0) {
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 8d8248a014d95f1fc0d75b2c14c010eef39bab62..f2cd492c8c66ffe2eca5bbd925469a76693142f8 100644
index c322c2cb659824c3568d1ef49462d8d5ee88cf41..86b308a7d83e9072feffc45cc9d7ad7d95a78e8d 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -215,6 +215,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -3245,7 +3245,7 @@ index 177849ae6613b42fbc2ee515b8ae93f1c13c07a6..c4399f1ad3a6c1a35abb28bc76ac0b05
}
}
diff --git a/net/minecraft/world/entity/monster/Drowned.java b/net/minecraft/world/entity/monster/Drowned.java
index c23c4e44ece85fb746a497cbb8a7cd14b2f9768a..87dacd6ddf2f237ebfa4fd98d1d95f2de572b814 100644
index 4d30cbe9be30d605afce273a63d2d2908863fb68..3e386677cf4354cede9d0f0365a3bb084eb1f276 100644
--- a/net/minecraft/world/entity/monster/Drowned.java
+++ b/net/minecraft/world/entity/monster/Drowned.java
@@ -75,6 +75,23 @@ public class Drowned extends Zombie implements RangedAttackMob {
@@ -3272,7 +3272,7 @@ index c23c4e44ece85fb746a497cbb8a7cd14b2f9768a..87dacd6ddf2f237ebfa4fd98d1d95f2d
@Override
protected void addBehaviourGoals() {
this.goalSelector.addGoal(1, new Drowned.DrownedGoToWaterGoal(this, 1.0));
@@ -395,7 +412,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
@@ -407,7 +424,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
}
}
@@ -3281,7 +3281,7 @@ index c23c4e44ece85fb746a497cbb8a7cd14b2f9768a..87dacd6ddf2f237ebfa4fd98d1d95f2d
private final Drowned drowned;
public DrownedMoveControl(Drowned mob) {
@@ -404,7 +421,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
@@ -416,7 +433,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
}
@Override
@@ -3290,7 +3290,7 @@ index c23c4e44ece85fb746a497cbb8a7cd14b2f9768a..87dacd6ddf2f237ebfa4fd98d1d95f2d
LivingEntity target = this.drowned.getTarget();
if (this.drowned.wantsToSwim() && this.drowned.isInWater()) {
if (target != null && target.getY() > this.drowned.getY() || this.drowned.searchingForLand) {
@@ -424,7 +441,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
@@ -436,7 +453,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
float f = (float)(Mth.atan2(d2, d) * 180.0F / (float)Math.PI) - 90.0F;
this.drowned.setYRot(this.rotlerp(this.drowned.getYRot(), f, 90.0F));
this.drowned.yBodyRot = this.drowned.getYRot();
@@ -3299,7 +3299,7 @@ index c23c4e44ece85fb746a497cbb8a7cd14b2f9768a..87dacd6ddf2f237ebfa4fd98d1d95f2d
float f2 = Mth.lerp(0.125F, this.drowned.getSpeed(), f1);
this.drowned.setSpeed(f2);
this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add(f2 * d * 0.005, f2 * d1 * 0.1, f2 * d2 * 0.005));
@@ -433,7 +450,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
@@ -445,7 +462,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add(0.0, -0.008, 0.0));
}
@@ -4615,7 +4615,7 @@ index 9b94e74f6317f835500225b087fe93487a7a0b22..b279e33bb14dfea4813bba770daf950f
profilerFiller.pop();
this.updateActivity();
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
index 637790ff833abaa0c52fdee204abba7077d12ccc..c84de9ba38d365ae93ea4ba047f6812b1161a9ba 100644
index 9c12c1de3a57915ee0a02b6574bfe3a4bb49d5d1..4f1c04c65ffb01d931d2ab5979ab05bb9b1d3923 100644
--- a/net/minecraft/world/entity/monster/Zombie.java
+++ b/net/minecraft/world/entity/monster/Zombie.java
@@ -100,11 +100,30 @@ public class Zombie extends Monster {