Jump to content

[1.16.5] Config file on client side not synced with server config file


MR_Classy

Recommended Posts

that's not how configs work,
there is the client config which is for client things like rendering,
there is the common config which is for everything else like Level generation,
and the server config is for server stuff

the name (type) of the config indicates on which side you can use the config,
so the server config doesn't know about the client config

Link to comment
Share on other sites

Ok, i mightve explained it wrong.
Im trying to create a config for a potions mod, specifically to enable or disable crafting of those potions, so i dont want players changing those values.

However, when i try to remove a recipe server side, the recipe still shows up ingame (the actual potion cant be crafted, but if i use something like JEI to check out how to craft it, the recipe is loaded in).

My understanding was that if something like a recipe gets turned off on the server side, the players shouldnt be able to still see it ingame.


 

Link to comment
Share on other sites

Sorry, im kinda new to this and not 100% sure which part does that.

This is the code i use to initiate the config 
 


       ModLoadingContext.get().registerConfig(Type.SERVER, PnsConfig.SPEC);
        PnsConfig.loadConfig(PnsConfig.SPEC, FMLPaths.CONFIGDIR.get().resolve("potsnstuff-server.toml").toString());

And the actual config class 
https://pastebin.com/BNaTVsjT

Link to comment
Share on other sites

cuz i was trying to find a way to stop the config file from generating in a random order and that was the only way i found how to do it, seemed a bit weird but didnt know how else.
And calling them in the main class

    public PotsNStuff() {
    	IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
        bus.addListener(this::setup);
        ConteinerTypeInit.CONTAINER_TYPES.register(bus);
        ItemInit.ITEMS.register(bus);
        EffectInit.EFFECTS.register(bus);
        RecepiesInit.RECIPE_SERIALIZERS.register(bus);
        PotionInit.POTIONS.register(bus);
        ModLoadingContext.get().registerConfig(Type.SERVER, PnsConfig.SPEC);
        PnsConfig.loadConfig(PnsConfig.SPEC, FMLPaths.CONFIGDIR.get().resolve("potsnstuff-server.toml").toString());
		MinecraftForge.EVENT_BUS.register(this);
    }

 

Link to comment
Share on other sites

 

2 minutes ago, Luis_ST said:

they are normally generate always in the same folder,
client config in: .minecraft/config
common config in: .minecraft/config
server config in: .minecraft/saves/world_name/serverconfig

i ment the variables in the .toml file not being in the order i added them via code

Link to comment
Share on other sites

And I'm aware the server should be the only one aware of what recipes exist, issue is the client also generates its own config instead of getting the info from the server.

On that note, I looked around a bit more and apparently the issue might be that I'm running logical server code on a logical client.

 

Link to comment
Share on other sites

16 minutes ago, diesieben07 said:

This makes no sense. Recipes must be made using JSON files.

You can use a custom IRecipeSerializer if you need specialized recipes.

Potion recipes, as in brewing stand recipe, not crafting table recipe

And for those (as far as I know) you use BrewingRecipeRegistry.addRecipe(base potion, ingredient, resulting potion), No JSON files needed

Edited by MR_Classy
Clarity
Link to comment
Share on other sites

12 minutes ago, diesieben07 said:

In that case you need to always register your recipe (on server and client!) and change its behavior dynamically based on the config file. Use a SERVER type config, which Forge automatically syncs to clients that join the server.

I'm already doing that, both the register part and server config part, it's not syncing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.