From 7e1ef517b97d7070e5c1f2609ec61eb1ebe2a9d6 Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Mon, 22 Jul 2013 01:00:00 -0400 Subject: [PATCH] massive package and file movement --- src/dark/api/ColorCode.java | 25 ++++-- src/dark/api/IBlockActivate.java | 12 +++ src/dark/api/IHeatObject.java | 23 ++---- src/dark/api/IHeatProducer.java | 8 +- src/dark/api/INetworkPart.java | 16 +--- src/dark/api/IPsiReciever.java | 12 +-- src/dark/api/IScroll.java | 6 +- src/dark/api/ISpecialAccess.java | 4 +- src/dark/api/ITerminal.java | 10 +-- src/dark/api/ITileConnector.java | 4 +- src/dark/api/IToolReadOut.java | 6 +- src/dark/api/PowerSystems.java | 2 +- src/dark/core/ClientProxy.java | 2 +- .../core/{MainProxy.java => CommonProxy.java} | 2 +- src/dark/core/DarkMain.java | 20 ++--- src/dark/core/INbtSave.java | 19 +++++ src/dark/core/ModPrefab.java | 3 - .../saving => core}/NBTFileLoader.java | 2 +- .../core/{recipes => }/RecipeManager.java | 6 +- .../{library/saving => core}/SaveManager.java | 7 +- src/dark/core/ServerLoad.java | 24 ------ .../{library => core}/access/AccessLevel.java | 14 ++-- .../access/GlobalAccess.java | 4 +- .../access/GlobalAccessLoader.java | 6 +- .../access/GlobalAccessManager.java | 4 +- .../access/GuiPacketManager.java | 7 +- .../{library => core}/access/UserAccess.java | 29 ++----- .../machine => core/blocks}/BlockMachine.java | 2 +- .../machine => core/blocks}/BlockMulti.java | 2 +- .../{items/parts => blocks}/BlockOre.java | 5 +- .../machine => core/blocks}/IMultiBlock.java | 22 ++--- .../parts => blocks}/OreGenSettings.java | 2 +- .../{items/parts => blocks}/OreGenerator.java | 2 +- .../blocks}/TileEntityMachine.java | 2 +- .../blocks}/TileEntityMulti.java | 2 +- .../{render => client}/BlockRenderInfo.java | 2 +- src/dark/core/client/ClientLoad.java | 8 -- .../{render => client}/EntityFakeBlock.java | 2 +- .../effects => core/client}/FXBeam.java | 20 ++--- .../FluidBlockRenderer.java | 2 +- .../{render => client}/RenderFakeBlock.java | 2 +- .../{render => client}/RenderMachine.java | 9 +- .../damage/EntityTileDamage.java | 9 +- .../{library => core}/damage/IHpTile.java | 32 +++----- .../damage/TileDamageSource.java | 2 +- .../{library => core}/gui/ContainerFake.java | 2 +- .../{library => core}/gui/GuiButtonArrow.java | 2 +- .../{library => core}/gui/GuiGlobalList.java | 4 +- .../gui/ISlotPickResult.java | 13 ++- src/dark/core/gui/ISlotWatcher.java | 8 ++ .../gui/SlotCraftingResult.java | 11 +-- .../{library => core}/gui/SlotRestricted.java | 9 +- .../{library => core}/gui/WatchedSlot.java | 6 +- .../helpers}/AutoCraftingManager.java | 82 ++++++------------- .../{ => core}/helpers/ConnectionHelper.java | 14 ++-- src/dark/{ => core}/helpers/Direction.java | 2 +- src/dark/{ => core}/helpers/FluidHelper.java | 2 +- .../helpers/FluidRestrictionHandler.java | 2 +- src/dark/core/helpers/IAutoCrafter.java | 7 ++ .../{ => core}/helpers/ItemFindingHelper.java | 38 +++------ src/dark/{ => core}/helpers/MetaGroup.java | 26 +++--- src/dark/{ => core}/helpers/Pair.java | 2 +- .../{ => core}/helpers/PlayerMsgHelper.java | 2 +- src/dark/{ => core}/helpers/Time.java | 2 +- .../core/items/{parts => }/EnumMeterials.java | 8 +- .../core/items/{parts => }/EnumOreParts.java | 2 +- src/dark/core/items/{parts => }/ItemOre.java | 2 +- .../core/items/{parts => }/ItemOreDirv.java | 5 +- src/dark/core/items/ItemParts.java | 9 +- .../{library => core}/math/LinearAlg.java | 14 ++-- .../{library => core}/math/MathHelper.java | 14 ++-- src/dark/{library => core}/math/Matrix4.java | 2 +- .../{library => core}/math/Quaternion.java | 25 ++---- .../terminal/CommandHelp.java | 3 +- .../terminal/CommandRegistry.java | 23 ++---- .../terminal/CommandUser.java | 4 +- .../terminal/ContainerTerminal.java | 2 +- .../terminal/TerminalCommand.java | 44 ++++------ .../terminal/TileEntityTerminal.java | 8 +- .../core/tile/network/NetworkSharedPower.java | 2 +- .../tile/network/NetworkTileEntities.java | 18 ++-- src/dark/library/gui/ISlotWatcher.java | 12 --- src/dark/library/saving/INbtSave.java | 27 ------ src/dark/prefab/machine/IAutoCrafter.java | 9 -- src/dark/prefab/machine/IBlockActivate.java | 17 ---- .../laser/TileEntityLaserEmitter.java | 2 +- 86 files changed, 329 insertions(+), 561 deletions(-) create mode 100644 src/dark/api/IBlockActivate.java rename src/dark/core/{MainProxy.java => CommonProxy.java} (90%) create mode 100644 src/dark/core/INbtSave.java rename src/dark/{library/saving => core}/NBTFileLoader.java (98%) rename src/dark/core/{recipes => }/RecipeManager.java (89%) rename src/dark/{library/saving => core}/SaveManager.java (80%) delete mode 100644 src/dark/core/ServerLoad.java rename src/dark/{library => core}/access/AccessLevel.java (78%) rename src/dark/{library => core}/access/GlobalAccess.java (68%) rename src/dark/{library => core}/access/GlobalAccessLoader.java (91%) rename src/dark/{library => core}/access/GlobalAccessManager.java (98%) rename src/dark/{library => core}/access/GuiPacketManager.java (90%) rename src/dark/{library => core}/access/UserAccess.java (86%) rename src/dark/{prefab/machine => core/blocks}/BlockMachine.java (99%) rename src/dark/{prefab/machine => core/blocks}/BlockMulti.java (99%) rename src/dark/core/{items/parts => blocks}/BlockOre.java (94%) rename src/dark/{prefab/machine => core/blocks}/IMultiBlock.java (57%) rename src/dark/core/{items/parts => blocks}/OreGenSettings.java (99%) rename src/dark/core/{items/parts => blocks}/OreGenerator.java (97%) rename src/dark/{prefab/machine => core/blocks}/TileEntityMachine.java (99%) rename src/dark/{prefab/machine => core/blocks}/TileEntityMulti.java (99%) rename src/dark/core/{render => client}/BlockRenderInfo.java (98%) delete mode 100644 src/dark/core/client/ClientLoad.java rename src/dark/core/{render => client}/EntityFakeBlock.java (98%) rename src/dark/{library/effects => core/client}/FXBeam.java (96%) rename src/dark/core/{render => client}/FluidBlockRenderer.java (99%) rename src/dark/core/{render => client}/RenderFakeBlock.java (99%) rename src/dark/core/{render => client}/RenderMachine.java (85%) rename src/dark/{library => core}/damage/EntityTileDamage.java (96%) rename src/dark/{library => core}/damage/IHpTile.java (50%) rename src/dark/{library => core}/damage/TileDamageSource.java (97%) rename src/dark/{library => core}/gui/ContainerFake.java (95%) rename src/dark/{library => core}/gui/GuiButtonArrow.java (97%) rename src/dark/{library => core}/gui/GuiGlobalList.java (98%) rename src/dark/{library => core}/gui/ISlotPickResult.java (60%) create mode 100644 src/dark/core/gui/ISlotWatcher.java rename src/dark/{library => core}/gui/SlotCraftingResult.java (79%) rename src/dark/{library => core}/gui/SlotRestricted.java (86%) rename src/dark/{library => core}/gui/WatchedSlot.java (84%) rename src/dark/{prefab/machine => core/helpers}/AutoCraftingManager.java (88%) rename src/dark/{ => core}/helpers/ConnectionHelper.java (86%) rename src/dark/{ => core}/helpers/Direction.java (98%) rename src/dark/{ => core}/helpers/FluidHelper.java (99%) rename src/dark/{ => core}/helpers/FluidRestrictionHandler.java (98%) create mode 100644 src/dark/core/helpers/IAutoCrafter.java rename src/dark/{ => core}/helpers/ItemFindingHelper.java (83%) rename src/dark/{ => core}/helpers/MetaGroup.java (66%) rename src/dark/{ => core}/helpers/Pair.java (95%) rename src/dark/{ => core}/helpers/PlayerMsgHelper.java (98%) rename src/dark/{ => core}/helpers/Time.java (97%) rename src/dark/core/items/{parts => }/EnumMeterials.java (97%) rename src/dark/core/items/{parts => }/EnumOreParts.java (95%) rename src/dark/core/items/{parts => }/ItemOre.java (94%) rename src/dark/core/items/{parts => }/ItemOreDirv.java (96%) rename src/dark/{library => core}/math/LinearAlg.java (77%) rename src/dark/{library => core}/math/MathHelper.java (83%) rename src/dark/{library => core}/math/Matrix4.java (87%) rename src/dark/{library => core}/math/Quaternion.java (90%) rename src/dark/{prefab/machine => core}/terminal/CommandHelp.java (98%) rename src/dark/{prefab/machine => core}/terminal/CommandRegistry.java (77%) rename src/dark/{prefab/machine => core}/terminal/CommandUser.java (96%) rename src/dark/{prefab/machine => core}/terminal/ContainerTerminal.java (95%) rename src/dark/{prefab/machine => core}/terminal/TerminalCommand.java (58%) rename src/dark/{prefab/machine => core}/terminal/TileEntityTerminal.java (98%) delete mode 100644 src/dark/library/gui/ISlotWatcher.java delete mode 100644 src/dark/library/saving/INbtSave.java delete mode 100644 src/dark/prefab/machine/IAutoCrafter.java delete mode 100644 src/dark/prefab/machine/IBlockActivate.java diff --git a/src/dark/api/ColorCode.java b/src/dark/api/ColorCode.java index 82ef4d7a..116a1be3 100644 --- a/src/dark/api/ColorCode.java +++ b/src/dark/api/ColorCode.java @@ -1,9 +1,23 @@ package dark.api; - public enum ColorCode { - BLACK("Black"), RED("Red"), GREEN("Green"), BROWN("Brown"), BLUE("Blue"), PURPLE("Purple"), CYAN("Cyan"), SILVER("Silver"), GREY("Grey"), PINK("Pink"), LIME("Lime"), YELLOW("Yellow"), LIGHTBLUE("LightBlue"), WHITE("White"), ORANGE("Orange"), NONE(""); + BLACK("Black"), + RED("Red"), + GREEN("Green"), + BROWN("Brown"), + BLUE("Blue"), + PURPLE("Purple"), + CYAN("Cyan"), + SILVER("Silver"), + GREY("Grey"), + PINK("Pink"), + LIME("Lime"), + YELLOW("Yellow"), + LIGHTBLUE("LightBlue"), + WHITE("White"), + ORANGE("Orange"), + NONE(""); String name; @@ -17,12 +31,10 @@ public enum ColorCode return this.name; } - /** - * gets a ColorCode from any of the following + /** gets a ColorCode from any of the following * * @param obj - Integer,String,LiquidData,ColorCode - * @return Color NONE if it can't find it - */ + * @return Color NONE if it can't find it */ public static ColorCode get(Object obj) { if (obj instanceof Integer && ((Integer) obj) < ColorCode.values().length) @@ -46,5 +58,4 @@ public enum ColorCode return NONE; } - } diff --git a/src/dark/api/IBlockActivate.java b/src/dark/api/IBlockActivate.java new file mode 100644 index 00000000..a67d54a8 --- /dev/null +++ b/src/dark/api/IBlockActivate.java @@ -0,0 +1,12 @@ +package dark.api; + +import net.minecraft.entity.player.EntityPlayer; + +/** A general interface to be implemented by anything that needs it. + * + * @author Calclavia */ +public interface IBlockActivate +{ + /** Called when activated */ + public boolean onActivated(EntityPlayer entityPlayer); +} \ No newline at end of file diff --git a/src/dark/api/IHeatObject.java b/src/dark/api/IHeatObject.java index 611940d7..ffb4844a 100644 --- a/src/dark/api/IHeatObject.java +++ b/src/dark/api/IHeatObject.java @@ -2,31 +2,22 @@ package dark.api; import net.minecraftforge.common.ForgeDirection; -/** - * Used by TileEntities or Entities to show heat stored and cooling rate of the object +/** Used by TileEntities or Entities to show heat stored and cooling rate of the object * - * @author DarkGuardsman - * - */ + * @author DarkGuardsman */ public interface IHeatObject { - /** - * Amount of heat stored in the body of the object + /** Amount of heat stored in the body of the object * - * @return amount of heat in generic units - */ + * @return amount of heat in generic units */ public double getHeat(ForgeDirection side); - /** - * Sets the heat level of the object or increase it + /** Sets the heat level of the object or increase it * * @param amount - amount to set or increase by - * @param incrase - true if should increase the current heat level - */ + * @param incrase - true if should increase the current heat level */ public void setHeat(double amount, boolean incrase); - /** - * Rate by which this object can cool by from the given side - */ + /** Rate by which this object can cool by from the given side */ public double getCoolingRate(ForgeDirection side); } diff --git a/src/dark/api/IHeatProducer.java b/src/dark/api/IHeatProducer.java index 74d0e327..1eeabe3b 100644 --- a/src/dark/api/IHeatProducer.java +++ b/src/dark/api/IHeatProducer.java @@ -4,13 +4,9 @@ import net.minecraftforge.common.ForgeDirection; public interface IHeatProducer { - /** - *Checks too see if this can produce heat - */ + /** Checks too see if this can produce heat */ public boolean getCanProduceHeat(ForgeDirection dir); - /** - * Gets the amount of heat in joules this can output - */ + /** Gets the amount of heat in joules this can output */ public double getHeatAmmount(ForgeDirection dir); } diff --git a/src/dark/api/INetworkPart.java b/src/dark/api/INetworkPart.java index 59feec7d..08e56da3 100644 --- a/src/dark/api/INetworkPart.java +++ b/src/dark/api/INetworkPart.java @@ -7,23 +7,15 @@ import dark.core.tile.network.NetworkTileEntities; public interface INetworkPart extends ITileConnector { - /** - * Array of connections this tile has to other tiles - */ + /** Array of connections this tile has to other tiles */ public List getNetworkConnections(); - /** - * Update the connection this tile has to other tiles - */ + /** Update the connection this tile has to other tiles */ public void refresh(); - /** - * Gets the networkPart's primary network - */ + /** Gets the networkPart's primary network */ public NetworkTileEntities getTileNetwork(); - /** - * Sets the networkPart's primary network - */ + /** Sets the networkPart's primary network */ public void setTileNetwork(NetworkTileEntities fluidNetwok); } diff --git a/src/dark/api/IPsiReciever.java b/src/dark/api/IPsiReciever.java index 21548125..6dabdf81 100644 --- a/src/dark/api/IPsiReciever.java +++ b/src/dark/api/IPsiReciever.java @@ -1,17 +1,11 @@ package dark.api; - - -/** - * A tileEntity that receives a pressure driven fluid. Suggested to use some of the class from +/** A tileEntity that receives a pressure driven fluid. Suggested to use some of the class from * net.minecraftforge.liquids too make your machine work with other fluid mods that don't use - * pressure - */ + * pressure */ public interface IPsiReciever extends ITileConnector { - /** - * the load that this machine is handling, working, or moving - */ + /** the load that this machine is handling, working, or moving */ public double getPressureLoad(); } diff --git a/src/dark/api/IScroll.java b/src/dark/api/IScroll.java index cd403688..831da252 100644 --- a/src/dark/api/IScroll.java +++ b/src/dark/api/IScroll.java @@ -2,10 +2,8 @@ package dark.api; public interface IScroll { - /** - * Scrolls the text field up or down. Client side only. Positive value will scroll the text down - * while a negative value will scroll it up. - */ + /** Scrolls the text field up or down. Client side only. Positive value will scroll the text down + * while a negative value will scroll it up. */ public void scroll(int amount); public void setScroll(int length); diff --git a/src/dark/api/ISpecialAccess.java b/src/dark/api/ISpecialAccess.java index d7b393fd..44922729 100644 --- a/src/dark/api/ISpecialAccess.java +++ b/src/dark/api/ISpecialAccess.java @@ -2,8 +2,8 @@ package dark.api; import java.util.List; -import dark.library.access.AccessLevel; -import dark.library.access.UserAccess; +import dark.core.access.AccessLevel; +import dark.core.access.UserAccess; /** Used by any object that needs to restrict access to it by a set of usernames * diff --git a/src/dark/api/ITerminal.java b/src/dark/api/ITerminal.java index dd5c8726..606da2f0 100644 --- a/src/dark/api/ITerminal.java +++ b/src/dark/api/ITerminal.java @@ -1,18 +1,12 @@ package dark.api; - import java.util.List; - public interface ITerminal extends ISpecialAccess, IScroll { - /** - * Gets an output of the string stored in the console. - */ + /** Gets an output of the string stored in the console. */ public List getTerminalOuput(); - /** - * Adds a string to the console. Server side only. - */ + /** Adds a string to the console. Server side only. */ public boolean addToConsole(String msg); } diff --git a/src/dark/api/ITileConnector.java b/src/dark/api/ITileConnector.java index d5339819..88a69e8c 100644 --- a/src/dark/api/ITileConnector.java +++ b/src/dark/api/ITileConnector.java @@ -5,8 +5,6 @@ import net.minecraftforge.common.ForgeDirection; public interface ITileConnector { - /** - * Can this tile connect on the given side - */ + /** Can this tile connect on the given side */ public boolean canTileConnect(TileEntity entity, ForgeDirection dir); } diff --git a/src/dark/api/IToolReadOut.java b/src/dark/api/IToolReadOut.java index 54cd1774..c493fd01 100644 --- a/src/dark/api/IToolReadOut.java +++ b/src/dark/api/IToolReadOut.java @@ -5,14 +5,12 @@ import net.minecraftforge.common.ForgeDirection; public interface IToolReadOut { - /** - * Grabs the message displayed to the user on right click of the machine with the pipe gauge + /** Grabs the message displayed to the user on right click of the machine with the pipe gauge * * @param user * @param side - may not work correctly yet but should give you a side * @return - a string to be displayed to the player for a reading. automatically adds ReadOut: - * to the beginning - */ + * to the beginning */ public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool); public static enum EnumTools diff --git a/src/dark/api/PowerSystems.java b/src/dark/api/PowerSystems.java index 9906ecb6..c0d0d1fa 100644 --- a/src/dark/api/PowerSystems.java +++ b/src/dark/api/PowerSystems.java @@ -20,7 +20,7 @@ public enum PowerSystems private static Boolean[] loaded; /** Checks to see if something can run powerless based on mods loaded - * + * * @param optional - power system that the device can use * @return true if free power is to be generated */ public static boolean runPowerLess(PowerSystems... optional) diff --git a/src/dark/core/ClientProxy.java b/src/dark/core/ClientProxy.java index 92f8f969..96820a64 100644 --- a/src/dark/core/ClientProxy.java +++ b/src/dark/core/ClientProxy.java @@ -1,6 +1,6 @@ package dark.core; -public class ClientProxy extends MainProxy +public class ClientProxy extends CommonProxy { } diff --git a/src/dark/core/MainProxy.java b/src/dark/core/CommonProxy.java similarity index 90% rename from src/dark/core/MainProxy.java rename to src/dark/core/CommonProxy.java index 812bf9bd..28115ed0 100644 --- a/src/dark/core/MainProxy.java +++ b/src/dark/core/CommonProxy.java @@ -1,6 +1,6 @@ package dark.core; -public class MainProxy +public class CommonProxy { public void preInit() { diff --git a/src/dark/core/DarkMain.java b/src/dark/core/DarkMain.java index e0d967b1..e66eb452 100644 --- a/src/dark/core/DarkMain.java +++ b/src/dark/core/DarkMain.java @@ -24,15 +24,13 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStoppingEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; -import dark.core.items.parts.BlockOre; -import dark.core.items.parts.EnumMeterials; -import dark.core.items.parts.ItemOre; -import dark.core.items.parts.ItemOreDirv; -import dark.core.recipes.RecipeManager; -import dark.helpers.FluidRestrictionHandler; -import dark.library.saving.SaveManager; -import dark.prefab.machine.BlockMulti; -import dark.prefab.machine.TileEntityMulti; +import dark.core.blocks.BlockMulti; +import dark.core.blocks.BlockOre; +import dark.core.blocks.TileEntityMulti; +import dark.core.helpers.FluidRestrictionHandler; +import dark.core.items.EnumMeterials; +import dark.core.items.ItemOre; +import dark.core.items.ItemOreDirv; /** @author HangCow, DarkGuardsman */ @Mod(modid = DarkMain.MOD_ID, name = DarkMain.MOD_NAME, version = DarkMain.VERSION, dependencies = "after:IC2,after:BuildCraft|Energy", useMetadata = true) @@ -50,8 +48,8 @@ public class DarkMain extends ModPrefab public static final String MOD_NAME = "Dark Heart"; public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVIS_VERSION + "." + BUILD_VERSION; - @SidedProxy(clientSide = "dark.core.ClientProxy", serverSide = "dark.core.MainProxy") - public static MainProxy proxy; + @SidedProxy(clientSide = "dark.core.ClientProxy", serverSide = "dark.core.CommonProxy") + public static CommonProxy proxy; public static final String CHANNEL = "DarkPackets"; diff --git a/src/dark/core/INbtSave.java b/src/dark/core/INbtSave.java new file mode 100644 index 00000000..24afc729 --- /dev/null +++ b/src/dark/core/INbtSave.java @@ -0,0 +1,19 @@ +package dark.core; + +import net.minecraft.nbt.NBTTagCompound; + +/** Classes the register to need saving on world save use this + * + * @author DarkGuardsman */ +public interface INbtSave +{ + /** gets the file name to save as */ + public String saveFileName(); + + /** the data to save when saving to the file */ + public NBTTagCompound getSaveData(); + + /** can the file be saved at this moment */ + public boolean shouldSave(boolean isServer); + +} diff --git a/src/dark/core/ModPrefab.java b/src/dark/core/ModPrefab.java index b8ad9484..f8b6765c 100644 --- a/src/dark/core/ModPrefab.java +++ b/src/dark/core/ModPrefab.java @@ -1,7 +1,5 @@ package dark.core; -import net.minecraftforge.common.Configuration; - import org.modstats.Modstats; import cpw.mods.fml.common.Mod.EventHandler; @@ -12,7 +10,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; public abstract class ModPrefab { - public String DOMAIN = "dark"; public String PREFIX = DOMAIN + ":"; diff --git a/src/dark/library/saving/NBTFileLoader.java b/src/dark/core/NBTFileLoader.java similarity index 98% rename from src/dark/library/saving/NBTFileLoader.java rename to src/dark/core/NBTFileLoader.java index 2bfdaeb8..8e29e6fd 100644 --- a/src/dark/library/saving/NBTFileLoader.java +++ b/src/dark/core/NBTFileLoader.java @@ -1,4 +1,4 @@ -package dark.library.saving; +package dark.core; import java.io.File; import java.io.FileInputStream; diff --git a/src/dark/core/recipes/RecipeManager.java b/src/dark/core/RecipeManager.java similarity index 89% rename from src/dark/core/recipes/RecipeManager.java rename to src/dark/core/RecipeManager.java index 87373ced..8a39b5d5 100644 --- a/src/dark/core/recipes/RecipeManager.java +++ b/src/dark/core/RecipeManager.java @@ -1,11 +1,11 @@ -package dark.core.recipes; +package dark.core; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; -import dark.core.items.parts.EnumMeterials; -import dark.core.items.parts.EnumOreParts; +import dark.core.items.EnumMeterials; +import dark.core.items.EnumOreParts; public class RecipeManager { diff --git a/src/dark/library/saving/SaveManager.java b/src/dark/core/SaveManager.java similarity index 80% rename from src/dark/library/saving/SaveManager.java rename to src/dark/core/SaveManager.java index dcf43f9e..eea8e6c0 100644 --- a/src/dark/library/saving/SaveManager.java +++ b/src/dark/core/SaveManager.java @@ -1,13 +1,9 @@ -package dark.library.saving; +package dark.core; import java.util.ArrayList; import java.util.List; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.event.world.WorldEvent; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLServerStoppingEvent; public class SaveManager { @@ -33,7 +29,6 @@ public class SaveManager nbtSaveList.add(saveClass); } } - /** Called to get all INbtSave classes to do a save to world */ public static void save(boolean isServer) diff --git a/src/dark/core/ServerLoad.java b/src/dark/core/ServerLoad.java deleted file mode 100644 index 2323eaca..00000000 --- a/src/dark/core/ServerLoad.java +++ /dev/null @@ -1,24 +0,0 @@ -package dark.core; - -public class ServerLoad -{ - - public void preInit() - { - // TODO Auto-generated method stub - - } - - public void Init() - { - // TODO Auto-generated method stub - - } - - public void postInit() - { - // TODO Auto-generated method stub - - } - -} diff --git a/src/dark/library/access/AccessLevel.java b/src/dark/core/access/AccessLevel.java similarity index 78% rename from src/dark/library/access/AccessLevel.java rename to src/dark/core/access/AccessLevel.java index 22da3599..7bc6308c 100644 --- a/src/dark/library/access/AccessLevel.java +++ b/src/dark/core/access/AccessLevel.java @@ -1,8 +1,12 @@ -package dark.library.access; +package dark.core.access; public enum AccessLevel { - NONE("None"), BASIC("Basic"), USER("Standard"), ADMIN("Admin"), OWNER("Owner"); + NONE("None"), + BASIC("Basic"), + USER("Standard"), + ADMIN("Admin"), + OWNER("Owner"); public String displayName; @@ -11,11 +15,9 @@ public enum AccessLevel displayName = name; } - /** - * Gets the access level in varies ways + /** Gets the access level in varies ways * - * @return AccessLevel NONE instead of null if correct level can't be found. - */ + * @return AccessLevel NONE instead of null if correct level can't be found. */ public static AccessLevel get(Object ob) { if (ob instanceof String) diff --git a/src/dark/library/access/GlobalAccess.java b/src/dark/core/access/GlobalAccess.java similarity index 68% rename from src/dark/library/access/GlobalAccess.java rename to src/dark/core/access/GlobalAccess.java index a45466de..9bc5840a 100644 --- a/src/dark/library/access/GlobalAccess.java +++ b/src/dark/core/access/GlobalAccess.java @@ -1,9 +1,9 @@ -package dark.library.access; +package dark.core.access; public class GlobalAccess { public GlobalAccess(String name) { - + } } diff --git a/src/dark/library/access/GlobalAccessLoader.java b/src/dark/core/access/GlobalAccessLoader.java similarity index 91% rename from src/dark/library/access/GlobalAccessLoader.java rename to src/dark/core/access/GlobalAccessLoader.java index 9845a2b1..50a519ad 100644 --- a/src/dark/library/access/GlobalAccessLoader.java +++ b/src/dark/core/access/GlobalAccessLoader.java @@ -1,11 +1,11 @@ -package dark.library.access; +package dark.core.access; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod.ServerStarting; import cpw.mods.fml.common.event.FMLServerStartingEvent; -import dark.library.saving.INbtSave; -import dark.library.saving.SaveManager; +import dark.core.INbtSave; +import dark.core.SaveManager; public class GlobalAccessLoader implements INbtSave { diff --git a/src/dark/library/access/GlobalAccessManager.java b/src/dark/core/access/GlobalAccessManager.java similarity index 98% rename from src/dark/library/access/GlobalAccessManager.java rename to src/dark/core/access/GlobalAccessManager.java index aa3b0bb3..ab7ad306 100644 --- a/src/dark/library/access/GlobalAccessManager.java +++ b/src/dark/core/access/GlobalAccessManager.java @@ -1,4 +1,4 @@ -package dark.library.access; +package dark.core.access; import java.util.ArrayList; import java.util.HashMap; @@ -8,7 +8,7 @@ import java.util.Map; import java.util.Map.Entry; import net.minecraft.nbt.NBTTagCompound; -import dark.library.saving.NBTFileLoader; +import dark.core.NBTFileLoader; public class GlobalAccessManager { diff --git a/src/dark/library/access/GuiPacketManager.java b/src/dark/core/access/GuiPacketManager.java similarity index 90% rename from src/dark/library/access/GuiPacketManager.java rename to src/dark/core/access/GuiPacketManager.java index 755651e8..5e21b34f 100644 --- a/src/dark/library/access/GuiPacketManager.java +++ b/src/dark/core/access/GuiPacketManager.java @@ -1,4 +1,4 @@ -package dark.library.access; +package dark.core.access; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.INetworkManager; @@ -12,7 +12,10 @@ public class GuiPacketManager extends PacketManager { public enum GuiPacketType { - USER_LISTS_REQUEST, USER_LISTS, LISTS_DATA, LISTS_DATA_REQUEST; + USER_LISTS_REQUEST, + USER_LISTS, + LISTS_DATA, + LISTS_DATA_REQUEST; } @Override diff --git a/src/dark/library/access/UserAccess.java b/src/dark/core/access/UserAccess.java similarity index 86% rename from src/dark/library/access/UserAccess.java rename to src/dark/core/access/UserAccess.java index ce54e7a8..54a263e7 100644 --- a/src/dark/library/access/UserAccess.java +++ b/src/dark/core/access/UserAccess.java @@ -1,4 +1,4 @@ -package dark.library.access; +package dark.core.access; import java.util.ArrayList; import java.util.List; @@ -19,9 +19,7 @@ public class UserAccess this.shouldSave = save; } - /** - * Write to nbt - */ + /** Write to nbt */ public NBTTagCompound writeToNBT(NBTTagCompound nbt) { nbt.setString("username", this.username); @@ -29,9 +27,7 @@ public class UserAccess return nbt; } - /** - * Read from nbt - */ + /** Read from nbt */ public void readFromNBT(NBTTagCompound nbt) { this.username = nbt.getString("username"); @@ -44,14 +40,11 @@ public class UserAccess access.readFromNBT(nbt); return access; } - - - /** - * Reads an entire UserAccess list from an nbt file + + /** Reads an entire UserAccess list from an nbt file * * @param nbt - nbt being read - * @return - the list - */ + * @return - the list */ public static List readListFromNBT(NBTTagCompound nbt, String tagName) { @@ -65,12 +58,10 @@ public class UserAccess return users; } - /** - * writes an entire UserAccess list to nbt at one time + /** writes an entire UserAccess list to nbt at one time * * @param save - nbt to save to - * @param users - list to save - */ + * @param users - list to save */ public static void writeListToNBT(NBTTagCompound save, List users) { NBTTagList usersTag = new NBTTagList(); @@ -88,9 +79,7 @@ public class UserAccess save.setTag("Users", usersTag); } - /** - * Removes a user from a list of UserAccess then returns that list - */ + /** Removes a user from a list of UserAccess then returns that list */ public static List removeUserAccess(String player, List users) { List removeList = new ArrayList(); diff --git a/src/dark/prefab/machine/BlockMachine.java b/src/dark/core/blocks/BlockMachine.java similarity index 99% rename from src/dark/prefab/machine/BlockMachine.java rename to src/dark/core/blocks/BlockMachine.java index 3e2f320a..f67a073a 100644 --- a/src/dark/prefab/machine/BlockMachine.java +++ b/src/dark/core/blocks/BlockMachine.java @@ -1,4 +1,4 @@ -package dark.prefab.machine; +package dark.core.blocks; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; diff --git a/src/dark/prefab/machine/BlockMulti.java b/src/dark/core/blocks/BlockMulti.java similarity index 99% rename from src/dark/prefab/machine/BlockMulti.java rename to src/dark/core/blocks/BlockMulti.java index c69bd7f1..1d6209f0 100644 --- a/src/dark/prefab/machine/BlockMulti.java +++ b/src/dark/core/blocks/BlockMulti.java @@ -1,4 +1,4 @@ -package dark.prefab.machine; +package dark.core.blocks; import java.util.Random; diff --git a/src/dark/core/items/parts/BlockOre.java b/src/dark/core/blocks/BlockOre.java similarity index 94% rename from src/dark/core/items/parts/BlockOre.java rename to src/dark/core/blocks/BlockOre.java index 08b56b9e..4ac72fbe 100644 --- a/src/dark/core/items/parts/BlockOre.java +++ b/src/dark/core/blocks/BlockOre.java @@ -1,4 +1,4 @@ -package dark.core.items.parts; +package dark.core.blocks; import java.util.List; @@ -11,7 +11,8 @@ import net.minecraft.util.Icon; import net.minecraftforge.common.Configuration; import net.minecraftforge.oredict.OreDictionary; import dark.core.DarkMain; -import dark.core.recipes.RecipeManager; +import dark.core.RecipeManager; +import dark.core.items.EnumMeterials; public class BlockOre extends Block { diff --git a/src/dark/prefab/machine/IMultiBlock.java b/src/dark/core/blocks/IMultiBlock.java similarity index 57% rename from src/dark/prefab/machine/IMultiBlock.java rename to src/dark/core/blocks/IMultiBlock.java index f7323aea..a4623983 100644 --- a/src/dark/prefab/machine/IMultiBlock.java +++ b/src/dark/core/blocks/IMultiBlock.java @@ -1,28 +1,22 @@ -package dark.prefab.machine; +package dark.core.blocks; import net.minecraft.tileentity.TileEntity; import universalelectricity.core.vector.Vector3; +import dark.api.IBlockActivate; -/** - * Interface to be applied to tile entity blocks that occupies more than one block space. Useful for +/** Interface to be applied to tile entity blocks that occupies more than one block space. Useful for * large machines. * - * @author Calclavia - * - */ + * @author Calclavia */ public interface IMultiBlock extends IBlockActivate { - /** - * Called when this multiblock is created + /** Called when this multiblock is created * - * @param placedPosition - The position the block was placed at - */ + * @param placedPosition - The position the block was placed at */ public void onCreate(Vector3 placedPosition); - /** - * Called when one of the multiblocks of this block is destroyed + /** Called when one of the multiblocks of this block is destroyed * - * @param callingBlock - The tile entity who called the onDestroy function - */ + * @param callingBlock - The tile entity who called the onDestroy function */ public void onDestroy(TileEntity callingBlock); } diff --git a/src/dark/core/items/parts/OreGenSettings.java b/src/dark/core/blocks/OreGenSettings.java similarity index 99% rename from src/dark/core/items/parts/OreGenSettings.java rename to src/dark/core/blocks/OreGenSettings.java index 9269870d..3b5d3c99 100644 --- a/src/dark/core/items/parts/OreGenSettings.java +++ b/src/dark/core/blocks/OreGenSettings.java @@ -1,4 +1,4 @@ -package dark.core.items.parts; +package dark.core.blocks; import java.util.Random; diff --git a/src/dark/core/items/parts/OreGenerator.java b/src/dark/core/blocks/OreGenerator.java similarity index 97% rename from src/dark/core/items/parts/OreGenerator.java rename to src/dark/core/blocks/OreGenerator.java index 64cce30c..499540f5 100644 --- a/src/dark/core/items/parts/OreGenerator.java +++ b/src/dark/core/blocks/OreGenerator.java @@ -1,4 +1,4 @@ -package dark.core.items.parts; +package dark.core.blocks; import java.util.ArrayList; import java.util.List; diff --git a/src/dark/prefab/machine/TileEntityMachine.java b/src/dark/core/blocks/TileEntityMachine.java similarity index 99% rename from src/dark/prefab/machine/TileEntityMachine.java rename to src/dark/core/blocks/TileEntityMachine.java index f5d6cfd7..3281b492 100644 --- a/src/dark/prefab/machine/TileEntityMachine.java +++ b/src/dark/core/blocks/TileEntityMachine.java @@ -1,4 +1,4 @@ -package dark.prefab.machine; +package dark.core.blocks; import java.util.Random; diff --git a/src/dark/prefab/machine/TileEntityMulti.java b/src/dark/core/blocks/TileEntityMulti.java similarity index 99% rename from src/dark/prefab/machine/TileEntityMulti.java rename to src/dark/core/blocks/TileEntityMulti.java index ec627e32..f4b204bf 100644 --- a/src/dark/prefab/machine/TileEntityMulti.java +++ b/src/dark/core/blocks/TileEntityMulti.java @@ -1,4 +1,4 @@ -package dark.prefab.machine; +package dark.core.blocks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/dark/core/render/BlockRenderInfo.java b/src/dark/core/client/BlockRenderInfo.java similarity index 98% rename from src/dark/core/render/BlockRenderInfo.java rename to src/dark/core/client/BlockRenderInfo.java index d95668f7..f0ccdebd 100644 --- a/src/dark/core/render/BlockRenderInfo.java +++ b/src/dark/core/client/BlockRenderInfo.java @@ -1,4 +1,4 @@ -package dark.core.render; +package dark.core.client; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; diff --git a/src/dark/core/client/ClientLoad.java b/src/dark/core/client/ClientLoad.java deleted file mode 100644 index 20c24bd2..00000000 --- a/src/dark/core/client/ClientLoad.java +++ /dev/null @@ -1,8 +0,0 @@ -package dark.core.client; - -import dark.core.ServerLoad; - -public class ClientLoad extends ServerLoad -{ - -} diff --git a/src/dark/core/render/EntityFakeBlock.java b/src/dark/core/client/EntityFakeBlock.java similarity index 98% rename from src/dark/core/render/EntityFakeBlock.java rename to src/dark/core/client/EntityFakeBlock.java index 3bcb0b52..85f9b1d5 100644 --- a/src/dark/core/render/EntityFakeBlock.java +++ b/src/dark/core/client/EntityFakeBlock.java @@ -1,4 +1,4 @@ -package dark.core.render; +package dark.core.client; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/dark/library/effects/FXBeam.java b/src/dark/core/client/FXBeam.java similarity index 96% rename from src/dark/library/effects/FXBeam.java rename to src/dark/core/client/FXBeam.java index 6a697652..6e8447fc 100644 --- a/src/dark/library/effects/FXBeam.java +++ b/src/dark/core/client/FXBeam.java @@ -1,4 +1,4 @@ -package dark.library.effects; +package dark.core.client; import java.awt.Color; @@ -16,12 +16,9 @@ import universalelectricity.core.vector.Vector3; import cpw.mods.fml.client.FMLClientHandler; import dark.core.DarkMain; -/** - * Based off Thaumcraft's Beam Renderer. +/** Based off Thaumcraft's Beam Renderer. * - * @author Calclavia, Azanor - * - */ + * @author Calclavia, Azanor */ public class FXBeam extends EntityFX { double movX = 0.0D; @@ -40,21 +37,22 @@ public class FXBeam extends EntityFX private int rotationSpeed = 20; private float prevSize = 0.0F; private float beamD = 0.08f; - private String texture = DarkMain.TEXTURE_DIRECTORY+""; + private String texture = DarkMain.TEXTURE_DIRECTORY + ""; public FXBeam(World world, Vector3 start, Vector3 end, Color color, String texture, int age, boolean pulse) { this(world, start, end, color, texture, age); this.pulse = pulse; } + public FXBeam(World world, Vector3 start, Vector3 end, Color color, String texture, int age) { super(world, start.x, start.y, start.z, 0.0D, 0.0D, 0.0D); this.setRGB(color.getRed(), color.getGreen(), color.getBlue()); - + this.texture = texture; - + this.setSize(0.02F, 0.02F); this.noClip = true; this.motionX = 0.0D; @@ -73,9 +71,7 @@ public class FXBeam extends EntityFX this.particleMaxAge = age; - /** - * Sets the particle age based on distance. - */ + /** Sets the particle age based on distance. */ EntityLivingBase renderentity = Minecraft.getMinecraft().renderViewEntity; int visibleDistance = 50; diff --git a/src/dark/core/render/FluidBlockRenderer.java b/src/dark/core/client/FluidBlockRenderer.java similarity index 99% rename from src/dark/core/render/FluidBlockRenderer.java rename to src/dark/core/client/FluidBlockRenderer.java index 20f4e1fc..d428a8e9 100644 --- a/src/dark/core/render/FluidBlockRenderer.java +++ b/src/dark/core/client/FluidBlockRenderer.java @@ -1,4 +1,4 @@ -package dark.core.render; +package dark.core.client; import java.util.HashMap; import java.util.Map; diff --git a/src/dark/core/render/RenderFakeBlock.java b/src/dark/core/client/RenderFakeBlock.java similarity index 99% rename from src/dark/core/render/RenderFakeBlock.java rename to src/dark/core/client/RenderFakeBlock.java index 3293b5b5..1d2bac6e 100644 --- a/src/dark/core/render/RenderFakeBlock.java +++ b/src/dark/core/client/RenderFakeBlock.java @@ -5,7 +5,7 @@ * 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ -package dark.core.render; +package dark.core.client; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; diff --git a/src/dark/core/render/RenderMachine.java b/src/dark/core/client/RenderMachine.java similarity index 85% rename from src/dark/core/render/RenderMachine.java rename to src/dark/core/client/RenderMachine.java index added33f..1270ecea 100644 --- a/src/dark/core/render/RenderMachine.java +++ b/src/dark/core/client/RenderMachine.java @@ -1,4 +1,4 @@ -package dark.core.render; +package dark.core.client; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; @@ -12,7 +12,7 @@ public abstract class RenderMachine extends TileEntitySpecialRenderer public RenderMachine() { - + } @Override @@ -22,11 +22,12 @@ public abstract class RenderMachine extends TileEntitySpecialRenderer } - /** Sudo method for setting the texture for current render + /** Sudo method for setting the texture for current render + * * @param name */ public void bindTextureByName(String domain, String name) { - func_110628_a(new ResourceLocation(domain,name)); + func_110628_a(new ResourceLocation(domain, name)); } public void bindTextureByName(ResourceLocation name) diff --git a/src/dark/library/damage/EntityTileDamage.java b/src/dark/core/damage/EntityTileDamage.java similarity index 96% rename from src/dark/library/damage/EntityTileDamage.java rename to src/dark/core/damage/EntityTileDamage.java index 2745920a..61f79574 100644 --- a/src/dark/library/damage/EntityTileDamage.java +++ b/src/dark/core/damage/EntityTileDamage.java @@ -1,4 +1,4 @@ -package dark.library.damage; +package dark.core.damage; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -21,13 +21,10 @@ import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -/** - * Entity designed to take damage and apply it to the tile from an Entity. Simulates the tile is +/** Entity designed to take damage and apply it to the tile from an Entity. Simulates the tile is * alive and can be harmed by normal AIs without additional code. * - * @author DarkGuardsman - * - */ + * @author DarkGuardsman */ public class EntityTileDamage extends EntityLiving implements IEntityAdditionalSpawnData { diff --git a/src/dark/library/damage/IHpTile.java b/src/dark/core/damage/IHpTile.java similarity index 50% rename from src/dark/library/damage/IHpTile.java rename to src/dark/core/damage/IHpTile.java index c1e6364f..0f9ee81b 100644 --- a/src/dark/library/damage/IHpTile.java +++ b/src/dark/core/damage/IHpTile.java @@ -1,45 +1,33 @@ -package dark.library.damage; +package dark.core.damage; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; public interface IHpTile { - /** - * Same as attackEntityFrom in Entity.class + /** Same as attackEntityFrom in Entity.class * * @param source - DamageSource/DamageType * @param ammount - amount of damage - * @return - */ + * @return */ public boolean onDamageTaken(DamageSource source, float ammount); - /** - * Is this tile considered too still be alive. Allows for the tile to remain while being - * considered dead - */ + /** Is this tile considered too still be alive. Allows for the tile to remain while being + * considered dead */ public boolean isAlive(); - /** - * Current hp of the tile - */ + /** Current hp of the tile */ public int hp(); - /** - * Sets the tiles hp + /** Sets the tiles hp * * @param i - amount - * @param increase - increase instead of replace - */ + * @param increase - increase instead of replace */ public void setHp(int i, boolean increase); - /** - * Max hp of the object - */ + /** Max hp of the object */ public int getMaxHealth(); - /** - * Can the potion be used on the Entity that is translating damage for the TileEntity - */ + /** Can the potion be used on the Entity that is translating damage for the TileEntity */ public boolean canApplyPotion(PotionEffect par1PotionEffect); } diff --git a/src/dark/library/damage/TileDamageSource.java b/src/dark/core/damage/TileDamageSource.java similarity index 97% rename from src/dark/library/damage/TileDamageSource.java rename to src/dark/core/damage/TileDamageSource.java index 852e242c..cc8f4382 100644 --- a/src/dark/library/damage/TileDamageSource.java +++ b/src/dark/core/damage/TileDamageSource.java @@ -1,4 +1,4 @@ -package dark.library.damage; +package dark.core.damage; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; diff --git a/src/dark/library/gui/ContainerFake.java b/src/dark/core/gui/ContainerFake.java similarity index 95% rename from src/dark/library/gui/ContainerFake.java rename to src/dark/core/gui/ContainerFake.java index 2f7986ba..33788a08 100644 --- a/src/dark/library/gui/ContainerFake.java +++ b/src/dark/core/gui/ContainerFake.java @@ -1,4 +1,4 @@ -package dark.library.gui; +package dark.core.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; diff --git a/src/dark/library/gui/GuiButtonArrow.java b/src/dark/core/gui/GuiButtonArrow.java similarity index 97% rename from src/dark/library/gui/GuiButtonArrow.java rename to src/dark/core/gui/GuiButtonArrow.java index e94d301d..d1408cdb 100644 --- a/src/dark/library/gui/GuiButtonArrow.java +++ b/src/dark/core/gui/GuiButtonArrow.java @@ -1,4 +1,4 @@ -package dark.library.gui; +package dark.core.gui; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; diff --git a/src/dark/library/gui/GuiGlobalList.java b/src/dark/core/gui/GuiGlobalList.java similarity index 98% rename from src/dark/library/gui/GuiGlobalList.java rename to src/dark/core/gui/GuiGlobalList.java index 77f789ac..2c15d278 100644 --- a/src/dark/library/gui/GuiGlobalList.java +++ b/src/dark/core/gui/GuiGlobalList.java @@ -1,4 +1,4 @@ -package dark.library.gui; +package dark.core.gui; import java.util.ArrayList; import java.util.HashMap; @@ -21,7 +21,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.api.IScroll; import dark.core.DarkMain; -import dark.library.access.UserAccess; +import dark.core.access.UserAccess; @SideOnly(Side.CLIENT) public class GuiGlobalList extends GuiContainer implements IScroll diff --git a/src/dark/library/gui/ISlotPickResult.java b/src/dark/core/gui/ISlotPickResult.java similarity index 60% rename from src/dark/library/gui/ISlotPickResult.java rename to src/dark/core/gui/ISlotPickResult.java index e3bf0cd3..1eb63fa0 100644 --- a/src/dark/library/gui/ISlotPickResult.java +++ b/src/dark/core/gui/ISlotPickResult.java @@ -1,18 +1,15 @@ -package dark.library.gui; +package dark.core.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -/** - * TileEntities that wish to do something if an item is removed from a slot - */ + +/** TileEntities that wish to do something if an item is removed from a slot */ public interface ISlotPickResult { - /** - * If the slot in the gui does something if the item is removed + /** If the slot in the gui does something if the item is removed * * @param entityPlayer - player who removed the item, will pass null from automation * @param slot - slot in the container class the item came from - * @param itemStack - item stack pulled from the slot - */ + * @param itemStack - item stack pulled from the slot */ public void onPickUpFromSlot(EntityPlayer entityPlayer, int slot, ItemStack itemStack); } diff --git a/src/dark/core/gui/ISlotWatcher.java b/src/dark/core/gui/ISlotWatcher.java new file mode 100644 index 00000000..702e84e0 --- /dev/null +++ b/src/dark/core/gui/ISlotWatcher.java @@ -0,0 +1,8 @@ +package dark.core.gui; + +/** Add this to a container class if using WatchedSlot to trigger the container on slot change */ +public interface ISlotWatcher +{ + /** Will trigger if the watched slot has changed */ + public void slotContentsChanged(int slot); +} diff --git a/src/dark/library/gui/SlotCraftingResult.java b/src/dark/core/gui/SlotCraftingResult.java similarity index 79% rename from src/dark/library/gui/SlotCraftingResult.java rename to src/dark/core/gui/SlotCraftingResult.java index 46a7d59f..a07c50c8 100644 --- a/src/dark/library/gui/SlotCraftingResult.java +++ b/src/dark/core/gui/SlotCraftingResult.java @@ -1,13 +1,10 @@ -package dark.library.gui; +package dark.core.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -/** - * Easy class to create a slot that is used for an event trigger or crafting based event - * - */ +/** Easy class to create a slot that is used for an event trigger or crafting based event */ public class SlotCraftingResult extends WatchedSlot { private ISlotPickResult tile; @@ -30,9 +27,7 @@ public class SlotCraftingResult extends WatchedSlot return true; } - /** - * When the slot has changed it calls @ISlotPickResult 's method - */ + /** When the slot has changed it calls @ISlotPickResult 's method */ @Override public void onPickupFromSlot(EntityPlayer entityPlayer, ItemStack itemStack) { diff --git a/src/dark/library/gui/SlotRestricted.java b/src/dark/core/gui/SlotRestricted.java similarity index 86% rename from src/dark/library/gui/SlotRestricted.java rename to src/dark/core/gui/SlotRestricted.java index 7182a9dc..7f88a092 100644 --- a/src/dark/library/gui/SlotRestricted.java +++ b/src/dark/core/gui/SlotRestricted.java @@ -1,15 +1,12 @@ -package dark.library.gui; +package dark.core.gui; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -/** - * Slot that can only allow one itemStack into it +/** Slot that can only allow one itemStack into it * - * @author DarkGuardsman - * - */ + * @author DarkGuardsman */ public class SlotRestricted extends Slot { private ItemStack[] itemStacks; diff --git a/src/dark/library/gui/WatchedSlot.java b/src/dark/core/gui/WatchedSlot.java similarity index 84% rename from src/dark/library/gui/WatchedSlot.java rename to src/dark/core/gui/WatchedSlot.java index abaef567..53348f73 100644 --- a/src/dark/library/gui/WatchedSlot.java +++ b/src/dark/core/gui/WatchedSlot.java @@ -1,11 +1,9 @@ -package dark.library.gui; +package dark.core.gui; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; -/** - * A slot that triggers the container class if changed - */ +/** A slot that triggers the container class if changed */ public class WatchedSlot extends Slot { private ISlotWatcher slotWatcher; diff --git a/src/dark/prefab/machine/AutoCraftingManager.java b/src/dark/core/helpers/AutoCraftingManager.java similarity index 88% rename from src/dark/prefab/machine/AutoCraftingManager.java rename to src/dark/core/helpers/AutoCraftingManager.java index 2b597ec6..6f2fcc30 100644 --- a/src/dark/prefab/machine/AutoCraftingManager.java +++ b/src/dark/core/helpers/AutoCraftingManager.java @@ -1,4 +1,4 @@ -package dark.prefab.machine; +package dark.core.helpers; import java.util.ArrayList; import java.util.List; @@ -18,23 +18,17 @@ import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import cpw.mods.fml.relauncher.ReflectionHelper; -import dark.helpers.Pair; -/** - * Rewrite of the imprinter crafting system into its own manageable class +/** Rewrite of the imprinter crafting system into its own manageable class * - * @author DarkGuardsman - * - */ + * @author DarkGuardsman */ public class AutoCraftingManager { final static boolean doDebug = false; TileEntity craftingEntity; IInventory craftingInv; - /** - * The entity must be an instance of IInventory to pass only the tileEntity - */ + /** The entity must be an instance of IInventory to pass only the tileEntity */ public AutoCraftingManager(final IAutoCrafter entity) { this.craftingEntity = (TileEntity) entity; @@ -44,9 +38,7 @@ public class AutoCraftingManager } } - /** - * Use only the entity if it is also an instance of IInventory - */ + /** Use only the entity if it is also an instance of IInventory */ public AutoCraftingManager(final IAutoCrafter entity, final IInventory inv) { this(entity); @@ -64,11 +56,9 @@ public class AutoCraftingManager } } - /** - * Does this player's inventory contain the required resources to craft this item? + /** Does this player's inventory contain the required resources to craft this item? * - * @return Required items to make the desired item. - */ + * @return Required items to make the desired item. */ public Pair getIdealRecipe(ItemStack outputItem) { this.printDebug("IdealRecipe", outputItem.toString()); @@ -132,13 +122,11 @@ public class AutoCraftingManager return null; } - /** - * Gets the itemStacks in the inv based on slots + /** Gets the itemStacks in the inv based on slots * * @param inv - @IInventory instance * @param slots - slot # to be used - * @return array of itemStack the same size as the slots input array - */ + * @return array of itemStack the same size as the slots input array */ public ItemStack[] getInvItems(IInventory inv, int... slots) { ItemStack[] containingItems = new ItemStack[slots.length]; @@ -154,11 +142,9 @@ public class AutoCraftingManager return containingItems; } - /** - * Returns if the following inventory has the following resource required. + /** Returns if the following inventory has the following resource required. * - * @param recipeItems - The items to be checked for the recipes. - */ + * @param recipeItems - The items to be checked for the recipes. */ public ArrayList hasResource(Object[] recipeItems) { try @@ -170,9 +156,7 @@ public class AutoCraftingManager { this.printDebug("ResourceChecker", "Looking for " + recipeItems.toString()); } - /** - * The actual amount of resource required. Each ItemStack will only have stacksize of 1. - */ + /** The actual amount of resource required. Each ItemStack will only have stacksize of 1. */ ArrayList actualResources = new ArrayList(); int itemMatch = 0; @@ -200,9 +184,7 @@ public class AutoCraftingManager } else if (obj instanceof ArrayList) { - /** - * Look for various possible ingredients of the same item and try to match it. - */ + /** Look for various possible ingredients of the same item and try to match it. */ ArrayList ingredientsList = (ArrayList) obj; Object[] ingredientsArray = ingredientsList.toArray(); @@ -248,13 +230,11 @@ public class AutoCraftingManager return null; } - /** - * Decreases the stack by a set amount + /** Decreases the stack by a set amount * * @param stack - starting stack * @param amount - amount of items - * @return the edited stack - */ + * @return the edited stack */ public static ItemStack decrStackSize(ItemStack stack, int amount) { if (stack != null) @@ -281,14 +261,12 @@ public class AutoCraftingManager } } - /** - * Checks if an item exist within the inv array + /** Checks if an item exist within the inv array * * @param recipeItem - itemstack being searched for * @param containingItems - inv array containing the search bounds * @return the point in the array the item was found -1 = the item was null or not valid -2 = - * the item was not found - */ + * the item was not found */ private int doesItemExist(ItemStack recipeItem, ItemStack[] containingItems) { if (recipeItem == null || recipeItem.itemID == 0 || recipeItem.stackSize <= 0) @@ -314,8 +292,7 @@ public class AutoCraftingManager return -2; } - /** - * Checks if itemstack are equal based on crafting result rather than normal itemstack this is + /** Checks if itemstack are equal based on crafting result rather than normal itemstack this is * done so that if the itemstack returns with * * @param recipeItem - itemstack being compared @@ -326,11 +303,10 @@ public class AutoCraftingManager * status * * If the item's meta data is not normal or in other words equals 32767 the meta data will be - * ignored - */ + * ignored */ public static boolean areStacksEqual(ItemStack recipeItem, ItemStack checkStack) { - if(recipeItem == null || checkStack == null) + if (recipeItem == null || checkStack == null) { return false; } @@ -345,27 +321,25 @@ public class AutoCraftingManager return recipeItem.isItemEqual(checkStack); } - /** - * Consumes an item checking for extra conditions like container items + /** Consumes an item checking for extra conditions like container items * * @param stack - starting itemStack * @param ammount - amount to consume - * @return what is left of the itemStack if any - */ + * @return what is left of the itemStack if any */ public static ItemStack consumeItem(ItemStack itemStack, int amount) { if (itemStack == null) { return null; } - + ItemStack stack = itemStack.copy(); - + if (stack.getItem() instanceof ItemBucket && stack.itemID != Item.bucketEmpty.itemID) { return new ItemStack(Item.bucketEmpty, 1); } - + if (stack.getItem().hasContainerItem()) { ItemStack containerStack = stack.getItem().getContainerItemStack(stack); @@ -392,11 +366,9 @@ public class AutoCraftingManager return decrStackSize(stack, amount); } - /** - * Used to automatically remove selected items from crafting inv + /** Used to automatically remove selected items from crafting inv * - * @param requiredItems - items that are to be removed - */ + * @param requiredItems - items that are to be removed */ public void consumeItems(ItemStack... requiredItems) { if (requiredItems != null) diff --git a/src/dark/helpers/ConnectionHelper.java b/src/dark/core/helpers/ConnectionHelper.java similarity index 86% rename from src/dark/helpers/ConnectionHelper.java rename to src/dark/core/helpers/ConnectionHelper.java index 140aad1a..fad877ed 100644 --- a/src/dark/helpers/ConnectionHelper.java +++ b/src/dark/core/helpers/ConnectionHelper.java @@ -1,4 +1,4 @@ -package dark.helpers; +package dark.core.helpers; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -7,16 +7,14 @@ import universalelectricity.core.vector.Vector3; public class ConnectionHelper { - /** - * Used to find all tileEntities sounding the location you will have to filter for selective + /** Used to find all tileEntities sounding the location you will have to filter for selective * tileEntities * * @param world - the world being searched threw * @param x * @param y * @param z - * @return an array of up to 6 tileEntities - */ + * @return an array of up to 6 tileEntities */ public static TileEntity[] getSurroundingTileEntities(TileEntity ent) { return getSurroundingTileEntities(ent.worldObj, ent.xCoord, ent.yCoord, ent.zCoord); @@ -54,10 +52,8 @@ public class ConnectionHelper return list; } - /** - * Used to find which of 4 Corners this block is in a group of blocks 0 = not a corner 1-4 = a - * corner of some direction - */ + /** Used to find which of 4 Corners this block is in a group of blocks 0 = not a corner 1-4 = a + * corner of some direction */ public static int corner(TileEntity entity) { TileEntity[] en = getSurroundingTileEntities(entity.worldObj, entity.xCoord, entity.yCoord, entity.zCoord); diff --git a/src/dark/helpers/Direction.java b/src/dark/core/helpers/Direction.java similarity index 98% rename from src/dark/helpers/Direction.java rename to src/dark/core/helpers/Direction.java index d5ec0edc..2934cf2d 100644 --- a/src/dark/helpers/Direction.java +++ b/src/dark/core/helpers/Direction.java @@ -1,4 +1,4 @@ -package dark.helpers; +package dark.core.helpers; import universalelectricity.core.vector.Vector3; diff --git a/src/dark/helpers/FluidHelper.java b/src/dark/core/helpers/FluidHelper.java similarity index 99% rename from src/dark/helpers/FluidHelper.java rename to src/dark/core/helpers/FluidHelper.java index ce5338da..45f5ad07 100644 --- a/src/dark/helpers/FluidHelper.java +++ b/src/dark/core/helpers/FluidHelper.java @@ -1,4 +1,4 @@ -package dark.helpers; +package dark.core.helpers; import net.minecraft.block.Block; import net.minecraft.world.World; diff --git a/src/dark/helpers/FluidRestrictionHandler.java b/src/dark/core/helpers/FluidRestrictionHandler.java similarity index 98% rename from src/dark/helpers/FluidRestrictionHandler.java rename to src/dark/core/helpers/FluidRestrictionHandler.java index efbc5975..f624b393 100644 --- a/src/dark/helpers/FluidRestrictionHandler.java +++ b/src/dark/core/helpers/FluidRestrictionHandler.java @@ -1,4 +1,4 @@ -package dark.helpers; +package dark.core.helpers; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.fluids.Fluid; diff --git a/src/dark/core/helpers/IAutoCrafter.java b/src/dark/core/helpers/IAutoCrafter.java new file mode 100644 index 00000000..23c749a8 --- /dev/null +++ b/src/dark/core/helpers/IAutoCrafter.java @@ -0,0 +1,7 @@ +package dark.core.helpers; + +public interface IAutoCrafter +{ + /** The slots used by the crafter for resources */ + public int[] getCraftingInv(); +} diff --git a/src/dark/helpers/ItemFindingHelper.java b/src/dark/core/helpers/ItemFindingHelper.java similarity index 83% rename from src/dark/helpers/ItemFindingHelper.java rename to src/dark/core/helpers/ItemFindingHelper.java index 9d8c57aa..687117c0 100644 --- a/src/dark/helpers/ItemFindingHelper.java +++ b/src/dark/core/helpers/ItemFindingHelper.java @@ -1,4 +1,4 @@ -package dark.helpers; +package dark.core.helpers; import java.util.ArrayList; import java.util.List; @@ -14,32 +14,26 @@ import universalelectricity.core.vector.Vector3; public class ItemFindingHelper { - /** - * gets all EntityItems in a location using a start and end point - */ + /** gets all EntityItems in a location using a start and end point */ public static List findAllItemIn(World world, Vector3 start, Vector3 end) { return world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(start.x, start.y, start.z, end.x, end.y, end.z)); } - /** - * Gets all EntityItems in an area and sorts them by a list of itemStacks + /** Gets all EntityItems in an area and sorts them by a list of itemStacks * * @param world - world being worked in * @param start - start point * @param end - end point * @param disiredItems - list of item that are being looked for - * @return a list of EntityItem that match the itemStacks desired - */ + * @return a list of EntityItem that match the itemStacks desired */ public static List findSelectItems(World world, Vector3 start, Vector3 end, List disiredItems) { List entityItems = ItemFindingHelper.findAllItemIn(world, start, end); return filterEntityItemsList(entityItems, disiredItems); } - /** - * filters an EntityItem List to a List of Items - */ + /** filters an EntityItem List to a List of Items */ public static List filterEntityItemsList(List entityItems, List disiredItems) { List newItemList = new ArrayList(); @@ -58,9 +52,7 @@ public class ItemFindingHelper return newItemList; } - /** - * filters out EnittyItems from an Entity list - */ + /** filters out EnittyItems from an Entity list */ public static List filterOutEntityItems(List entities) { List newEntityList = new ArrayList(); @@ -76,13 +68,11 @@ public class ItemFindingHelper return newEntityList; } - /** - * filter a list of itemStack to another list of itemStacks + /** filter a list of itemStack to another list of itemStacks * * @param totalItems - full list of items being filtered * @param desiredItems - list the of item that are being filtered too - * @return a list of item from the original that are wanted - */ + * @return a list of item from the original that are wanted */ public static List filterItems(List totalItems, List desiredItems) { List newItemList = new ArrayList(); @@ -101,15 +91,13 @@ public class ItemFindingHelper return newItemList; } - /** - * Drops an item stack at the exact center of the location without any velocity or random throw + /** Drops an item stack at the exact center of the location without any velocity or random throw * angle * * @param world - world to drop the item in * @param x y z - location vector * @param stack - itemstack to drop - * @return if the item was spawned in the world - */ + * @return if the item was spawned in the world */ public static boolean dropItemStackExact(World world, double x, double y, double z, ItemStack stack) { if (!world.isRemote && stack != null) @@ -121,14 +109,12 @@ public class ItemFindingHelper return false; } - /** - * grabs all the items that the block can drop then pass them onto dropBlockAsItem_do + /** grabs all the items that the block can drop then pass them onto dropBlockAsItem_do * * @param world * @param x * @param y - * @param z - */ + * @param z */ public static void dropBlockAsItem(World world, int x, int y, int z) { if (!world.isRemote) diff --git a/src/dark/helpers/MetaGroup.java b/src/dark/core/helpers/MetaGroup.java similarity index 66% rename from src/dark/helpers/MetaGroup.java rename to src/dark/core/helpers/MetaGroup.java index cae755c4..5d5ae1db 100644 --- a/src/dark/helpers/MetaGroup.java +++ b/src/dark/core/helpers/MetaGroup.java @@ -1,18 +1,14 @@ -package dark.helpers; +package dark.core.helpers; -/** - * Used by machines that only rotate to 4 directions +/** Used by machines that only rotate to 4 directions * - * @author DarkGuardsman * - */ + * @author DarkGuardsman * */ public class MetaGroup { - /** - * Gets minecraft style facing direction base + /** Gets minecraft style facing direction base * * @param metaData - block metadata based on 4 meta rotation - * @return 2,5,3,4 - */ + * @return 2,5,3,4 */ public static int getFacingMeta(int metaData) { int meta = metaData % 4; @@ -35,18 +31,16 @@ public class MetaGroup return newMeta; } - /** - * Gets the block's group - */ + /** Gets the block's group */ public static int getGrouping(int meta) { return meta % 4; } - /** - * Gets the starting meta of a group + + /** Gets the starting meta of a group + * * @param grouping - 4 meta group base - * @return metadata - */ + * @return metadata */ public static int getGroupStartMeta(int grouping) { return grouping * 4; diff --git a/src/dark/helpers/Pair.java b/src/dark/core/helpers/Pair.java similarity index 95% rename from src/dark/helpers/Pair.java rename to src/dark/core/helpers/Pair.java index 258d9fb1..9dd3e7dc 100644 --- a/src/dark/helpers/Pair.java +++ b/src/dark/core/helpers/Pair.java @@ -1,4 +1,4 @@ -package dark.helpers; +package dark.core.helpers; public class Pair { diff --git a/src/dark/helpers/PlayerMsgHelper.java b/src/dark/core/helpers/PlayerMsgHelper.java similarity index 98% rename from src/dark/helpers/PlayerMsgHelper.java rename to src/dark/core/helpers/PlayerMsgHelper.java index 957158f2..676d81d2 100644 --- a/src/dark/helpers/PlayerMsgHelper.java +++ b/src/dark/core/helpers/PlayerMsgHelper.java @@ -1,4 +1,4 @@ -package dark.helpers; +package dark.core.helpers; import java.util.Iterator; import java.util.List; diff --git a/src/dark/helpers/Time.java b/src/dark/core/helpers/Time.java similarity index 97% rename from src/dark/helpers/Time.java rename to src/dark/core/helpers/Time.java index 354e4cd0..fc5222cc 100644 --- a/src/dark/helpers/Time.java +++ b/src/dark/core/helpers/Time.java @@ -1,4 +1,4 @@ -package dark.helpers; +package dark.core.helpers; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/src/dark/core/items/parts/EnumMeterials.java b/src/dark/core/items/EnumMeterials.java similarity index 97% rename from src/dark/core/items/parts/EnumMeterials.java rename to src/dark/core/items/EnumMeterials.java index 0e79e9bd..5c3f5c79 100644 --- a/src/dark/core/items/parts/EnumMeterials.java +++ b/src/dark/core/items/EnumMeterials.java @@ -1,4 +1,4 @@ -package dark.core.items.parts; +package dark.core.items; import java.util.ArrayList; import java.util.List; @@ -6,11 +6,11 @@ import java.util.List; import net.minecraft.item.ItemStack; import universalelectricity.prefab.ore.OreGenReplaceStone; import dark.core.DarkMain; -import dark.core.recipes.RecipeManager; +import dark.core.RecipeManager; /** Class for storing materials, there icon names, sub items to be made from them or there sub ores - * - * + * + * * @author DarkGuardsman */ public enum EnumMeterials { diff --git a/src/dark/core/items/parts/EnumOreParts.java b/src/dark/core/items/EnumOreParts.java similarity index 95% rename from src/dark/core/items/parts/EnumOreParts.java rename to src/dark/core/items/EnumOreParts.java index 8f9b7f8b..0ee652ac 100644 --- a/src/dark/core/items/parts/EnumOreParts.java +++ b/src/dark/core/items/EnumOreParts.java @@ -1,4 +1,4 @@ -package dark.core.items.parts; +package dark.core.items; public enum EnumOreParts { diff --git a/src/dark/core/items/parts/ItemOre.java b/src/dark/core/items/ItemOre.java similarity index 94% rename from src/dark/core/items/parts/ItemOre.java rename to src/dark/core/items/ItemOre.java index 529f2284..a4e2579b 100644 --- a/src/dark/core/items/parts/ItemOre.java +++ b/src/dark/core/items/ItemOre.java @@ -1,4 +1,4 @@ -package dark.core.items.parts; +package dark.core.items; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; diff --git a/src/dark/core/items/parts/ItemOreDirv.java b/src/dark/core/items/ItemOreDirv.java similarity index 96% rename from src/dark/core/items/parts/ItemOreDirv.java rename to src/dark/core/items/ItemOreDirv.java index fd41c78a..15891e1b 100644 --- a/src/dark/core/items/parts/ItemOreDirv.java +++ b/src/dark/core/items/ItemOreDirv.java @@ -1,4 +1,4 @@ -package dark.core.items.parts; +package dark.core.items; import java.util.List; @@ -10,10 +10,9 @@ import net.minecraftforge.common.Configuration; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.DarkMain; -import dark.core.items.ItemBasic; /** A series of items that are derived from a basic ore block - * + * * @author DarkGuardsman */ public class ItemOreDirv extends ItemBasic { diff --git a/src/dark/core/items/ItemParts.java b/src/dark/core/items/ItemParts.java index f67061c5..fd42ffb8 100644 --- a/src/dark/core/items/ItemParts.java +++ b/src/dark/core/items/ItemParts.java @@ -6,13 +6,10 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; -/** - * Parts that are used for crafting higher up items and block. These parts have no use other that +/** Parts that are used for crafting higher up items and block. These parts have no use other that * crafting * - * @author DarkGuardsman - * - */ + * @author DarkGuardsman */ public class ItemParts extends ItemBasic { @@ -31,7 +28,7 @@ public class ItemParts extends ItemBasic public ItemParts(int itemID, Configuration config) { - super(itemID, "lmPart",config); + super(itemID, "lmPart", config); this.setHasSubtypes(true); this.setMaxDamage(0); this.setMaxStackSize(64); diff --git a/src/dark/library/math/LinearAlg.java b/src/dark/core/math/LinearAlg.java similarity index 77% rename from src/dark/library/math/LinearAlg.java rename to src/dark/core/math/LinearAlg.java index d5fff8c8..c0ad24e3 100644 --- a/src/dark/library/math/LinearAlg.java +++ b/src/dark/core/math/LinearAlg.java @@ -1,13 +1,11 @@ -package dark.library.math; +package dark.core.math; import universalelectricity.core.vector.Vector3; public class LinearAlg { - /** - * @param vec - vector3 that is on the sphere - * @return new Vector3(radius, inclination, azimuth) - */ + /** @param vec - vector3 that is on the sphere + * @return new Vector3(radius, inclination, azimuth) */ public static Vector3 vecToSphereAngles(Vector3 vec) { double radius = Math.sqrt((vec.x * vec.x) + (vec.y * vec.y) + (vec.z * vec.z)); @@ -16,14 +14,12 @@ public class LinearAlg return new Vector3(radius, inclination, azimuth); } - /** - * Turns radius and sphere cords into a vector3 + /** Turns radius and sphere cords into a vector3 * * @param radius - sphere radius * @param inclination - * @param azimuth - * @return Vector3(x,y,z) - */ + * @return Vector3(x,y,z) */ public static Vector3 sphereAnglesToVec(Double radius, Double inclination, Double azimuth) { double x = radius * Math.sin(inclination) * Math.cos(azimuth); diff --git a/src/dark/library/math/MathHelper.java b/src/dark/core/math/MathHelper.java similarity index 83% rename from src/dark/library/math/MathHelper.java rename to src/dark/core/math/MathHelper.java index c3a6c86e..19d918c6 100644 --- a/src/dark/library/math/MathHelper.java +++ b/src/dark/core/math/MathHelper.java @@ -1,32 +1,28 @@ -package dark.library.math; +package dark.core.math; import java.util.Random; public class MathHelper { - /** - * Generates an array of random numbers + /** Generates an array of random numbers * * @param random - random instance to be used * @param maxNumber - max size of the int to use * @param arraySize - length of the array - * @return array of random numbers - */ + * @return array of random numbers */ public static int[] generateRandomIntArray(Random random, int maxNumber, int arraySize) { return MathHelper.generateRandomIntArray(random, 0, maxNumber, arraySize); } - /** - * Generates an array of random numbers + /** Generates an array of random numbers * * @param random - random instance to be used * @param minNumber - smallest random Integer to use. Warning can lead to longer than normal * delay in returns * @param maxNumber - max size of the int to use * @param arraySize - length of the array - * @return array of random numbers - */ + * @return array of random numbers */ public static int[] generateRandomIntArray(Random random, int minNumber, int maxNumber, int arraySize) { int[] array = new int[arraySize]; diff --git a/src/dark/library/math/Matrix4.java b/src/dark/core/math/Matrix4.java similarity index 87% rename from src/dark/library/math/Matrix4.java rename to src/dark/core/math/Matrix4.java index fb0ec41e..b349caf4 100644 --- a/src/dark/library/math/Matrix4.java +++ b/src/dark/core/math/Matrix4.java @@ -1,4 +1,4 @@ -package dark.library.math; +package dark.core.math; public class Matrix4 { diff --git a/src/dark/library/math/Quaternion.java b/src/dark/core/math/Quaternion.java similarity index 90% rename from src/dark/library/math/Quaternion.java rename to src/dark/core/math/Quaternion.java index dcc24f53..b244951a 100644 --- a/src/dark/library/math/Quaternion.java +++ b/src/dark/core/math/Quaternion.java @@ -1,14 +1,11 @@ -package dark.library.math; +package dark.core.math; import universalelectricity.core.vector.Vector3; -/** - * This code is converted from C code to java based off of this tutorial +/** This code is converted from C code to java based off of this tutorial * http://content.gpwiki.org/index.php/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation * - * @author DarkGuardsman - * - */ + * @author DarkGuardsman */ public class Quaternion { public static final float TOLERANCE = 0.00001f; @@ -48,9 +45,7 @@ public class Quaternion this.w = w; } - /** - * Normalizes the Quaternion only if its outside the min errors range - */ + /** Normalizes the Quaternion only if its outside the min errors range */ public void normalise() { // Don't normalize if we don't have to @@ -65,9 +60,7 @@ public class Quaternion } } - /** - * Gets the inverse of this Quaternion - */ + /** Gets the inverse of this Quaternion */ public Quaternion getConj() { return new Quaternion(-x, -y, -z, w); @@ -80,9 +73,7 @@ public class Quaternion z = -z; } - /** - * Multiplying q1 with q2 applies the rotation q2 to q1 - * */ + /** Multiplying q1 with q2 applies the rotation q2 to q1 */ public Quaternion multi(Quaternion rq) { return new Quaternion(w * rq.x + x * rq.w + y * rq.z - z * rq.y, w * rq.y + y * rq.w + z * rq.x - x * rq.z, w * rq.z + z * rq.w + x * rq.y - y * rq.x, w * rq.w - x * rq.x - y * rq.y - z * rq.z); @@ -94,9 +85,7 @@ public class Quaternion this.set(temp); } - /** - * Multi a vector against this in other words applying rotation - */ + /** Multi a vector against this in other words applying rotation */ public Vector3 multi(Vector3 vec) { Vector3 vn = vec.clone(); diff --git a/src/dark/prefab/machine/terminal/CommandHelp.java b/src/dark/core/terminal/CommandHelp.java similarity index 98% rename from src/dark/prefab/machine/terminal/CommandHelp.java rename to src/dark/core/terminal/CommandHelp.java index 3bb575bb..041284b8 100644 --- a/src/dark/prefab/machine/terminal/CommandHelp.java +++ b/src/dark/core/terminal/CommandHelp.java @@ -1,5 +1,4 @@ -package dark.prefab.machine.terminal; - +package dark.core.terminal; import java.util.ArrayList; import java.util.List; diff --git a/src/dark/prefab/machine/terminal/CommandRegistry.java b/src/dark/core/terminal/CommandRegistry.java similarity index 77% rename from src/dark/prefab/machine/terminal/CommandRegistry.java rename to src/dark/core/terminal/CommandRegistry.java index fe67572f..aad5a0e9 100644 --- a/src/dark/prefab/machine/terminal/CommandRegistry.java +++ b/src/dark/core/terminal/CommandRegistry.java @@ -1,25 +1,18 @@ -package dark.prefab.machine.terminal; - +package dark.core.terminal; import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; import dark.api.ITerminal; -/** - * - * @author Calclavia, DarkGuardsman - * - */ + +/** @author Calclavia, DarkGuardsman */ public class CommandRegistry { public static final List COMMANDS = new ArrayList(); - /** - * - * @param prefix - what the command starts with for example /time - * @param cmd - Cmd instance that will execute the command - */ + /** @param prefix - what the command starts with for example /time + * @param cmd - Cmd instance that will execute the command */ public static void register(TerminalCommand cmd) { if (!COMMANDS.contains(cmd)) @@ -28,11 +21,9 @@ public class CommandRegistry } } - /** - * When a player uses a command in any CMD machine it pass threw here first + /** When a player uses a command in any CMD machine it pass threw here first * - * @param terminal - The terminal, can be cast to TileEntity. - */ + * @param terminal - The terminal, can be cast to TileEntity. */ public static void onCommand(EntityPlayer player, ITerminal terminal, String cmd) { if (cmd != null && cmd != "") diff --git a/src/dark/prefab/machine/terminal/CommandUser.java b/src/dark/core/terminal/CommandUser.java similarity index 96% rename from src/dark/prefab/machine/terminal/CommandUser.java rename to src/dark/core/terminal/CommandUser.java index 52e06649..cd7690a0 100644 --- a/src/dark/prefab/machine/terminal/CommandUser.java +++ b/src/dark/core/terminal/CommandUser.java @@ -1,4 +1,4 @@ -package dark.prefab.machine.terminal; +package dark.core.terminal; import java.util.ArrayList; import java.util.List; @@ -6,7 +6,7 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayer; import dark.api.ISpecialAccess; import dark.api.ITerminal; -import dark.library.access.AccessLevel; +import dark.core.access.AccessLevel; public class CommandUser extends TerminalCommand { diff --git a/src/dark/prefab/machine/terminal/ContainerTerminal.java b/src/dark/core/terminal/ContainerTerminal.java similarity index 95% rename from src/dark/prefab/machine/terminal/ContainerTerminal.java rename to src/dark/core/terminal/ContainerTerminal.java index dd6b255b..716af9cd 100644 --- a/src/dark/prefab/machine/terminal/ContainerTerminal.java +++ b/src/dark/core/terminal/ContainerTerminal.java @@ -1,4 +1,4 @@ -package dark.prefab.machine.terminal; +package dark.core.terminal; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; diff --git a/src/dark/prefab/machine/terminal/TerminalCommand.java b/src/dark/core/terminal/TerminalCommand.java similarity index 58% rename from src/dark/prefab/machine/terminal/TerminalCommand.java rename to src/dark/core/terminal/TerminalCommand.java index 08e8f7b5..02b0fd0c 100644 --- a/src/dark/prefab/machine/terminal/TerminalCommand.java +++ b/src/dark/core/terminal/TerminalCommand.java @@ -1,61 +1,45 @@ -package dark.prefab.machine.terminal; - +package dark.core.terminal; import java.util.List; import net.minecraft.entity.player.EntityPlayer; import dark.api.ISpecialAccess; import dark.api.ITerminal; -/** - * - * @author Calclavia, DarkGuardsman - * - */ + +/** @author Calclavia, DarkGuardsman */ public abstract class TerminalCommand { - /** - * what the commands starts with /help /time /day + /** what the commands starts with /help /time /day * - * @return - */ + * @return */ public abstract String getCommandPrefix(); - /** - * Executes the command + /** Executes the command * * @param var1 - * @param args - */ + * @param args */ public abstract boolean processCommand(EntityPlayer player, ITerminal terminal, String[] args); - /** - * Returns true if the given command sender is allowed to use this command. - */ + /** Returns true if the given command sender is allowed to use this command. */ public abstract boolean canPlayerUse(EntityPlayer player, ISpecialAccess specialAccess); - /** - * should this command show on /help + /** should this command show on /help * * @param player - used to find if it should show - * @return true/false - */ + * @return true/false */ public abstract boolean showOnHelp(EntityPlayer player, ISpecialAccess specialAccess); - /** - * returns the list of commands that the player can view on /help keep it shorter than 22 chars + /** returns the list of commands that the player can view on /help keep it shorter than 22 chars * to fit on Cmd Gui * * @param player - * @return - */ + * @return */ public abstract List getCmdUses(EntityPlayer player, ISpecialAccess specialAccess); - /** - * some cmds can only be use on some machines but will be access by all machines. to prevent the + /** some cmds can only be use on some machines but will be access by all machines. to prevent the * cmd from activating on the machine return false * * @param mm - * @return - */ + * @return */ public abstract boolean canMachineUse(ISpecialAccess specialAccess); } diff --git a/src/dark/prefab/machine/terminal/TileEntityTerminal.java b/src/dark/core/terminal/TileEntityTerminal.java similarity index 98% rename from src/dark/prefab/machine/terminal/TileEntityTerminal.java rename to src/dark/core/terminal/TileEntityTerminal.java index 82ad033c..d8a7ea1b 100644 --- a/src/dark/prefab/machine/terminal/TileEntityTerminal.java +++ b/src/dark/core/terminal/TileEntityTerminal.java @@ -1,4 +1,4 @@ -package dark.prefab.machine.terminal; +package dark.core.terminal; import java.util.ArrayList; import java.util.HashSet; @@ -22,9 +22,9 @@ import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; import dark.api.ISpecialAccess; import dark.api.ITerminal; -import dark.library.access.AccessLevel; -import dark.library.access.UserAccess; -import dark.prefab.machine.TileEntityMachine; +import dark.core.access.AccessLevel; +import dark.core.access.UserAccess; +import dark.core.blocks.TileEntityMachine; /** @author Calclavia, DarkGuardsman */ public abstract class TileEntityTerminal extends TileEntityMachine implements ISpecialAccess, IPacketReceiver, ITerminal diff --git a/src/dark/core/tile/network/NetworkSharedPower.java b/src/dark/core/tile/network/NetworkSharedPower.java index b9179bc1..b1d61e22 100644 --- a/src/dark/core/tile/network/NetworkSharedPower.java +++ b/src/dark/core/tile/network/NetworkSharedPower.java @@ -6,7 +6,7 @@ import dark.api.INetworkPart; /** Used for tile networks that only need to share power or act like a group battery that doesn't * store power on world save - * + * * @author DarkGuardsman */ public class NetworkSharedPower extends NetworkTileEntities { diff --git a/src/dark/core/tile/network/NetworkTileEntities.java b/src/dark/core/tile/network/NetworkTileEntities.java index bf0ca173..abff6bcb 100644 --- a/src/dark/core/tile/network/NetworkTileEntities.java +++ b/src/dark/core/tile/network/NetworkTileEntities.java @@ -13,7 +13,7 @@ import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.VectorHelper; import cpw.mods.fml.common.FMLLog; import dark.api.INetworkPart; -import dark.helpers.ConnectionHelper; +import dark.core.helpers.ConnectionHelper; public abstract class NetworkTileEntities { @@ -27,13 +27,13 @@ public abstract class NetworkTileEntities /** Creates a new instance of this network to be used to merge or split networks while still * maintaining each class that extends the base network class - * + * * @return - new network instance using the current networks properties */ public abstract NetworkTileEntities newInstance(); /** Adds a TileEntity to the network. extends this to catch non-network parts and add them to * other tile lists - * + * * @param tileEntity - tileEntity instance * @param member - add to network member list * @return */ @@ -129,7 +129,7 @@ public abstract class NetworkTileEntities /** Combines two networks together into one. Calls to preMerge and doMerge instead of doing the * merge process itself - * + * * @param network * @param part */ public void merge(NetworkTileEntities network, INetworkPart part) @@ -147,17 +147,17 @@ public abstract class NetworkTileEntities /** Processing that needs too be done before the network merges. Use this to do final network * merge calculations and to cause network merge failure - * + * * @param network the network that is to merge with this one * @param part the part at which started the network merge. Use this to cause damage if two * networks merge with real world style failures - * + * * @return false if the merge needs to be canceled. - * + * * Cases in which the network should fail to merge are were the two networks merge with error. * Or, in the case of pipes the two networks merge and the merge point was destroyed by * combination of liquids. - * + * * Ex Lava and water */ public boolean preMergeProcessing(NetworkTileEntities network, INetworkPart part) { @@ -249,7 +249,7 @@ public abstract class NetworkTileEntities } /** invalidates/remove a tile from the networks that surround and connect to it - * + * * @param tileEntity - tile */ public static void invalidate(TileEntity tileEntity) { diff --git a/src/dark/library/gui/ISlotWatcher.java b/src/dark/library/gui/ISlotWatcher.java deleted file mode 100644 index cb47e5e2..00000000 --- a/src/dark/library/gui/ISlotWatcher.java +++ /dev/null @@ -1,12 +0,0 @@ -package dark.library.gui; - -/** - * Add this to a container class if using WatchedSlot to trigger the container on slot change - */ -public interface ISlotWatcher -{ - /** - * Will trigger if the watched slot has changed - */ - public void slotContentsChanged(int slot); -} diff --git a/src/dark/library/saving/INbtSave.java b/src/dark/library/saving/INbtSave.java deleted file mode 100644 index 9fcb8b1a..00000000 --- a/src/dark/library/saving/INbtSave.java +++ /dev/null @@ -1,27 +0,0 @@ -package dark.library.saving; - -import net.minecraft.nbt.NBTTagCompound; -/** - * Classes the register to need saving on world save use this - * - * @author DarkGuardsman - * - */ -public interface INbtSave -{ - /** - * gets the file name to save as - */ - public String saveFileName(); - - /** - * the data to save when saving to the file - */ - public NBTTagCompound getSaveData(); - - /** - * can the file be saved at this moment - */ - public boolean shouldSave(boolean isServer); - -} diff --git a/src/dark/prefab/machine/IAutoCrafter.java b/src/dark/prefab/machine/IAutoCrafter.java deleted file mode 100644 index 01ccdc07..00000000 --- a/src/dark/prefab/machine/IAutoCrafter.java +++ /dev/null @@ -1,9 +0,0 @@ -package dark.prefab.machine; - -public interface IAutoCrafter -{ - /** - * The slots used by the crafter for resources - */ - public int[] getCraftingInv(); -} diff --git a/src/dark/prefab/machine/IBlockActivate.java b/src/dark/prefab/machine/IBlockActivate.java deleted file mode 100644 index e445fd4d..00000000 --- a/src/dark/prefab/machine/IBlockActivate.java +++ /dev/null @@ -1,17 +0,0 @@ -package dark.prefab.machine; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * A general interface to be implemented by anything that needs it. - * - * @author Calclavia - * - */ -public interface IBlockActivate -{ - /** - * Called when activated - */ - public boolean onActivated(EntityPlayer entityPlayer); -} \ No newline at end of file diff --git a/src/dark/transmit/laser/TileEntityLaserEmitter.java b/src/dark/transmit/laser/TileEntityLaserEmitter.java index 6830287a..8b4b67cc 100644 --- a/src/dark/transmit/laser/TileEntityLaserEmitter.java +++ b/src/dark/transmit/laser/TileEntityLaserEmitter.java @@ -1,7 +1,7 @@ package dark.transmit.laser; import net.minecraftforge.common.ForgeDirection; -import dark.prefab.machine.TileEntityMachine; +import dark.core.blocks.TileEntityMachine; public class TileEntityLaserEmitter extends TileEntityMachine {