2021-11-21 23:28:57 -05:00
package baubles.common ;
import java.util.ArrayList ;
import baubles.api.expanded.BaubleExpandedSlots ;
import net.minecraftforge.common.config.Configuration ;
public class BaublesConfig {
public static boolean hideDebugItem = true ;
2023-01-29 00:05:42 -05:00
public static int [] soulBoundEnchantments = new int [] {};
2025-06-09 23:06:10 +02:00
public static boolean useOldGuiButton = false ;
public static boolean useOldGuiRendering = false ;
2021-11-21 23:28:57 -05:00
public static boolean showUnusedSlots = false ;
public static boolean manualSlotSelection = false ;
public static String [] overrideSlotTypes = new String [] {
BaubleExpandedSlots . amuletType ,
BaubleExpandedSlots . ringType ,
BaubleExpandedSlots . ringType ,
BaubleExpandedSlots . beltType
};
static final String categoryDebug = "debug" ;
2023-01-29 00:05:42 -05:00
static final String categoryGeneral = "general" ;
2021-11-21 23:28:57 -05:00
static final String categoryMenu = "menu" ;
2025-06-14 11:16:16 +02:00
static final String categoryClient = "client" ;
2021-11-21 23:28:57 -05:00
static final String categoryOverride = "override" ;
public static void loadConfig ( Configuration config ) {
ArrayList < String > currentlyRegisteredTypes = BaubleExpandedSlots . getCurrentlyRegisteredTypes ();
String [] currentSlotAssignments = BaubleExpandedSlots . getCurrentSlotAssignments ();
//categoryDebug
2021-11-22 16:53:06 -05:00
hideDebugItem = config . getBoolean ( "hideDebugItem" , categoryDebug , hideDebugItem , "Hides the Bauble debug item from the creative menu.\n" );
2021-11-21 23:28:57 -05:00
2023-01-29 00:05:42 -05:00
//categoryGeneral
soulBoundEnchantments = config . get ( categoryGeneral , "soulBoundEnchantments" , soulBoundEnchantments ,
"IDs of enchantments that should be treated as soul bound when on items in a bauble slot."
). getIntList ();
2025-06-14 11:16:16 +02:00
//categoryClient
useOldGuiButton = config . getBoolean ( "useOldGuiButton" , categoryClient , useOldGuiButton , "Use the old Baubles Button texture and location instead.\n" );
useOldGuiRendering = config . getBoolean ( "useOldRendering" , categoryClient , useOldGuiRendering , "Display the old Bauble GUI instead of the new sidebar.\n" );
2021-11-21 23:28:57 -05:00
//categoryMenu
showUnusedSlots = config . getBoolean ( "showUnusedSlots" , categoryMenu , showUnusedSlots , "Display unused Bauble slots.\n" );
2023-01-29 00:05:42 -05:00
manualSlotSelection = config . getBoolean ( "manualSlotSelection" , categoryMenu , manualSlotSelection ,
"Manually override slot assignments.\n!Bauble slot types must be configured manually with this option enabled!\n"
);
2021-11-21 23:28:57 -05:00
//categoryOverride
2023-01-29 00:05:42 -05:00
config . getStringList ( "defualtSlotTypes" , categoryOverride , new String [] {},
"Baubles and its addons assigned the folowing types to the bauble slots.\n!This config option automatically changes to reflect what Baubles and its addons assigned each time the game is launched!"
);
2021-11-21 23:28:57 -05:00
config . getCategory ( categoryOverride ). get ( "defualtSlotTypes" ). set ( currentSlotAssignments );
overrideSlotTypes = config . getStringList ( "slotTypeOverrides" , categoryOverride , overrideSlotTypes ,
"Slot assignments to use if manualSlotSelection is enabled.\nAny assignents after the first " +
BaubleExpandedSlots . slotLimit + " will be ignored.\n!Adding, moving, or removing slots of the "
+ BaubleExpandedSlots . amuletType + ", " + BaubleExpandedSlots . ringType + ", or " + BaubleExpandedSlots . beltType +
2023-01-29 00:05:42 -05:00
" types will reduce compatibility with mods made for original Baubles versions!\n" ,
2021-11-21 23:28:57 -05:00
currentlyRegisteredTypes . toArray ( new String [ currentlyRegisteredTypes . size () ] )
);
2023-01-29 00:05:42 -05:00
2021-11-21 23:28:57 -05:00
if ( manualSlotSelection ) {
BaubleExpandedSlots . overrideSlots ( overrideSlotTypes );
}
if ( config . hasChanged ()) {
config . save ();
}
}
}