mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@b0da38c2 Repository details in RuntimeException for MavenLibraryResolver#addRepository (#12939) PaperMC/Paper@1922be90 Update custom tags (#12183) PaperMC/Paper@79cf1353 Ignore HopperInventorySearchEvent when it has no listeners (#13009) PaperMC/Paper@ea014f7a feat: add stuckEntityPoiRetryDelay config (#12949) PaperMC/Paper@a9e76749 Support for showNotification in PlayerRecipeDiscoverEvent (#12992) PaperMC/Paper@5622c9dd Expose attribute sentiment (#12974) PaperMC/Paper@42b653b1 Expose more argument types (#12665) PaperMC/Paper@52d9a221 [ci/skip] Fix typo in Display javadoc (#13010) PaperMC/Paper@614e9acf Improve APIs around riptide tridents (#12996) PaperMC/Paper@51706e5a Fixed DyeItem sheep dye hunk
35 lines
2.6 KiB
Diff
35 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: hayanesuru <hayanesuru@outlook.jp>
|
|
Date: Thu, 26 Jun 2025 00:42:27 +0900
|
|
Subject: [PATCH] optimize despawn
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
|
index 5fc9ec3e564135013622f839e59ef5a0ddff6f71..012c500c4a5a06be92fa17c141b15ca6547c8483 100644
|
|
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
|
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
|
@@ -179,7 +179,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
|
@MergeMap
|
|
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
|
|
@MergeMap
|
|
- public Map<MobCategory, DespawnRangePair> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> DespawnRangePair.createDefault()));
|
|
+ public Map<MobCategory, DespawnRangePair> despawnRanges = new java.util.EnumMap<>(Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> DespawnRangePair.createDefault()))); // Leaf - replace EnumMap optimize despawn
|
|
public DespawnRange.Shape despawnRangeShape = DespawnRange.Shape.ELLIPSOID;
|
|
@MergeMap
|
|
public Reference2IntMap<MobCategory> ticksPerSpawn = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
|
|
diff --git a/src/main/java/io/papermc/paper/configuration/type/DespawnRange.java b/src/main/java/io/papermc/paper/configuration/type/DespawnRange.java
|
|
index 7779edcbbce36d7da177a92807dac73fbe24c9fa..093638ded4e35a33f34ef3d0e0fc2175efc5efaf 100644
|
|
--- a/src/main/java/io/papermc/paper/configuration/type/DespawnRange.java
|
|
+++ b/src/main/java/io/papermc/paper/configuration/type/DespawnRange.java
|
|
@@ -20,8 +20,8 @@ public final class DespawnRange {
|
|
|
|
public static final TypeSerializer<DespawnRange> SERIALIZER = new Serializer();
|
|
|
|
- private final IntOr.Default horizontalLimit;
|
|
- private final IntOr.Default verticalLimit;
|
|
+ public final IntOr.Default horizontalLimit; // Leaf - optimize despawn
|
|
+ public final IntOr.Default verticalLimit; // Leaf - optimize despawn
|
|
private final boolean wasDefinedViaLongSyntax;
|
|
|
|
// cached values
|