Pulling item ids, etc from the Config file now
This commit is contained in:
parent
d80f370daa
commit
d93b59447e
|
@ -3,9 +3,11 @@ package ee3.core;
|
|||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
|
||||
import static ee3.lib.ItemIds.*;
|
||||
import ee3.lib.Reference;
|
||||
|
||||
import net.minecraft.src.mod_EE3;
|
||||
import static net.minecraft.src.forge.Configuration.*;
|
||||
import net.minecraft.src.forge.Configuration;
|
||||
import net.minecraft.src.forge.Property;
|
||||
|
||||
|
@ -14,6 +16,10 @@ public class ConfigurationManager {
|
|||
private String cfgFile;
|
||||
private static final String CATEGORY_KEYBIND = "keybinds";
|
||||
|
||||
public static boolean AUTO_RESOLVE_IDS;
|
||||
public static boolean ENABLE_SOUNDS;
|
||||
public static boolean ENABLE_PARTICLES;
|
||||
|
||||
public ConfigurationManager(String cfgFile) {
|
||||
this.cfgFile = Reference.CONFIG_DIR + cfgFile;
|
||||
}
|
||||
|
@ -33,8 +39,12 @@ public class ConfigurationManager {
|
|||
Property prop;
|
||||
|
||||
/* General Configs */
|
||||
prop = config.getOrCreateBooleanProperty("autoResolve", Configuration.CATEGORY_GENERAL, false);
|
||||
prop = config.getOrCreateBooleanProperty("enableSounds", Configuration.CATEGORY_GENERAL, true);
|
||||
prop = config.getOrCreateBooleanProperty("autoResolve", CATEGORY_GENERAL, false);
|
||||
AUTO_RESOLVE_IDS = prop.getBoolean(false);
|
||||
prop = config.getOrCreateBooleanProperty("enableSounds", CATEGORY_GENERAL, true);
|
||||
ENABLE_SOUNDS = prop.getBoolean(false);
|
||||
prop = config.getOrCreateBooleanProperty("enableParticles", CATEGORY_GENERAL, true);
|
||||
ENABLE_PARTICLES = prop.getBoolean(false);
|
||||
|
||||
/* Block Ids */
|
||||
prop = config.getOrCreateBlockIdProperty("stone", 175);
|
||||
|
@ -43,11 +53,73 @@ public class ConfigurationManager {
|
|||
prop = config.getOrCreateBlockIdProperty("torch", 178);
|
||||
prop = config.getOrCreateBlockIdProperty("device", 179);
|
||||
|
||||
/* Item Ids */
|
||||
prop = config.getOrCreateIntProperty("imperfectPhilStone", CATEGORY_ITEM, 27270);
|
||||
IMPERFECT_PHIL_STONE = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("philStone", CATEGORY_ITEM, 27271);
|
||||
PHIL_STONE = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("djinnRing", CATEGORY_ITEM, 27272);
|
||||
DJINN_RING = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("eyeOfTheVoid", CATEGORY_ITEM, 27273);
|
||||
EYE_OF_THE_VOID = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("idolOfGaia", CATEGORY_ITEM, 27274);
|
||||
IDOL_OF_GAIA = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("luminator", CATEGORY_ITEM, 27275);
|
||||
LUMINATOR = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("pahisTempest", CATEGORY_ITEM, 27276);
|
||||
PAHIS_TEMPEST = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("hornOfEverflowing", CATEGORY_ITEM, 27277);
|
||||
HORN_OF_EVERFLOWING = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("timelordsPocketWatch", CATEGORY_ITEM, 27278);
|
||||
TIMELORDS_POCKET_WATCH = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("caclinedAsh", CATEGORY_ITEM, 27279);
|
||||
CALCINED_ASH = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("alchemicalCoal", CATEGORY_ITEM, 27280);
|
||||
ALCHEMICAL_COAL = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("mobiusFuel", CATEGORY_ITEM, 27281);
|
||||
MOBIUS_FUEL = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("diviningRod", CATEGORY_ITEM, 27282);
|
||||
DIVINING_ROD = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("panacea", CATEGORY_ITEM, 27283);
|
||||
PANACEA = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("autoMail", CATEGORY_ITEM, 27284);
|
||||
AUTO_MAIL = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("caster", CATEGORY_ITEM, 27285);
|
||||
CASTER = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("projector", CATEGORY_ITEM, 27286);
|
||||
PROJECTOR = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("algot", CATEGORY_ITEM, 27287);
|
||||
ALGOT = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("wolfBoots", CATEGORY_ITEM, 27288);
|
||||
WOLF_BOOTS = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("darkMatter", CATEGORY_ITEM, 27289);
|
||||
DARK_MATTER = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Pickaxe", CATEGORY_ITEM, 27290);
|
||||
DARK_MATTER_PICKAXE = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Shovel", CATEGORY_ITEM, 27291);
|
||||
DARK_MATTER_SHOVEL = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Hoe", CATEGORY_ITEM, 27292);
|
||||
DARK_MATTER_HOE = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Shears", CATEGORY_ITEM, 27292);
|
||||
DARK_MATTER_SHEARS = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Hammer", CATEGORY_ITEM, 27293);
|
||||
DARK_MATTER_HAMMER = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Sword", CATEGORY_ITEM, 27294);
|
||||
DARK_MATTER_SWORD = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Bow", CATEGORY_ITEM, 27295);
|
||||
DARK_MATTER_BOW = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_FishingRod", CATEGORY_ITEM, 27296);
|
||||
DARK_MATTER_FISHING_ROD = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Armor", CATEGORY_ITEM, 27297);
|
||||
DARK_MATTER_ARMOR = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("wardOfXeno", CATEGORY_ITEM, 27297);
|
||||
WARD_OF_XENOPHOBIA = prop.getInt();
|
||||
|
||||
/* Keybinds */
|
||||
prop = config.getOrCreateIntProperty("key.extra", CATEGORY_KEYBIND, 46);
|
||||
prop = config.getOrCreateIntProperty("key.charge", CATEGORY_KEYBIND, 47);
|
||||
prop = config.getOrCreateIntProperty("key.toggle", CATEGORY_KEYBIND, 34);
|
||||
prop = config.getOrCreateIntProperty("key.release", CATEGORY_KEYBIND, 19);
|
||||
prop = config.getOrCreateIntProperty("extra", CATEGORY_KEYBIND, 46);
|
||||
prop = config.getOrCreateIntProperty("charge", CATEGORY_KEYBIND, 47);
|
||||
prop = config.getOrCreateIntProperty("toggle", CATEGORY_KEYBIND, 34);
|
||||
prop = config.getOrCreateIntProperty("release", CATEGORY_KEYBIND, 19);
|
||||
|
||||
/* Write */
|
||||
config.save();
|
||||
|
|
|
@ -3,7 +3,7 @@ package ee3.core;
|
|||
public class EMCMapping {
|
||||
|
||||
private float cost;
|
||||
private float recovery;
|
||||
private float recoveryPercentage;
|
||||
private boolean learnable;
|
||||
private boolean recoverable;
|
||||
|
||||
|
@ -11,14 +11,14 @@ public class EMCMapping {
|
|||
|
||||
public EMCMapping(float cost) {
|
||||
this.cost = cost;
|
||||
recovery = cost;
|
||||
recoveryPercentage = 1.0F;
|
||||
learnable = true;
|
||||
recoverable = true;
|
||||
}
|
||||
|
||||
public EMCMapping(float cost, float recovery, boolean learnable, boolean recoverable) {
|
||||
public EMCMapping(float cost, float recoveryPercentage, boolean learnable, boolean recoverable) {
|
||||
this.cost = cost;
|
||||
this.recovery = recovery;
|
||||
this.recoveryPercentage = recoveryPercentage;
|
||||
this.learnable = learnable;
|
||||
this.recoverable = recoverable;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class EMCMapping {
|
|||
}
|
||||
|
||||
public float getRecoveryEMC() {
|
||||
return recovery;
|
||||
return recoveryPercentage;
|
||||
}
|
||||
|
||||
public boolean isLearnable() {
|
||||
|
@ -43,8 +43,8 @@ public class EMCMapping {
|
|||
this.cost = cost;
|
||||
}
|
||||
|
||||
public void setRecoveryEMC(float recovery) {
|
||||
this.recovery = recovery;
|
||||
public void setRecoveryPercentage(float recoveryPercentage) {
|
||||
this.recoveryPercentage = recoveryPercentage;
|
||||
}
|
||||
|
||||
public void setLearnable(boolean learnable) {
|
||||
|
|
|
@ -34,7 +34,7 @@ public class RecipesPhilStone {
|
|||
public static void initRecipes() {
|
||||
//determineBaseMaterials();
|
||||
initTransmutationRecipes();
|
||||
initEquivalencyRecipes();
|
||||
initEquivalenceRecipes();
|
||||
initReconstructiveRecipes();
|
||||
initDestructorRecipes();
|
||||
initPortableSmeltingRecipes();
|
||||
|
@ -139,7 +139,7 @@ public class RecipesPhilStone {
|
|||
}
|
||||
}
|
||||
|
||||
public static void initEquivalencyRecipes() {
|
||||
public static void initEquivalenceRecipes() {
|
||||
/* Wood Plank Cycle */
|
||||
addMetaCycleRecipe(planks, 4);
|
||||
|
||||
|
@ -152,7 +152,7 @@ public class RecipesPhilStone {
|
|||
/* Leaf Cycle */
|
||||
addMetaCycleRecipe(leaves, 4);
|
||||
|
||||
/* Tallgrass Cycle */
|
||||
/* Tall Grass Cycle */
|
||||
addMetaCycleRecipe(tallGrass, 3);
|
||||
|
||||
/* Wool Cycle */
|
||||
|
@ -161,6 +161,8 @@ public class RecipesPhilStone {
|
|||
/* Stone Brick Cycle */
|
||||
addMetaCycleRecipe(stoneBrick, 4);
|
||||
|
||||
/* Dye Equivalence Cycle */
|
||||
|
||||
/* Dirt -> Cobble -> Sand -> Dirt */
|
||||
addRecipe(dirt, philStone, cobblestone);
|
||||
addRecipe(cobblestone, philStone, sand);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ee3.item;
|
||||
|
||||
import ee3.lib.ItemIds;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ModLoader;
|
||||
|
||||
|
@ -13,9 +14,13 @@ public class ModItems {
|
|||
if (initialized)
|
||||
initialized = true;
|
||||
|
||||
philStone = new ItemPhilosopherStone(27270).setIconCoord(0, 0).setItemName("philStone");
|
||||
/* Initialise each mod item individually */
|
||||
philStone = new ItemPhilosopherStone(ItemIds.PHIL_STONE).setIconCoord(0, 0).setItemName("philStone");
|
||||
|
||||
/* Set the Container items for our mod items */
|
||||
philStone.setContainerItem(philStone);
|
||||
|
||||
/* Add the item names to the mod items */
|
||||
ModLoader.addName(philStone, "Philosopher's Stone");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,34 @@
|
|||
package ee3.lib;
|
||||
|
||||
public class ItemIds {
|
||||
|
||||
public static int IMPERFECT_PHIL_STONE;
|
||||
public static int PHIL_STONE;
|
||||
public static int DJINN_RING;
|
||||
public static int EYE_OF_THE_VOID;
|
||||
public static int IDOL_OF_GAIA;
|
||||
public static int LUMINATOR;
|
||||
public static int PAHIS_TEMPEST;
|
||||
public static int HORN_OF_EVERFLOWING;
|
||||
public static int TIMELORDS_POCKET_WATCH;
|
||||
public static int WARD_OF_XENOPHOBIA;
|
||||
public static int CALCINED_ASH;
|
||||
public static int ALCHEMICAL_COAL;
|
||||
public static int MOBIUS_FUEL;
|
||||
public static int DIVINING_ROD;
|
||||
public static int PANACEA;
|
||||
public static int AUTO_MAIL;
|
||||
public static int CASTER;
|
||||
public static int PROJECTOR;
|
||||
public static int ALGOT;
|
||||
public static int WOLF_BOOTS;
|
||||
public static int DARK_MATTER;
|
||||
public static int DARK_MATTER_PICKAXE;
|
||||
public static int DARK_MATTER_SHOVEL;
|
||||
public static int DARK_MATTER_HOE;
|
||||
public static int DARK_MATTER_SHEARS;
|
||||
public static int DARK_MATTER_HAMMER;
|
||||
public static int DARK_MATTER_SWORD;
|
||||
public static int DARK_MATTER_BOW;
|
||||
public static int DARK_MATTER_FISHING_ROD;
|
||||
public static int DARK_MATTER_ARMOR;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import ee3.core.Version;
|
|||
import ee3.core.interfaces.IProxy;
|
||||
import ee3.gui.GuiHandler;
|
||||
import ee3.item.ModItems;
|
||||
import ee3.lib.ItemIds;
|
||||
import ee3.lib.Reference;
|
||||
import ee3.lib.Sounds;
|
||||
import ee3.network.PacketHandler;
|
||||
|
@ -46,7 +47,10 @@ public class mod_EE3 extends NetworkMod {
|
|||
// Initialise the configuration settings from file
|
||||
config.init();
|
||||
|
||||
// Initialise the mod items
|
||||
ModItems.init();
|
||||
|
||||
// Initialise the Philosopher Stone recipes
|
||||
RecipesPhilStone.initRecipes();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue