9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-archived-patches/unapplied/mcserver/0174-C2ME-Reduce-Allocations.patch
Dreeam 8bffdef317 More patches
Shallou - Habitat
Genre: Progressive House (maybe)
2025-09-29 14:23:25 -04:00

25 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
Date: Thu, 7 Nov 2024 19:45:31 +0100
Subject: [PATCH] C2ME: Reduce Allocations
This patch is based on the following mixin:
"com/ishland/c2me/opts/allocs/mixin/object_pooling_caching/MixinOreFeature.java"
By: ishland <ishlandmc@yeah.net>
As part of: C2ME (https://github.com/RelativityMC/C2ME-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/world/level/levelgen/feature/OreFeature.java b/net/minecraft/world/level/levelgen/feature/OreFeature.java
index c7b46efd4f08067e2c9c5c8b0e8b71a94a79823d..d14609e932f2ce4e97d1e354b424cc3ec86bd25b 100644
--- a/net/minecraft/world/level/levelgen/feature/OreFeature.java
+++ b/net/minecraft/world/level/levelgen/feature/OreFeature.java
@@ -69,7 +69,7 @@ public class OreFeature extends Feature<OreConfiguration> {
int height
) {
int i = 0;
- BitSet bitSet = new BitSet(width * height * width);
+ BitSet bitSet = org.dreeam.leaf.util.cache.CachedOrNewBitsGetter.getCachedOrNewBitSet(width * height * width); // Leaf - C2ME - Reduce Allocations
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
int i1 = config.size;
double[] doubles = new double[i1 * 4];