mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-17 11:15:07 +00:00
Chisel item refactor.
Add chisel slot to autochisel. Refactor slot tooltip and valid items.
This commit is contained in:
1 parent
9202778b4d
commit
71e839831f
21 files changed
+288
-318
No files matched your search
@@ -13,48 +13,69 @@ public class Configurations {
|
||||
public static Configuration config;
|
||||
|
||||
public static boolean configExists;
|
||||
public static boolean oldPillars;
|
||||
public static boolean disableCTM;
|
||||
public static boolean blockDescriptions;
|
||||
|
||||
public static double concreteVelocity;
|
||||
public static boolean ghostCloud;
|
||||
public static boolean chiselStoneToCobbleBricks;
|
||||
public static int factoryBlockAmount;
|
||||
public static boolean allowMossy;
|
||||
public static boolean chiselRecipe;
|
||||
public static boolean autoChisel;
|
||||
public static boolean fancy;
|
||||
public static boolean enableFMP;
|
||||
public static boolean chiselStoneToCobbleBricks;
|
||||
|
||||
public static int factoryBlockAmount;
|
||||
public static int particlesTickrate;
|
||||
public static int marbleAmount;
|
||||
public static int limestoneAmount;
|
||||
public static int graniteAmount;
|
||||
public static int dioriteAmount;
|
||||
public static int andesiteAmount;
|
||||
|
||||
public static double concreteVelocity;
|
||||
public static int particlesTickrate;
|
||||
public static boolean oldPillars;
|
||||
public static boolean disableCTM;
|
||||
public static boolean fancy;
|
||||
public static boolean blockDescriptions;
|
||||
|
||||
public static boolean allowChiselDamage;
|
||||
public static int ironChiselMaxDamage;
|
||||
public static int diamondChiselMaxDamage;
|
||||
|
||||
public static boolean refreshConfig() {
|
||||
concreteVelocity = config.get("general", "concreteVelocity", 0.45,
|
||||
|
||||
String category;
|
||||
|
||||
/* general */
|
||||
category = "general";
|
||||
concreteVelocity = config.get(category, "concreteVelocity", 0.45,
|
||||
"Traversing concrete roads, players will acceleration to this velocity. For reference, normal running speed is about 0.28. Set to 0 to disable acceleration.").getDouble(0.45);
|
||||
particlesTickrate = config.get("client", "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1);
|
||||
oldPillars = config.get("client", "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false);
|
||||
disableCTM = !config.get("client", "connectedTextures", true, "Enable connected textures").getBoolean(true);
|
||||
fancy = config.get("client", "fancyLeaves", true, "Enable fancy textures").getBoolean(true);
|
||||
blockDescriptions = config.get("client", "tooltipsUseBlockDescriptions", true, "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.")
|
||||
ghostCloud = config.get(category, "doesCloudRenderLikeGhost", true).getBoolean(true);
|
||||
factoryBlockAmount = config.get(category, "amountYouGetFromFactoryBlockCrafting", 32).getInt(32);
|
||||
allowMossy = config.get(category, "allowCobbleToMossyInChisel", true).getBoolean(true);
|
||||
chiselRecipe = config.get(category, "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false);
|
||||
enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP").getBoolean(true);
|
||||
chiselStoneToCobbleBricks = config.get(category, "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false);
|
||||
|
||||
/* worldgen */
|
||||
category = "worldgen";
|
||||
marbleAmount = config.get(category, "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none").getInt(7);
|
||||
limestoneAmount = config.get(category, "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none").getInt(8);
|
||||
graniteAmount = config.get(category, "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.").getInt(8);
|
||||
dioriteAmount = config.get(category, "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.").getInt(8);
|
||||
andesiteAmount = config.get(category, "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.").getInt(8);
|
||||
|
||||
/* client */
|
||||
category = "client";
|
||||
particlesTickrate = config.get(category, "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1);
|
||||
oldPillars = config.get(category, "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false);
|
||||
disableCTM = !config.get(category, "connectedTextures", true, "Enable connected textures").getBoolean(true);
|
||||
fancy = config.get(category, "fancyLeaves", true, "Enable fancy textures").getBoolean(true);
|
||||
blockDescriptions = config.get(category, "tooltipsUseBlockDescriptions", true, "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.")
|
||||
.getBoolean(true);
|
||||
ghostCloud = config.get("general", "doesCloudRenderLikeGhost", true).getBoolean(true);
|
||||
factoryBlockAmount = config.get("general", "amountYouGetFromFactoryBlockCrafting", 32).getInt(32);
|
||||
allowMossy = config.get("general", "allowCobbleToMossyInChisel", true).getBoolean(true);
|
||||
marbleAmount = config.get("worldgen", "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none").getInt(7);
|
||||
limestoneAmount = config.get("worldgen", "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none").getInt(8);
|
||||
graniteAmount = config.get("worldgen", "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.").getInt(8);
|
||||
dioriteAmount = config.get("worldgen", "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.").getInt(8);
|
||||
andesiteAmount = config.get("worldgen", "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.").getInt(8);
|
||||
chiselRecipe = config.get("general", "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false);
|
||||
autoChisel = config.get("general", "autoChisel", true, "Should people be allowed to use the auto chisel").getBoolean(true);
|
||||
enableFMP = config.get("general", "enableFMP", true, "Do you want to enable FMP").getBoolean(true);
|
||||
chiselStoneToCobbleBricks = config.get("general", "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false);
|
||||
|
||||
/* chisel */
|
||||
|
||||
category = "chisel";
|
||||
allowChiselDamage = config.get(category, "allowChiselDamage", true, "Should the chisel be damageable and take damage when it chisels something.").getBoolean();
|
||||
ironChiselMaxDamage = config.get(category, "ironChiselMaxDamage", 500, "The max damage of the standard iron chisel. Default: 500.").getInt();
|
||||
diamondChiselMaxDamage = config.get(category, "diamondChiselMaxDamage", 5000, "The max damage of the diamond chisel. Default: 5000").getInt();
|
||||
|
||||
if (config.hasChanged()) {
|
||||
config.save();
|
||||
@@ -65,21 +86,23 @@ public class Configurations {
|
||||
public static boolean featureEnabled(Features feature) {
|
||||
return config.get("features", featureName(feature), true).getBoolean(true) && refreshConfig();
|
||||
}
|
||||
|
||||
|
||||
// this makes the old camelCase names from the new CONSTANT_CASE names
|
||||
private static String featureName (Features feature) {
|
||||
private static String featureName(Features feature) {
|
||||
String[] words = feature.name().toLowerCase(Locale.ENGLISH).split("_");
|
||||
if (words.length == 1) {
|
||||
return words[0];
|
||||
}
|
||||
|
||||
|
||||
String ret = words[0];
|
||||
for (int i = 1; i < words.length; i++) {
|
||||
ret += StringUtils.capitalize(words[i]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public static boolean featureEnabled(String feature) {return false;}
|
||||
public static boolean featureEnabled(String feature) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user