9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-19 14:59:29 +00:00
Files
Gale/gale-server/minecraft-patches/features/0053-Replace-instance-list-with-optimized-collection.patch
2025-01-27 09:45:41 -05:00

28 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Sun, 18 Aug 2024 22:44:48 -0400
Subject: [PATCH] Replace instance list with optimized collection
License: MIT (https://opensource.org/licenses/MIT)
Gale - https://galemc.org
This patch is based on the following mixin:
"com/ishland/vmp/mixins/general/collections/MixinTypeFilterableList.java"
By: ishland <ishlandmc@yeah.net>
As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/util/ClassInstanceMultiMap.java b/net/minecraft/util/ClassInstanceMultiMap.java
index 3bc4aba806e254a01ce5c71c723196ac01393192..4cd1b8ce60f7befca63a5b6396c0781ae3583dcd 100644
--- a/net/minecraft/util/ClassInstanceMultiMap.java
+++ b/net/minecraft/util/ClassInstanceMultiMap.java
@@ -16,7 +16,7 @@ import net.minecraft.Util;
public class ClassInstanceMultiMap<T> extends AbstractCollection<T> {
private final Map<Class<?>, List<T>> byClass = new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>(2); // Gale - Lithium - replace class map with optimized collection
private final Class<T> baseClass;
- private final List<T> allInstances = Lists.newArrayList();
+ private final List<T> allInstances = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>(); // Gale - VMP - replace instance map with optimized collection
public ClassInstanceMultiMap(Class<T> baseClass) {
this.baseClass = baseClass;