-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.20.6 #744
base: 1.20.x
Are you sure you want to change the base?
1.20.6 #744
Conversation
Xplat/src/main/java/vazkii/patchouli/common/recipe/ShapedBookRecipe.java
Outdated
Show resolved
Hide resolved
Xplat/src/main/java/vazkii/patchouli/common/recipe/ShapelessBookRecipe.java
Outdated
Show resolved
Hide resolved
if (nbtStart > 0) { | ||
nbt = res.substring(nbtStart).replaceAll("([^\\\\])'", "$1\"").replaceAll("\\\\'", "'"); | ||
res = res.substring(0, nbtStart); | ||
public static Triple<ResourceLocation, Integer, DataComponentMap> parseItemStackString(String res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's time for a purpose built record here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, I didn't want to change anything without talking it over first
Xplat/src/main/java/vazkii/patchouli/mixin/AccessorComponentSerializer.java
Outdated
Show resolved
Hide resolved
You can specify components in vanilla results now
As discussed in Discord. The custom book recipe types have been removed since you can specify components in vanilla recipe outputs now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mistakes in the itemstack string format
I suggest using the vanilla path for the item + components section and moving the count to the end
ItemParser.ItemResult result = parser.parse(new StringReader(res.toString() + components)); //TODO: Check if the parsed result is correct | ||
componentMap.addAll(result.components()); | ||
} catch (CommandSyntaxException e) { | ||
throw new RuntimeException("Failed to parse ItemStack JSON", e); | ||
} | ||
} | ||
|
||
return ImmutableTriple.of(key, countn, tag); | ||
return ImmutableTriple.of(key, countn, componentMap.build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- use the patch directly not the map
- this method checks for
{
for the components but the components use[
now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know regex 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably the res.indexOf("{")
isn't it 😓
Initial update to 1.20.6.
I was able to abstract/implement the network message classes into the Xplat source-set.
There's still some TODOs like figuring out what to do with the
nbt
keys from the item related json.