Skip to content

Commit

Permalink
Fix fortress mob spawn (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed Jul 29, 2024
1 parent bb803a9 commit c279af4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
7 changes: 5 additions & 2 deletions patches/server/0006-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ index c2c421b1caf76b40542fdc436801accbe97a38cb..29f139fb4d70a9a362ac0a30579eb0b4
.withRequiredArg()
diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..c97284e726b707699af98c999423d8383c7a5c87
index 0000000000000000000000000000000000000000..5009708d8875f2a88e76f4a48c180d616c2547a6
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,936 @@
@@ -0,0 +1,939 @@
+package org.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -312,6 +312,9 @@ index 0000000000000000000000000000000000000000..c97284e726b707699af98c999423d838
+ @GlobalConfig(name = "disable-LivingEntity-ai-step-alive-check", category = {"modify", "minecraft-old"})
+ public static boolean disableLivingEntityAiStepAliveCheck = false;
+
+ @GlobalConfig(name = "fix-fortress-mob-spawn", category = {"modify", "minecraft-old"})
+ public static boolean fixFortressMobSpawn = false;
+
+ // Leaves end - modify - minecraft-old
+
+ // Leaves start - modify - elytra-aeronautics
Expand Down
25 changes: 25 additions & 0 deletions patches/server/0131-Fix-fortress-mob-spawn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MC_XiaoHei <[email protected]>
Date: Mon, 29 Jul 2024 08:20:31 +0800
Subject: [PATCH] Fix fortress mob spawn


diff --git a/src/main/java/net/minecraft/world/level/biome/MobSpawnSettings.java b/src/main/java/net/minecraft/world/level/biome/MobSpawnSettings.java
index cb7465ed9bdebe1b31f02d11725e75ff8b44ca66..f56da8b6741b81b7a51d0d9cb89a2192e059f6eb 100644
--- a/src/main/java/net/minecraft/world/level/biome/MobSpawnSettings.java
+++ b/src/main/java/net/minecraft/world/level/biome/MobSpawnSettings.java
@@ -176,6 +176,14 @@ public class MobSpawnSettings {
this.maxCount = maxGroupSize;
}

+ // Leaves start - fix fortress mob spawn
+ @Override
+ public boolean equals(Object obj) {
+ if(!org.leavesmc.leaves.LeavesConfig.fixFortressMobSpawn || !(obj instanceof SpawnerData other)) return super.equals(obj);
+ return this.type == other.type && this.minCount == other.minCount && this.maxCount == other.maxCount;
+ }
+ // Leaves end - fix fortress mob spawn
+
@Override
public String toString() {
return EntityType.getKey(this.type) + "*(" + this.minCount + "-" + this.maxCount + "):" + this.getWeight();

0 comments on commit c279af4

Please sign in to comment.