Update mixin
This commit is contained in:
parent
fab831f143
commit
2f92dbe12c
|
|
@ -1,7 +1,6 @@
|
||||||
package org.embeddedt.modernfix.forge.mixin.perf.rewrite_registry;
|
package org.embeddedt.modernfix.forge.mixin.perf.rewrite_registry;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.registries.ForgeRegistry;
|
import net.minecraftforge.registries.ForgeRegistry;
|
||||||
import org.embeddedt.modernfix.annotation.IgnoreOutsideDev;
|
import org.embeddedt.modernfix.annotation.IgnoreOutsideDev;
|
||||||
|
|
@ -14,15 +13,12 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Mixin(ForgeRegistry.Snapshot.class)
|
@Mixin(ForgeRegistry.Snapshot.class)
|
||||||
@IgnoreOutsideDev
|
@IgnoreOutsideDev
|
||||||
public class ForgeRegistrySnapshotMixin {
|
public class ForgeRegistrySnapshotMixin {
|
||||||
@Shadow(remap = false) @Final @Mutable public Map<ResourceLocation, Integer> ids;
|
@Shadow(remap = false) @Final @Mutable public Map<ResourceLocation, Integer> ids;
|
||||||
|
|
||||||
@Shadow(remap = false) @Final @Mutable public Set<ResourceLocation> dummied;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The only good reason to use tree maps here is to keep the order the same. But we are tracking IDs
|
* The only good reason to use tree maps here is to keep the order the same. But we are tracking IDs
|
||||||
* anyway so order shouldn't matter. We replace the maps that will be most used.
|
* anyway so order shouldn't matter. We replace the maps that will be most used.
|
||||||
|
|
@ -30,6 +26,5 @@ public class ForgeRegistrySnapshotMixin {
|
||||||
@Inject(method = "<init>", at = @At("RETURN"))
|
@Inject(method = "<init>", at = @At("RETURN"))
|
||||||
private void replaceSnapshotMaps(CallbackInfo ci) {
|
private void replaceSnapshotMaps(CallbackInfo ci) {
|
||||||
this.ids = new Object2ObjectOpenHashMap<>();
|
this.ids = new Object2ObjectOpenHashMap<>();
|
||||||
this.dummied = new ObjectOpenHashSet<>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user