diff --git a/src/dark/api/reciepes/MachineRecipeHandler.java b/src/dark/api/reciepes/MachineRecipeHandler.java index 2f281ebc..c7d911ba 100644 --- a/src/dark/api/reciepes/MachineRecipeHandler.java +++ b/src/dark/api/reciepes/MachineRecipeHandler.java @@ -20,7 +20,7 @@ import dark.core.basics.EnumMaterial; import dark.core.basics.EnumOrePart; import dark.core.basics.ItemOreDirv; import dark.core.helpers.AutoCraftingManager; -import dark.machines.common.CoreRecipeLoader; +import dark.machines.CoreRecipeLoader; /** Recipes for ore processor machines * diff --git a/src/dark/core/CoreMachine.java b/src/dark/core/CoreMachine.java index f2a8d2ec..bdad6a8e 100644 --- a/src/dark/core/CoreMachine.java +++ b/src/dark/core/CoreMachine.java @@ -9,8 +9,6 @@ import dark.api.save.SaveManager; import dark.core.prefab.LaserEntityDamageSource; import dark.core.prefab.fluids.FluidHelper; import dark.core.prefab.tilenetwork.NetworkUpdateHandler; -import dark.machines.common.ExternalModHandler; -import dark.machines.common.PlayerKeyHandler; public class CoreMachine { diff --git a/src/dark/machines/common/DMCreativeTab.java b/src/dark/core/DMCreativeTab.java similarity index 96% rename from src/dark/machines/common/DMCreativeTab.java rename to src/dark/core/DMCreativeTab.java index d5cdc1f5..c6440e6b 100644 --- a/src/dark/machines/common/DMCreativeTab.java +++ b/src/dark/core/DMCreativeTab.java @@ -1,4 +1,4 @@ -package dark.machines.common; +package dark.core; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; diff --git a/src/dark/machines/common/EntityTickHandler.java b/src/dark/core/EntityTickHandler.java similarity index 98% rename from src/dark/machines/common/EntityTickHandler.java rename to src/dark/core/EntityTickHandler.java index 375dfa15..e9f62941 100644 --- a/src/dark/machines/common/EntityTickHandler.java +++ b/src/dark/core/EntityTickHandler.java @@ -1,4 +1,4 @@ -package dark.machines.common; +package dark.core; import java.util.EnumSet; diff --git a/src/dark/machines/common/ExternalModHandler.java b/src/dark/core/ExternalModHandler.java similarity index 98% rename from src/dark/machines/common/ExternalModHandler.java rename to src/dark/core/ExternalModHandler.java index 78bc79ca..623f935e 100644 --- a/src/dark/machines/common/ExternalModHandler.java +++ b/src/dark/core/ExternalModHandler.java @@ -1,4 +1,4 @@ -package dark.machines.common; +package dark.core; import net.minecraft.tileentity.TileEntity; import buildcraft.api.transport.IPipeTile; diff --git a/src/dark/core/ModObjectRegistry.java b/src/dark/core/ModObjectRegistry.java index d97442c3..35d27796 100644 --- a/src/dark/core/ModObjectRegistry.java +++ b/src/dark/core/ModObjectRegistry.java @@ -26,7 +26,7 @@ import dark.core.interfaces.IExtraInfo.IExtraBlockInfo; import dark.core.interfaces.IExtraInfo.IExtraItemInfo; import dark.core.prefab.BlockFluid; import dark.core.prefab.machine.BlockMachine; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Handler to make registering all parts of a mod's objects that are loaded into the game by forge * diff --git a/src/dark/machines/common/PlayerKeyHandler.java b/src/dark/core/PlayerKeyHandler.java similarity index 98% rename from src/dark/machines/common/PlayerKeyHandler.java rename to src/dark/core/PlayerKeyHandler.java index 689a12b0..d6fe8f28 100644 --- a/src/dark/machines/common/PlayerKeyHandler.java +++ b/src/dark/core/PlayerKeyHandler.java @@ -1,4 +1,4 @@ -package dark.machines.common; +package dark.core; import java.util.EnumSet; diff --git a/src/dark/core/basics/BlockGasOre.java b/src/dark/core/basics/BlockGasOre.java index bc6820ed..e2938fb9 100644 --- a/src/dark/core/basics/BlockGasOre.java +++ b/src/dark/core/basics/BlockGasOre.java @@ -23,10 +23,10 @@ import universalelectricity.core.vector.Vector3; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.api.IGasBlock; +import dark.core.DMCreativeTab; import dark.core.prefab.ModPrefab; import dark.core.prefab.fluids.EnumGas; -import dark.machines.common.DMCreativeTab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Gas that is designed to generate underground in the same way as an ore * diff --git a/src/dark/core/basics/BlockOre.java b/src/dark/core/basics/BlockOre.java index 67a79835..851b50ef 100644 --- a/src/dark/core/basics/BlockOre.java +++ b/src/dark/core/basics/BlockOre.java @@ -22,8 +22,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.interfaces.IExtraInfo.IExtraBlockInfo; import dark.core.prefab.ModPrefab; -import dark.machines.common.CoreRecipeLoader; -import dark.machines.common.DarkMain; +import dark.machines.CoreRecipeLoader; +import dark.machines.DarkMain; public class BlockOre extends Block implements IExtraBlockInfo { diff --git a/src/dark/core/basics/EnumMaterial.java b/src/dark/core/basics/EnumMaterial.java index e58e3328..51c06cb6 100644 --- a/src/dark/core/basics/EnumMaterial.java +++ b/src/dark/core/basics/EnumMaterial.java @@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.machines.common.CoreRecipeLoader; +import dark.machines.CoreRecipeLoader; /** Class for storing materials, there icon names, sub items to be made from them or there sub ores * diff --git a/src/dark/core/basics/GasOreGenerator.java b/src/dark/core/basics/GasOreGenerator.java index ddd637fd..d724aeba 100644 --- a/src/dark/core/basics/GasOreGenerator.java +++ b/src/dark/core/basics/GasOreGenerator.java @@ -10,7 +10,7 @@ import net.minecraft.world.gen.ChunkProviderEnd; import net.minecraft.world.gen.ChunkProviderHell; import net.minecraftforge.fluids.FluidStack; import cpw.mods.fml.common.IWorldGenerator; -import dark.machines.common.CoreRecipeLoader; +import dark.machines.CoreRecipeLoader; public class GasOreGenerator implements IWorldGenerator { diff --git a/src/dark/core/basics/ItemBlockOre.java b/src/dark/core/basics/ItemBlockOre.java index bde572da..5df62517 100644 --- a/src/dark/core/basics/ItemBlockOre.java +++ b/src/dark/core/basics/ItemBlockOre.java @@ -3,7 +3,7 @@ package dark.core.basics; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import dark.core.basics.BlockOre.OreData; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class ItemBlockOre extends ItemBlock { diff --git a/src/dark/core/basics/ItemCommonTool.java b/src/dark/core/basics/ItemCommonTool.java index dfbfb959..c12fbcbb 100644 --- a/src/dark/core/basics/ItemCommonTool.java +++ b/src/dark/core/basics/ItemCommonTool.java @@ -37,7 +37,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.interfaces.IExtraInfo.IExtraItemInfo; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Flexible tool class that uses NBT to store damage and effect rather than metadata. Metadata * instead is used to store sub items allowing several different tools to exist within the same item diff --git a/src/dark/core/basics/ItemOreDirv.java b/src/dark/core/basics/ItemOreDirv.java index 7313760d..cf3e0b2a 100644 --- a/src/dark/core/basics/ItemOreDirv.java +++ b/src/dark/core/basics/ItemOreDirv.java @@ -16,7 +16,7 @@ import dark.api.events.LaserEvent; import dark.core.interfaces.IExtraInfo.IExtraItemInfo; import dark.core.prefab.ItemBasic; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** A series of items that are derived from a basic material * diff --git a/src/dark/core/basics/ItemParts.java b/src/dark/core/basics/ItemParts.java index 0c7e1073..0b5e49d9 100644 --- a/src/dark/core/basics/ItemParts.java +++ b/src/dark/core/basics/ItemParts.java @@ -13,7 +13,7 @@ import cpw.mods.fml.relauncher.SideOnly; import dark.core.interfaces.IExtraInfo.IExtraItemInfo; import dark.core.prefab.ItemBasic; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** A meta data item containing parts of various crafting recipes. These parts do not do anything but * allow new crafting recipes to be created. diff --git a/src/dark/core/interfaces/IInvBox.java b/src/dark/core/interfaces/IInvBox.java index 5594baa6..5e900989 100644 --- a/src/dark/core/interfaces/IInvBox.java +++ b/src/dark/core/interfaces/IInvBox.java @@ -9,7 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; * automation. As well this is not designed to replace the need for IInventory support of a tile but * to make it easier to manage. Suggested use it to create a prefab manager for several tiles. Then * have those tiles use the prefab as an extermal inventory manager to reduce code size per class. - * + * * @author DarkGuardsman */ public interface IInvBox extends ISidedInventory { @@ -21,4 +21,7 @@ public interface IInvBox extends ISidedInventory /** Called to load the inventory array */ public void loadInv(NBTTagCompound tag); + + /** Dels all the items in the inventory */ + public void clear(); } diff --git a/src/dark/core/loader/DarkCoreModContainer.java b/src/dark/core/loader/DarkCoreModContainer.java index 2bbe958b..794e7875 100644 --- a/src/dark/core/loader/DarkCoreModContainer.java +++ b/src/dark/core/loader/DarkCoreModContainer.java @@ -15,7 +15,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.versioning.ArtifactVersion; import cpw.mods.fml.common.versioning.VersionParser; import cpw.mods.fml.common.versioning.VersionRange; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class DarkCoreModContainer extends DummyModContainer { diff --git a/src/dark/core/network/PacketManagerEffects.java b/src/dark/core/network/PacketManagerEffects.java index 182a57b5..cf2efdb1 100644 --- a/src/dark/core/network/PacketManagerEffects.java +++ b/src/dark/core/network/PacketManagerEffects.java @@ -12,7 +12,7 @@ import universalelectricity.core.vector.Vector3; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.network.Player; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class PacketManagerEffects implements IPacketManager { diff --git a/src/dark/core/network/PacketManagerEntity.java b/src/dark/core/network/PacketManagerEntity.java index d3a5874c..5e991b4e 100644 --- a/src/dark/core/network/PacketManagerEntity.java +++ b/src/dark/core/network/PacketManagerEntity.java @@ -12,7 +12,7 @@ import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class PacketManagerEntity implements IPacketManager { diff --git a/src/dark/core/network/PacketManagerKeyEvent.java b/src/dark/core/network/PacketManagerKeyEvent.java index 86424aee..495112ab 100644 --- a/src/dark/core/network/PacketManagerKeyEvent.java +++ b/src/dark/core/network/PacketManagerKeyEvent.java @@ -12,7 +12,7 @@ import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; import dark.core.interfaces.IControlReceiver; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class PacketManagerKeyEvent implements IPacketManager { diff --git a/src/dark/core/prefab/BlockFluid.java b/src/dark/core/prefab/BlockFluid.java index 40ae8ff0..e441aa84 100644 --- a/src/dark/core/prefab/BlockFluid.java +++ b/src/dark/core/prefab/BlockFluid.java @@ -8,7 +8,7 @@ import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge.fluids.Fluid; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class BlockFluid extends BlockFluidFinite { diff --git a/src/dark/core/prefab/ItemBasic.java b/src/dark/core/prefab/ItemBasic.java index e315ba22..93611f5e 100644 --- a/src/dark/core/prefab/ItemBasic.java +++ b/src/dark/core/prefab/ItemBasic.java @@ -6,7 +6,7 @@ import net.minecraft.util.Icon; import net.minecraftforge.common.Configuration; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class ItemBasic extends Item { diff --git a/src/dark/core/prefab/ModPrefab.java b/src/dark/core/prefab/ModPrefab.java index 53b73bd7..4a810aa4 100644 --- a/src/dark/core/prefab/ModPrefab.java +++ b/src/dark/core/prefab/ModPrefab.java @@ -24,11 +24,11 @@ import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.relauncher.Side; import dark.api.save.SaveManager; import dark.core.CoreMachine; +import dark.core.ExternalModHandler; import dark.core.ModObjectRegistry; +import dark.core.PlayerKeyHandler; import dark.core.prefab.fluids.FluidHelper; import dark.core.prefab.tilenetwork.NetworkUpdateHandler; -import dark.machines.common.ExternalModHandler; -import dark.machines.common.PlayerKeyHandler; public abstract class ModPrefab { diff --git a/src/dark/machines/common/RecipeLoader.java b/src/dark/core/prefab/RecipeLoader.java similarity index 98% rename from src/dark/machines/common/RecipeLoader.java rename to src/dark/core/prefab/RecipeLoader.java index 22b7a2be..537e9998 100644 --- a/src/dark/machines/common/RecipeLoader.java +++ b/src/dark/core/prefab/RecipeLoader.java @@ -1,4 +1,4 @@ -package dark.machines.common; +package dark.core.prefab; import net.minecraft.block.Block; import net.minecraft.item.Item; diff --git a/src/dark/core/prefab/entities/EntityTestCar.java b/src/dark/core/prefab/entities/EntityTestCar.java index 6fdc62f9..4dcf0071 100644 --- a/src/dark/core/prefab/entities/EntityTestCar.java +++ b/src/dark/core/prefab/entities/EntityTestCar.java @@ -1,7 +1,7 @@ package dark.core.prefab.entities; import net.minecraft.world.World; -import dark.machines.common.CoreRecipeLoader; +import dark.machines.CoreRecipeLoader; public class EntityTestCar extends EntityVehicle { diff --git a/src/dark/core/prefab/entities/ItemVehicleSpawn.java b/src/dark/core/prefab/entities/ItemVehicleSpawn.java index 66db9e97..94db4055 100644 --- a/src/dark/core/prefab/entities/ItemVehicleSpawn.java +++ b/src/dark/core/prefab/entities/ItemVehicleSpawn.java @@ -12,8 +12,8 @@ import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import dark.core.DMCreativeTab; import dark.core.prefab.ModPrefab; -import dark.machines.common.DMCreativeTab; /** Basic item used to spawn a vehicle * diff --git a/src/dark/core/prefab/invgui/GuiBar.java b/src/dark/core/prefab/invgui/GuiBar.java index 6c1a8942..2cf5cebd 100644 --- a/src/dark/core/prefab/invgui/GuiBar.java +++ b/src/dark/core/prefab/invgui/GuiBar.java @@ -10,7 +10,7 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import universalelectricity.core.vector.Vector2; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** When done should be a prefab that can be used to render a power bar on the screen * diff --git a/src/dark/core/prefab/invgui/GuiButtonImage.java b/src/dark/core/prefab/invgui/GuiButtonImage.java index 3170d600..7b38d7f6 100644 --- a/src/dark/core/prefab/invgui/GuiButtonImage.java +++ b/src/dark/core/prefab/invgui/GuiButtonImage.java @@ -9,7 +9,7 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; @SideOnly(Side.CLIENT) public class GuiButtonImage extends GuiButton diff --git a/src/dark/core/prefab/invgui/GuiMessageBox.java b/src/dark/core/prefab/invgui/GuiMessageBox.java index 5098a10c..217ceb58 100644 --- a/src/dark/core/prefab/invgui/GuiMessageBox.java +++ b/src/dark/core/prefab/invgui/GuiMessageBox.java @@ -7,7 +7,7 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class GuiMessageBox extends GuiBase { diff --git a/src/dark/core/prefab/invgui/InvChest.java b/src/dark/core/prefab/invgui/InvChest.java index 80aee410..a48354b8 100644 --- a/src/dark/core/prefab/invgui/InvChest.java +++ b/src/dark/core/prefab/invgui/InvChest.java @@ -246,4 +246,11 @@ public class InvChest implements IInvBox } + @Override + public void clear() + { + this.containedItems = null; + this.getContainedItems(); + } + } diff --git a/src/dark/core/prefab/machine/BlockMachine.java b/src/dark/core/prefab/machine/BlockMachine.java index f74cf914..e8770249 100644 --- a/src/dark/core/prefab/machine/BlockMachine.java +++ b/src/dark/core/prefab/machine/BlockMachine.java @@ -29,7 +29,7 @@ import dark.core.ModObjectRegistry.BlockBuildData; import dark.core.interfaces.IBlockActivated; import dark.core.interfaces.IExtraInfo.IExtraBlockInfo; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Basic TileEntity Container class designed to be used by generic machines. It is suggested that * each mod using this create there own basic block extending this to reduce need to use build data diff --git a/src/dark/core/prefab/machine/BlockMulti.java b/src/dark/core/prefab/machine/BlockMulti.java index 0e89c0b7..1ea9e6a1 100644 --- a/src/dark/core/prefab/machine/BlockMulti.java +++ b/src/dark/core/prefab/machine/BlockMulti.java @@ -23,7 +23,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.interfaces.IExtraInfo.IExtraBlockInfo; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class BlockMulti extends BlockContainer implements IExtraBlockInfo { diff --git a/src/dark/core/prefab/machine/TileEntityEnergyMachine.java b/src/dark/core/prefab/machine/TileEntityEnergyMachine.java index e49b7865..100f146a 100644 --- a/src/dark/core/prefab/machine/TileEntityEnergyMachine.java +++ b/src/dark/core/prefab/machine/TileEntityEnergyMachine.java @@ -16,7 +16,7 @@ import universalelectricity.core.grid.IElectricityNetwork; import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.VectorHelper; import dark.api.energy.IPowerLess; -import dark.machines.common.ExternalModHandler; +import dark.core.ExternalModHandler; /** Basic energy tile that can consume power * diff --git a/src/dark/core/prefab/machine/TileEntityMachine.java b/src/dark/core/prefab/machine/TileEntityMachine.java index ae3f1528..e1875009 100644 --- a/src/dark/core/prefab/machine/TileEntityMachine.java +++ b/src/dark/core/prefab/machine/TileEntityMachine.java @@ -22,7 +22,7 @@ import dark.core.interfaces.IInvBox; import dark.core.interfaces.IExtraInfo.IExtraTileEntityInfo; import dark.core.network.ISimplePacketReceiver; import dark.core.network.PacketHandler; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public abstract class TileEntityMachine extends TileEntityInv implements ISidedInventory, IExternalInv, IDisableable, ISimplePacketReceiver, IRotatable, IExtraTileEntityInfo { diff --git a/src/dark/core/prefab/sentry/BlockSentryGun.java b/src/dark/core/prefab/sentry/BlockSentryGun.java index a5e8d2ba..18c671cc 100644 --- a/src/dark/core/prefab/sentry/BlockSentryGun.java +++ b/src/dark/core/prefab/sentry/BlockSentryGun.java @@ -11,7 +11,7 @@ import com.builtbroken.common.Pair; import dark.core.ModObjectRegistry; import dark.core.prefab.ItemBlockHolder; import dark.core.prefab.machine.BlockMachine; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Actual block that is the sentry gun. Mainly a place holder as the sentry guns need something to * exist threw that is not an entity. Renders need to still be handled by the respective mod. diff --git a/src/dark/core/prefab/sentry/BlockSentryPlatform.java b/src/dark/core/prefab/sentry/BlockSentryPlatform.java index afb5c10a..b858ab8a 100644 --- a/src/dark/core/prefab/sentry/BlockSentryPlatform.java +++ b/src/dark/core/prefab/sentry/BlockSentryPlatform.java @@ -2,7 +2,7 @@ package dark.core.prefab.sentry; import net.minecraft.block.material.Material; import dark.core.prefab.machine.BlockMachine; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Base platform for all sentry and turret's created to use for power, logic, and inventory * connections to the world. diff --git a/src/dark/core/prefab/sentry/TileEntitySentry.java b/src/dark/core/prefab/sentry/TileEntitySentry.java index 2ba9236b..43a1dc15 100644 --- a/src/dark/core/prefab/sentry/TileEntitySentry.java +++ b/src/dark/core/prefab/sentry/TileEntitySentry.java @@ -21,7 +21,7 @@ import dark.core.helpers.RayTraceHelper; import dark.core.network.PacketHandler; import dark.core.prefab.entities.EntityTileDamage; import dark.core.prefab.machine.TileEntityMachine; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Prefab tileEntity for creating senty guns that can be of type aimed, mounted, or automated. * Contains most of the code for a sentry gun to operate short of aiming and operating logic. This diff --git a/src/dark/machines/common/CommonProxy.java b/src/dark/machines/CommonProxy.java similarity index 88% rename from src/dark/machines/common/CommonProxy.java rename to src/dark/machines/CommonProxy.java index 13ee19dc..0afaed85 100644 --- a/src/dark/machines/common/CommonProxy.java +++ b/src/dark/machines/CommonProxy.java @@ -1,4 +1,4 @@ -package dark.machines.common; +package dark.machines; import java.awt.Color; @@ -8,10 +8,10 @@ import net.minecraft.world.World; import universalelectricity.core.vector.Vector3; import cpw.mods.fml.common.network.IGuiHandler; import dark.core.network.PacketManagerEffects; -import dark.machines.common.machines.ContainerBatteryBox; -import dark.machines.common.machines.ContainerCoalGenerator; -import dark.machines.common.machines.TileEntityBatteryBox; -import dark.machines.common.machines.TileEntitySteamGen; +import dark.machines.generators.ContainerCoalGenerator; +import dark.machines.generators.TileEntitySteamGen; +import dark.machines.machines.ContainerBatteryBox; +import dark.machines.machines.TileEntityBatteryBox; public class CommonProxy implements IGuiHandler { diff --git a/src/dark/machines/common/CoreRecipeLoader.java b/src/dark/machines/CoreRecipeLoader.java similarity index 98% rename from src/dark/machines/common/CoreRecipeLoader.java rename to src/dark/machines/CoreRecipeLoader.java index 098f96e7..780a39e5 100644 --- a/src/dark/machines/common/CoreRecipeLoader.java +++ b/src/dark/machines/CoreRecipeLoader.java @@ -1,4 +1,4 @@ -package dark.machines.common; +package dark.machines; import net.minecraft.block.Block; import net.minecraft.item.Item; @@ -19,11 +19,12 @@ import dark.core.basics.ItemOreDirv; import dark.core.basics.ItemParts; import dark.core.basics.BlockOre.OreData; import dark.core.basics.ItemParts.Parts; -import dark.machines.common.blocks.BlockBasalt; -import dark.machines.common.items.ItemReadoutTools; -import dark.machines.common.items.ItemWrench; -import dark.machines.common.machines.BlockSolarPanel; -import dark.machines.common.transmit.BlockWire; +import dark.core.prefab.RecipeLoader; +import dark.machines.deco.BlockBasalt; +import dark.machines.generators.BlockSolarPanel; +import dark.machines.items.ItemReadoutTools; +import dark.machines.items.ItemWrench; +import dark.machines.transmit.BlockWire; public class CoreRecipeLoader extends RecipeLoader { diff --git a/src/dark/machines/common/DarkMain.java b/src/dark/machines/DarkMain.java similarity index 94% rename from src/dark/machines/common/DarkMain.java rename to src/dark/machines/DarkMain.java index 0b21e389..a347a1c7 100644 --- a/src/dark/machines/common/DarkMain.java +++ b/src/dark/machines/DarkMain.java @@ -1,4 +1,4 @@ -package dark.machines.common; +package dark.machines; import java.awt.Color; import java.io.File; @@ -34,6 +34,7 @@ import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import dark.api.reciepes.MachineRecipeHandler; +import dark.core.DMCreativeTab; import dark.core.ModObjectRegistry; import dark.core.basics.BlockGasOre; import dark.core.basics.BlockOre; @@ -55,23 +56,23 @@ import dark.core.prefab.entities.ItemVehicleSpawn; import dark.core.prefab.fluids.EnumGas; import dark.core.prefab.machine.BlockMulti; import dark.core.prefab.machine.TileEntityNBTContainer; -import dark.machines.common.blocks.BlockBasalt; -import dark.machines.common.blocks.BlockColorGlass; -import dark.machines.common.blocks.BlockColorGlowGlass; -import dark.machines.common.blocks.BlockColorSand; -import dark.machines.common.blocks.ItemBlockColored; -import dark.machines.common.items.ItemBattery; -import dark.machines.common.items.ItemColoredDust; -import dark.machines.common.items.ItemFluidCan; -import dark.machines.common.items.ItemReadoutTools; -import dark.machines.common.items.ItemWrench; -import dark.machines.common.machines.BlockDebug; -import dark.machines.common.machines.BlockEnergyStorage; -import dark.machines.common.machines.BlockSmallSteamGen; -import dark.machines.common.machines.BlockSolarPanel; -import dark.machines.common.machines.ItemBlockEnergyStorage; -import dark.machines.common.transmit.BlockWire; -import dark.machines.common.transmit.ItemBlockWire; +import dark.machines.deco.BlockBasalt; +import dark.machines.deco.BlockColorGlass; +import dark.machines.deco.BlockColorGlowGlass; +import dark.machines.deco.BlockColorSand; +import dark.machines.deco.ItemBlockColored; +import dark.machines.generators.BlockSmallSteamGen; +import dark.machines.generators.BlockSolarPanel; +import dark.machines.items.ItemBattery; +import dark.machines.items.ItemColoredDust; +import dark.machines.items.ItemFluidCan; +import dark.machines.items.ItemReadoutTools; +import dark.machines.items.ItemWrench; +import dark.machines.machines.BlockDebug; +import dark.machines.machines.BlockEnergyStorage; +import dark.machines.machines.ItemBlockEnergyStorage; +import dark.machines.transmit.BlockWire; +import dark.machines.transmit.ItemBlockWire; /** @author HangCow, DarkGuardsman */ @Mod(modid = DarkMain.MOD_ID, name = DarkMain.MOD_NAME, version = DarkMain.VERSION, dependencies = "after:BuildCraft|Energy", useMetadata = true) diff --git a/src/dark/machines/client/ClientProxy.java b/src/dark/machines/client/ClientProxy.java index e48cdfcd..0660accb 100644 --- a/src/dark/machines/client/ClientProxy.java +++ b/src/dark/machines/client/ClientProxy.java @@ -14,13 +14,13 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.prefab.ModPrefab; import dark.core.prefab.entities.EntityTestCar; +import dark.machines.CommonProxy; +import dark.machines.CoreRecipeLoader; import dark.machines.client.gui.GuiBatteryBox; import dark.machines.client.renders.BlockRenderingHandler; import dark.machines.client.renders.ItemRenderFluidCan; import dark.machines.client.renders.RenderTestCar; -import dark.machines.common.CommonProxy; -import dark.machines.common.CoreRecipeLoader; -import dark.machines.common.machines.TileEntityBatteryBox; +import dark.machines.machines.TileEntityBatteryBox; @SideOnly(Side.CLIENT) public class ClientProxy extends CommonProxy diff --git a/src/dark/machines/client/FXBeam.java b/src/dark/machines/client/FXBeam.java index de600b21..a8f90e2c 100644 --- a/src/dark/machines/client/FXBeam.java +++ b/src/dark/machines/client/FXBeam.java @@ -16,7 +16,7 @@ import universalelectricity.core.vector.Vector3; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Based off Thaumcraft's Beam Renderer. * diff --git a/src/dark/machines/client/gui/GuiBatteryBox.java b/src/dark/machines/client/gui/GuiBatteryBox.java index 7d2add68..17133d1d 100644 --- a/src/dark/machines/client/gui/GuiBatteryBox.java +++ b/src/dark/machines/client/gui/GuiBatteryBox.java @@ -11,9 +11,9 @@ import universalelectricity.core.electricity.ElectricityDisplay; import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.machines.common.DarkMain; -import dark.machines.common.machines.ContainerBatteryBox; -import dark.machines.common.machines.TileEntityBatteryBox; +import dark.machines.DarkMain; +import dark.machines.machines.ContainerBatteryBox; +import dark.machines.machines.TileEntityBatteryBox; @SideOnly(Side.CLIENT) public class GuiBatteryBox extends GuiContainer diff --git a/src/dark/machines/client/gui/GuiMachineBase.java b/src/dark/machines/client/gui/GuiMachineBase.java index 8182785d..c6fb4f54 100644 --- a/src/dark/machines/client/gui/GuiMachineBase.java +++ b/src/dark/machines/client/gui/GuiMachineBase.java @@ -13,7 +13,7 @@ import dark.core.prefab.invgui.GuiBase; import dark.core.prefab.invgui.GuiButtonImage; import dark.core.prefab.invgui.GuiButtonImage.ButtonIcon; import dark.core.prefab.machine.TileEntityMachine; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** To be used with all machine that have a gui to allow generic settings and feature all all devices * diff --git a/src/dark/machines/client/renders/BlockRenderingHandler.java b/src/dark/machines/client/renders/BlockRenderingHandler.java index 4240abf9..12dd836c 100644 --- a/src/dark/machines/client/renders/BlockRenderingHandler.java +++ b/src/dark/machines/client/renders/BlockRenderingHandler.java @@ -13,10 +13,10 @@ import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.prefab.ModPrefab; +import dark.machines.CoreRecipeLoader; +import dark.machines.DarkMain; import dark.machines.client.models.ModelMachine; import dark.machines.client.models.ModelSolarPanel; -import dark.machines.common.CoreRecipeLoader; -import dark.machines.common.DarkMain; @SideOnly(Side.CLIENT) public class BlockRenderingHandler implements ISimpleBlockRenderingHandler diff --git a/src/dark/machines/client/renders/ItemRenderFluidCan.java b/src/dark/machines/client/renders/ItemRenderFluidCan.java index e4561da3..306cc64c 100644 --- a/src/dark/machines/client/renders/ItemRenderFluidCan.java +++ b/src/dark/machines/client/renders/ItemRenderFluidCan.java @@ -11,10 +11,10 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.machines.CoreRecipeLoader; +import dark.machines.DarkMain; import dark.machines.client.models.ModelSmallFluidCan; -import dark.machines.common.CoreRecipeLoader; -import dark.machines.common.DarkMain; -import dark.machines.common.items.ItemFluidCan; +import dark.machines.items.ItemFluidCan; @SideOnly(Side.CLIENT) public class ItemRenderFluidCan implements IItemRenderer diff --git a/src/dark/machines/client/renders/RenderBlockSolarPanel.java b/src/dark/machines/client/renders/RenderBlockSolarPanel.java index ab9f93ed..dc33f787 100644 --- a/src/dark/machines/client/renders/RenderBlockSolarPanel.java +++ b/src/dark/machines/client/renders/RenderBlockSolarPanel.java @@ -7,8 +7,8 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.machines.DarkMain; import dark.machines.client.models.ModelSolarPanel; -import dark.machines.common.DarkMain; @SideOnly(Side.CLIENT) public class RenderBlockSolarPanel extends RenderTileMachine diff --git a/src/dark/machines/client/renders/RenderBlockWire.java b/src/dark/machines/client/renders/RenderBlockWire.java index 11f8f968..2227059b 100644 --- a/src/dark/machines/client/renders/RenderBlockWire.java +++ b/src/dark/machines/client/renders/RenderBlockWire.java @@ -15,8 +15,8 @@ import universalelectricity.core.vector.VectorHelper; import buildcraft.api.power.IPowerReceptor; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.machines.DarkMain; import dark.machines.client.models.ModelCopperWire; -import dark.machines.common.DarkMain; @SideOnly(Side.CLIENT) public class RenderBlockWire extends RenderTileMachine diff --git a/src/dark/machines/client/renders/RenderSteamGen.java b/src/dark/machines/client/renders/RenderSteamGen.java index 2c3b4b4d..39a344f8 100644 --- a/src/dark/machines/client/renders/RenderSteamGen.java +++ b/src/dark/machines/client/renders/RenderSteamGen.java @@ -10,10 +10,10 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.prefab.ModPrefab; import dark.core.prefab.machine.TileEntityMachine; +import dark.machines.DarkMain; import dark.machines.client.models.ModelMachine; import dark.machines.client.models.ModelSteamGen; import dark.machines.client.models.ModelSteamTurbine; -import dark.machines.common.DarkMain; @SideOnly(Side.CLIENT) public class RenderSteamGen extends RenderTileMachine diff --git a/src/dark/machines/client/renders/RenderTestCar.java b/src/dark/machines/client/renders/RenderTestCar.java index d89498c5..70cf55bf 100644 --- a/src/dark/machines/client/renders/RenderTestCar.java +++ b/src/dark/machines/client/renders/RenderTestCar.java @@ -11,8 +11,8 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.prefab.entities.EntityAdvanced; +import dark.machines.DarkMain; import dark.machines.client.models.ModelTestCar; -import dark.machines.common.DarkMain; @SideOnly(Side.CLIENT) public class RenderTestCar extends Render diff --git a/src/dark/machines/common/blocks/TileEntityGasBlock.java b/src/dark/machines/common/blocks/TileEntityGasBlock.java deleted file mode 100644 index ab20ff57..00000000 --- a/src/dark/machines/common/blocks/TileEntityGasBlock.java +++ /dev/null @@ -1,78 +0,0 @@ -package dark.machines.common.blocks; - -import java.io.IOException; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.fluids.FluidStack; - -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; -import dark.core.network.ISimplePacketReceiver; -import dark.core.network.PacketHandler; -import dark.machines.common.DarkMain; - -public class TileEntityGasBlock extends TileEntity implements ISimplePacketReceiver -{ - private FluidStack stack = null; - - public FluidStack getFluidStack() - { - return stack; - } - - public void setStack(FluidStack stack) - { - this.stack = stack; - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.stack = FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("Fluid")); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setCompoundTag("fluid", this.getFluidStack().writeToNBT(new NBTTagCompound())); - } - - @Override - public boolean canUpdate() - { - return false; - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput data, Player player) - { - try - { - if (id.equalsIgnoreCase("Desc")) - { - this.stack = FluidStack.loadFluidStackFromNBT(PacketHandler.instance().readNBTTagCompound(data)); - return true; - } - } - catch (IOException e) - { - e.printStackTrace(); - } - return false; - } - - @Override - public Packet getDescriptionPacket() - { - if (this.stack != null) - { - return PacketHandler.instance().getTilePacket(DarkMain.CHANNEL, this, "Desc", this.stack.writeToNBT(new NBTTagCompound())); - } - return null; - } -} diff --git a/src/dark/machines/common/machines/BlockHeater.java b/src/dark/machines/common/machines/BlockHeater.java deleted file mode 100644 index 6246c1c7..00000000 --- a/src/dark/machines/common/machines/BlockHeater.java +++ /dev/null @@ -1,156 +0,0 @@ -package dark.machines.common.machines; - -import java.util.List; -import java.util.Set; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.Configuration; - -import com.builtbroken.common.Pair; - -import dark.core.ModObjectRegistry.BlockBuildData; -import dark.core.prefab.machine.BlockMachine; -import dark.machines.common.CommonProxy; -import dark.machines.common.DarkMain; - -public class BlockHeater extends BlockMachine -{ - - public BlockHeater(BlockBuildData data) - { - super(data); - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (world.getBlockMetadata(x, y, z) % 4 < 3) - { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) + 1, 3); - return true; - } - else - { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) - 3, 3); - return true; - } - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - for (HeatMachineData data : HeatMachineData.values()) - { - list.add(new Pair>("DC" + data.unlocalizedName, data.clazz)); - } - } - - @Override - public void loadExtraConfigs(Configuration config) - { - super.loadExtraConfigs(config); - } - - /** Called when the block is right clicked by the player */ - @Override - public boolean onMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - - if (!par1World.isRemote) - { - par5EntityPlayer.openGui(DarkMain.getInstance(), HeatMachineData.values()[par1World.getBlockMetadata(x, y, z) / 4].guiID, par1World, x, y, z); - } - - return true; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - try - { - return HeatMachineData.values()[metadata / 4].clazz.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - return null; - - } - - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(new ItemStack(par1, 1, 0)); - par3List.add(new ItemStack(par1, 1, 8)); - par3List.add(new ItemStack(par1, 1, 12)); - } - - @Override - public int damageDropped(int metadata) - { - return metadata / 4; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - int id = idPicked(world, x, y, z); - - if (id == 0) - { - return null; - } - - Item item = Item.itemsList[id]; - - if (item == null) - { - return null; - } - - int metadata = getDamageValue(world, x, y, z); - - return new ItemStack(id, 1, metadata); - } - - public static enum HeatMachineData - { - HEAT_COUPLE("themalcouple", 0, CommonProxy.GUI_COAL_GEN, TileEntitySteamGen.class), - HEAT_EXCHANGE("heatexchanger", 4, CommonProxy.GUI_FUEL_GEN, TileEntitySteamGen.class), - HEAT_PLATE("heatplate", 8, CommonProxy.GUI_BATTERY_BOX, null); - - public String unlocalizedName; - public int startMeta, guiID; - public boolean enabled = true; - public boolean allowCrafting = true; - public Class clazz; - - private HeatMachineData(String name, int meta, int guiID, Class clazz) - { - this.unlocalizedName = name; - this.startMeta = meta; - this.guiID = guiID; - this.clazz = clazz; - } - } -} diff --git a/src/dark/machines/common/machines/IDebugTile.java b/src/dark/machines/common/machines/IDebugTile.java deleted file mode 100644 index 7b9dbdd1..00000000 --- a/src/dark/machines/common/machines/IDebugTile.java +++ /dev/null @@ -1,8 +0,0 @@ -package dark.machines.common.machines; - -import dark.core.interfaces.IBlockActivated; - -public interface IDebugTile extends IBlockActivated -{ - -} diff --git a/src/dark/machines/common/machines/ItemBlockEnergyStorage.java b/src/dark/machines/common/machines/ItemBlockEnergyStorage.java deleted file mode 100644 index 796fedcc..00000000 --- a/src/dark/machines/common/machines/ItemBlockEnergyStorage.java +++ /dev/null @@ -1,49 +0,0 @@ -package dark.machines.common.machines; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** Item version of the enrgy storage block - * - * @author Darkguardsman */ -public class ItemBlockEnergyStorage extends ItemBlock -{ - public ItemBlockEnergyStorage(int id) - { - super(id); - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - - @Override - public int getMetadata(int damage) - { - return damage; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) - { - return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage(); - } - - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) - { - if (!world.setBlock(x, y, z, this.getBlockID(), side, 3)) - { - return false; - } - - if (world.getBlockId(x, y, z) == this.getBlockID()) - { - Block.blocksList[this.getBlockID()].onBlockPlacedBy(world, x, y, z, player, stack); - Block.blocksList[this.getBlockID()].onPostBlockPlaced(world, x, y, z, metadata); - } - - return true; - } -} diff --git a/src/dark/machines/common/transmit/BlockLaserEmitter.java b/src/dark/machines/common/transmit/BlockLaserEmitter.java deleted file mode 100644 index afa7a35d..00000000 --- a/src/dark/machines/common/transmit/BlockLaserEmitter.java +++ /dev/null @@ -1,14 +0,0 @@ -package dark.machines.common.transmit; - -import net.minecraft.block.material.Material; -import universalelectricity.prefab.block.BlockAdvanced; - -public class BlockLaserEmitter extends BlockAdvanced -{ - - public BlockLaserEmitter(int id) - { - super(id, Material.iron); - } - -} diff --git a/src/dark/machines/common/transmit/ItemBlockLaserEmitter.java b/src/dark/machines/common/transmit/ItemBlockLaserEmitter.java deleted file mode 100644 index 138031d9..00000000 --- a/src/dark/machines/common/transmit/ItemBlockLaserEmitter.java +++ /dev/null @@ -1,11 +0,0 @@ -package dark.machines.common.transmit; - -import net.minecraft.item.ItemBlock; - -public class ItemBlockLaserEmitter extends ItemBlock -{ - public ItemBlockLaserEmitter(int par1) - { - super(par1); - } -} diff --git a/src/dark/machines/common/transmit/TileEntityLaserEmitter.java b/src/dark/machines/common/transmit/TileEntityLaserEmitter.java deleted file mode 100644 index 81414b9e..00000000 --- a/src/dark/machines/common/transmit/TileEntityLaserEmitter.java +++ /dev/null @@ -1,125 +0,0 @@ -package dark.machines.common.transmit; - -import java.awt.Color; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumMovingObjectType; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.vector.Vector3; -import dark.core.prefab.machine.TileEntityEnergyMachine; -import dark.machines.common.DarkMain; - -public class TileEntityLaserEmitter extends TileEntityEnergyMachine -{ - /** Is tile set up to receive power */ - private boolean receiver = false; - /** Demand of connected network */ - private float powerDemand = 0.0f; - /** Supply from other laser emitter */ - private float powerSupply = 0.0f; - private float yaw, pitch, prevYaw, prevPitch, deltaYaw, deltaPitch; - /** Color of renderer laser */ - private Color color = Color.red; - /** Linked emitter */ - TileEntityLaserEmitter linkedEmitter = null; - Vector3 laserTarget = null; - - public TileEntityLaserEmitter() - { - super(.001f/* 1W/t*/, 1f/* 1000W battery*/); - } - - /** Facing direction of the tile and not the laser */ - public ForgeDirection getFacingDirection() - { - int meta = 0; - if (this.worldObj != null) - { - meta = (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) % 6); - } - return ForgeDirection.getOrientation(meta); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if (this.isFunctioning()) - { - this.updateRotation(); - if (this.linkedEmitter != null && ticks % 20 == 0) - { - this.createLaser(new Vector3(linkedEmitter)); - } - else if (laserTarget != null) - { - TileEntity entity = laserTarget.getTileEntity(this.worldObj); - if (entity instanceof TileEntityLaserEmitter && ((TileEntityLaserEmitter) entity).receiver != this.receiver) - { - linkedEmitter = (TileEntityLaserEmitter) entity; - } - } - } - } - - public void updateRotation() - { - - } - - protected void createLaser(Vector3 target) - { - Vector3 start = new Vector3(this); - double distance = start.distance(target); - MovingObjectPosition hit = start.rayTrace(this.worldObj, yaw, pitch, true, distance); - if (hit != null) - { - if (hit.typeOfHit == EnumMovingObjectType.ENTITY) - { - //TODO damage entity if power is over 1000W - } - else - { - - } - } - else - { - DarkMain.proxy.renderBeam(this.worldObj, start, target, color, 20); - } - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return direction == this.getFacingDirection().getOpposite(); - } - - @Override - public float getRequest(ForgeDirection side) - { - if (!receiver && side == getFacingDirection().getOpposite()) - { - return powerDemand; - } - return 0; - } - - @Override - public float getProvide(ForgeDirection direction) - { - if (receiver && direction == getFacingDirection().getOpposite()) - { - return powerSupply; - } - return 0; - } - - @Override - public String getChannel() - { - return DarkMain.CHANNEL; - } - -} diff --git a/src/dark/machines/common/blocks/BlockBasalt.java b/src/dark/machines/deco/BlockBasalt.java similarity index 96% rename from src/dark/machines/common/blocks/BlockBasalt.java rename to src/dark/machines/deco/BlockBasalt.java index 02d4f7a3..32a19fe4 100644 --- a/src/dark/machines/common/blocks/BlockBasalt.java +++ b/src/dark/machines/deco/BlockBasalt.java @@ -1,4 +1,4 @@ -package dark.machines.common.blocks; +package dark.machines.deco; import java.util.Random; @@ -10,7 +10,7 @@ import net.minecraft.util.Icon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class BlockBasalt extends Block { diff --git a/src/dark/machines/common/blocks/BlockColorGlass.java b/src/dark/machines/deco/BlockColorGlass.java similarity index 91% rename from src/dark/machines/common/blocks/BlockColorGlass.java rename to src/dark/machines/deco/BlockColorGlass.java index dcb9350e..00397f28 100644 --- a/src/dark/machines/common/blocks/BlockColorGlass.java +++ b/src/dark/machines/deco/BlockColorGlass.java @@ -1,4 +1,4 @@ -package dark.machines.common.blocks; +package dark.machines.deco; import java.util.Random; @@ -6,9 +6,8 @@ import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.core.prefab.BlockColored; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class BlockColorGlass extends BlockColored { diff --git a/src/dark/machines/common/blocks/BlockColorGlowGlass.java b/src/dark/machines/deco/BlockColorGlowGlass.java similarity index 84% rename from src/dark/machines/common/blocks/BlockColorGlowGlass.java rename to src/dark/machines/deco/BlockColorGlowGlass.java index 70896dec..59366f5b 100644 --- a/src/dark/machines/common/blocks/BlockColorGlowGlass.java +++ b/src/dark/machines/deco/BlockColorGlowGlass.java @@ -1,4 +1,4 @@ -package dark.machines.common.blocks; +package dark.machines.deco; public class BlockColorGlowGlass extends BlockColorGlass { diff --git a/src/dark/machines/common/blocks/BlockColorSand.java b/src/dark/machines/deco/BlockColorSand.java similarity index 96% rename from src/dark/machines/common/blocks/BlockColorSand.java rename to src/dark/machines/deco/BlockColorSand.java index 0e181175..ba8ecfff 100644 --- a/src/dark/machines/common/blocks/BlockColorSand.java +++ b/src/dark/machines/deco/BlockColorSand.java @@ -1,4 +1,4 @@ -package dark.machines.common.blocks; +package dark.machines.deco; import java.util.Random; @@ -6,9 +6,8 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.world.World; -import dark.core.prefab.BlockColored; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; //TODO fix instant falling sand public class BlockColorSand extends BlockColored diff --git a/src/dark/core/prefab/BlockColored.java b/src/dark/machines/deco/BlockColored.java similarity index 97% rename from src/dark/core/prefab/BlockColored.java rename to src/dark/machines/deco/BlockColored.java index afb6e8ff..4d41ad79 100644 --- a/src/dark/core/prefab/BlockColored.java +++ b/src/dark/machines/deco/BlockColored.java @@ -1,4 +1,4 @@ -package dark.core.prefab; +package dark.machines.deco; import java.util.List; @@ -11,7 +11,7 @@ import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Prefab class to make any block have 16 separate color instances similar to wool block * diff --git a/src/dark/machines/common/blocks/ItemBlockBasalt.java b/src/dark/machines/deco/ItemBlockBasalt.java similarity index 95% rename from src/dark/machines/common/blocks/ItemBlockBasalt.java rename to src/dark/machines/deco/ItemBlockBasalt.java index 1a36f897..08956fee 100644 --- a/src/dark/machines/common/blocks/ItemBlockBasalt.java +++ b/src/dark/machines/deco/ItemBlockBasalt.java @@ -1,4 +1,4 @@ -package dark.machines.common.blocks; +package dark.machines.deco; import java.util.List; diff --git a/src/dark/machines/common/blocks/ItemBlockColored.java b/src/dark/machines/deco/ItemBlockColored.java similarity index 90% rename from src/dark/machines/common/blocks/ItemBlockColored.java rename to src/dark/machines/deco/ItemBlockColored.java index d61b91ae..90acc74e 100644 --- a/src/dark/machines/common/blocks/ItemBlockColored.java +++ b/src/dark/machines/deco/ItemBlockColored.java @@ -1,9 +1,9 @@ -package dark.machines.common.blocks; +package dark.machines.deco; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class ItemBlockColored extends ItemBlock { diff --git a/src/dark/machines/common/machines/BlockSmallSteamGen.java b/src/dark/machines/generators/BlockSmallSteamGen.java similarity index 98% rename from src/dark/machines/common/machines/BlockSmallSteamGen.java rename to src/dark/machines/generators/BlockSmallSteamGen.java index 5c03ebe8..70d71d34 100644 --- a/src/dark/machines/common/machines/BlockSmallSteamGen.java +++ b/src/dark/machines/generators/BlockSmallSteamGen.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.generators; import java.util.List; import java.util.Random; @@ -19,12 +19,12 @@ import com.builtbroken.common.Pair; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.core.DMCreativeTab; import dark.core.ModObjectRegistry.BlockBuildData; import dark.core.helpers.MathHelper; import dark.core.prefab.machine.BlockMachine; import dark.machines.client.renders.BlockRenderingHandler; import dark.machines.client.renders.RenderSteamGen; -import dark.machines.common.DMCreativeTab; /** Starter power setup using steam generated by burning items or fuels. This setup takes two blocks. * A) the generator B) the collector The generator creates the steam and burns the fuel. The diff --git a/src/dark/machines/common/machines/BlockSolarPanel.java b/src/dark/machines/generators/BlockSolarPanel.java similarity index 97% rename from src/dark/machines/common/machines/BlockSolarPanel.java rename to src/dark/machines/generators/BlockSolarPanel.java index 62357916..fbed5640 100644 --- a/src/dark/machines/common/machines/BlockSolarPanel.java +++ b/src/dark/machines/generators/BlockSolarPanel.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.generators; import java.util.List; import java.util.Set; @@ -15,11 +15,11 @@ import com.builtbroken.common.Pair; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.core.DMCreativeTab; import dark.core.ModObjectRegistry.BlockBuildData; import dark.core.prefab.machine.BlockMachine; import dark.machines.client.renders.BlockRenderingHandler; import dark.machines.client.renders.RenderBlockSolarPanel; -import dark.machines.common.DMCreativeTab; public class BlockSolarPanel extends BlockMachine { diff --git a/src/dark/machines/common/machines/ContainerCoalGenerator.java b/src/dark/machines/generators/ContainerCoalGenerator.java similarity index 98% rename from src/dark/machines/common/machines/ContainerCoalGenerator.java rename to src/dark/machines/generators/ContainerCoalGenerator.java index ede61b73..f3c2db0c 100644 --- a/src/dark/machines/common/machines/ContainerCoalGenerator.java +++ b/src/dark/machines/generators/ContainerCoalGenerator.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.generators; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; diff --git a/src/dark/machines/common/machines/TileEntitySolarPanel.java b/src/dark/machines/generators/TileEntitySolarPanel.java similarity index 97% rename from src/dark/machines/common/machines/TileEntitySolarPanel.java rename to src/dark/machines/generators/TileEntitySolarPanel.java index 44358c9f..7d484f61 100644 --- a/src/dark/machines/common/machines/TileEntitySolarPanel.java +++ b/src/dark/machines/generators/TileEntitySolarPanel.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.generators; import java.util.EnumSet; diff --git a/src/dark/machines/common/machines/TileEntitySteamFan.java b/src/dark/machines/generators/TileEntitySteamFan.java similarity index 77% rename from src/dark/machines/common/machines/TileEntitySteamFan.java rename to src/dark/machines/generators/TileEntitySteamFan.java index 2b86f688..26041e22 100644 --- a/src/dark/machines/common/machines/TileEntitySteamFan.java +++ b/src/dark/machines/generators/TileEntitySteamFan.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.generators; public class TileEntitySteamFan extends TileEntitySteamPiston { diff --git a/src/dark/machines/common/machines/TileEntitySteamGen.java b/src/dark/machines/generators/TileEntitySteamGen.java similarity index 99% rename from src/dark/machines/common/machines/TileEntitySteamGen.java rename to src/dark/machines/generators/TileEntitySteamGen.java index 24359922..e7e2c7e4 100644 --- a/src/dark/machines/common/machines/TileEntitySteamGen.java +++ b/src/dark/machines/generators/TileEntitySteamGen.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.generators; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; diff --git a/src/dark/machines/common/machines/TileEntitySteamPiston.java b/src/dark/machines/generators/TileEntitySteamPiston.java similarity index 97% rename from src/dark/machines/common/machines/TileEntitySteamPiston.java rename to src/dark/machines/generators/TileEntitySteamPiston.java index afeabc06..b68a0763 100644 --- a/src/dark/machines/common/machines/TileEntitySteamPiston.java +++ b/src/dark/machines/generators/TileEntitySteamPiston.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.generators; import java.util.EnumSet; diff --git a/src/dark/machines/common/items/ItemBattery.java b/src/dark/machines/items/ItemBattery.java similarity index 95% rename from src/dark/machines/common/items/ItemBattery.java rename to src/dark/machines/items/ItemBattery.java index d7b159d7..b5a3bfbb 100644 --- a/src/dark/machines/common/items/ItemBattery.java +++ b/src/dark/machines/items/ItemBattery.java @@ -1,4 +1,4 @@ -package dark.machines.common.items; +package dark.machines.items; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -10,7 +10,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.interfaces.IExtraInfo.IExtraItemInfo; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Simple battery to store energy * diff --git a/src/dark/machines/common/items/ItemColoredDust.java b/src/dark/machines/items/ItemColoredDust.java similarity index 96% rename from src/dark/machines/common/items/ItemColoredDust.java rename to src/dark/machines/items/ItemColoredDust.java index 3489b873..dc5ab1be 100644 --- a/src/dark/machines/common/items/ItemColoredDust.java +++ b/src/dark/machines/items/ItemColoredDust.java @@ -1,4 +1,4 @@ -package dark.machines.common.items; +package dark.machines.items; import java.util.List; @@ -10,7 +10,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.prefab.ItemBasic; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class ItemColoredDust extends ItemBasic { diff --git a/src/dark/machines/common/items/ItemFluidCan.java b/src/dark/machines/items/ItemFluidCan.java similarity index 96% rename from src/dark/machines/common/items/ItemFluidCan.java rename to src/dark/machines/items/ItemFluidCan.java index df50655a..0f068fde 100644 --- a/src/dark/machines/common/items/ItemFluidCan.java +++ b/src/dark/machines/items/ItemFluidCan.java @@ -1,4 +1,4 @@ -package dark.machines.common.items; +package dark.machines.items; import java.util.List; @@ -14,9 +14,9 @@ import net.minecraftforge.fluids.ItemFluidContainer; import universalelectricity.core.item.ElectricItemHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.core.DMCreativeTab; import dark.core.prefab.ModPrefab; -import dark.machines.common.DMCreativeTab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; /** Small fluid can that is designed to store up to one bucket of fluid. Doesn't work like a bucket * as it is sealed with a pressure cap. This can is designed to work with tools or machines only. diff --git a/src/dark/machines/common/items/ItemReadoutTools.java b/src/dark/machines/items/ItemReadoutTools.java similarity index 99% rename from src/dark/machines/common/items/ItemReadoutTools.java rename to src/dark/machines/items/ItemReadoutTools.java index 8dff149d..cf652860 100644 --- a/src/dark/machines/common/items/ItemReadoutTools.java +++ b/src/dark/machines/items/ItemReadoutTools.java @@ -1,4 +1,4 @@ -package dark.machines.common.items; +package dark.machines.items; import java.util.List; @@ -26,7 +26,7 @@ import dark.api.IToolReadOut.EnumTools; import dark.core.prefab.ItemBasic; import dark.core.prefab.ModPrefab; import dark.core.prefab.fluids.FluidHelper; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class ItemReadoutTools extends ItemBasic { diff --git a/src/dark/machines/common/items/ItemStorageCan.java b/src/dark/machines/items/ItemStorageCan.java similarity index 79% rename from src/dark/machines/common/items/ItemStorageCan.java rename to src/dark/machines/items/ItemStorageCan.java index a7c3f8d3..a3035f2f 100644 --- a/src/dark/machines/common/items/ItemStorageCan.java +++ b/src/dark/machines/items/ItemStorageCan.java @@ -1,4 +1,4 @@ -package dark.machines.common.items; +package dark.machines.items; /** Can that is used to store items such as food, parts, or solid fuels. * diff --git a/src/dark/machines/common/items/ItemWrench.java b/src/dark/machines/items/ItemWrench.java similarity index 97% rename from src/dark/machines/common/items/ItemWrench.java rename to src/dark/machines/items/ItemWrench.java index a52adbbf..8dd5cfc9 100644 --- a/src/dark/machines/common/items/ItemWrench.java +++ b/src/dark/machines/items/ItemWrench.java @@ -1,4 +1,4 @@ -package dark.machines.common.items; +package dark.machines.items; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; @@ -12,7 +12,7 @@ import buildcraft.api.tools.IToolWrench; import dark.core.interfaces.IExtraInfo.IExtraItemInfo; import dark.core.prefab.ItemBasic; import dark.core.prefab.ModPrefab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class ItemWrench extends ItemBasic implements IToolWrench, IExtraItemInfo { diff --git a/src/dark/machines/common/machines/BlockDebug.java b/src/dark/machines/machines/BlockDebug.java similarity index 97% rename from src/dark/machines/common/machines/BlockDebug.java rename to src/dark/machines/machines/BlockDebug.java index e046a833..1d4beb58 100644 --- a/src/dark/machines/common/machines/BlockDebug.java +++ b/src/dark/machines/machines/BlockDebug.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.machines; import java.util.List; import java.util.Set; @@ -17,10 +17,10 @@ import com.builtbroken.common.Pair; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.core.DMCreativeTab; import dark.core.ModObjectRegistry.BlockBuildData; import dark.core.prefab.machine.BlockMachine; -import dark.machines.common.DMCreativeTab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class BlockDebug extends BlockMachine { diff --git a/src/dark/machines/common/machines/BlockEnergyStorage.java b/src/dark/machines/machines/BlockEnergyStorage.java similarity index 94% rename from src/dark/machines/common/machines/BlockEnergyStorage.java rename to src/dark/machines/machines/BlockEnergyStorage.java index 0aecd238..f214c958 100644 --- a/src/dark/machines/common/machines/BlockEnergyStorage.java +++ b/src/dark/machines/machines/BlockEnergyStorage.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.machines; import java.util.List; import java.util.Set; @@ -18,10 +18,10 @@ import universalelectricity.core.vector.Vector3; import com.builtbroken.common.Pair; +import dark.core.DMCreativeTab; import dark.core.prefab.machine.BlockMachine; -import dark.machines.common.CommonProxy; -import dark.machines.common.DMCreativeTab; -import dark.machines.common.DarkMain; +import dark.machines.CommonProxy; +import dark.machines.DarkMain; /** Block for energy storage devices * diff --git a/src/dark/machines/common/machines/BlockTransformer.java b/src/dark/machines/machines/BlockTransformer.java similarity index 80% rename from src/dark/machines/common/machines/BlockTransformer.java rename to src/dark/machines/machines/BlockTransformer.java index fd3fdba3..a0a4e4e3 100644 --- a/src/dark/machines/common/machines/BlockTransformer.java +++ b/src/dark/machines/machines/BlockTransformer.java @@ -1,11 +1,11 @@ -package dark.machines.common.machines; +package dark.machines.machines; import net.minecraft.block.material.Material; import net.minecraftforge.common.Configuration; import universalelectricity.core.UniversalElectricity; +import dark.core.DMCreativeTab; import dark.core.prefab.machine.BlockMachine; -import dark.machines.common.DMCreativeTab; -import dark.machines.common.DarkMain; +import dark.machines.DarkMain; public class BlockTransformer extends BlockMachine { diff --git a/src/dark/machines/common/machines/ContainerBatteryBox.java b/src/dark/machines/machines/ContainerBatteryBox.java similarity index 98% rename from src/dark/machines/common/machines/ContainerBatteryBox.java rename to src/dark/machines/machines/ContainerBatteryBox.java index 1657c3cb..32541906 100644 --- a/src/dark/machines/common/machines/ContainerBatteryBox.java +++ b/src/dark/machines/machines/ContainerBatteryBox.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.machines; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; diff --git a/src/dark/machines/machines/ItemBlockEnergyStorage.java b/src/dark/machines/machines/ItemBlockEnergyStorage.java new file mode 100644 index 00000000..0e4c444c --- /dev/null +++ b/src/dark/machines/machines/ItemBlockEnergyStorage.java @@ -0,0 +1,89 @@ +package dark.machines.machines; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import universalelectricity.core.vector.Vector3; +import dark.machines.CoreRecipeLoader; + +/** Item version of the enrgy storage block + * + * @author Darkguardsman */ +public class ItemBlockEnergyStorage extends ItemBlock +{ + public ItemBlockEnergyStorage(int id) + { + super(id); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public int getMetadata(int damage) + { + return damage; + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage(); + } + + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + if (!world.setBlock(x, y, z, this.getBlockID(), side, 3)) + { + return false; + } + + if (world.getBlockId(x, y, z) == this.getBlockID()) + { + Block.blocksList[this.getBlockID()].onBlockPlacedBy(world, x, y, z, player, stack); + Block.blocksList[this.getBlockID()].onPostBlockPlaced(world, x, y, z, metadata); + if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("wrenched")) + { + TileEntity entity = world.getBlockTileEntity(x, y, z); + if (entity instanceof TileEntityBatteryBox) + { + ((TileEntityBatteryBox) entity).getInventory().loadInv(stack.getTagCompound()); + ((TileEntityBatteryBox) entity).setEnergyStored(stack.getTagCompound().getFloat("energy")); + } + } + } + + return true; + } + + public static ItemStack getWrenchedBatteryBox(World world, Vector3 vec) + { + ItemStack itemStack = new ItemStack(CoreRecipeLoader.blockBatBox); + TileEntity entity = vec.getTileEntity(world); + if (entity instanceof TileEntityBatteryBox) + { + if (itemStack.getTagCompound() == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + itemStack.getTagCompound().setBoolean("wrenched", true); + itemStack.getTagCompound().setFloat("energy", ((TileEntityBatteryBox) entity).getEnergyStored()); + ((TileEntityBatteryBox) entity).getInventory().saveInv(itemStack.getTagCompound()); + ((TileEntityBatteryBox) entity).getInventory().clear(); + } + return itemStack; + } + + public int getItemStackLimit(ItemStack stack) + { + if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("wrenched")) + { + return 1; + } + return this.getItemStackLimit(); + } +} diff --git a/src/dark/machines/common/machines/TileEntityBatteryBox.java b/src/dark/machines/machines/TileEntityBatteryBox.java similarity index 99% rename from src/dark/machines/common/machines/TileEntityBatteryBox.java rename to src/dark/machines/machines/TileEntityBatteryBox.java index 388868ba..2e46543d 100644 --- a/src/dark/machines/common/machines/TileEntityBatteryBox.java +++ b/src/dark/machines/machines/TileEntityBatteryBox.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.machines; import java.util.EnumSet; diff --git a/src/dark/machines/common/machines/TileEntityInfFluid.java b/src/dark/machines/machines/TileEntityInfFluid.java similarity index 97% rename from src/dark/machines/common/machines/TileEntityInfFluid.java rename to src/dark/machines/machines/TileEntityInfFluid.java index 03f3aeb6..cf0008d2 100644 --- a/src/dark/machines/common/machines/TileEntityInfFluid.java +++ b/src/dark/machines/machines/TileEntityInfFluid.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.machines; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -17,9 +17,10 @@ import universalelectricity.core.vector.Vector3; import com.builtbroken.common.lang.TextHelper.TextColor; +import dark.core.interfaces.IBlockActivated; import dark.core.prefab.fluids.FluidHelper; -public class TileEntityInfFluid extends TileEntity implements IFluidHandler, IDebugTile +public class TileEntityInfFluid extends TileEntity implements IFluidHandler, IBlockActivated { FluidTank tank = new FluidTank(Integer.MAX_VALUE); boolean autoEmpty = false; diff --git a/src/dark/machines/common/machines/TileEntityInfLoad.java b/src/dark/machines/machines/TileEntityInfLoad.java similarity index 78% rename from src/dark/machines/common/machines/TileEntityInfLoad.java rename to src/dark/machines/machines/TileEntityInfLoad.java index 1837a1f0..6b53d6d6 100644 --- a/src/dark/machines/common/machines/TileEntityInfLoad.java +++ b/src/dark/machines/machines/TileEntityInfLoad.java @@ -1,10 +1,10 @@ -package dark.machines.common.machines; +package dark.machines.machines; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.ForgeDirection; import dark.core.prefab.machine.TileEntityEnergyMachine; -public class TileEntityInfLoad extends TileEntityEnergyMachine implements IDebugTile +public class TileEntityInfLoad extends TileEntityEnergyMachine { @Override @@ -52,12 +52,4 @@ public class TileEntityInfLoad extends TileEntityEnergyMachine implements IDebug { return Integer.MAX_VALUE; } - - @Override - public boolean onActivated(EntityPlayer entityPlayer) - { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/dark/machines/common/machines/TileEntityInfSupply.java b/src/dark/machines/machines/TileEntityInfSupply.java similarity index 86% rename from src/dark/machines/common/machines/TileEntityInfSupply.java rename to src/dark/machines/machines/TileEntityInfSupply.java index f289ae7f..299ef0a2 100644 --- a/src/dark/machines/common/machines/TileEntityInfSupply.java +++ b/src/dark/machines/machines/TileEntityInfSupply.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.machines; import java.util.EnumSet; @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.ForgeDirection; import dark.core.prefab.machine.TileEntityEnergyMachine; -public class TileEntityInfSupply extends TileEntityEnergyMachine implements IDebugTile +public class TileEntityInfSupply extends TileEntityEnergyMachine { @Override @@ -61,12 +61,4 @@ public class TileEntityInfSupply extends TileEntityEnergyMachine implements IDeb { return 0; } - - @Override - public boolean onActivated(EntityPlayer entityPlayer) - { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/dark/machines/common/machines/TileEntityVoid.java b/src/dark/machines/machines/TileEntityVoid.java similarity index 89% rename from src/dark/machines/common/machines/TileEntityVoid.java rename to src/dark/machines/machines/TileEntityVoid.java index 9a78bc2c..709be6f0 100644 --- a/src/dark/machines/common/machines/TileEntityVoid.java +++ b/src/dark/machines/machines/TileEntityVoid.java @@ -1,4 +1,4 @@ -package dark.machines.common.machines; +package dark.machines.machines; import java.util.HashMap; @@ -12,9 +12,9 @@ import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; /** Designed to debug fluid devices by draining everything that comes in at one time - * + * * @author DarkGuardsman */ -public class TileEntityVoid extends TileEntity implements IFluidHandler, IDebugTile +public class TileEntityVoid extends TileEntity implements IFluidHandler { //TODO later add to this to make it actually have an ingame use other than debug public static HashMap storage = new HashMap(); @@ -62,11 +62,4 @@ public class TileEntityVoid extends TileEntity implements IFluidHandler, IDebugT return new FluidTankInfo[] { this.tank.getInfo() }; } - @Override - public boolean onActivated(EntityPlayer entityPlayer) - { - // TODO Auto-generated method stub - return false; - } - } diff --git a/src/dark/machines/common/transmit/BlockWire.java b/src/dark/machines/transmit/BlockWire.java similarity index 98% rename from src/dark/machines/common/transmit/BlockWire.java rename to src/dark/machines/transmit/BlockWire.java index 50c06fac..76ae06fe 100644 --- a/src/dark/machines/common/transmit/BlockWire.java +++ b/src/dark/machines/transmit/BlockWire.java @@ -1,4 +1,4 @@ -package dark.machines.common.transmit; +package dark.machines.transmit; import java.util.List; import java.util.Set; @@ -24,11 +24,11 @@ import com.builtbroken.common.Pair; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.core.DMCreativeTab; import dark.core.ModObjectRegistry.BlockBuildData; import dark.core.prefab.machine.BlockMachine; +import dark.machines.DarkMain; import dark.machines.client.renders.RenderBlockWire; -import dark.machines.common.DMCreativeTab; -import dark.machines.common.DarkMain; public class BlockWire extends BlockMachine { diff --git a/src/dark/machines/common/transmit/ItemBlockWire.java b/src/dark/machines/transmit/ItemBlockWire.java similarity index 83% rename from src/dark/machines/common/transmit/ItemBlockWire.java rename to src/dark/machines/transmit/ItemBlockWire.java index dc7ec9e0..72e5cb9d 100644 --- a/src/dark/machines/common/transmit/ItemBlockWire.java +++ b/src/dark/machines/transmit/ItemBlockWire.java @@ -1,8 +1,8 @@ -package dark.machines.common.transmit; +package dark.machines.transmit; import net.minecraft.util.Icon; import dark.core.prefab.ItemBlockHolder; -import dark.machines.common.CoreRecipeLoader; +import dark.machines.CoreRecipeLoader; public class ItemBlockWire extends ItemBlockHolder { diff --git a/src/dark/machines/common/transmit/TileEntityDetectorWire.java b/src/dark/machines/transmit/TileEntityDetectorWire.java similarity index 91% rename from src/dark/machines/common/transmit/TileEntityDetectorWire.java rename to src/dark/machines/transmit/TileEntityDetectorWire.java index d3184a6d..89967d45 100644 --- a/src/dark/machines/common/transmit/TileEntityDetectorWire.java +++ b/src/dark/machines/transmit/TileEntityDetectorWire.java @@ -1,4 +1,4 @@ -package dark.machines.common.transmit; +package dark.machines.transmit; public class TileEntityDetectorWire extends TileEntityWire { diff --git a/src/dark/machines/common/transmit/TileEntitySwitchWire.java b/src/dark/machines/transmit/TileEntitySwitchWire.java similarity index 95% rename from src/dark/machines/common/transmit/TileEntitySwitchWire.java rename to src/dark/machines/transmit/TileEntitySwitchWire.java index 0e0765b2..a15c80c8 100644 --- a/src/dark/machines/common/transmit/TileEntitySwitchWire.java +++ b/src/dark/machines/transmit/TileEntitySwitchWire.java @@ -1,4 +1,4 @@ -package dark.machines.common.transmit; +package dark.machines.transmit; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; diff --git a/src/dark/machines/common/transmit/TileEntityWire.java b/src/dark/machines/transmit/TileEntityWire.java similarity index 95% rename from src/dark/machines/common/transmit/TileEntityWire.java rename to src/dark/machines/transmit/TileEntityWire.java index ff2a266d..5760fe5f 100644 --- a/src/dark/machines/common/transmit/TileEntityWire.java +++ b/src/dark/machines/transmit/TileEntityWire.java @@ -1,4 +1,4 @@ -package dark.machines.common.transmit; +package dark.machines.transmit; import universalelectricity.compatibility.TileEntityUniversalConductor; import dark.api.ColorCode;