mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: 0514fc4e2 Add missing effects 8f5d9effd Add getMainThreadExecutor to BukkitScheduler 313b5020b Allow adding items to BlockDropItemEvent (#5093) 9a556d9da [CI-SKIP] [Auto] Rebuild Patches 72b2768ad Inline shift fields in EnumDirection (#5082) ffff53fa7 added option to disable pathfinding updates on block changes (#5123) b67081fd7 add DragonEggFormEvent (fixes #5110) (#5112) 3eefafbaf Fix javadoc build 0081ed1c4 Add javadoc step to GH Actions 01082503e Add dropLeash variable to EntityUnleashEvent (#5130) 31f9f869a [CI-SKIP] Fix YourKit links in readme, fixes #5091 8ac27aa38 [Auto] Updated Upstream (CraftBukkit) c4d9cc831 [Auto] Updated Upstream (Bukkit/CraftBukkit) d0477d326 [Auto] Updated Upstream (CraftBukkit) d9f5f7018 EntityMoveEvent (#4614)
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 27 Nov 2020 10:33:33 -0600
|
||||
Subject: [PATCH] Zombie break door minimum difficulty option
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java
|
||||
index 7488a12926c5ee4adc3bc1fa3973988350381544..23870a271b759a953a095df835e08ea2a09f4218 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java
|
||||
@@ -13,7 +13,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract {
|
||||
super(entityinsentient);
|
||||
this.b = -1;
|
||||
this.c = -1;
|
||||
- this.g = predicate;
|
||||
+ this.g = entityinsentient instanceof EntityZombie ? difficulty -> testDifficulty(entity) : predicate; // Purpur
|
||||
}
|
||||
|
||||
public PathfinderGoalBreakDoor(EntityInsentient entityinsentient, int i, Predicate<EnumDifficulty> predicate) {
|
||||
@@ -82,4 +82,21 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract {
|
||||
private boolean a(EnumDifficulty enumdifficulty) {
|
||||
return this.g.test(enumdifficulty);
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ private boolean testDifficulty(Entity entity) {
|
||||
+ EnumDifficulty difficulty = entity.world.getDifficulty();
|
||||
+ switch (entity.world.purpurConfig.zombieBreakDoorMinDifficulty) {
|
||||
+ case PEACEFUL:
|
||||
+ return difficulty == EnumDifficulty.HARD || difficulty == EnumDifficulty.NORMAL || difficulty == EnumDifficulty.EASY || difficulty == EnumDifficulty.PEACEFUL;
|
||||
+ case EASY:
|
||||
+ return difficulty == EnumDifficulty.HARD || difficulty == EnumDifficulty.NORMAL || difficulty == EnumDifficulty.EASY;
|
||||
+ case NORMAL:
|
||||
+ return difficulty == EnumDifficulty.HARD || difficulty == EnumDifficulty.NORMAL;
|
||||
+ case HARD:
|
||||
+ default:
|
||||
+ return difficulty == EnumDifficulty.HARD;
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f4abaeaa36f97c8cae0507c7746cd960a5fc35fc..afe772f6249f3901a5057684fcce89053237bc13 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -2,6 +2,7 @@ package net.pl3x.purpur;
|
||||
|
||||
import net.minecraft.server.Block;
|
||||
import net.minecraft.server.Blocks;
|
||||
+import net.minecraft.server.EnumDifficulty;
|
||||
import net.minecraft.server.Explosion;
|
||||
import net.minecraft.server.IRegistry;
|
||||
import net.minecraft.server.Item;
|
||||
@@ -1128,6 +1129,7 @@ public class PurpurWorldConfig {
|
||||
public double zombieJockeyChance = 0.05D;
|
||||
public boolean zombieJockeyTryExistingChickens = true;
|
||||
public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
|
||||
+ public EnumDifficulty zombieBreakDoorMinDifficulty = EnumDifficulty.HARD;
|
||||
private void zombieSettings() {
|
||||
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
||||
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
||||
@@ -1135,6 +1137,11 @@ public class PurpurWorldConfig {
|
||||
zombieJockeyChance = getDouble("mobs.zombie.jockey.chance", zombieJockeyChance);
|
||||
zombieJockeyTryExistingChickens = getBoolean("mobs.zombie.jockey.try-existing-chickens", zombieJockeyTryExistingChickens);
|
||||
zombieAggressiveTowardsVillagerWhenLagging = getBoolean("mobs.zombie.aggressive-towards-villager-when-lagging", zombieAggressiveTowardsVillagerWhenLagging);
|
||||
+ try {
|
||||
+ zombieBreakDoorMinDifficulty = EnumDifficulty.valueOf(getString("mobs.zombie.break-door-minimum-difficulty", zombieBreakDoorMinDifficulty.name()));
|
||||
+ } catch (IllegalArgumentException ignore) {
|
||||
+ zombieBreakDoorMinDifficulty = EnumDifficulty.HARD;
|
||||
+ }
|
||||
}
|
||||
|
||||
public boolean zombieHorseCanSwim = false;
|
||||
Reference in New Issue
Block a user