aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0489-Configurable-door-breaking-difficulty.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0489-Configurable-door-breaking-difficulty.patch')
-rw-r--r--patches/server/0489-Configurable-door-breaking-difficulty.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/patches/server/0489-Configurable-door-breaking-difficulty.patch b/patches/server/0489-Configurable-door-breaking-difficulty.patch
new file mode 100644
index 0000000000..c0ec74016c
--- /dev/null
+++ b/patches/server/0489-Configurable-door-breaking-difficulty.patch
@@ -0,0 +1,37 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sun, 3 Jan 2021 22:27:43 -0800
+Subject: [PATCH] Configurable door breaking difficulty
+
+== AT ==
+public net.minecraft.world.entity.monster.Vindicator DOOR_BREAKING_PREDICATE
+public net.minecraft.world.entity.monster.Zombie DOOR_BREAKING_PREDICATE
+
+Co-authored-by: Doc <[email protected]>
+
+diff --git a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
+index 9fec5823d99d1ae8e41d9e21f7ddb8b8e94bf887..a6af5ac9d09834940d3dd4c80b16450b90484edb 100644
+--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
++++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
+@@ -197,7 +197,7 @@ public class Vindicator extends AbstractIllager {
+
+ static class VindicatorBreakDoorGoal extends BreakDoorGoal {
+ public VindicatorBreakDoorGoal(Mob mob) {
+- super(mob, 6, Vindicator.DOOR_BREAKING_PREDICATE);
++ super(mob, 6, com.google.common.base.Predicates.in(mob.level().paperConfig().entities.behavior.doorBreakingDifficulty.getOrDefault(mob.getType(), mob.level().paperConfig().entities.behavior.doorBreakingDifficulty.get(EntityType.VINDICATOR)))); // Paper - Configurable door breaking difficulty
+ this.setFlags(EnumSet.of(Goal.Flag.MOVE));
+ }
+
+diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+index a0cd226d4f5c700c84604527ddde35466c7654bb..a41a2ffe3b0af5c244a513c839829da3f86e5ed3 100644
+--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
++++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+@@ -100,7 +100,7 @@ public class Zombie extends Monster {
+
+ public Zombie(EntityType<? extends Zombie> type, Level world) {
+ super(type, world);
+- this.breakDoorGoal = new BreakDoorGoal(this, Zombie.DOOR_BREAKING_PREDICATE);
++ this.breakDoorGoal = new BreakDoorGoal(this, com.google.common.base.Predicates.in(world.paperConfig().entities.behavior.doorBreakingDifficulty.getOrDefault(type, world.paperConfig().entities.behavior.doorBreakingDifficulty.get(EntityType.ZOMBIE)))); // Paper - Configurable door breaking difficulty
+ }
+
+ public Zombie(Level world) {