Skip to content

Add client-side recipe loading for servers without recipe sync#2025

Open
keklick1337 wants to merge 2 commits intoshedaniel:18.x-1.21.4from
keklick1337:feature/force-local-recipes
Open

Add client-side recipe loading for servers without recipe sync#2025
keklick1337 wants to merge 2 commits intoshedaniel:18.x-1.21.4from
keklick1337:feature/force-local-recipes

Conversation

@keklick1337
Copy link
Copy Markdown

Summary

Adds a new config option Force Local Recipes (under Filtering category) that loads recipes from client data packs instead of waiting for server recipe sync.

This is useful for multiplayer servers (e.g. 2b2t) that don't send recipe data to clients, causing REI to show no recipes.

Changes

New Config Option

  • Added forceLocalRecipes boolean option to ConfigObject API and ConfigObjectImpl
  • Added UI toggle in AllREIConfigOptions with deferred plugin reload on toggle
  • Added to Filtering category in AllREIConfigGroups

Recipe Loading

  • When enabled on a remote server, loads recipes from client-side vanilla data packs using VanillaServerPackResources and a temporary RecipeManager
  • Stores loaded displays in ServerDisplayRegistryImpl.pendingForceLocalDisplays
  • Injects pending displays into DisplayRegistryImpl.endReload()

Server Sync Blocking

  • DisplaySyncPacket.handle() returns early when enabled on remote servers
  • ClientRecipeUpdateEvent.ADD and .REMOVE are skipped when enabled on remote servers

Recovery & UX

  • ClientGuiEvent.INIT_PRE handler triggers full reload if no reload stages were observed (multiplayer reconnect scenario)
  • Suppresses 'Partial Recipes Data' warning in ImportantWarningsWidget
  • Localized strings in en_us.json with yellow warning about reconnection requirement

Safety

  • All guards include !isLocalServer() check — singleplayer is completely unaffected
  • Plugin reload is deferred via Minecraft.getInstance().execute() to avoid ConcurrentModificationException

Limitations

  • ~63 tag-dependent recipes (bundles, shulker boxes, tool materials) fail to parse due to tags not being loaded in the temporary RecipeManager. 1307/1370 recipes load successfully.
  • Requires reconnecting to the server after toggling the option.

Files Changed

  • ConfigObject.java — added isForceLocalRecipes() interface method
  • ConfigObjectImpl.java — added field and implementation
  • AllREIConfigOptions.java — added FORCE_LOCAL_RECIPES option
  • AllREIConfigGroups.java — added to filtering category
  • RoughlyEnoughItemsCoreClient.java — INIT_PRE handler, event guards
  • DisplaySyncPacket.java — sync blocking guard
  • ServerDisplayRegistryImpl.java — client-side recipe loading
  • DisplayRegistryImpl.java — pending display injection
  • ImportantWarningsWidget.java — warning suppression
  • en_us.json — localization strings

…cipe data

Adds a new config option under Filtering > Force Local Recipes that loads
recipes from client data packs instead of waiting for server recipe sync.

This is useful for multiplayer servers (e.g. 2b2t) that don't send recipe
data to clients, causing REI to show no recipes.

When enabled:
- Blocks server recipe sync packets
- Loads recipes from client-side vanilla data packs
- Injects loaded displays into the client display registry
- Suppresses the 'Partial Recipes' warning

Limitations:
- ~63 tag-dependent recipes may fail to parse (bundles, shulker boxes, etc.)
- Requires reconnecting to the server after toggling the option
- Only activates on remote servers (singleplayer is unaffected)
@keklick1337 keklick1337 changed the title feat: Add Force Local Recipes option for servers that do not send recipe data Add client-side recipe loading for servers without recipe sync Feb 11, 2026
@shedaniel
Copy link
Copy Markdown
Owner

Do you think it is possible to have a temporarily tag manager?

@keklick1337
Copy link
Copy Markdown
Author

Do you think it is possible to have a temporarily tag manager?

No TagManager class exists - tags are loaded via TagLoader in MC 1.12.4
I can load all tags through TagLoader.loadTagsForExistingRegistries(ResourceManager, RegistryAccess), this method loads all tags and returns

@keklick1337
Copy link
Copy Markdown
Author

any updates about my pr?

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