Merge remote-tracking branch 'origin/1.19.2' into 1.19.4

This commit is contained in:
embeddedt 2023-08-12 12:09:21 -04:00
commit 073b8cb9de
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
25 changed files with 73 additions and 27 deletions

View File

@ -11,6 +11,10 @@ import org.spongepowered.asm.mixin.Overwrite;
@Mixin(Minecraft.class) @Mixin(Minecraft.class)
@ClientOnlyMixin @ClientOnlyMixin
public class MinecraftMixin { public class MinecraftMixin {
/**
* @author embeddedt
* @reason avoid exception stacktrace being printed in dev
*/
@Overwrite @Overwrite
private UserApiService createUserApiService(YggdrasilAuthenticationService yggdrasilAuthenticationService, GameConfig arg) { private UserApiService createUserApiService(YggdrasilAuthenticationService yggdrasilAuthenticationService, GameConfig arg) {
return UserApiService.OFFLINE; return UserApiService.OFFLINE;

View File

@ -36,7 +36,7 @@ public class StateHolderMixin {
} }
}); });
@Redirect(method = "codec", at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/Codec;dispatch(Ljava/lang/String;Ljava/util/function/Function;Ljava/util/function/Function;)Lcom/mojang/serialization/Codec;")) @Redirect(method = "codec", at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/Codec;dispatch(Ljava/lang/String;Ljava/util/function/Function;Ljava/util/function/Function;)Lcom/mojang/serialization/Codec;", remap = false))
private static <O, S extends StateHolder<O, S>> Codec<S> obtainCodec(Codec<O> codec, String typeKey, Function<S, O> type, Function<O, ? extends Codec<S>> codecFn, Codec<O> codecMethodArg, Function<O, S> stateSupplier) { private static <O, S extends StateHolder<O, S>> Codec<S> obtainCodec(Codec<O> codec, String typeKey, Function<S, O> type, Function<O, ? extends Codec<S>> codecFn, Codec<O> codecMethodArg, Function<O, S> stateSupplier) {
return codec.dispatch(typeKey, type, block -> { return codec.dispatch(typeKey, type, block -> {
if(block instanceof Block) { if(block instanceof Block) {

View File

@ -16,7 +16,7 @@ import java.lang.reflect.Type;
public class BlockElementFaceDeserializerMixin { public class BlockElementFaceDeserializerMixin {
@Redirect(method = "deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraft/client/renderer/block/model/BlockElementFace;", @Redirect(method = "deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraft/client/renderer/block/model/BlockElementFace;",
at = @At(value = "INVOKE", target = "Lcom/google/gson/JsonDeserializationContext;deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;)Ljava/lang/Object;", ordinal = 0)) at = @At(value = "INVOKE", target = "Lcom/google/gson/JsonDeserializationContext;deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;)Ljava/lang/Object;", ordinal = 0, remap = false))
private Object skipUvsForInitialLoad(JsonDeserializationContext context, JsonElement element, Type type) { private Object skipUvsForInitialLoad(JsonDeserializationContext context, JsonElement element, Type type) {
return UVController.useDummyUv.get() ? UVController.dummyUv : context.deserialize(element, type); return UVController.useDummyUv.get() ? UVController.dummyUv : context.deserialize(element, type);
} }

View File

@ -49,6 +49,7 @@ public abstract class ItemModelShaperMixin {
} }
/** /**
* @author embeddedt
* @reason Get the stored location for that item and meta, and get the model * @reason Get the stored location for that item and meta, and get the model
* from that location from the model manager. * from that location from the model manager.
**/ **/
@ -59,6 +60,7 @@ public abstract class ItemModelShaperMixin {
} }
/** /**
* @author embeddedt
* @reason Don't get all models during init (with dynamic loading, that would * @reason Don't get all models during init (with dynamic loading, that would
* generate them all). Just store location instead. * generate them all). Just store location instead.
**/ **/
@ -68,6 +70,7 @@ public abstract class ItemModelShaperMixin {
} }
/** /**
* @author embeddedt
* @reason Disable cache rebuilding (with dynamic loading, that would generate * @reason Disable cache rebuilding (with dynamic loading, that would generate
* all models). * all models).
**/ **/

View File

@ -15,7 +15,7 @@ public class MappedRegistryMixin {
*/ */
@Redirect( @Redirect(
method = "registerMapping(ILnet/minecraft/resources/ResourceKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/core/Holder$Reference;", method = "registerMapping(ILnet/minecraft/resources/ResourceKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/core/Holder$Reference;",
at = @At(value = "INVOKE", target = "Lit/unimi/dsi/fastutil/objects/ObjectList;size(I)V") at = @At(value = "INVOKE", target = "Lit/unimi/dsi/fastutil/objects/ObjectList;size(I)V", remap = false)
) )
private void setSizeSmart(ObjectList<?> list, int size) { private void setSizeSmart(ObjectList<?> list, int size) {
if(list instanceof ObjectArrayList && size > list.size()) { if(list instanceof ObjectArrayList && size > list.size()) {

View File

@ -18,7 +18,7 @@ public abstract class BiomeMixin {
* @return * @return
*/ */
@Overwrite @Overwrite
public final float getTemperature(BlockPos pos) { private float getTemperature(BlockPos pos) {
return this.getHeightAdjustedTemperature(pos); return this.getHeightAdjustedTemperature(pos);
} }
} }

View File

@ -9,6 +9,7 @@ import java.util.function.BiConsumer;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@SuppressWarnings("unchecked")
public class DirectStorageBiMap<K, V> implements BiMap<K, V> { public class DirectStorageBiMap<K, V> implements BiMap<K, V> {
private final Function<V, K> keyGetter; private final Function<V, K> keyGetter;
private final BiConsumer<V, K> keySetter; private final BiConsumer<V, K> keySetter;

View File

@ -4,10 +4,11 @@
"modernfix.jei_load": "Loading JEI, this may take a while", "modernfix.jei_load": "Loading JEI, this may take a while",
"modernfix.no_lazydfu": "LazyDFU is not installed. If Minecraft needs to update game data from an older version, there may be noticeable lag.", "modernfix.no_lazydfu": "LazyDFU is not installed. If Minecraft needs to update game data from an older version, there may be noticeable lag.",
"modernfix.no_ferritecore": "FerriteCore is not installed. Memory usage will be very high.", "modernfix.no_ferritecore": "FerriteCore is not installed. Memory usage will be very high.",
"modernfix.connectedness_dynresoruces": "Connectedness and ModernFix's dynamic resources option are not compatible. Remove Connectedness or disable dynamic resources in the ModernFix config.",
"modernfix.perf_mod_warning": "It is recommended to install the mods, but the warning(s) can be disabled in the ModernFix config.", "modernfix.perf_mod_warning": "It is recommended to install the mods, but the warning(s) can be disabled in the ModernFix config.",
"modernfix.config": "ModernFix mixin config", "modernfix.config": "ModernFix mixin config",
"modernfix.config.done_restart": "Done (restart required)", "modernfix.config.done_restart": "Done (restart required)",
"modernfix.message.reload_config": "Run /mfrc after changing configs on disk for them to take effect.", "modernfix.message.reload_config": "A mod config file change was detected. To prevent loading files that aren't done saving, reloading must be triggered by running /mfrc.",
"modernfix.option.on": "on", "modernfix.option.on": "on",
"modernfix.option.off": "off", "modernfix.option.off": "off",
"modernfix.option.disabled": "disabled", "modernfix.option.disabled": "disabled",

View File

@ -1,6 +1,9 @@
package org.embeddedt.modernfix; package org.embeddedt.modernfix;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint; import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;
import net.fabricmc.loader.impl.gui.FabricGuiEntry;
import net.fabricmc.loader.impl.gui.FabricStatusTree;
import org.embeddedt.modernfix.core.ModernFixMixinPlugin; import org.embeddedt.modernfix.core.ModernFixMixinPlugin;
import org.embeddedt.modernfix.fabric.mappings.MappingsClearer; import org.embeddedt.modernfix.fabric.mappings.MappingsClearer;
import org.embeddedt.modernfix.spark.SparkLaunchProfiler; import org.embeddedt.modernfix.spark.SparkLaunchProfiler;
@ -19,5 +22,18 @@ public class ModernFixPreLaunchFabric implements PreLaunchEntrypoint {
if(ModernFixMixinPlugin.instance.isOptionEnabled("perf.clear_fabric_mapping_tables.MappingsClearer")) { if(ModernFixMixinPlugin.instance.isOptionEnabled("perf.clear_fabric_mapping_tables.MappingsClearer")) {
MappingsClearer.clear(); MappingsClearer.clear();
} }
// Prevent launching with Continuity when dynamic resources is on
if(false && ModernFixMixinPlugin.instance.isOptionEnabled("perf.dynamic_resources.ContinuityCheck")
&& FabricLoader.getInstance().isModLoaded("continuity")) {
CommonModUtil.runWithoutCrash(() -> {
FabricGuiEntry.displayError("Compatibility warning", null, tree -> {
FabricStatusTree.FabricStatusTab crashTab = tree.addTab("Warning");
crashTab.node.addMessage("Continuity and ModernFix's dynamic resources option are not compatible before Minecraft 1.19.4.", FabricStatusTree.FabricTreeWarningLevel.ERROR);
crashTab.node.addMessage("Remove Continuity or disable dynamic resources in the ModernFix config.", FabricStatusTree.FabricTreeWarningLevel.ERROR);
tree.tabs.removeIf(tab -> tab != crashTab);
}, true);
}, "display Continuity warning");
}
} }
} }

View File

@ -17,7 +17,7 @@ public class SuggestionsBuilderMixin {
@Unique @Unique
private static final int MAX_SUGGESTIONS = 10000; private static final int MAX_SUGGESTIONS = 10000;
@Shadow @Final @Mutable @Shadow(remap = false) @Final @Mutable
private List<Suggestion> result; private List<Suggestion> result;
@Redirect(method = "*", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z"), require = 0) @Redirect(method = "*", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z"), require = 0)

View File

@ -19,10 +19,12 @@ import net.minecraftforge.event.level.LevelEvent;
import net.minecraftforge.event.server.ServerStartedEvent; import net.minecraftforge.event.server.ServerStartedEvent;
import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.*;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.util.ObfuscationReflectionHelper; import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
import org.embeddedt.modernfix.ModernFixClient; import org.embeddedt.modernfix.ModernFixClient;
import org.embeddedt.modernfix.core.ModernFixMixinPlugin;
import org.embeddedt.modernfix.forge.config.NightConfigFixer; import org.embeddedt.modernfix.forge.config.NightConfigFixer;
import org.embeddedt.modernfix.screen.ModernFixConfigScreen; import org.embeddedt.modernfix.screen.ModernFixConfigScreen;
@ -35,6 +37,7 @@ public class ModernFixClientForge {
public ModernFixClientForge() { public ModernFixClientForge() {
commonMod = new ModernFixClient(); commonMod = new ModernFixClient();
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::keyBindRegister); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::keyBindRegister);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup);
ModLoadingContext.get().registerExtensionPoint( ModLoadingContext.get().registerExtensionPoint(
ConfigScreenHandler.ConfigScreenFactory.class, ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new ModernFixConfigScreen(screen)) () -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new ModernFixConfigScreen(screen))
@ -48,6 +51,15 @@ public class ModernFixClientForge {
event.register(configKey); event.register(configKey);
} }
private void onClientSetup(FMLClientSetupEvent event) {
if(false && ModernFixMixinPlugin.instance.isOptionEnabled("perf.dynamic_resources.ConnectednessCheck")
&& ModList.get().isLoaded("connectedness")) {
event.enqueueWork(() -> {
ModLoader.get().addWarning(new ModLoadingWarning(ModLoadingContext.get().getActiveContainer().getModInfo(), ModLoadingStage.SIDED_SETUP, "modernfix.connectedness_dynresoruces"));
});
}
}
@SubscribeEvent @SubscribeEvent
public void onConfigKey(TickEvent.ClientTickEvent event) { public void onConfigKey(TickEvent.ClientTickEvent event) {
if(event.phase == TickEvent.Phase.START && configKey.consumeClick()) { if(event.phase == TickEvent.Phase.START && configKey.consumeClick()) {

View File

@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ObjectModificationManager.class) @Mixin(ObjectModificationManager.class)
@RequiresMod("blueprint") @RequiresMod("blueprint")
public abstract class ObjectModificationManagerMixin extends SimpleJsonResourceReloadListener { public abstract class ObjectModificationManagerMixin extends SimpleJsonResourceReloadListener {
@Shadow protected SelectionSpace selectionSpace; @Shadow(remap = false) protected SelectionSpace selectionSpace;
public ObjectModificationManagerMixin(Gson gson, String string) { public ObjectModificationManagerMixin(Gson gson, String string) {
super(gson, string); super(gson, string);

View File

@ -20,7 +20,7 @@ import java.util.concurrent.ConcurrentMap;
@ClientOnlyMixin @ClientOnlyMixin
@SuppressWarnings({"rawtypes", "unchecked"}) @SuppressWarnings({"rawtypes", "unchecked"})
public class ResourceUtilMixin { public class ResourceUtilMixin {
@Shadow @Final @Mutable @Shadow(remap = false) @Final @Mutable
private static Map metadataCache; private static Map metadataCache;
/** /**

View File

@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(GameData.class) @Mixin(GameData.class)
public class GameDataMixin { public class GameDataMixin {
@Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/registries/ForgeRegistry;dump(Lnet/minecraft/resources/ResourceLocation;)V")) @Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/registries/ForgeRegistry;dump(Lnet/minecraft/resources/ResourceLocation;)V", remap = false))
private static void noDump(ForgeRegistry<?> reg, ResourceLocation id) { private static void noDump(ForgeRegistry<?> reg, ResourceLocation id) {
} }
} }

View File

@ -23,7 +23,7 @@ import java.util.Map;
@Mixin(ForgeItemModelShaper.class) @Mixin(ForgeItemModelShaper.class)
@ClientOnlyMixin @ClientOnlyMixin
public abstract class ItemModelMesherForgeMixin extends ItemModelShaper { public abstract class ItemModelMesherForgeMixin extends ItemModelShaper {
@Shadow @Final @Mutable private Map<Holder.Reference<Item>, ModelResourceLocation> locations; @Shadow(remap = false) @Final @Mutable private Map<Holder.Reference<Item>, ModelResourceLocation> locations;
private Map<Holder.Reference<Item>, ModelResourceLocation> overrideLocations; private Map<Holder.Reference<Item>, ModelResourceLocation> overrideLocations;
@ -51,6 +51,7 @@ public abstract class ItemModelMesherForgeMixin extends ItemModelShaper {
} }
/** /**
* @author embeddedt
* @reason Get the stored location for that item and meta, and get the model * @reason Get the stored location for that item and meta, and get the model
* from that location from the model manager. * from that location from the model manager.
**/ **/
@ -62,6 +63,7 @@ public abstract class ItemModelMesherForgeMixin extends ItemModelShaper {
} }
/** /**
* @author embeddedt
* @reason Don't get all models during init (with dynamic loading, that would * @reason Don't get all models during init (with dynamic loading, that would
* generate them all). Just store location instead. * generate them all). Just store location instead.
**/ **/
@ -72,6 +74,7 @@ public abstract class ItemModelMesherForgeMixin extends ItemModelShaper {
} }
/** /**
* @author embeddedt
* @reason Disable cache rebuilding (with dynamic loading, that would generate * @reason Disable cache rebuilding (with dynamic loading, that would generate
* all models). * all models).
**/ **/

View File

@ -63,6 +63,7 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
@Shadow @Final @Mutable private Map<ModelBakery.BakedCacheKey, BakedModel> bakedCache; @Shadow @Final @Mutable private Map<ModelBakery.BakedCacheKey, BakedModel> bakedCache;
@Shadow @Final @Mutable private BlockColors blockColors; @Shadow @Final @Mutable private BlockColors blockColors;
@Shadow @Final private static Logger LOGGER; @Shadow @Final private static Logger LOGGER;
@Shadow public abstract UnbakedModel getModel(ResourceLocation resourceLocation); @Shadow public abstract UnbakedModel getModel(ResourceLocation resourceLocation);

View File

@ -36,22 +36,27 @@ import java.util.function.Predicate;
@ClientOnlyMixin @ClientOnlyMixin
public abstract class CTMPackReloadListenerMixin implements ModernFixClientIntegration { public abstract class CTMPackReloadListenerMixin implements ModernFixClientIntegration {
/* caches the original render checks */ /* caches the original render checks */
@Shadow @Final private static Map<Holder.Reference<Block>, Predicate<RenderType>> blockRenderChecks; @Shadow(remap = false) @Final private static Map<Holder.Reference<Block>, Predicate<RenderType>> blockRenderChecks;
private static Map<Holder.Reference<Block>, Predicate<RenderType>> renderCheckOverrides = new ConcurrentHashMap<>(); private static Map<Holder.Reference<Block>, Predicate<RenderType>> renderCheckOverrides = new ConcurrentHashMap<>();
private static ChunkRenderTypeSet DEFAULT_TYPE_SET = ChunkRenderTypeSet.of(RenderType.solid()); private static ChunkRenderTypeSet DEFAULT_TYPE_SET = ChunkRenderTypeSet.of(RenderType.solid());
@Shadow protected abstract Predicate<RenderType> getLayerCheck(BlockState state, BakedModel model); @Shadow(remap = false) protected abstract Predicate<RenderType> getLayerCheck(BlockState state, BakedModel model);
@Shadow protected abstract ChunkRenderTypeSet getExistingRenderCheck(Block block); @Shadow(remap = false) protected abstract ChunkRenderTypeSet getExistingRenderCheck(Block block);
@Inject(method = "<init>", at = @At("RETURN")) @Inject(method = "<init>", at = @At("RETURN"))
private void onInit(CallbackInfo ci) { private void onInit(CallbackInfo ci) {
ModernFixClient.CLIENT_INTEGRATIONS.add(this); ModernFixClient.CLIENT_INTEGRATIONS.add(this);
} }
/**
* @author embeddedt
* @reason handle layer changes dynamically
*/
@Overwrite(remap = false) @Overwrite(remap = false)
@SuppressWarnings("removal")
private void refreshLayerHacks() { private void refreshLayerHacks() {
renderCheckOverrides.clear(); renderCheckOverrides.clear();
if(blockRenderChecks.isEmpty()) { if(blockRenderChecks.isEmpty()) {

View File

@ -37,9 +37,9 @@ import java.util.function.Function;
@ClientOnlyMixin @ClientOnlyMixin
public abstract class TextureMetadataHandlerMixin implements ModernFixClientIntegration { public abstract class TextureMetadataHandlerMixin implements ModernFixClientIntegration {
@Shadow @Nonnull protected abstract BakedModel wrap(UnbakedModel model, BakedModel object) throws IOException; @Shadow(remap = false) @Nonnull protected abstract BakedModel wrap(UnbakedModel model, BakedModel object) throws IOException;
@Shadow @Final public static Multimap<ResourceLocation, Material> TEXTURES_SCRAPED; @Shadow(remap = false) @Final public static Multimap<ResourceLocation, Material> TEXTURES_SCRAPED;
@Inject(method = "<init>", at = @At("RETURN")) @Inject(method = "<init>", at = @At("RETURN"))
private void subscribeDynamic(CallbackInfo ci) { private void subscribeDynamic(CallbackInfo ci) {

View File

@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@RequiresMod("refinedstorage") @RequiresMod("refinedstorage")
@ClientOnlyMixin @ClientOnlyMixin
public class ClientSetupMixin { public class ClientSetupMixin {
@Shadow @Final private static BakedModelOverrideRegistry BAKED_MODEL_OVERRIDE_REGISTRY; @Shadow(remap = false) @Final private static BakedModelOverrideRegistry BAKED_MODEL_OVERRIDE_REGISTRY;
@Inject(method = "<init>", at = @At("RETURN")) @Inject(method = "<init>", at = @At("RETURN"))
private void addDynamicListener(CallbackInfo ci) { private void addDynamicListener(CallbackInfo ci) {

View File

@ -31,7 +31,7 @@ import java.util.stream.Stream;
@RequiresMod("supermartijn642corelib") @RequiresMod("supermartijn642corelib")
@ClientOnlyMixin @ClientOnlyMixin
public class ClientRegistrationHandlerMixin { public class ClientRegistrationHandlerMixin {
@Shadow @Final private List<Pair<Supplier<Stream<ResourceLocation>>, Function<BakedModel, BakedModel>>> modelOverwrites; @Shadow(remap = false) @Final private List<Pair<Supplier<Stream<ResourceLocation>>, Function<BakedModel, BakedModel>>> modelOverwrites;
private Map<ResourceLocation, Function<BakedModel, BakedModel>> modelOverwritesByLocation = new Object2ObjectOpenHashMap<>(); private Map<ResourceLocation, Function<BakedModel, BakedModel>> modelOverwritesByLocation = new Object2ObjectOpenHashMap<>();

View File

@ -17,13 +17,13 @@ import java.util.Map;
@Mixin(targets = { "net/minecraftforge/registries/NamespacedWrapper" }) @Mixin(targets = { "net/minecraftforge/registries/NamespacedWrapper" })
public abstract class NamespacedHolderHelperMixin<T> extends MappedRegistry<T> { public abstract class NamespacedHolderHelperMixin<T> extends MappedRegistry<T> {
@Shadow private Map<ResourceLocation, Holder.Reference<T>> holdersByName; @Shadow(remap = false) private Map<ResourceLocation, Holder.Reference<T>> holdersByName;
public NamespacedHolderHelperMixin(ResourceKey<? extends Registry<T>> arg, Lifecycle lifecycle) { public NamespacedHolderHelperMixin(ResourceKey<? extends Registry<T>> arg, Lifecycle lifecycle) {
super(arg, lifecycle); super(arg, lifecycle);
} }
@Inject(method = "freeze", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraftforge/registries/NamespacedWrapper;holdersByName:Ljava/util/Map;"), cancellable = true) @Inject(method = "freeze", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraftforge/registries/NamespacedWrapper;holdersByName:Ljava/util/Map;", remap = false), cancellable = true)
private void fastDummyCheck(CallbackInfoReturnable<Registry<T>> cir) { private void fastDummyCheck(CallbackInfoReturnable<Registry<T>> cir) {
// Quickly iterate without making any streams, etc. to see if everything is fine // Quickly iterate without making any streams, etc. to see if everything is fine
// Use the slow path (by returning without cancelling) when there is an error // Use the slow path (by returning without cancelling) when there is an error

View File

@ -28,12 +28,12 @@ import java.util.Set;
@Mixin(PathPackResources.class) @Mixin(PathPackResources.class)
public abstract class ForgePathPackResourcesMixin implements ICachingResourcePack { public abstract class ForgePathPackResourcesMixin implements ICachingResourcePack {
@Shadow protected abstract Path resolve(String... paths); @Shadow(remap = false) protected abstract Path resolve(String... paths);
@Shadow @NotNull @Shadow(remap = false) @NotNull
protected abstract Set<String> getNamespacesFromDisk(PackType type); protected abstract Set<String> getNamespacesFromDisk(PackType type);
@Shadow private static String[] getPathFromLocation(PackType type, ResourceLocation location) { @Shadow(remap = false) private static String[] getPathFromLocation(PackType type, ResourceLocation location) {
throw new AssertionError(); throw new AssertionError();
} }

View File

@ -19,9 +19,9 @@ import java.util.Set;
@Mixin(ForgeRegistry.Snapshot.class) @Mixin(ForgeRegistry.Snapshot.class)
@IgnoreOutsideDev @IgnoreOutsideDev
public class ForgeRegistrySnapshotMixin { public class ForgeRegistrySnapshotMixin {
@Shadow @Final @Mutable public Map<ResourceLocation, Integer> ids; @Shadow(remap = false) @Final @Mutable public Map<ResourceLocation, Integer> ids;
@Shadow @Final @Mutable public Set<ResourceLocation> dummied; @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

View File

@ -19,7 +19,7 @@ public class TagEntryMixin {
* @reason use cached location, overwrite rather than inject to avoid allocs * @reason use cached location, overwrite rather than inject to avoid allocs
*/ */
@Overwrite @Overwrite
public ExtraCodecs.TagOrElementLocation elementOrTag() { private ExtraCodecs.TagOrElementLocation elementOrTag() {
ExtraCodecs.TagOrElementLocation loc = cachedLoc; ExtraCodecs.TagOrElementLocation loc = cachedLoc;
if(loc == null) { if(loc == null) {
loc = new ExtraCodecs.TagOrElementLocation(this.id, this.tag); loc = new ExtraCodecs.TagOrElementLocation(this.id, this.tag);

View File

@ -18,7 +18,7 @@ public class TagOrElementLocationMixin {
* @reason use cached ID, overwrite rather than inject to avoid allocs * @reason use cached ID, overwrite rather than inject to avoid allocs
*/ */
@Overwrite @Overwrite
public String decoratedId() { private String decoratedId() {
String id = cachedDecoratedId; String id = cachedDecoratedId;
if(id == null) { if(id == null) {
id = this.tag ? "#" + this.id : this.id.toString(); id = this.tag ? "#" + this.id : this.id.toString();