mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Dropped per the advice of Proximyst. Has possible issues if players log in while they are still logging out from another location, with increased risk during lag spikes. A fix/workaround is possible in the future, but for the time being we will just drop this patch to avoid any potential problems.
35 lines
1.8 KiB
Diff
35 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: jmp <jasonpenilla2@me.com>
|
|
Date: Wed, 2 Dec 2020 03:07:58 -0800
|
|
Subject: [PATCH] PaperPR - Config option for Piglins guarding chests
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index 2452f54d96cab2d93140c64e25d9b799cbc94caa..3ff2fa66b940acbe8e72fb03bf7a86398ab69613 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -669,6 +669,11 @@ public class PaperWorldConfig {
|
|
zombiesTargetTurtleEggs = getBoolean("zombies-target-turtle-eggs", zombiesTargetTurtleEggs);
|
|
}
|
|
|
|
+ public boolean piglinsGuardChests = true;
|
|
+ private void piglinsGuardChests() {
|
|
+ piglinsGuardChests = getBoolean("piglins-guard-chests", piglinsGuardChests);
|
|
+ }
|
|
+
|
|
public boolean useEigencraftRedstone = false;
|
|
private void useEigencraftRedstone() {
|
|
useEigencraftRedstone = this.getBoolean("use-faster-eigencraft-redstone", false);
|
|
diff --git a/src/main/java/net/minecraft/server/PiglinAI.java b/src/main/java/net/minecraft/server/PiglinAI.java
|
|
index 0407fa1751d89a037da8cb01f5ceef9b9833dd18..df5aafec9a5844a1ae3e948d8a787051a8903bce 100644
|
|
--- a/src/main/java/net/minecraft/server/PiglinAI.java
|
|
+++ b/src/main/java/net/minecraft/server/PiglinAI.java
|
|
@@ -357,6 +357,7 @@ public class PiglinAI {
|
|
}
|
|
|
|
public static void a(EntityHuman entityhuman, boolean flag) {
|
|
+ if (!entityhuman.world.paperConfig.piglinsGuardChests) return; // Paper
|
|
List<EntityPiglinAbstract> list = entityhuman.world.a(EntityPiglin.class, entityhuman.getBoundingBox().g(16.0D)); // CraftBukkit - decompile error
|
|
|
|
list.stream().filter(PiglinAI::d).filter((entitypiglin) -> {
|