Skip to content

Commit

Permalink
Updated dependnecies, allow slashes in recipe IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Dec 6, 2023
1 parent c4c8720 commit 4bbb7b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ public ResourceLocation getOrCreateId() {
var js = getSerializationTypeFunction();
var ids = CommonProperties.get().ignoreCustomUniqueRecipeIds ? null : js.schemaType.schema.uniqueIdFunction.apply(this);

var prefix = js.id.getNamespace() + ":kjs_";
var prefix = js.id.getNamespace() + ":kjs/";

if (ids == null) {
if (ids == null || ids.isEmpty()) {
ids = UtilsJS.getUniqueId(json);
} else {
ids = RecipeSchema.normalizeId(ids).replace(':', '_').replace('/', '_');
ids = ids.replace(':', '_');
}

id = type.event.takeId(this, prefix, ids);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static String normalizeId(String id) {
public RecipeSchema uniqueOutputId(RecipeKey<OutputItem> resultItemKey) {
return uniqueId(r -> {
var item = r.getValue(resultItemKey);
return item == null || item.isEmpty() ? null : normalizeId(item.item.kjs$getId());
return item == null || item.isEmpty() ? null : normalizeId(item.item.kjs$getId()).replace('/', '_');
});
}

Expand All @@ -176,7 +176,7 @@ public RecipeSchema uniqueOutputArrayId(RecipeKey<OutputItem[]> resultItemKey) {
sb.append('_');
}

sb.append(normalizeId(item.item.kjs$getId()));
sb.append(normalizeId(item.item.kjs$getId()).replace('/', '_'));
}
}

Expand All @@ -188,7 +188,7 @@ public RecipeSchema uniqueInputId(RecipeKey<InputItem> resultItemKey) {
return uniqueId(r -> {
var ingredient = r.getValue(resultItemKey);
var item = ingredient == null ? null : ingredient.ingredient.kjs$getFirst();
return item == null || item.isEmpty() ? null : normalizeId(item.kjs$getId());
return item == null || item.isEmpty() ? null : normalizeId(item.kjs$getId()).replace('/', '_');
});
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ minecraft_version=1.20.1
rhino_version=2001.2.2-build.11
min_rhino_version=2001.2.2-build.1
architectury_version=9.1.12
fabric_loader_version=0.14.22
fabric_api_version=0.88.1+1.20.1
rei_version=12.0.634
fabric_loader_version=0.15.0
fabric_api_version=0.91.0+1.20.1
rei_version=12.0.674
#rei_comp_version=9.0.16
forge_version=47.1.76
forge_version=47.1.81
#forge_bookshelf_version=11.0.3
#forge_gamestages_version=7.+
#emendatus_enigmatica_file=3510459
jei_version=15.2.0.23
jei_version=15.2.0.27
mixin_extras=0.2.0-rc.2

0 comments on commit 4bbb7b3

Please sign in to comment.