Jump to content

Server Configuration Problems


Jagm

Recommended Posts

Hello, I've recently been having problems with server sided config files. My mod (Convenient Recipes) creates a config file in the config folder of the server but it doesn't work. The file works fine client side, but when I edit an option in the server config it doesn't do anything.

 

In the pre-initialisation method I am running this:

 

Configuration config = new Configuration(e.getSuggestedConfigurationFile());

config.load();

//Then my configuration options, for example:

allowChainMailCrafting = config.getBoolean("Chain Mail Crafting", "recipes", true, "Allows the crafting of chain mail armour from iron bars.");

config.save();

 

This all works fine in singleplayer but editing the server's config file doesn't do anything. It seems to be dependent on the client's configuration. Please let me know id I'm doing something stupid. Thank you for your consideration.

Link to comment
Share on other sites

My pre-initialisation method:

 

@EventHandler

public static void preInit(FMLPreInitialisationEvent e){}

 

I think the client being unable to see server config thing is my problem. Do you know of any mods with an example of how to pass server configurations to the client properly?

Link to comment
Share on other sites

In the load method

 

if(chainMailCrafting){

GameRegistry.addRecipe(new ItemStack(Items.chainmail_boots), new Object[]{"i i","i i",'i',Blocks.iron_bars});

GameRegistry.addRecipe(new ItemStack(Items.chainmail_leggings), new Object[]{"iii","i i","i i",'i',Blocks.iron_bars});

GameRegistry.addRecipe(new ItemStack(Items.chainmail_chestplate), new Object[]{"i i","iii","iii",'i',Blocks.iron_bars});

GameRegistry.addRecipe(new ItemStack(Items.chainmail_helmet), new Object[]{"iii","i i",'i',Blocks.iron_bars});

}

 

Why should that matter?

Link to comment
Share on other sites

Situation:

Client has config with TRUE. Server has FALSE.

You log in on server - client will have recipe, server won't.

 

Try crafting item - it will most likely appear in crafting result but pulling it out will not work.

 

To pass this problem you can use packets that will synchronize value on client once he has logged in, then make new IRecipe that will always ask if the result can be crafted (depending on this boolean).

Otherwise you will be left with client-side void-recipy that will not work, yet be visible.

 

EDIT:

This might have been the dumbest thing I wrote on forums in a long while - please correct me if I am wrong: Are recipes both-sided (like blocks)? If they are server-sided (result from server) then everything above is false.

 

EDIT 2: In case my statement was right:

You should never make registration depend on config. Rather make booleans that will be checked in runtime. E.g: Server has recipe, but client didn't register it. What now?

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Situation:

Client has config with TRUE. Server has FALSE.

You log in on server - client will have recipe, server won't.

 

Try crafting item - it will most likely appear in crafting result but pulling it out will not work.

 

To pass this problem you can use packets that will synchronize value on client once he has logged in, then make new IRecipe that will always ask if the result can be crafted (depending on this boolean).

Otherwise you will be left with client-side void-recipy that will not work, yet be visible.

 

EDIT:

This might have been the dumbest thing I wrote on forums in a long while - please correct me if I am wrong: Are recipes both-sided (like blocks)? If they are server-sided (result from server) then everything above is false.

 

EDIT 2: In case my statement was right:

You should never make registration depend on config. Rather make booleans that will be checked in runtime. E.g: Server has recipe, but client didn't register it. What now?

 

If you're going to do this, I would suggest just removing client side configs entirely and depend solely upon server side configs since singleplayer runs it's own server, causing two sets of configs to be necessary.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello, Im beginning to learn how to mod with forge, I previously was messing around with spigot but wanted to switch from plugins to full fledged modding. I'm trying to make a recipe for turning a block into charcoal   ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.CHARCOAL_BLOCK_ITEM.get()) .pattern("CCC") .pattern("CCC") .pattern("CCC") .define('C', Items.CHARCOAL) .unlockedBy(getHasName(Items.CHARCOAL), has(Items.CHARCOAL)) .save(pRecipeOutput); This is under an Override build Recipes class and registered with data gen However I get this error that I don't understand the reason behind why I'm getting it   This removes the normal recipe of smelting any wood log into charcoal, but my custom recipe is there and works Any help with the proper way of doing this and solving this issue is appreciated ps: Is the only way to make recipes with forge is through Minecraft's datapack system?? Am I to belive that Spigot has a better implementation of custom recipes then Forge, a Mod API??
    • You need to override the burn time of the corresponding BlockItem, like with this code to register a block that can be used as fuel:   private static <T extends Block> RegistryObject<Item> registerFuelBlockItem(String name, RegistryObject<T> block, int burnTime) { return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties()) { @Override public int getBurnTime(ItemStack itemStack, @Nullable RecipeType<?> recipeType) { return burnTime; } }); }  
    • Can you post your recipe generation class? You might have forgotten to add the advancement trigger, that part is a bit tricky.
    • https://mclo.gs/YHcp6d1 Got rid of a few of the mods that needed that version of gecko lib and now... 
    • It is worthy of the world to hear this testimony. I'm here to spread the word about Captain WebGenesis's wonderful deeds. My name is Martin Luther. I lost USD 232,000.00 in a binary investment trading scam and didn't realize it until a few weeks later. The site and services I utilized appeared authentic, and everything appeared legitimate until I emailed them to request a withdrawal of my weekly gains and they did not reply. I looked online for a specialized expert to help me get my money back. After reading countless testimonials about how Fastfund Recovery has assisted numerous con victims in getting their money back from fraudulent investment firms, I decided to give the expert a trial. I contacted Fastfund Recovery and submitted my case to the expert. He assured me that all my lost money would be retrieved and returned to my wallet address. Fastfund Recovery worked on my case, and to my amazement, my lost funds were returned to my wallet within 72 hours. Contact Fastfund Recovery right away to have your lost money returned to you. Contact Info  Tele gram ; Fastfundsrecovery mail ; { Fastfundrecovery8 (AT) Gmail com }  
  • Topics

×
×
  • Create New...

Important Information

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