mirror of
https://github.com/AlmostReliable/almostunified.git
synced 2024-11-14 11:15:23 -05:00
Compare commits
2 commits
0d41ce5184
...
09c6b9895c
Author | SHA1 | Date | |
---|---|---|---|
|
09c6b9895c | ||
|
ba06760073 |
4 changed files with 11 additions and 5 deletions
|
@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
||||||
## Unreleased
|
## Unreleased
|
||||||
- /
|
- /
|
||||||
|
|
||||||
|
## [1.2.2] - 2024-10-23
|
||||||
|
|
||||||
|
- fixed crash on empty recipe JSONs
|
||||||
|
|
||||||
## [1.2.1] - 2024-10-22
|
## [1.2.1] - 2024-10-22
|
||||||
|
|
||||||
- added logging for cases where items are assigned to multiple unification tags
|
- added logging for cases where items are assigned to multiple unification tags
|
||||||
|
@ -40,6 +44,7 @@ All notable changes to this project will be documented in this file.
|
||||||
Initial 1.21.1 port.
|
Initial 1.21.1 port.
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
|
[1.2.2]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.2.2
|
||||||
[1.2.1]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.2.1
|
[1.2.1]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.2.1
|
||||||
[1.2.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.2.0
|
[1.2.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.2.0
|
||||||
[1.1.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.1.0
|
[1.1.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.21.1-1.1.0
|
||||||
|
|
|
@ -32,13 +32,13 @@ public final class RecipeLink implements RecipeData {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static RecipeLink of(ResourceLocation id, JsonObject originalRecipe) {
|
public static RecipeLink of(ResourceLocation id, JsonObject originalRecipe) {
|
||||||
ResourceLocation type = ResourceLocation.tryParse(originalRecipe.get("type").getAsString());
|
try {
|
||||||
if (type == null) {
|
ResourceLocation type = ResourceLocation.parse(originalRecipe.get("type").getAsString());
|
||||||
|
return new RecipeLink(id, originalRecipe, type);
|
||||||
|
} catch (Exception e) {
|
||||||
AlmostUnifiedCommon.LOGGER.warn("Could not detect recipe type for recipe '{}', skipping.", id);
|
AlmostUnifiedCommon.LOGGER.warn("Could not detect recipe type for recipe '{}', skipping.", id);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new RecipeLink(id, originalRecipe, type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RecipeLink ofOrThrow(ResourceLocation id, JsonObject originalRecipe) {
|
public static RecipeLink ofOrThrow(ResourceLocation id, JsonObject originalRecipe) {
|
||||||
|
|
|
@ -112,6 +112,7 @@ public class RecipeTransformer {
|
||||||
return recipes
|
return recipes
|
||||||
.entrySet()
|
.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
|
.filter(entry -> entry.getValue() instanceof JsonObject jsonObject && !jsonObject.isEmpty())
|
||||||
.map(entry -> RecipeLink.of(entry.getKey(), entry.getValue().getAsJsonObject()))
|
.map(entry -> RecipeLink.of(entry.getKey(), entry.getValue().getAsJsonObject()))
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.sorted(Comparator.comparing(entry -> entry.getId().toString()))
|
.sorted(Comparator.comparing(entry -> entry.getId().toString()))
|
||||||
|
|
|
@ -8,7 +8,7 @@ enableAccessWidener = false
|
||||||
minecraftVersion = 1.21.1
|
minecraftVersion = 1.21.1
|
||||||
|
|
||||||
# Mod
|
# Mod
|
||||||
modVersion = 1.2.1
|
modVersion = 1.2.2
|
||||||
modPackage = com.almostreliable.unified
|
modPackage = com.almostreliable.unified
|
||||||
modId = almostunified
|
modId = almostunified
|
||||||
modName = AlmostUnified
|
modName = AlmostUnified
|
||||||
|
|
Loading…
Reference in a new issue