diff --git a/src/minecraft/dark/library/DarkMain.java b/src/minecraft/dark/library/DarkMain.java index 4a1b0d289..f07081ef9 100644 --- a/src/minecraft/dark/library/DarkMain.java +++ b/src/minecraft/dark/library/DarkMain.java @@ -22,8 +22,19 @@ public class DarkMain public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "Dark/General.cfg")); - public static final Logger LOGGER = Logger.getLogger("Dark-Lib"); - + public static final Logger LOGGER = Logger.getLogger("DarkLib"); + + public void init() + { + + } + + public static void registerMod(Object mod) + { + + } + + /** * Loads most of the items from basic components to be used */ @@ -31,6 +42,8 @@ public class DarkMain { if (!loadedItems) { + LOGGER.fine("Loaded Basic Components Items"); + // UniversalElectricity.CONFIGURATION.load(); BasicComponents.requestItem("ingotCopper", 0); BasicComponents.requestItem("ingotTin", 0); diff --git a/src/minecraft/dark/library/IDarkMod.java b/src/minecraft/dark/library/IDarkMod.java new file mode 100644 index 000000000..ee09537fe --- /dev/null +++ b/src/minecraft/dark/library/IDarkMod.java @@ -0,0 +1,6 @@ +package dark.library; + +public interface IDarkMod +{ + +} diff --git a/src/minecraft/dark/library/PowerSystems.java b/src/minecraft/dark/library/PowerSystems.java index 0ad581555..a7caf3d4c 100644 --- a/src/minecraft/dark/library/PowerSystems.java +++ b/src/minecraft/dark/library/PowerSystems.java @@ -5,8 +5,11 @@ import cpw.mods.fml.common.Loader; public enum PowerSystems { INDUSTRIALCRAFT("IC2"), MEKANISM("Mekanism"), BUILDCRAFT("BuildCraft|Energy"); + public String id; - + + private boolean[] loaded = new boolean[this.values().length]; + private PowerSystems(String id) { this.id = id; diff --git a/src/minecraft/dark/library/files/FileManager.java b/src/minecraft/dark/library/files/FileManager.java new file mode 100644 index 000000000..e10157ecb --- /dev/null +++ b/src/minecraft/dark/library/files/FileManager.java @@ -0,0 +1,63 @@ +package dark.library.files; + +import java.io.File; + +import net.minecraft.client.Minecraft; +import net.minecraft.server.MinecraftServer; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; + +public class FileManager +{ + public static final String directory = (Loader.instance().getConfigDir().toString() + File.separator + "Dark"); + public static final String langFile = directory + File.separator + "language"; + public static final String npc = directory + File.separator + "npc"; + + /** + * Gets all files in a directory + */ + public static File[] ListFilesInDir(String dir) + { + File folder = new File(dir); + + if (!folder.exists()) + { + folder.mkdirs(); + } + + File[] listOfFiles = folder.listFiles(); + + return listOfFiles; + } + /** + * Loads language files + */ + public static int loadLangFiles(File[] files) + { + int unofficialLanguages = 0; + + try + { + for (File langFile : files) + { + if (langFile.exists()) + { + String name = langFile.getName(); + if (name.endsWith(".lang")) + { + String lang = name.substring(0, name.length() - 4); + LanguageRegistry.instance().loadLocalization(langFile.toString(), lang, false); + unofficialLanguages++; + } + } + } + } + catch (Exception e) + { + // the folder is likely empty, so what... + } + + return unofficialLanguages; + } +} diff --git a/src/minecraft/dark/library/npc/NPC_FORMATE.txt b/src/minecraft/dark/library/npc/NPC_FORMATE.txt new file mode 100644 index 000000000..1ac462c8c --- /dev/null +++ b/src/minecraft/dark/library/npc/NPC_FORMATE.txt @@ -0,0 +1,4 @@ +TASK: Collection +From: tile.chest ore +To: tile.furnace 0 + diff --git a/src/minecraft/dark/library/npc/TaskGroup.java b/src/minecraft/dark/library/npc/TaskGroup.java new file mode 100644 index 000000000..f4d6a1b98 --- /dev/null +++ b/src/minecraft/dark/library/npc/TaskGroup.java @@ -0,0 +1,30 @@ +package dark.library.npc; + +import universalelectricity.prefab.TranslationHelper; + +public enum TaskGroup +{ + /* Collection of items for ground or inventories */ + COLLECTION("collection"), + /* Defence of an area from NPCs or Players */ + DEFENCE("Guardsman"), + /* Attack of an area against NPCs or Players */ + OFFENCE("Soldier"), + /* Creation or repair of items/blocks */ + CRAFTING("Crafter"); + + public String unlocalizedName; + + private TaskGroup(String name) + { + this.unlocalizedName = name; + } + + /** + * Returns the localized name of a task for GUIs/etc + */ + public String getLocalizedName() + { + return TranslationHelper.getLocal("npc.task." + this.unlocalizedName); + } +} diff --git a/src/minecraft/dark/library/npc/prefab/EntityNpc.java b/src/minecraft/dark/library/npc/prefab/EntityNpc.java new file mode 100644 index 000000000..8d25a4c04 --- /dev/null +++ b/src/minecraft/dark/library/npc/prefab/EntityNpc.java @@ -0,0 +1,21 @@ +package dark.library.npc.prefab; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.INpc; +import net.minecraft.world.World; + +public class EntityNpc extends EntityLiving implements INpc +{ + + public EntityNpc(World par1World) + { + super(par1World); + } + + @Override + public int getMaxHealth() + { + return 20; + } + +}