Skip to content

Commit

Permalink
Merge branch '1.21' into 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyploszaj committed Aug 11, 2024
2 parents 1bfbd0b + 9a17a91 commit 022ca78
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 12 deletions.
9 changes: 2 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ protected List<String> getAllModAuthorsAgnos() {
.map(p -> p.getName()).distinct().toList();
}

@Override
protected List<String> getModsWithPluginsAgnos() {
List<String> list = Lists.newArrayList();
for (EntrypointContainer<EmiPlugin> 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<EmiPluginContainer> getPluginsAgnos() {
List<EmiPluginContainer> list = Lists.newArrayList();
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version=1.20.6
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,25 @@ protected List<String> getAllModNamesAgnos() {
return ModList.get().getMods().stream().map(m -> m.getDisplayName()).toList();
}

@Override
protected List<String> getModsWithPluginsAgnos() {
List<String> 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<EmiPluginContainer> getPluginsAgnos() {
List<EmiPluginContainer> containers = Lists.newArrayList();
Expand Down
4 changes: 2 additions & 2 deletions xplat/src/main/java/dev/emi/emi/jemi/JemiUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public static IIngredientType getFluidType() {

public static Set<String> getHandledMods() {
Set<String> set = Sets.newHashSet();
for (EmiPluginContainer plugin : EmiAgnos.getPlugins()) {
set.add(plugin.id());
for (String mod : EmiAgnos.getModsWithPlugins()) {
set.add(mod);
}
return set;
}
Expand Down
6 changes: 6 additions & 0 deletions xplat/src/main/java/dev/emi/emi/platform/EmiAgnos.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ public static List<String> getAllModAuthors() {

protected abstract List<String> getAllModAuthorsAgnos();

public static List<String> getModsWithPlugins() {
return delegate.getModsWithPluginsAgnos();
}

protected abstract List<String> getModsWithPluginsAgnos();

public static List<EmiPluginContainer> getPlugins() {
return delegate.getPluginsAgnos();
}
Expand Down
11 changes: 9 additions & 2 deletions xplat/src/main/java/dev/emi/emi/registry/EmiStackList.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,15 @@ public static void reload() {
Map<ItemGroup, Collection<ItemStack>> itemGroupToStacksMap = client.submit(() -> {
Map<ItemGroup, Collection<ItemStack>> map = new Reference2ReferenceOpenHashMap<>();
for (ItemGroup group : ItemGroups.getGroups()) {
group.updateEntries(context);
map.put(group, group.getSearchTabStacks());
String groupName = "null";
try {
groupName = group.getDisplayName().toString();
group.updateEntries(context);
map.put(group, group.getSearchTabStacks());
} catch(Exception e) {
EmiLog.error("Creative item group " + groupName + " threw while EMI was attempting to construct the index, items may be missing.");
EmiLog.error(e);
}
}
return map;
}).join();
Expand Down

0 comments on commit 022ca78

Please sign in to comment.