mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-21 15:59:28 +00:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@681c013 Bundle spark (#11093) PaperMC/Paper@5fee9c6 Move configuration option to a system property PaperMC/Paper@aa3b356 Improve server startup logging (#11110) PaperMC/Paper@9aea240 Properly lookup plugin classes when looked up by spark PaperMC/Paper@7e91a2c Update the bundled spark version
This commit is contained in:
36
patches/server/0084-Store-mob-counts-in-an-array.patch
Normal file
36
patches/server/0084-Store-mob-counts-in-an-array.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Wed, 30 Nov 2022 17:46:23 +0100
|
||||
Subject: [PATCH] Store mob counts in an array
|
||||
|
||||
License: MIT (https://opensource.org/licenses/MIT)
|
||||
Gale - https://galemc.org
|
||||
|
||||
This patch is based on the following mixin:
|
||||
"com/ishland/vmp/mixins/general/spawn_density_cap/MixinSpawnDensityCapperDensityCap.java"
|
||||
By: ishland <ishlandmc@yeah.net>
|
||||
As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java b/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
index 2039b16e5e9bc0797b3f31081d221bb8b34a4dc7..ceab64ea37f69c254680a8bdd6d2a596d94cb7dc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java
|
||||
@@ -42,14 +42,14 @@ public class LocalMobCapCalculator {
|
||||
}
|
||||
|
||||
static class MobCounts {
|
||||
- private final Object2IntMap<MobCategory> counts = new Object2IntOpenHashMap<>(MobCategory.values().length);
|
||||
+ public final int[] counts = new int[MobCategory.values().length]; // Gale - VMP - store mob counts in an array
|
||||
|
||||
public void add(MobCategory spawnGroup) {
|
||||
- this.counts.computeInt(spawnGroup, (group, density) -> density == null ? 1 : density + 1);
|
||||
+ this.counts[spawnGroup.ordinal()]++; // Gale - VMP - store mob counts in an array
|
||||
}
|
||||
|
||||
public boolean canSpawn(MobCategory spawnGroup) {
|
||||
- return this.counts.getOrDefault(spawnGroup, 0) < spawnGroup.getMaxInstancesPerChunk();
|
||||
+ return this.counts[spawnGroup.ordinal()] < spawnGroup.getMaxInstancesPerChunk(); // Gale - VMP - store mob counts in an array
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user