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

Add modded Block/Item/Entity Stats #398

Merged
merged 27 commits into from
Sep 18, 2024
Merged

Add modded Block/Item/Entity Stats #398

merged 27 commits into from
Sep 18, 2024

Conversation

glowredman
Copy link
Member

Block/Items stats are registered by injecting in the GameRegistry methods which register them. Entity stats are registered when the server started. The stat arrays for blocks/items are remapped when the block/item ids change.
Note: block/item stats may not work depending on how the mods override certain functions. This affects craft stats the most.

2024-07-26_16 20 29
2024-07-26_16 20 31
2024-07-26_16 20 33

Other changes:

  • Move Mixins for FML into their own package
  • Use @WrapWithCondition v2
  • Address some warnings regarding generics
  • Sort Entity stats lexicographically (can be disabled in the config)

@glowredman glowredman requested a review from a team July 26, 2024 14:21
@Caedis
Copy link
Member

Caedis commented Jul 28, 2024

How are you handling if a mod manually adds their items to the stat list?

@Caedis
Copy link
Member

Caedis commented Jul 29, 2024

Needs error checking
image

Copy link
Member

@Caedis Caedis left a comment

Choose a reason for hiding this comment

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

Was not tested in full pack; needs error handling

@glowredman
Copy link
Member Author

@Caedis Item/Block stats are registered during GameRegistry.registerItem() / GameRegistry.registerBlock(), so if another mod adds stats for some items/blocks, it will override those added by HP. The stat IDs will most likely be different.
Entity stats are added on FMLServerStartedEvent, so other mods most likely have added their stats by then. HP respects that and won't add duplicate stats. An exception is NEI, which adds spawn eggs for Snowmen and Iron Golems. It does so after that event. I added a mod check to suppress NEI's behaviour when HP is loaded and the tweak is enabled.

@glowredman glowredman requested a review from Caedis July 30, 2024 20:35
@Dream-Master Dream-Master requested a review from a team August 4, 2024 12:30
@Pxx500
Copy link
Member

Pxx500 commented Aug 10, 2024

Error while changing from MP to SP (nightly 582)
image

@Dream-Master
Copy link
Member

If no one approve this very soon I will merge it. It’s on zeta for a while and I get no negative feedback.

@Dream-Master
Copy link
Member

@Caedis it is on zeta formore than 4 weeks. So it is tested in full pack

@glowredman glowredman merged commit a542334 into master Sep 18, 2024
1 check passed
@glowredman glowredman deleted the stats branch September 18, 2024 22:00
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.

5 participants