From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Taiyou06 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 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 { 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];