diff --git a/src/main/java/net/frozenblock/lib/item/impl/sherd/DecoratedPotPatternRegistryEntrypoint.java b/src/main/java/net/frozenblock/lib/item/impl/sherd/DecoratedPotPatternRegistryEntrypoint.java index b17078681..6be668e0d 100644 --- a/src/main/java/net/frozenblock/lib/item/impl/sherd/DecoratedPotPatternRegistryEntrypoint.java +++ b/src/main/java/net/frozenblock/lib/item/impl/sherd/DecoratedPotPatternRegistryEntrypoint.java @@ -20,15 +20,11 @@ import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Item; import net.minecraft.world.level.block.entity.DecoratedPotPattern; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import java.util.Map; public interface DecoratedPotPatternRegistryEntrypoint { - void registerForItems(Map> map); - void bootstrap(Registry registry); @Contract("_, _, _ -> new") diff --git a/src/main/java/net/frozenblock/lib/item/mixin/sherd/DecoratedPotPatternsMixin.java b/src/main/java/net/frozenblock/lib/item/mixin/sherd/DecoratedPotPatternsMixin.java index 8abcc5575..412cd1291 100644 --- a/src/main/java/net/frozenblock/lib/item/mixin/sherd/DecoratedPotPatternsMixin.java +++ b/src/main/java/net/frozenblock/lib/item/mixin/sherd/DecoratedPotPatternsMixin.java @@ -17,52 +17,27 @@ package net.frozenblock.lib.item.mixin.sherd; -import com.google.common.collect.ImmutableMap; -import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.fabricmc.loader.api.FabricLoader; import net.frozenblock.lib.item.impl.sherd.DecoratedPotPatternRegistryEntrypoint; import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.item.Item; import net.minecraft.world.level.block.entity.DecoratedPotPattern; import net.minecraft.world.level.block.entity.DecoratedPotPatterns; import org.spongepowered.asm.mixin.Mixin; -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; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import java.util.Map; -@Mixin(value = DecoratedPotPatterns.class, priority = 50) +@Mixin(DecoratedPotPatterns.class) public class DecoratedPotPatternsMixin { - @Shadow - public static Map> ITEM_TO_POT_TEXTURE; - - @Inject(method = "", at = @At(value = "TAIL")) - private static void frozenLib$createMap(CallbackInfo info) { - Map> mutableSherdMap = new Object2ObjectOpenHashMap<>(ITEM_TO_POT_TEXTURE); - FabricLoader.getInstance().getEntrypointContainers("frozenlib:decorated_pot_patterns", DecoratedPotPatternRegistryEntrypoint.class).forEach(entrypoint -> { - DecoratedPotPatternRegistryEntrypoint decoratedPotPatternRegistryEntrypoint = entrypoint.getEntrypoint(); - decoratedPotPatternRegistryEntrypoint.registerForItems(mutableSherdMap); - }); - ITEM_TO_POT_TEXTURE = ImmutableMap.copyOf(mutableSherdMap); - } - - @Inject( - method = "bootstrap", - at = @At( - value = "RETURN", - shift = At.Shift.BEFORE - ) - ) + @Inject(method = "bootstrap", at = @At(value = "RETURN", shift = At.Shift.BEFORE)) private static void frozenLib$bootstrap(Registry registry, CallbackInfoReturnable info) { FabricLoader.getInstance().getEntrypointContainers("frozenlib:decorated_pot_patterns", DecoratedPotPatternRegistryEntrypoint.class).forEach(entrypoint -> { try { DecoratedPotPatternRegistryEntrypoint decoratedPotPatternRegistryEntrypoint = entrypoint.getEntrypoint(); decoratedPotPatternRegistryEntrypoint.bootstrap(registry); - } catch (Throwable ignored) {} + } catch (Throwable ignored) { + } }); } }