MineColonies

MineColonies

53M Downloads

[BUG] CompatibilityManager#discoverAllItems is being called on server side

caelwarner opened this issue ยท 5 comments

commented

Is there an existing issue for this?

  • I have searched the existing issues

Are you using the latest MineColonies Verison?

  • I am running the latest alpha version of MineColonies for my Minecraft version.

Did you check on the Wiki? or ask on Discord?

  • I checked the MineColonies Wiki and made sure my issue is not covered there. Or I was sent from discord to open an issue here.

Minecraft Version

1.19.3

MineColonies Version

1.0.1275-ALPHA

Structurize Version

1.0.484-ALPHA

Related Mods and their Versions

  1. Forge Version: 44.1.21
  2. Create Version: 1.19.3 0.5.0j

Current Behavior

CompatibilityManager#discoverAllItems is getting called on the server side by DataPackSyncEventHandler$ServerEvents#loadRecipes which causes crashes when other mods run client side only code to build their creative mode tabs. The specific incompatibility is with Create.

Expected Behavior

CompatibilityManager#discoverAllItems not be called on the server side.

Reproduction Steps

  1. Install Create & MineColonies
  2. Run server

Logs

https://gist.github.com/Ackar77/9121a3c738ff8e658bc40d2a7c07f35a

Anything else?

The issue on Create's repo Creators-of-Create/Create#4545

commented

This is the only way to get some data, please report to create

commented

This is completely intentional, and ideally Create should fix it on their side. There shouldn't be any particular reason why this method can't be called on server side. (Albeit it's true that it is only called on client side in vanilla.)

Having said that, we could possibly add in something to work around broken code in other mods.

commented

The comment has been removed in the patch above already. ๐Ÿ˜

commented

Alright, I will look into fixing it on Create's side. I originally thought this might be unintentional based off of the comment on CompatibilityManager#discoverAllItems

/**
* Create complete list of all existing items, client side only.
*/
private void discoverAllItems()

commented

Oh, Thats an old comment, it used to be client side only some time back. We should remove that too.
Nowadays we do it both sides so both sides have the same knowledge.