random stuff... really just random
This commit is contained in:
parent
ad5ffc8687
commit
75e7805c21
7 changed files with 143 additions and 3 deletions
|
@ -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);
|
||||
|
|
6
src/minecraft/dark/library/IDarkMod.java
Normal file
6
src/minecraft/dark/library/IDarkMod.java
Normal file
|
@ -0,0 +1,6 @@
|
|||
package dark.library;
|
||||
|
||||
public interface IDarkMod
|
||||
{
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
|
63
src/minecraft/dark/library/files/FileManager.java
Normal file
63
src/minecraft/dark/library/files/FileManager.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
4
src/minecraft/dark/library/npc/NPC_FORMATE.txt
Normal file
4
src/minecraft/dark/library/npc/NPC_FORMATE.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
TASK: Collection
|
||||
From: tile.chest ore
|
||||
To: tile.furnace 0
|
||||
|
30
src/minecraft/dark/library/npc/TaskGroup.java
Normal file
30
src/minecraft/dark/library/npc/TaskGroup.java
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
21
src/minecraft/dark/library/npc/prefab/EntityNpc.java
Normal file
21
src/minecraft/dark/library/npc/prefab/EntityNpc.java
Normal file
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue