mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-24 01:09:29 +00:00
25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Sun, 6 Jul 2025 01:53:38 +0300
|
|
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..45d43707909685d2494f054d4b9e6451af6c2f72 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.bxteam.divinemc.util.cache.CachedOrNewBitsGetter.getCachedOrNewBitSet(width * height * width); // DivineMC - C2ME: Reduce Allocations
|
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
|
int i1 = config.size;
|
|
double[] doubles = new double[i1 * 4];
|