forked from raymondbh/TFC-Additions
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
120 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ minecraft { | |
runDir = "" | ||
} | ||
} | ||
|
||
configurations { | ||
shade | ||
compile.extendsFrom shade | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.rbh.tfcadditions.Config; | ||
|
||
import cpw.mods.fml.client.config.GuiConfig; | ||
import cpw.mods.fml.client.config.IConfigElement; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraftforge.common.config.ConfigElement; | ||
import org.rbh.tfcadditions.Handlers.ConfigHandler; | ||
import org.rbh.tfcadditions.Reference.Reference; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
|
||
/** | ||
* Created by raymondbh on 08.06.2016. | ||
*/ | ||
public class ConfigGUI extends GuiConfig { | ||
|
||
public ConfigGUI(GuiScreen parentScreen) { | ||
super(parentScreen, getConfigElements(), Reference.ModID, false, false, Reference.ModName); | ||
} | ||
|
||
private static List<IConfigElement> getConfigElements() { | ||
|
||
List<IConfigElement> configElementsList = new ArrayList<IConfigElement>(); | ||
for (String catName : ConfigHandler.config.getCategoryNames() ) { | ||
if ( catName.contains(".")) continue; | ||
configElementsList.add(new ConfigElement(ConfigHandler.config.getCategory(catName))); | ||
} | ||
return configElementsList; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.rbh.tfcadditions.Config; | ||
|
||
import cpw.mods.fml.client.IModGuiFactory; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiScreen; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* Created by raymondbh on 08.06.2016. | ||
*/ | ||
public class GUIFactory implements IModGuiFactory { | ||
|
||
@Override | ||
public void initialize(Minecraft minecraftInstance) { | ||
|
||
} | ||
|
||
@Override | ||
public Class<? extends GuiScreen> mainConfigGuiClass() { | ||
return ConfigGUI.class; | ||
} | ||
|
||
@Override | ||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { | ||
return null; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/org/rbh/tfcadditions/Handlers/ConfigHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.rbh.tfcadditions.Handlers; | ||
|
||
import cpw.mods.fml.common.event.FMLPreInitializationEvent; | ||
import net.minecraftforge.common.config.Configuration; | ||
|
||
/** | ||
* Created by raymondbh on 08.06.2016. | ||
*/ | ||
public class ConfigHandler { | ||
|
||
public static final String GENERAL = "General"; | ||
public static Configuration config; | ||
|
||
public static boolean HideNEI = false; | ||
|
||
public static void preInit(FMLPreInitializationEvent event) { | ||
|
||
config = new Configuration(event.getSuggestedConfigurationFile()); | ||
config.load(); | ||
|
||
loadGeneralConfig(); | ||
} | ||
|
||
public static void loadGeneralConfig() { | ||
|
||
HideNEI = config.getBoolean("HideNEIVanilla", GENERAL, false, "This will hide vanilla blocks not used by TFC in NEI."); | ||
|
||
if(config.hasChanged()) config.save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters