Prototype implementation of 0107-Multithreaded-Tracker.patch
This commit is contained in:
@@ -32,4 +32,4 @@ kotlin {
|
||||
|
||||
configure<AccessWidenerExtension> {
|
||||
paths = files("../src/main/resources/nitori.accesswidener")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<>();
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,10 @@
|
||||
"MixinMob",
|
||||
"MixinWorldGenRegion",
|
||||
"MixinNoiseBasedChunkGenerator",
|
||||
"MixinBlockPos"
|
||||
"MixinBlockPos",
|
||||
"MixinIteratorSafeOrderedReferenceSet",
|
||||
"MixinChunkEntitySlicess",
|
||||
"MixinServerBossEvent"
|
||||
"MixinServerEntity"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user