mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
38 lines
2.2 KiB
Diff
38 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
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 <nachito94@msn.com>
|
|
|
|
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 ffc8e20d916940fb5e28bac610e3c6bd3d493f78..a9e75a16a7dc0ff5d4f0faa92ebc444559a39325 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
|
|
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 b89a5ecc9138808532f0e3248f0349161391e5e1..185f0c0d709f374cf6df2654dd9708fca90b1349 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
@@ -99,7 +99,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
|
|
}
|
|
|
|
public Zombie(Level world) {
|