Skip to content

[Port] [1.21.10] Port to 1.21.10#41

Draft
Minecraftschurli wants to merge 2 commits intomainfrom
port/1.21.10
Draft

[Port] [1.21.10] Port to 1.21.10#41
Minecraftschurli wants to merge 2 commits intomainfrom
port/1.21.10

Conversation

@Minecraftschurli
Copy link
Contributor

Copy link
Collaborator

@IchHabeHunger54 IchHabeHunger54 left a comment

Choose a reason for hiding this comment

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

Looks good content-wise, some minor nitpicks. Also some code style changes I'd like to see applied:

  • No package-info.javas, they're insanely bloaty without really contributing anything imo.
  • All classes in the datagen should be final.
  • When putting annotations such as @Nullable on a field or method, put it above, don't inline it after the access modifier. I marked this in some places, do it in other places as well. Also applies to e.g. the @Unmodifiable annotation.
  • Why are you using @UnknownNullability? If I understand JSpecify correctly, that annotation shouldn't really be used since it's the default value anyway.
  • Run Optimize Imports on the entire thing after applying all other changes.
    Also, why exactly are we doing feature flags...?

As a sidenote, due to the complexity of the changes and me not yet looking into them, I haven't had a look at the following so far:

  • All BERs
  • The various model changes, including datagen
  • Some parts of the Fancy Crafter and the Printing Table
    I will hopefully get to reviewing them soon.

"dataRuntimeOnly"("curse.maven:blueprint-382216:6449863")
"dataRuntimeOnly"("curse.maven:buzzier-bees-355458:6449894")
}
//if (abnormalsCompat) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't just setting abnormalsCompat to false also work?

copy(BCTags.Blocks.TYPEWRITERS, BCTags.Items.TYPEWRITERS);
tag(BCTags.Items.SEAT_BACKS).addTags(BCTags.Items.SEAT_BACKS_SMALL, BCTags.Items.SEAT_BACKS_RAISED, BCTags.Items.SEAT_BACKS_FLAT, BCTags.Items.SEAT_BACKS_TALL, BCTags.Items.SEAT_BACKS_FANCY);
tag(BCTags.Items.BOOKCASE_BOOKS).addTags(ItemTags.BOOKSHELF_BOOKS, ItemTags.LECTERN_BOOKS)
BCBlockItemTagsProvider.addBlockTags(blockTagKey -> new BlockToItemConverter(this.tag(BlockToItemConverter.blockTagToItemTag(blockTagKey))));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm honestly not a fan of this. If it's not easily possible to copy the block tags, can we maybe just copypaste the block tag gen here and replace Block with Item? This BlockToItemConverter feels overengineered for no reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is copied vanilla code

return new Nested<>(name, k1 -> new GroupedHolder<>(k2 -> prefix.apply(k1, k2), name, (s,k2) -> register.registerBlock(s, p -> factory.apply(k1, k2, p), properties.apply(k1, k2)), keys2), keys1);
}

public static class Nested<K1, K2, R, T extends R> implements GroupingDeferredHolder<R, T> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move to a separate class, there really is no point of an inner class 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.

Except being nicer to read than a single long class name GroupedHolder.Nested > NestedGroupedHolder

@Minecraftschurli
Copy link
Contributor Author

Minecraftschurli commented Feb 28, 2026

No package-info.javas, they're insanely bloaty without really contributing anything imo.

We need to specify a default nullability somehow and we can't use module-info.java yet.

When putting annotations such as @Nullable on a field or method, put it above, don't inline it after the access modifier. I marked this in some places, do it in other places as well. Also applies to e.g. the @Unmodifiable annotation.

Not possible when using JSpecify

Why are you using @UnknownNullability? If I understand JSpecify correctly, that annotation shouldn't really be used since it's the default value anyway.

only if you don't have a package-info.java or module-info.java stating a default nullability (either everything not null or everything nullable) which is to be preferred over unknown by default.

Also, why exactly are we doing feature flags...?

I was experimenting and hiding stuff that I didn't finish behind the flag

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants