Prototype implementation of 0107-Multithreaded-Tracker.patch

This commit is contained in:
Altiami
2024-04-01 04:27:23 -07:00
parent dfcdc9b14d
commit 05b0910bf4
3 changed files with 6 additions and 40 deletions

View File

@@ -32,4 +32,4 @@ kotlin {
configure<AccessWidenerExtension> { configure<AccessWidenerExtension> {
paths = files("../src/main/resources/nitori.accesswidener") paths = files("../src/main/resources/nitori.accesswidener")
} }

View File

@@ -1,38 +0,0 @@
// Nitori Copyright (C) 2024 Gensokyo Reimagined
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package net.gensokyoreimagined.nitori.core;
import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.server.level.ChunkMap;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ChunkMap.class)
public class ChunkMapMixin {
@Mutable
@Shadow @Final public Int2ObjectMap<ChunkMap.TrackedEntity> entityMap;
@Inject(method = "<init>", at = @At("RETURN"))
private void reassignEntityTrackers(CallbackInfo ci) {
this.entityMap = new Int2ObjectLinkedOpenHashMap<>();
}
}

View File

@@ -20,6 +20,10 @@
"MixinMob", "MixinMob",
"MixinWorldGenRegion", "MixinWorldGenRegion",
"MixinNoiseBasedChunkGenerator", "MixinNoiseBasedChunkGenerator",
"MixinBlockPos" "MixinBlockPos",
"MixinIteratorSafeOrderedReferenceSet",
"MixinChunkEntitySlicess",
"MixinServerBossEvent"
"MixinServerEntity"
] ]
} }