Skip to content

Commit

Permalink
Raider die skip self raid check
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jul 9, 2023
1 parent ad54bba commit 0fab274
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
9 changes: 7 additions & 2 deletions patches/server/0004-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ index 35d2da9d91dcdd89de7c0f4af028fd182376ea8d..d73482fb1e71fe2951e96ae0593de268
.withRequiredArg()
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..00d2ee563d41ef75e50d13cedcbb77fad38dc71e
index 0000000000000000000000000000000000000000..24bbcab59ebe153516e602180db0b0353b9dffde
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,814 @@
@@ -0,0 +1,819 @@
+package top.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -771,6 +771,11 @@ index 0000000000000000000000000000000000000000..00d2ee563d41ef75e50d13cedcbb77fa
+ noBlockUpdateCommand = getBoolean("settings.modify.no-block-update-command", noBlockUpdateCommand);
+ }
+
+ public static boolean skipSelfRaidCheck = false;
+ private static void skipSelfRaidCheck() {
+ skipSelfRaidCheck = getBoolean("settings.modify.raider-die-skip-self-raid-check", skipSelfRaidCheck);
+ }
+
+ public static final class WorldConfig {
+
+ public final String worldName;
Expand Down
19 changes: 19 additions & 0 deletions patches/server/0084-Raider-die-skip-self-raid-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <[email protected]>
Date: Sun, 9 Jul 2023 16:51:47 +0800
Subject: [PATCH] Raider die skip self raid check


diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 57fdcdaf54fd1c92a6e51a3a81789029096e5abe..1b8e141e50dd2a156eda2455988ea45a390692ae 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -134,7 +134,7 @@ public abstract class Raider extends PatrollingMonster {
raid.removeFromRaid(this, false);
}

- if (this.isPatrolLeader() && raid == null && ((ServerLevel) this.level()).getRaidAt(this.blockPosition()) == null) {
+ if (this.isPatrolLeader() && (top.leavesmc.leaves.LeavesConfig.skipSelfRaidCheck || raid == null) && ((ServerLevel) this.level()).getRaidAt(this.blockPosition()) == null) { // Leaves - skip self raid check
ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
Player entityhuman = null;

0 comments on commit 0fab274

Please sign in to comment.