Java Code Examples for net.minecraftforge.common.config.Property#setComment()
The following examples show how to use
net.minecraftforge.common.config.Property#setComment() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PLConfig.java From Production-Line with MIT License | 6 votes |
public static void init(File configFile) { instance = new PLConfig(configFile); if (!configFile.exists()) { gtiLogger.log(Level.ERROR, "Cannot create ProductionLine config file"); gtiLogger.log(Level.INFO, "Skipping config load"); } else { instance.load(); Property throwableUran238 = instance.get(CATEGORY_GENERAL, "ThrowableUran238", true); throwableUran238.setComment("Allow throw uranium 238, was hit after the radiation effect"); instance.throwableUran238 = throwableUran238.getBoolean(); Property throwablePackagedSalt = instance.get(CATEGORY_GENERAL, "ThrowablePackagedSalt", true); throwablePackagedSalt.setComment("Allow throw uranium 238, was hit after the salty effect"); instance.throwablePackagedSalt = throwablePackagedSalt.getBoolean(); instance.explosiveFurnace = instance.get(CATEGORY_GENERAL, "ExplosiveFurnace", true).getBoolean(); instance.save(); } gtiLogger.log(Level.INFO, "ProductionLine config loaded"); }
Example 2
Source File: TFCOptions.java From TFC2 with GNU General Public License v3.0 | 6 votes |
public static boolean getBooleanFor(Configuration config,String heading, String item, boolean value, String comment) { if (config == null) return value; try { Property prop = config.get(heading, item, value); prop.setComment(comment); return prop.getBoolean(value); } catch (Exception e) { System.out.println("[TFC2] Error while trying to add Integer, config wasn't loaded properly!"); } return value; }
Example 3
Source File: TFCOptions.java From TFC2 with GNU General Public License v3.0 | 6 votes |
public static int getIntFor(Configuration config,String heading, String item, int value, String comment) { if (config == null) return value; try { Property prop = config.get(heading, item, value); prop.setComment(comment); return prop.getInt(value); } catch (Exception e) { System.out.println("[TFC2] Error while trying to add Integer, config wasn't loaded properly!"); } return value; }
Example 4
Source File: TFCOptions.java From TFC2 with GNU General Public License v3.0 | 6 votes |
public static double getDoubleFor(Configuration config,String heading, String item, double value, String comment) { if (config == null) return value; try { Property prop = config.get(heading, item, value); prop.setComment(comment); return prop.getDouble(value); } catch (Exception e) { System.out.println("[TFC2] Error while trying to add Double, config wasn't loaded properly!"); } return value; }
Example 5
Source File: Config.java From Levels with GNU General Public License v2.0 | 5 votes |
private static void syncMain() { String category = "main"; List<String> propOrder = Lists.newArrayList(); Property prop; /* * Experience */ prop = main.get(category, "maxLevel", maxLevel); prop.setComment("Determines the max level of weapons and armor."); maxLevel = prop.getDouble(); propOrder.add(prop.getName()); prop = main.get(category, "experienceExponent", expExponent); prop.setComment("Sets the exponent of the experience algorithm."); expExponent = prop.getDouble(); propOrder.add(prop.getName()); prop = main.get(category, "experienceMultiplier", expMultiplier); prop.setComment("Sets the multiplier of the experience algorithm."); expMultiplier = prop.getInt(); propOrder.add(prop.getName()); /* * Miscellaneous */ prop = main.get(category, "itemBlacklist", itemBlacklist); prop.setComment("Items in this blacklist will not gain the leveling systems. Useful for very powerful items or potential conflicts. Style should be 'modid:item'"); itemBlacklist = prop.getStringList(); propOrder.add(prop.getName()); prop = main.get(category, "unlimitedDurability", unlimitedDurability); prop.setComment("Determines whether or not weapons and armor will lose durability."); unlimitedDurability = prop.getBoolean(); propOrder.add(prop.getName()); main.setCategoryPropertyOrder(category, propOrder); main.save(); }
Example 6
Source File: TFCOptions.java From TFC2 with GNU General Public License v3.0 | 5 votes |
public static String getStringFor(Configuration config, String heading, String item, String value, String comment) { if (config == null) return value; try { Property prop = config.get(heading, item, value); prop.setComment(comment); return prop.getString(); } catch (Exception e) { System.out.println("[TFC2] Error while trying to add String, config wasn't loaded properly!"); } return value; }
Example 7
Source File: ConfigReader.java From enderutilities with GNU Lesser General Public License v3.0 | 4 votes |
private static void loadConfigItemControl(Configuration conf) { Property prop; currentCategory = "DisableBlocks"; currentRequiresMcRestart = true; conf.addCustomCategoryComment(currentCategory, "Completely disable blocks (don't register them to the game.)\n" + "Note that machines are grouped together and identified by the meta value. You can't disable just a specific meta value."); // Block disable Configs.disableBlockASU = getProp("disableBlockAdjustableStorageUnit", false).getBoolean(); Configs.disableBlockBarrel = getProp("disableBlockBarrel", false).getBoolean(); Configs.disableBlockDrawbridge = getProp("disableBlockDrawbridge", false).getBoolean(); Configs.disableBlockEnderElevator = getProp("disableBlockEnderElevator", false).getBoolean(); Configs.disableBlockFloor = getProp("disableBlockFloor", false).getBoolean(); Configs.disableBlockInserter = getProp("disableBlockInserter", false).getBoolean(); Configs.disableBlockMolecularExciter = getProp("disableBlockMolecularExciter", false).getBoolean(); Configs.disableBlockPhasing = getProp("disableBlockPhasing", false).getBoolean(); Configs.disableBlockPortal = getProp("disableBlockPortal", false).getBoolean(); Configs.disableBlockPortalFrame = getProp("disableBlockPortalFrame", false).getBoolean(); Configs.disableBlockPortalPanel = getProp("disableBlockPortalPanel", false).getBoolean(); Configs.disableBlockSoundBlock = getProp("disableBlockSoundBlock", false).getBoolean(); prop = getProp("disableBlockEnergyBridge", false); prop.setComment("Meta values: 0 = Energy Bridge Resonator; 1 = Energy Bridge Receiver; 2 = Energy Bridge Transmitter"); Configs.disableBlockEnergyBridge = prop.getBoolean(); prop = getProp("disableBlockMachine_0", false); prop.setComment("Info: Machine_0 meta values: 0 = Ender Furnace"); Configs.disableBlockMachine_0 = prop.getBoolean(); prop = getProp("disableBlockMachine_1", false); prop.setComment("Info: Machine_1 meta values: 0 = Ender Infuser; 1 = Tool Workstation, 2 = Creation Station"); Configs.disableBlockMachine_1 = prop.getBoolean(); prop = getProp("disableBlockStorage_0", false); prop.setComment("Meta values: 0..2 = Memory Chests, 3..6 = Handy Chests, 7 = Junk Storage Unit"); Configs.disableBlockStorage_0 = prop.getBoolean(); prop = getProp("disableBlockMassiveStorageUnit", false); prop.setComment("Meta values: 0 = Massive Storage Unit, 1 = Massive Storage Bundle"); Configs.disableBlockMSU = prop.getBoolean(); currentCategory = "DisableItems"; conf.addCustomCategoryComment(currentCategory, "Completely disable items (don't register them to the game.)\n" + "Note that some items are grouped together using the damage value (and/or NBT data) to identify them.\n" + "You can't disable a specific damage value only (so that existing items would vanish)."); // Item disable Configs.disableItemCraftingPart = getProp("disableItemCraftingPart", false).getBoolean(); Configs.disableItemEnderCapacitor = getProp("disableItemEnderCapacitor", false).getBoolean(); Configs.disableItemLinkCrystal = getProp("disableItemLinkCrystal", false).getBoolean(); Configs.disableItemBuildersWand = getProp("disableItemBuildersWand", false).getBoolean(); Configs.disableItemEnderArrow = getProp("disableItemEnderArrow", false).getBoolean(); Configs.disableItemEnderBag = getProp("disableItemEnderBag", false).getBoolean(); Configs.disableItemEnderBow = getProp("disableItemEnderBow", false).getBoolean(); Configs.disableItemEnderBucket = getProp("disableItemEnderBucket", false).getBoolean(); Configs.disableItemEnderLasso = getProp("disableItemEnderLasso", false).getBoolean(); Configs.disableItemEnderPearl = getProp("disableItemEnderPearl", false).getBoolean(); Configs.disableItemEnderPorter = getProp("disableItemEnderPorter", false).getBoolean(); Configs.disableItemEnderSword = getProp("disableItemEnderSword", false).getBoolean(); Configs.disableItemEnderTools = getProp("disableItemEnderTools", false).getBoolean(); Configs.disableItemHandyBag = getProp("disableItemHandyBag", false).getBoolean(); Configs.disableItemIceMelter = getProp("disableItemIceMelter", false).getBoolean(); Configs.disableItemInventorySwapper = getProp("disableItemInventorySwapper", false).getBoolean(); Configs.disableItemLivingManipulator = getProp("disableItemLivingManipulator", false).getBoolean(); Configs.disableItemMobHarness = getProp("disableItemMobHarness", false).getBoolean(); Configs.disableItemNullifier = getProp("disableItemNullifier", false).getBoolean(); Configs.disableItemPetContract = getProp("disableItemPetContract", false).getBoolean(); Configs.disableItemPickupManager = getProp("disableItemPickupManager", false).getBoolean(); Configs.disableItemQuickStacker = getProp("disableItemQuickStacker", false).getBoolean(); Configs.disableItemPortalScaler = getProp("disableItemPortalScaler", false).getBoolean(); Configs.disableItemRuler = getProp("disableItemRuler", false).getBoolean(); Configs.disableItemSyringe = getProp("disableItemSyringe", false).getBoolean(); Configs.disableItemVoidPickaxe = getProp("disableItemVoidPickaxe", false).getBoolean(); // Recipe disable currentCategory = "DisableRecipes"; conf.addCustomCategoryComment(currentCategory, "Disable item recipes"); // Blocks Configs.disableRecipeEnderElevator = getProp("disableRecipeEnderElevator", false).getBoolean(); }
Example 8
Source File: ConfigReader.java From enderutilities with GNU Lesser General Public License v3.0 | 4 votes |
private static void loadConfigLists(Configuration conf) { Property prop; currentRequiresMcRestart = false; currentCategory = CATEGORY_LISTS; prop = getProp("dollyBlockBlacklist", new String[0]); prop.setComment("A list of blockstates that are not allowed to be picked up\nby the Dolly (only effective in survival mode!)\n" + "Use a blockstate string, for example:\n'minecraft:gold_block' or 'minecraft:stone[variant=andesite]'.\n" + "A block name without properties will match all states,\nfor example: 'minecraft:stone'\n" + "would match smooth stone and all the granite/andesite/diorite\nvariants that are in the same block."); Configs.dollyBlockBlacklist = prop.getStringList(); prop = getProp("energyBridgeBedrockWhitelist", new String[] { "minecraft:bedrock" }); prop.setComment("A list of blockstates that are valid for the Energy Bridge's Bedrock requirement.\n" + "Use a blockstate string, for example: 'minecraft:gold_block' or 'minecraft:stone[variant=andesite]'.\n" + "A block name without properties will match all states, for example: 'minecraft:stone'\n" + "would match smooth stone and all the granite/andesite/diorite variants that are in the same block."); Configs.energyBridgeBedrockWhitelist = prop.getStringList(); prop = getProp("endDimensions", new String[0]); prop.setComment("A list of dimension IDs that should be considered End dimensions, although they may otherwise not seem like it.\n" + "This is mainly used for the Energy Bridges, to allow the Transmitters to work in custom End dimensions."); Configs.endDimensions = prop.getStringList(); prop = getProp("enderBagListType", "whitelist"); prop.setComment("Target control list type used for Ender Bag. Allowed values: blacklist, whitelist."); Configs.enderBagListTypeIsWhitelist = prop.getString().equalsIgnoreCase("whitelist"); prop = getProp("enderBagBlackList", new String[0]); prop.setComment("Block types the Ender Bag is NOT allowed to (= doesn't properly) work with."); Configs.enderBagBlacklist = prop.getStringList(); prop = getProp("enderBagWhiteList", new String[] { "minecraft:chest", "minecraft:dispenser", "minecraft:dropper", "minecraft:ender_chest", "minecraft:furnace", "minecraft:hopper", "minecraft:trapped_chest" }); prop.setComment("Block types the Ender Bag is allowed to (= should properly) work with. **NOTE** Only some vanilla blocks work properly atm!!"); Configs.enderBagWhitelist = prop.getStringList(); prop = getProp("livingMatterManipulatorListType", "blacklist"); prop.setComment("The list type used for the Living Matter Manipulator. Allowed values: blacklist, whitelist."); Configs.lmmListIsWhitelist = prop.getString().equalsIgnoreCase("whitelist"); prop = getProp("livingMatterManipulatorBlackList", new String[] { "minecraft:ender_dragon", "minecraft:wither" }); prop.setComment("List of entity names the LMM is not allowed to store, if 'livingMatterManipulatorListType' is 'blacklist'."); Configs.lmmBlacklist = prop.getStringList(); prop = getProp("livingMatterManipulatorWhiteList", new String[] {}); prop.setComment("List of entity names the LMM is only allowed to store, if 'livingMatterManipulatorListType' is 'whitelist'."); Configs.lmmWhitelist = prop.getStringList(); prop = getProp("teleportBlackList", new String[] { "minecraft:ender_dragon", "minecraft:ender_crystal", "minecraft:wither" }); prop.setComment("Entities that are not allowed to be teleported using any methods"); Configs.teleportBlacklist = prop.getStringList(); BlackLists.registerDollyBlacklist(Configs.dollyBlockBlacklist); BlackLists.registerEnergyBridgeBedrockWhitelist(Configs.energyBridgeBedrockWhitelist); BlackLists.registerEnderBagLists(Configs.enderBagBlacklist, Configs.enderBagWhitelist); BlackLists.registerTeleportBlacklist(Configs.teleportBlacklist); WorldUtils.setCustomEndDimensions(Configs.endDimensions); }