From 9a17a91428cb9dc334472e36bf0245747c4b8018 Mon Sep 17 00:00:00 2001 From: emilyploszaj Date: Sun, 11 Aug 2024 16:10:00 -0500 Subject: [PATCH] 1.1.12 --- CHANGELOG.md | 9 ++------- .../emi/platform/fabric/EmiAgnosFabric.java | 15 +++++++++++++++ gradle.properties | 2 +- .../platform/neoforge/EmiAgnosNeoForge.java | 19 +++++++++++++++++++ .../main/java/dev/emi/emi/jemi/JemiUtil.java | 4 ++-- .../java/dev/emi/emi/platform/EmiAgnos.java | 6 ++++++ 6 files changed, 45 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20828888..97b9c3c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,5 @@ ### Tweaks -* Re-enabled stack batching for 1.21 -* Query creative group contents on thread. This may cause slight notable performance dips but will significantly improve compatibility -* Redundant JEI initialization will not be performed on mods with dedicated EMI integration, increasing performance in those situations +* Tweaked JEI/EMI compatibility disabling to not load plugins earlier than previously expected ### Fixes -* Various fixes to modern JEI compatibility -* Fix recipe filling behavior having incorrect behavior with edge case slot interactions -* Fixed invisible slots having rendered overlays when they should not #654 -* Fixed handling for extra mouse button binds #645 +* Fixed regression in item group querying causing errors to cascade outside of single groups diff --git a/fabric/src/main/java/dev/emi/emi/platform/fabric/EmiAgnosFabric.java b/fabric/src/main/java/dev/emi/emi/platform/fabric/EmiAgnosFabric.java index 0d83f277..6d565c61 100644 --- a/fabric/src/main/java/dev/emi/emi/platform/fabric/EmiAgnosFabric.java +++ b/fabric/src/main/java/dev/emi/emi/platform/fabric/EmiAgnosFabric.java @@ -108,6 +108,21 @@ protected List getAllModAuthorsAgnos() { .map(p -> p.getName()).distinct().toList(); } + @Override + protected List getModsWithPluginsAgnos() { + List list = Lists.newArrayList(); + for (EntrypointContainer container : FabricLoader.getInstance().getEntrypointContainers("emi", EmiPlugin.class)) { + try { + list.add(container.getProvider().getMetadata().getId()); + } catch (Throwable t) { + EmiLog.error("Critical exception thrown when reading EMI Plugin from mod " + container.getProvider().getMetadata().getId()); + EmiLog.error(t); + } + } + return list; + } + + @Override protected List getPluginsAgnos() { List list = Lists.newArrayList(); diff --git a/gradle.properties b/gradle.properties index d750fa6d..55125607 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ minecraft_version=1.21 enabled_platforms=fabric,neoforge archives_base_name=emi -mod_version=1.1.11 +mod_version=1.1.12 maven_group=dev.emi architectury_version=4.9.83 diff --git a/neoforge/src/main/java/dev/emi/emi/platform/neoforge/EmiAgnosNeoForge.java b/neoforge/src/main/java/dev/emi/emi/platform/neoforge/EmiAgnosNeoForge.java index 28fa392e..1d4367e6 100644 --- a/neoforge/src/main/java/dev/emi/emi/platform/neoforge/EmiAgnosNeoForge.java +++ b/neoforge/src/main/java/dev/emi/emi/platform/neoforge/EmiAgnosNeoForge.java @@ -110,6 +110,25 @@ protected List getAllModNamesAgnos() { return ModList.get().getMods().stream().map(m -> m.getDisplayName()).toList(); } + @Override + protected List getModsWithPluginsAgnos() { + List mods = Lists.newArrayList(); + Type entrypointType = Type.getType(EmiEntrypoint.class); + for (ModFileScanData data : ModList.get().getAllScanData()) { + for (ModFileScanData.AnnotationData annot : data.getAnnotations()) { + try { + if (entrypointType.equals(annot.annotationType())) { + mods.add(data.getIModInfoData().get(0).getMods().get(0).getModId()); + } + } catch (Throwable t) { + EmiLog.error("Exception constructing entrypoint:"); + t.printStackTrace(); + } + } + } + return mods; + } + @Override protected List getPluginsAgnos() { List containers = Lists.newArrayList(); diff --git a/xplat/src/main/java/dev/emi/emi/jemi/JemiUtil.java b/xplat/src/main/java/dev/emi/emi/jemi/JemiUtil.java index 9024c952..1a4ed7a4 100644 --- a/xplat/src/main/java/dev/emi/emi/jemi/JemiUtil.java +++ b/xplat/src/main/java/dev/emi/emi/jemi/JemiUtil.java @@ -82,8 +82,8 @@ public static IIngredientType getFluidType() { public static Set getHandledMods() { Set set = Sets.newHashSet(); - for (EmiPluginContainer plugin : EmiAgnos.getPlugins()) { - set.add(plugin.id()); + for (String mod : EmiAgnos.getModsWithPlugins()) { + set.add(mod); } return set; } diff --git a/xplat/src/main/java/dev/emi/emi/platform/EmiAgnos.java b/xplat/src/main/java/dev/emi/emi/platform/EmiAgnos.java index 3d2ba0f4..c665dc75 100644 --- a/xplat/src/main/java/dev/emi/emi/platform/EmiAgnos.java +++ b/xplat/src/main/java/dev/emi/emi/platform/EmiAgnos.java @@ -80,6 +80,12 @@ public static List getAllModAuthors() { protected abstract List getAllModAuthorsAgnos(); + public static List getModsWithPlugins() { + return delegate.getModsWithPluginsAgnos(); + } + + protected abstract List getModsWithPluginsAgnos(); + public static List getPlugins() { return delegate.getPluginsAgnos(); }