Skip to content
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

Open
wants to merge 11 commits into
base: 1.20.x
Choose a base branch
from
Open

1.20.6 #744

wants to merge 11 commits into from

Conversation

Mrbysco
Copy link
Contributor

@Mrbysco Mrbysco commented Apr 24, 2024

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.

@Mrbysco Mrbysco changed the title 1.20.5 1.20.6 Apr 29, 2024
if (nbtStart > 0) {
nbt = res.substring(nbtStart).replaceAll("([^\\\\])'", "$1\"").replaceAll("\\\\'", "'");
res = res.substring(0, nbtStart);
public static Triple<ResourceLocation, Integer, DataComponentMap> parseItemStackString(String res) {
Copy link
Collaborator

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

Copy link
Contributor Author

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

You can specify components in vanilla results now
@Mrbysco
Copy link
Contributor Author

Mrbysco commented May 3, 2024

As discussed in Discord. The custom book recipe types have been removed since you can specify components in vanilla recipe outputs now.

Copy link
Collaborator

@Minecraftschurli Minecraftschurli left a 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

Comment on lines 70 to 77
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());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. use the patch directly not the map
  2. this method checks for { for the components but the components use [ now

Copy link
Contributor Author

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 😓

Copy link
Contributor Author

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 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants