diff --git a/PATCHES.md b/PATCHES.md index ccab7f2b..72f466c7 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -68,7 +68,6 @@ # Patches | server | Remove vanilla profiler callers | Sotr | | | server | Skip events if there's no listeners | William Blake Galbreath | | | server | Swaps the predicate order of collision | ㄗㄠˋ ㄑㄧˊ | | -| server | Tuinity Optimise biome conversion | Spottedleaf | | | server | Tweak Explosions | Aikar | | | server | Use block distance in portal search radius | Patrick Hemmer | | | api | Yatopia API Bundle | Bud Gidiere | | diff --git a/patches/server/0029-Akarin-updated-Async-Path-Finding.patch b/patches/removed/server/0029-Akarin-updated-Async-Path-Finding.patch similarity index 100% rename from patches/server/0029-Akarin-updated-Async-Path-Finding.patch rename to patches/removed/server/0029-Akarin-updated-Async-Path-Finding.patch diff --git a/patches/server/0030-Optimize-player-loops-around-weather.patch b/patches/server/0029-Optimize-player-loops-around-weather.patch similarity index 100% rename from patches/server/0030-Optimize-player-loops-around-weather.patch rename to patches/server/0029-Optimize-player-loops-around-weather.patch diff --git a/patches/server/0031-Optimize-BehaviorController.patch b/patches/server/0030-Optimize-BehaviorController.patch similarity index 100% rename from patches/server/0031-Optimize-BehaviorController.patch rename to patches/server/0030-Optimize-BehaviorController.patch diff --git a/patches/server/0032-Optimize-Villagers.patch b/patches/server/0031-Optimize-Villagers.patch similarity index 100% rename from patches/server/0032-Optimize-Villagers.patch rename to patches/server/0031-Optimize-Villagers.patch diff --git a/patches/server/0033-Use-block-distance-in-portal-search-radius.patch b/patches/server/0032-Use-block-distance-in-portal-search-radius.patch similarity index 100% rename from patches/server/0033-Use-block-distance-in-portal-search-radius.patch rename to patches/server/0032-Use-block-distance-in-portal-search-radius.patch diff --git a/patches/server/0034-Tuinity-Optimise-biome-conversion.patch b/patches/server/0034-Tuinity-Optimise-biome-conversion.patch deleted file mode 100644 index dec50ec9..00000000 --- a/patches/server/0034-Tuinity-Optimise-biome-conversion.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Spottedleaf -Date: Thu, 13 Aug 2020 19:42:25 +0300 -Subject: [PATCH] Tuinity Optimise biome conversion - -For some reason this patch was dropped from Tuinity (maybe not needed?), however we ported this -just in case. - -Ported by MrIvanPlays - -diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index bfae77f129859fba5e0f53723ba62a1626773b7c..0e9e3e75487ffedb4128f12a34af7733f05ffa75 100644 ---- a/src/main/java/net/minecraft/server/BiomeBase.java -+++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -97,6 +97,16 @@ public final class BiomeBase { - this.p = biomefog; - } - -+ // Yatopia start - optimise biome conversion -+ private org.bukkit.block.Biome bukkitBiome; -+ public final org.bukkit.block.Biome getBukkitBiome(IRegistry registry) { -+ if (this.bukkitBiome == null) { -+ this.bukkitBiome = org.bukkit.block.Biome.valueOf(registry.getKey(this).getKey().toUpperCase(java.util.Locale.ENGLISH)); -+ } -+ return this.bukkitBiome; -+ } -+ // Yatopia end -+ - public BiomeSettingsMobs b() { - return this.l; - } -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 0677ff98d530da5d4ae2194ebd0c229298d594a6..2155f794a97237b5288d4c7760e41a52993dd19a 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -506,12 +506,14 @@ public class CraftBlock implements Block { - getWorld().setBiome(getX(), getY(), getZ(), bio); - } - -+ private static final java.util.EnumMap BUKKIT_BIOME_TO_NMS_CACHE = new java.util.EnumMap<>(Biome.class); // Yatopia -+ - public static Biome biomeBaseToBiome(IRegistry registry, BiomeBase base) { - if (base == null) { - return null; - } - -- return Registry.BIOME.get(CraftNamespacedKey.fromMinecraft(registry.getKey(base))); -+ return base.getBukkitBiome(registry); // Yatopia - } - - public static BiomeBase biomeToBiomeBase(IRegistry registry, Biome bio) { -@@ -519,7 +521,16 @@ public class CraftBlock implements Block { - return null; - } - -- return registry.get(CraftNamespacedKey.toMinecraft(bio.getKey())); -+ // Yatopia start - optimise biome conversion -+ BiomeBase cached = BUKKIT_BIOME_TO_NMS_CACHE.get(bio); -+ if (cached != null) return cached; -+ -+ BiomeBase ret = registry.get(CraftNamespacedKey.toMinecraft(bio.getKey())); -+ synchronized (BUKKIT_BIOME_TO_NMS_CACHE) { -+ BUKKIT_BIOME_TO_NMS_CACHE.put(bio, ret); -+ } -+ return ret; -+ // Yatopia end - } - - @Override