9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/patches/removed/server/0107-Fix-fortress-mob-spawn.patch

26 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MC_XiaoHei <xiaohei.xor7@outlook.com>
Date: Mon, 29 Jul 2024 08:20:31 +0800
Subject: [PATCH] Fix fortress mob spawn
diff --git a/net/minecraft/world/level/biome/MobSpawnSettings.java b/net/minecraft/world/level/biome/MobSpawnSettings.java
index db3b8a237d63255aa9ffd70c88a093002a6bd770..7d28dcb8c3dbbf2875c8d04cd60d56445d9dc325 100644
--- a/net/minecraft/world/level/biome/MobSpawnSettings.java
+++ b/net/minecraft/world/level/biome/MobSpawnSettings.java
@@ -155,6 +155,14 @@ public class MobSpawnSettings {
this.maxCount = maxCount;
}
+ // Leaves start - fix fortress mob spawn
+ @Override
+ public boolean equals(Object obj) {
+ if(!org.leavesmc.leaves.LeavesConfig.modify.oldMC.fixFortressMobSpawn || !(obj instanceof SpawnerData other)) return this == 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 + ")";