Jump to content

Recommended Posts

Posted

First, sorry I am still on 1.7.10 I will move on very, very quickly, believe me.

 

Everything seems to work fine on my custom config but it does not really save correctly.  If you change the config once the game is launched the config will not save/ overwrite the config it started with ...meaning you have to actually edit the config file  ..

 

That's probably because it's 1.7.10?

 

package com.glistre.glistremod.lib;

import com.glistre.glistremod.GlistreMod;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraftforge.common.config.Configuration;

public class ConfigurationGlistre {

public static boolean cheapRecipe;
//ore attempt
public static boolean enableWorldGeneration;

//	

//ID attempt
public static int biomeGlistreID;
public static int biomeFreonID;
public static int dimensionId;

public static final boolean CHEAPRECIPE_DEFAULT = false;
public static final String CHEAPRECIPE_NAME = "Enables the cheap recipe for the Silver Sword and Glistering Bread";
public static final boolean WORLDSETTINGS_DEFAULT = true;
public static final String WORLD_SETTINGS = "Allows custom ore to generate in the world.";

public static final String CATEGORY_BIOME = "Change the ID of the Biomes";
public static final String CATEGORY_DIMENSION = "Change the ID of the Dimension";



public static void loadConfig(){
	FMLCommonHandler.instance().bus().register(GlistreMod.instance);
	  
	// recipes
	final String RECIPES = GlistreMod.config.CATEGORY_GENERAL + GlistreMod.config.CATEGORY_SPLITTER + "Recipes";
	GlistreMod.config.addCustomCategoryComment(RECIPES, "Enable or disable recipes");
	cheapRecipe = GlistreMod.config.get(RECIPES, CHEAPRECIPE_NAME, CHEAPRECIPE_DEFAULT).getBoolean(CHEAPRECIPE_DEFAULT);

	// world settings
	final String WORLDGEN = GlistreMod.config.CATEGORY_GENERAL + GlistreMod.config.CATEGORY_SPLITTER + "World Settings";
	GlistreMod.config.addCustomCategoryComment(WORLDGEN, "Enable or disable world settings");
	enableWorldGeneration = GlistreMod.config.get(WORLDGEN, WORLD_SETTINGS, WORLDSETTINGS_DEFAULT).getBoolean(WORLDSETTINGS_DEFAULT);

	final String CATEGORY_BIOME = GlistreMod.config.CATEGORY_GENERAL + GlistreMod.config.CATEGORY_SPLITTER + "Biomes";
	GlistreMod.config.addCustomCategoryComment(CATEGORY_BIOME, "ID of the Biomes");
	biomeGlistreID = GlistreMod.config.get(Configuration.CATEGORY_GENERAL, "Glistering Biome ID", 155).getInt();  
	biomeFreonID = GlistreMod.config.get(Configuration.CATEGORY_GENERAL, "Freon Biome ID", 154).getInt();  

	final String CATEGORY_DIMENSION = GlistreMod.config.CATEGORY_GENERAL + GlistreMod.config.CATEGORY_SPLITTER + "Dimensions";
	GlistreMod.config.addCustomCategoryComment(CATEGORY_DIMENSION, "ID of the Dimension");
	dimensionId = GlistreMod.config.get(Configuration.CATEGORY_GENERAL, "dimensionFreonId", .getInt();  



	if(GlistreMod.config.hasChanged()){

		GlistreMod.config.save();
	}
}

}

Posted

comment this:

 

if(GlistreMod.config.hasChanged()){

 

Because fuck it, if it hasn't changed, save it anyway because who's going to notice.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Thank you, but that did not seem to change anything when I commented it out.

 

My config looks fine when I go into the mod and click on the gui button "config" and appears to change the setting but it never changes anything .  The only time I can change is when I go into the the config file and edit ...

 

Well, this mod is really cool, believe me. ..cannot wait to update it to 1.8 but I have got to finish it up

 

I would really, really, appreciate any help on this

 

Here's the rest of my code ...this is my recipe class:

package com.glistre.glistremod.lib;

import com.glistre.glistremod.GlistreMod;
import com.glistre.glistremod.blocks.BlockRegistry;
import com.glistre.glistremod.items.ItemRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;

public class Recipes {

public static void initShapedRecipes(){
	if(!ConfigurationGlistre.secretRecipe){


    //  SWORD RECIPE  
   	        GameRegistry.addRecipe(new ItemStack(ItemRegistry.SilverSword_1, 1), new Object[]{" X "," X "," S ", 'S', Items.stick,'X', ItemRegistry.SilverIngot_1,});

	}else{


    //  SWORD RECIPE  
   	        GameRegistry.addRecipe(new ItemStack(ItemRegistry.SilverSword_1, 1), new Object[]{" X "," X "," S ", 'S', Items.stick,'X', BlockRegistry.MyBlock_1,});
	}


}
public static void initShapelessRecipes(){
	if(!ConfigurationGlistre.secretRecipe){
	//  GLISTERING BREAD standard RECIPE
         ItemStack glistrebread = new ItemStack(ItemRegistry.GlistreFood_1);        
         GameRegistry.addShapelessRecipe(glistrebread, ItemRegistry.Glistre_Dust, Items.bread);
   	// GLISTRE DUST standard RECIPE
        ItemStack GlistreDust = new ItemStack(ItemRegistry.Glistre_Dust);        
        GameRegistry.addShapelessRecipe(GlistreDust, ItemRegistry.SilverIngot_1, Items.gold_ingot);
	}else{ 
	//   GLISTERING BREAD secret RECIPE
         ItemStack glistrebread = new ItemStack(ItemRegistry.GlistreFood_1);        
         GameRegistry.addShapelessRecipe(glistrebread, Blocks.dirt, Items.bread);
    //   Glistre Sword secret recipe
    	ItemStack enchant = new ItemStack(ItemRegistry.Glistre_Sword);
    	enchant.addEnchantment(Enchantment.fireAspect, 7);
    	GameRegistry.addShapelessRecipe(enchant, Items.bone, Items.golden_apple);
    //   Silver Pickaxe secret recipe
    	ItemStack enchant02 = new ItemStack(ItemRegistry.SilverPickaxe_1);
    	enchant02.addEnchantment(Enchantment.fortune, 11);
    	GameRegistry.addShapelessRecipe(enchant02, Items.bone, Items.quartz);


	}

}

public static void initSmeltingRecipes(){
   	// SMELTING GLISTRE INGOT RECIPE
        ItemStack GlistreIngot2 = new ItemStack(ItemRegistry.Glistre_Ingot);
        GameRegistry.addSmelting(ItemRegistry.Glistre_Dust, GlistreIngot2, 12.0F);      

}
}

 

And this is in my main class:

/* 	MOD INFO */
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION, guiFactory = "com.glistre.glistremod.lib.GlistreGuiFactory")
//, dependencies = "required-after:Mystcraft"

public class GlistreMod {

/*	PROXY INFO */
@SidedProxy(clientSide = ("com.glistre.glistremod.proxies.ClientProxy"), serverSide = ("com.glistre.glistremod.proxies.CommonProxy"))
public static CommonProxy proxy;

public static Configuration config;

@Mod.Instance(Reference.MOD_ID)	
public static GlistreMod instance;

public static Logger log = FMLLog.getLogger();

GlistreEventHandler handler = new GlistreEventHandler();

@EventHandler	
public void preInit(FMLPreInitializationEvent event) {


FMLCommonHandler.instance().bus().register(handler);
MinecraftForge.EVENT_BUS.register(handler);



proxy.preInit();

config = new Configuration(event.getSuggestedConfigurationFile());
ConfigurationGlistre.loadConfig();

 

I tried this event in both my main class and event class:

@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event){
if(event.modID.equals(Reference.MOD_ID))
//resync configs this is where restart would or not be required
{
	ConfigurationGlistre.loadConfig();
}
}

Posted

I'm not familiar with how Forge's in-game config GUIs function, but it seems to me like calling #loadConfig again would overwrite any changes you may have made from the GUI with the values from the actual file.

 

Speaking of which, GUIs are client-side only, so any config settings that you allow to be configured from there either need to only be used on the client side, OR you need to have a way of getting the new settings to the server so the config file on the server (which may or may not be on the player's computer) can actually save them.

 

Take a look at Battlegear2, for example, specifically their GUI's #onGuiClosed method, and their Config class' #refreshConfig method.

Posted
  On 4/7/2016 at 1:50 AM, coolAlias said:

I'm not familiar with how Forge's in-game config GUIs function, but it seems to me like calling #loadConfig again would overwrite any changes you may have made from the GUI with the values from the actual file.

 

Speaking of which, GUIs are client-side only, so any config settings that you allow to be configured from there either need to only be used on the client side, OR you need to have a way of getting the new settings to the server so the config file on the server (which may or may not be on the player's computer) can actually save them.

 

Take a look at Battlegear2, for example, specifically their GUI's #onGuiClosed method, and their Config class' #refreshConfig method.

 

so in #onConfigChangedEvent  I would not load the Configuration.Glistre?  That is where I have "if config hasChanged ...config.save() ... I would think it would save the change then load the saved config ...

 

I never see an event for onConfigChangedEvent ...nothing ever shows up in the console I add a Systemout.println  it does not seem that any event ever takes place

Posted

looks like I have followed this tutorial to the letter:

 

https://github.com/Minalien/BlogArchive/blob/master/ForgeTutorials/Spotlight__Config_GUIs.md

 

... everything appears to work but it does not .. the config is created at the default and you can change in the config setting in Minecraft via the config button then change in the gui screen but the config never changes

 

it's always the default

 

Is it possible that this does not work in 1.7.10 version 10.13.4.14.92? 

  that is what I am using

 

Posted

SOLVED!!!!

 

My Reference.MOD_NAME  in the Config GUI class does not work

 

I should have used Reference.MOD_ID

 

!! Amazing and frustrating at the same time

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

    • Verified users can now unlock a $100 OFF Temu Coupon Code using the verified promo code [ALF401700]. This Temu $100 OFF code works for both new and existing customers and can be used to redeem up to 50% off your next order. Our exclusive Temu coupon code [ALF401700] delivers a flat $100 OFF on top of existing deals. First-time customers using code ALF401700 can save an extra 100% off select items. Returning users also qualify for an automatic $100 OFF discount just by applying this code at checkout. But wait—there’s more. With our Temu coupon codes for 2025, users can score up to 90% OFF on clearance items. Whether you’re shopping in the USA, Canada, UK, or elsewhere, Temu promo code ALF401700 unlocks extra discounts tailored to your account. Some users are saving 100% on items using this 2025 Temu promo code. 🔥 Temu Coupon Highlights Using Code [ALF401700]: Temu new user code – ALF401700: Save 50% off your first order + $100 OFF. Temu promo for existing customers – ALF401700: Enjoy flat $100 OFF instantly. Global availability: Works in the USA, UK, Canada, Germany, France, Japan, Chile, Colombia, Malaysia, Mexico, South Korea, Philippines, Saudi Arabia, Qatar, Pakistan, and more. Top 2025 Coupon Deal: Get $200 OFF plus 100% bonus discounts using code ALF401700. Top-Ranked Temu Deals for 2025 (Coupon Code: ALF401700): ✅ Temu $100 OFF Memorial Day Sale — Use ALF401700 ✅ Temu First Order Coupon — Use ALF401700 for 50% + $100 OFF ✅ Temu USA Coupon Code — Save $100 instantly with ALF401700 ✅ Temu Japan, Germany, Chile Codes — All support ALF401700 ✅ Temu Reddit Discount – $100 OFF: Valid for both new and old users ✅ Temu Coupon Bundle 2025 — $100 OFF + up to 50% slash ✅ 100% OFF Free Gift Code — Use ALF401700, no invite needed ✅ Temu Sign-Up Bonus Promo — Get a welcome $100 OFF instantly ✅ Free Temu Code for New Users — Use ALF401700, no referral required  Temu Clearance Codes 2025 — Use ALF401700 for 85–100% discounts Why ALF401700 is the Best Temu Code in 2025 Using Temu code ALF401700 is your ticket to massive savings, free shipping, first-order discounts, and stackable coupon bundles. Whether you're browsing electronics, fashion, home goods, or beauty products, this verified Temu discount code offers real savings—up to 90% OFF + $100 OFF on qualified orders. 💡 Pro Tip: Apply ALF401700 during checkout in the Temu app or website to activate your instant $100 discount, even if you’re not a new user. Temu $100 OFF Code by Country (All Use ALF401700): 🇺🇸 Temu USA – ALF401700 🇯🇵 Temu Japan – ALF401700 🇲🇽 Temu Mexico – ALF401700 🇨🇱 Temu Chile – ALF401700 🇨🇴 Temu Colombia – ALF401700 🇲🇾 Temu Malaysia – ALF401700 🇵🇭 Temu Philippines – ALF401700 🇰🇷 Temu Korea – ALF401700 🇵🇰 Temu Pakistan – ALF401700 🇫🇮 Temu Finland – ALF401700 🇸🇦 Temu Saudi Arabia – ALF401700 🇶🇦 Temu Qatar – ALF401700 🇫🇷 Temu France – ALF401700 🇩🇪 Temu Germany – ALF401700 🇮🇱 Temu Israel – ALF401700 Temu Coupon Code [ALF401700] Summary for SEO: Temu $100 OFF Code  Temu First Order Discount Code 2025  Temu Verified Promo Code ALF401700  Temu 50% OFF + $100 Bonus  Temu 100% OFF Code 2025  Temu App Promo ALF401700  Temu Working Discount Code 2025 
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • You can check the config of Geckolib and Mowzie's Mobs - maybe there is a way to disable some render features
    • You can use the .requires() function  the server also has a permission level of 4, which is the highest permission level.
  • Topics

×
×
  • Create New...

Important Information

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