diff --git a/build.gradle b/build.gradle index 61d93688..42669421 100644 --- a/build.gradle +++ b/build.gradle @@ -116,11 +116,11 @@ subprojects { } dependencies { - include(project(":polymer-autohost")) - include(project(":polymer-core")) - include(project(":polymer-common")) - include(project(":polymer-resource-pack")) - include(project(":polymer-blocks")) + api include(project(":polymer-autohost")) + api include(project(":polymer-core")) + api include(project(":polymer-common")) + api include(project(":polymer-resource-pack")) + api include(project(":polymer-blocks")) //include(project(":polymer-client-extensions")) } diff --git a/gradle.properties b/gradle.properties index eefff903..785cf36f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ fabric_version=0.72.0+1.19.3 maven_group = eu.pb4 -mod_version = 0.3.9 +mod_version = 0.3.10 minecraft_version_supported = ">=1.19.3-beta.3" diff --git a/polymer-core/build.gradle b/polymer-core/build.gradle index b137b973..b49fb999 100644 --- a/polymer-core/build.gradle +++ b/polymer-core/build.gradle @@ -50,16 +50,16 @@ dependencies { modCompileOnly('com.github.TheEpicBlock:PolyMc:5.1.0') - modCompileOnly /*modLocalRuntime*/("curse.maven:jade-324717:4160727") - modCompileOnly "mcp.mobius.waila:wthit:fabric-5.1.3" + modCompileOnly /*modLocalRuntime*/("curse.maven:jade-324717:4328555") + modCompileOnly modLocalRuntime("mcp.mobius.waila:wthit:fabric-6.1.4") //modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:9.1.530" - modCompileOnly "me.shedaniel:RoughlyEnoughItems-fabric:10.0.581" - modCompileOnly /*modLocalRuntime*/("dev.emi:emi:0.5.3+1.19.3") + modCompileOnly /*modLocalRuntime*/ ("me.shedaniel:RoughlyEnoughItems-fabric:10.0.592") + modCompileOnly /*modLocalRuntime*/("dev.emi:emi:0.6.6+1.19.3") //modCompileOnlyApi modLocalRuntime("mezz.jei:jei-1.19-common:11.0.0.206") //modCompileOnlyApi modLocalRuntime("mezz.jei:jei-1.19-fabric:11.0.0.206") - modCompileOnly /*modRuntimeOnly*/("curse.maven:jei-238222:3928387") + modCompileOnly /*modRuntimeOnly*/("maven.modrinth:jei:12.2.0.17") //modCompileOnly ("mcjty.theoneprobe:theoneprobe-fabric:1.18.2-5.0.9") //modRuntimeOnly ("mcjty.theoneprobe:theoneprobe-fabric:1.18.2-5.0.9") @@ -73,20 +73,20 @@ dependencies { exclude(group: "net.fabricmc") } - modCompileOnly("fr.catcore:server-translations-api:1.4.18+1.19.2") - modLocalRuntime("fr.catcore:server-translations-api:1.4.18+1.19.2") + modCompileOnly("fr.catcore:server-translations-api:1.4.19+1.19.3") + modLocalRuntime("fr.catcore:server-translations-api:1.4.19+1.19.3") - modCompileOnly 'com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v2.4.2-mc1.19.3' - modCompileOnly 'com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v2.4.2-mc1.19.3' + modCompileOnly 'com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v2.5.1-mc1.19.3' + modCompileOnly 'com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v2.5.1-mc1.19.3' // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. testmodImplementation sourceSets.main.output - implementation include(project(path: ':polymer-reg-sync-manipulator', configuration: 'namedElements')) - implementation project(path: ':polymer-common', configuration: 'namedElements') - implementation include(project(path: ':polymer-networking', configuration: 'namedElements')) + api include(project(path: ':polymer-reg-sync-manipulator', configuration: 'namedElements')) + api project(path: ':polymer-common', configuration: 'namedElements') + api include(project(path: ':polymer-networking', configuration: 'namedElements')) compileOnly (project(path: ':polymer-resource-pack', configuration: 'namedElements')) localRuntime (project(path: ':polymer-resource-pack', configuration: 'namedElements')) diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerItemUtils.java b/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerItemUtils.java index 3f2cf709..a462f124 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerItemUtils.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerItemUtils.java @@ -54,6 +54,9 @@ public final class PolymerItemUtils { * You can also return new ItemStack, however please keep previous nbt so other modifications aren't removed if not needed! */ public static final FunctionEvent ITEM_MODIFICATION_EVENT = new FunctionEvent<>(); + private static final String[] NBT_TO_COPY = { "CanDestroy", "CanPlaceOn", BlockItem.BLOCK_ENTITY_TAG_KEY, + CompassItem.LODESTONE_DIMENSION_KEY, CompassItem.LODESTONE_POS_KEY, CompassItem.LODESTONE_TRACKED_KEY, + }; private PolymerItemUtils() { } @@ -374,33 +377,22 @@ public static ItemStack createItemStack(ItemStack itemStack, TooltipContext tool } if (itemStack.getItem() instanceof PotionItem) { - if (!out.getOrCreateNbt().contains("CustomPotionColor")) { - out.getOrCreateNbt().putInt("CustomPotionColor", PotionUtil.getColor(itemStack)); - } - } - - NbtElement canDestroy = itemStack.getNbt().get("CanDestroy"); - - if (canDestroy != null) { - out.getNbt().put("CanDestroy", canDestroy); + out.getOrCreateNbt().putInt("CustomPotionColor", PotionUtil.getColor(itemStack)); } - NbtElement canPlaceOn = itemStack.getNbt().get("CanPlaceOn"); + for (var i = 0; i < NBT_TO_COPY.length; i++) { + var key = NBT_TO_COPY[i]; + var tag = itemStack.getNbt().get(key); - if (canPlaceOn != null) { - out.getNbt().put("CanPlaceOn", canPlaceOn); + if (tag != null) { + out.getNbt().put(key, tag); + } } if (CrossbowItem.isCharged(itemStack)) { CrossbowItem.setCharged(out, true); } - var beTag = itemStack.getNbt().get(BlockItem.BLOCK_ENTITY_TAG_KEY); - - if (beTag != null) { - out.getNbt().put(BlockItem.BLOCK_ENTITY_TAG_KEY, beTag); - } - try { if (itemStack.getNbt().contains("ChargedProjectiles", NbtElement.LIST_TYPE)) { var outList = new NbtList(); diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/api/utils/PolymerRegistry.java b/polymer-core/src/main/java/eu/pb4/polymer/core/api/utils/PolymerRegistry.java index 165737f1..dbbf6992 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/api/utils/PolymerRegistry.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/api/utils/PolymerRegistry.java @@ -2,12 +2,14 @@ import net.minecraft.util.Identifier; import net.minecraft.util.collection.IndexedIterable; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.Map; import java.util.Set; +@ApiStatus.NonExtendable public interface PolymerRegistry extends IndexedIterable { @Nullable T get(Identifier identifier); @@ -29,4 +31,6 @@ public interface PolymerRegistry extends IndexedIterable { Collection getTagsOf(T entry); int size(); + + boolean contains(Identifier id); } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/PolymerImplUtils.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/PolymerImplUtils.java index 749018ce..2d5b4cb4 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/PolymerImplUtils.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/PolymerImplUtils.java @@ -319,10 +319,6 @@ public static PolymerTooltipContext getTooltipContext(ServerPlayerEntity player) return player != null && player.networkHandler instanceof PolymerNetworkHandlerExtension h && h.polymer$advancedTooltip() ? PolymerTooltipContext.ADVANCED : PolymerTooltipContext.BASIC; } - public static boolean areSamePolymerType(ItemStack a, ItemStack b) { - return Objects.equals(PolymerItemUtils.getServerIdentifier(a), PolymerItemUtils.getServerIdentifier(b)); - } - public static boolean isServerSideSyncableEntry(Registry reg, Object obj) { return PolymerUtils.isServerOnly(obj) || (PolymerImpl.SYNC_MODDED_ENTRIES_POLYMC && !reg.getId(obj).getNamespace().equals("minecraft")); } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/InternalClientRegistry.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/InternalClientRegistry.java index 245f19ce..b6a3a9bc 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/InternalClientRegistry.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/InternalClientRegistry.java @@ -26,6 +26,7 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.fabricmc.fabric.impl.itemgroup.ItemGroupHelper; +import net.fabricmc.loader.api.FabricLoader; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -416,6 +417,7 @@ public static void register() { } public static String getModName(Identifier id) { - return "Server (" + id.getNamespace() + ")"; + var container = FabricLoader.getInstance().getModContainer(id.getNamespace()); + return container.isPresent() ? container.get().getMetadata().getName() : (id.getNamespace() + "*"); } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/CompatUtils.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/CompatUtils.java index 9c43ffc5..f69f97f5 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/CompatUtils.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/CompatUtils.java @@ -1,19 +1,38 @@ package eu.pb4.polymer.core.impl.client.compat; import eu.pb4.polymer.core.api.client.PolymerClientUtils; +import eu.pb4.polymer.core.api.item.PolymerItemUtils; import eu.pb4.polymer.core.impl.PolymerImpl; +import eu.pb4.polymer.core.impl.client.InternalClientRegistry; import eu.pb4.polymer.core.impl.client.interfaces.ClientItemGroupExtension; import net.minecraft.client.MinecraftClient; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroups; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStackSet; +import net.minecraft.util.Identifier; import org.jetbrains.annotations.ApiStatus; +import java.util.Objects; import java.util.function.Consumer; @ApiStatus.Internal public class CompatUtils { + public static boolean areSamePolymerType(ItemStack a, ItemStack b) { + return Objects.equals(getItemId(a), getItemId(b)); + } + + private static Identifier getItemId(ItemStack stack) { + var id = PolymerItemUtils.getServerIdentifier(stack); + + if (id == null) { + return stack.getItem().getRegistryEntry().registryKey().getValue(); + } + + return id; + } + + public static void iterateItems(Consumer consumer) { var stacks = ItemStackSet.create(); @@ -44,5 +63,13 @@ public static void registerReload(Runnable runnable) { }); } } + + public static String getModName(ItemStack stack) { + var id = PolymerItemUtils.getServerIdentifier(stack); + if (id != null) { + return InternalClientRegistry.getModName(id); + } + return null; + } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/JadeCompatibility.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/JadeCompatibility.java index 331368e9..a384ba6a 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/JadeCompatibility.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/JadeCompatibility.java @@ -31,6 +31,8 @@ public void registerClient(IWailaClientRegistration registrar) { if (PolymerImpl.IS_CLIENT) { registrar.registerBlockComponent(BlockOverride.INSTANCE, Block.class); registrar.registerEntityComponent(EntityOverride.INSTANCE, Entity.class); + + registrar.addItemModNameCallback(CompatUtils::getModName); } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/ReiCompatibility.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/ReiCompatibility.java index fc5c98ab..2061522b 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/ReiCompatibility.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/ReiCompatibility.java @@ -3,17 +3,13 @@ import eu.pb4.polymer.core.api.item.PolymerItemUtils; import eu.pb4.polymer.core.impl.PolymerImpl; import eu.pb4.polymer.core.impl.PolymerImplUtils; -import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.RoughlyEnoughItemsCoreClient; -import me.shedaniel.rei.api.client.REIRuntime; import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.EntryRegistry; import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.entry.comparison.EntryComparator; import me.shedaniel.rei.api.common.entry.comparison.ItemComparatorRegistry; import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; -import me.shedaniel.rei.impl.client.REIRuntimeImpl; -import me.shedaniel.rei.impl.init.RoughlyEnoughItemsInitializer; import net.minecraft.item.ItemStack; import java.util.function.Predicate; diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/WthitCompatibility.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/WthitCompatibility.java index 5f0cb3ca..2ffe92c6 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/WthitCompatibility.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/WthitCompatibility.java @@ -50,41 +50,13 @@ private static class OtherOverrides implements IEventListener { @Override public @Nullable String getHoveredItemModName(ItemStack stack, IPluginConfig config) { - if (PolymerItemUtils.isPolymerServerItem(stack) || !ClientUtils.isClientThread()) { - return null; - } - - var id = PolymerItemUtils.getServerIdentifier(stack); - - if (id != null) { - String modName = null; - var regBlock = Registries.ITEM.get(id); - if (regBlock != null) { - modName = IModInfo.get(regBlock).getName(); - } - - if (modName == null || modName.isEmpty() || (modName.equals("Minecraft") && !id.getNamespace().equals("minecraft"))) { - modName = InternalClientRegistry.getModName(id); - } - - return modName; - } - return null; + return CompatUtils.getModName(stack); } } private static class BlockOverride implements IBlockComponentProvider { public static final BlockOverride INSTANCE = new BlockOverride(); - @Override - public @Nullable BlockState getOverride(IBlockAccessor accessor, IPluginConfig config) { - var block = InternalClientRegistry.getBlockAt(accessor.getPosition()); - if (block != ClientPolymerBlock.NONE_STATE) { - return Blocks.STONE.getDefaultState(); - } - return null; - } - @Override public ITooltipComponent getIcon(IBlockAccessor accessor, IPluginConfig config) { var block = InternalClientRegistry.getBlockAt(accessor.getPosition()); diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/other/ImplPolymerRegistry.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/other/ImplPolymerRegistry.java index f3a80bbf..6d6c6517 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/other/ImplPolymerRegistry.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/other/ImplPolymerRegistry.java @@ -83,6 +83,11 @@ public int size() { return this.entryMap.size(); } + @Override + public boolean contains(Identifier id) { + return this.entryMap.containsKey(id); + } + public void set(Identifier identifier, int rawId, T entry) { this.entryMap.put(identifier, entry); this.identifierMap.put(entry, identifier); diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/emi_EmiStackMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/emi_EmiStackMixin.java index 11322aca..b5b39fd6 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/emi_EmiStackMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/emi_EmiStackMixin.java @@ -3,6 +3,7 @@ import dev.emi.emi.api.stack.Comparison; import dev.emi.emi.api.stack.EmiStack; import eu.pb4.polymer.core.impl.PolymerImplUtils; +import eu.pb4.polymer.core.impl.client.compat.CompatUtils; import net.minecraft.item.ItemStack; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Pseudo; @@ -18,14 +19,14 @@ public abstract class emi_EmiStackMixin { @Inject(method = "isEqual(Ldev/emi/emi/api/stack/EmiStack;)Z", at = @At("HEAD"), cancellable = true, remap = false, require = 0) private void polymer$areEqual(EmiStack stack, CallbackInfoReturnable cir) { - if (!PolymerImplUtils.areSamePolymerType(stack.getItemStack(), this.getItemStack())) { + if (!CompatUtils.areSamePolymerType(stack.getItemStack(), this.getItemStack())) { cir.setReturnValue(false); } } @Inject(method = "isEqual(Ldev/emi/emi/api/stack/EmiStack;Ldev/emi/emi/api/stack/Comparison;)Z", at = @At("HEAD"), cancellable = true, remap = false, require = 0) private void polymer$areEqual2(EmiStack stack, Comparison comparison, CallbackInfoReturnable cir) { - if (!PolymerImplUtils.areSamePolymerType(stack.getItemStack(), this.getItemStack())) { + if (!CompatUtils.areSamePolymerType(stack.getItemStack(), this.getItemStack())) { cir.setReturnValue(false); } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/jei_StackHelperMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/jei_StackHelperMixin.java new file mode 100644 index 00000000..1b15d612 --- /dev/null +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/jei_StackHelperMixin.java @@ -0,0 +1,22 @@ +package eu.pb4.polymer.core.mixin.client.compat; + +import eu.pb4.polymer.core.api.item.PolymerItemUtils; +import mezz.jei.common.util.StackHelper; +import net.minecraft.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Pseudo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Pseudo +@Mixin(StackHelper.class) +public class jei_StackHelperMixin { + @Inject(method = "getRegistryNameForStack", at = @At("HEAD"), cancellable = true, remap = false, require = 0) + private static void polymer$changeId(ItemStack stack, CallbackInfoReturnable cir) { + var id = PolymerItemUtils.getServerIdentifier(stack); + if (id != null) { + cir.setReturnValue(id.toString()); + } + } +} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/jei_SubtypeManagerMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/jei_SubtypeManagerMixin.java deleted file mode 100644 index 271893bf..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/jei_SubtypeManagerMixin.java +++ /dev/null @@ -1,27 +0,0 @@ -package eu.pb4.polymer.core.mixin.client.compat; - -import eu.pb4.polymer.core.api.item.PolymerItemUtils; -import mezz.jei.api.ingredients.IIngredientTypeWithSubtypes; -import mezz.jei.api.ingredients.subtypes.UidContext; -import mezz.jei.common.ingredients.subtypes.SubtypeManager; -import net.minecraft.item.ItemStack; -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Pseudo; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -@Pseudo -@Mixin(SubtypeManager.class) -public class jei_SubtypeManagerMixin { - @Inject(method = "getSubtypeInfo", at = @At("HEAD"), cancellable = true, remap = false, require = 0) - private void polymer_handlePolymerSubtypes(IIngredientTypeWithSubtypes ingredientType, Object ingredient, UidContext context, CallbackInfoReturnable<@Nullable String> cir) { - if (ingredient instanceof ItemStack stack) { - var id = PolymerItemUtils.getServerIdentifier(stack); - if (id != null) { - cir.setReturnValue("polymer_item|" + id); - } - } - } -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/rei_ItemEntryDefinitionMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/rei_ItemEntryDefinitionMixin.java index 1c7b3fa4..16ce39a7 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/rei_ItemEntryDefinitionMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/compat/rei_ItemEntryDefinitionMixin.java @@ -3,6 +3,7 @@ import eu.pb4.polymer.core.api.client.ClientPolymerItem; import eu.pb4.polymer.core.api.item.PolymerItemUtils; import eu.pb4.polymer.core.impl.PolymerImplUtils; +import eu.pb4.polymer.core.impl.client.compat.CompatUtils; import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.entry.comparison.ComparisonContext; import me.shedaniel.rei.plugin.client.entry.ItemEntryDefinition; @@ -23,7 +24,7 @@ public abstract class rei_ItemEntryDefinitionMixin { @Inject(method = "equals(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;Lme/shedaniel/rei/api/common/entry/comparison/ComparisonContext;)Z", at = @At("HEAD"), cancellable = true, remap = false, require = 0) private void polymer$areEqual(ItemStack o1, ItemStack o2, ComparisonContext context, CallbackInfoReturnable cir) { - if (!PolymerImplUtils.areSamePolymerType(o1, o2)) { + if (!CompatUtils.areSamePolymerType(o1, o2)) { cir.setReturnValue(false); } } @@ -36,10 +37,6 @@ public abstract class rei_ItemEntryDefinitionMixin { if (item != null) { cir.setReturnValue(item.visualStack().copy()); - } else { - var stack = value.copy(); - stack.setCount(1); - cir.setReturnValue(stack); } } } diff --git a/polymer-core/src/main/resources/fabric.mod.json b/polymer-core/src/main/resources/fabric.mod.json index cef3bba7..411230a8 100644 --- a/polymer-core/src/main/resources/fabric.mod.json +++ b/polymer-core/src/main/resources/fabric.mod.json @@ -58,10 +58,6 @@ "modmenu": { "badges": [ "library" ], "discord": "https://pb4.eu/discord" - }, - "waila:plugins": { - "id": "polymer:main", - "initializer": "eu.pb4.polymer.core.impl.client.compat.WthitCompatibility" } } } diff --git a/polymer-core/src/main/resources/polymer-core.mixins.json b/polymer-core/src/main/resources/polymer-core.mixins.json index 1dbfb8d4..75ac196a 100644 --- a/polymer-core/src/main/resources/polymer-core.mixins.json +++ b/polymer-core/src/main/resources/polymer-core.mixins.json @@ -86,7 +86,7 @@ "client.block.WorldChunkMixin", "client.compat.armor_ArmorFeatureRendererMixin", "client.compat.emi_EmiStackMixin", - "client.compat.jei_SubtypeManagerMixin", + "client.compat.jei_StackHelperMixin", "client.compat.rei_ItemEntryDefinitionMixin", "client.entity.EntityMixin", "client.item.ItemGroupMixin", diff --git a/polymer-core/src/main/resources/waila_plugins.json b/polymer-core/src/main/resources/waila_plugins.json new file mode 100644 index 00000000..f76fa13d --- /dev/null +++ b/polymer-core/src/main/resources/waila_plugins.json @@ -0,0 +1,6 @@ +{ + "polymer:core": { + "initializer": "eu.pb4.polymer.core.impl.client.compat.WthitCompatibility", + "side": "client" + } +} \ No newline at end of file diff --git a/polymer-networking/build.gradle b/polymer-networking/build.gradle index 55011801..358b9559 100644 --- a/polymer-networking/build.gradle +++ b/polymer-networking/build.gradle @@ -7,7 +7,7 @@ loom { } dependencies { - implementation include(project(path: ':polymer-common', configuration: 'namedElements')) + api include(project(path: ':polymer-common', configuration: 'namedElements')) } afterEvaluate { diff --git a/polymer-resource-pack/build.gradle b/polymer-resource-pack/build.gradle index 449e26a8..33b1790f 100644 --- a/polymer-resource-pack/build.gradle +++ b/polymer-resource-pack/build.gradle @@ -16,7 +16,7 @@ loom { dependencies { //modCompileOnly ('nl.theepicblock:PolyMc:5.1.0+1.19') modCompileOnly ('com.github.TheEpicBlock:PolyMc:5.1.0') - implementation include(project(path: ':polymer-common', configuration: 'namedElements')) + api include(project(path: ':polymer-common', configuration: 'namedElements')) } afterEvaluate {