From 363ce7ad119dc5688345b2765b62f1f2e0bd0371 Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Thu, 9 Jan 2014 01:15:16 -0500 Subject: [PATCH] More error correction --- .../com/builtbroken/minecraft/BlockFluid.java | 3 +- .../minecraft/prefab/TileEntityInv.java | 2 +- .../minecraft/prefab/TileEntityMachine.java | 22 --- .../prefab/invgui/GuiButtonImage.java | 3 +- .../prefab/invgui/GuiMachineContainer.java | 4 +- .../prefab/invgui/GuiMessageBox.java | 3 +- .../recipes/MachineRecipeHandler.java | 2 +- .../resonantinduction/api/IProcessable.java | 4 +- .../api/fluid/INetworkFluidPart.java | 2 +- .../archaic/ArcClientProxy.java | 6 + .../archaic/ArcCommonProxy.java | 35 +++++ .../archaic/ArchaicTier.java | 54 +++++++ .../resonantinduction/blocks/BlockGasOre.java | 4 +- .../resonantinduction/client/ClientProxy.java | 3 - .../client/gui/EnumTaskIcon.java | 34 ++-- .../client/gui/GuiBatteryBox.java | 64 -------- .../client/gui/GuiImprinter.java | 3 +- .../core/base/BlockBase.java | 1 - .../resonantinduction/core/base/ItemBase.java | 1 - .../core/recipe/RecipeLoader.java | 1 - .../core/resource/ItemBlockOre.java | 4 +- .../core/resource/ItemOreDirv.java | 12 +- .../core/resource/ItemParts.java | 10 +- .../energy/battery/BlockBatteryBox.java | 143 ----------------- .../energy/battery/ContainerBatteryBox.java | 106 ------------- .../battery/ItemBlockEnergyStorage.java | 124 --------------- .../energy/battery/TileBatteryBox.java | 145 ------------------ .../energy/wire/ItemWire.java | 6 +- .../mechanics/armbot/BlockArmbot.java | 9 +- .../mechanics/armbot/Program.java | 5 +- .../mechanics/armbot/TaskBase.java | 5 +- .../mechanics/armbot/TileEntityArmbot.java | 13 +- .../mechanics/armbot/command/TaskBreak.java | 2 +- .../mechanics/armbot/command/TaskGive.java | 1 - .../armbot/command/TaskRotateBy.java | 1 - .../armbot/command/TaskRotateTo.java | 1 - .../mechanics/armbot/command/TaskTake.java | 1 - .../machine/mining/TileLaserDrill.java | 2 +- .../machine/mining/TileMiningLaser.java | 2 +- .../transport/BlockTurntable.java | 1 - .../transport/CommonProxy.java | 2 - .../transport/ResonantInductionTransport.java | 3 - .../transport/TileEntityAssembly.java | 6 +- .../transport/encoder/BlockEncoder.java | 1 - .../transport/encoder/ItemDisk.java | 3 +- .../transport/encoder/TileEntityEncoder.java | 6 +- .../transport/fluid/BlockKitchenSink.java | 1 - .../transport/fluid/BlockSteamPiston.java | 1 - .../fluid/TileEntityReleaseValve.java | 2 +- .../fluid/prefab/TileEntityFluidDevice.java | 4 +- .../fluid/pump/BlockConstructionPump.java | 4 +- .../transport/fluid/pump/BlockDrain.java | 8 +- .../transport/hopper/BlockAdvancedHopper.java | 4 +- .../hopper/TileEntityAdvancedHopper.java | 3 +- .../transport/imprinter/BlockImprinter.java | 7 +- .../transport/imprinter/ItemImprinter.java | 6 +- .../imprinter/TileEntityImprinter.java | 3 +- .../transport/logistic/BlockDetector.java | 6 +- .../transport/logistic/BlockRejector.java | 6 +- .../logistic/TileEntityDetector.java | 2 +- .../transport/vechicle/ItemVehicleSpawn.java | 5 +- .../tilenetwork/prefab/NetworkPathFinder.java | 2 +- .../prefab/NetworkResourceSupply.java | 2 +- .../prefab/NetworkSharedPower.java | 2 +- .../prefab/NetworkTileEntities.java | 4 +- 65 files changed, 214 insertions(+), 723 deletions(-) create mode 100644 src/main/java/resonantinduction/archaic/ArcClientProxy.java create mode 100644 src/main/java/resonantinduction/archaic/ArcCommonProxy.java create mode 100644 src/main/java/resonantinduction/archaic/ArchaicTier.java delete mode 100644 src/main/java/resonantinduction/client/gui/GuiBatteryBox.java delete mode 100644 src/main/java/resonantinduction/energy/battery/BlockBatteryBox.java delete mode 100644 src/main/java/resonantinduction/energy/battery/ContainerBatteryBox.java delete mode 100644 src/main/java/resonantinduction/energy/battery/ItemBlockEnergyStorage.java delete mode 100644 src/main/java/resonantinduction/energy/battery/TileBatteryBox.java diff --git a/src/main/java/com/builtbroken/minecraft/BlockFluid.java b/src/main/java/com/builtbroken/minecraft/BlockFluid.java index 5b8351cd..7f3397db 100644 --- a/src/main/java/com/builtbroken/minecraft/BlockFluid.java +++ b/src/main/java/com/builtbroken/minecraft/BlockFluid.java @@ -6,6 +6,7 @@ import net.minecraft.util.Icon; import net.minecraftforge.common.Configuration; import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge.fluids.Fluid; +import resonantinduction.core.Settings; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -18,7 +19,7 @@ public class BlockFluid extends BlockFluidFinite public BlockFluid(String prefix, Fluid fluid, Configuration config) { - this(prefix, DarkCore.getNextID(), fluid, config); + this(prefix, Settings.getNextBlockID(), fluid, config); } public BlockFluid(String prefix, int id, Fluid fluid, Configuration config) diff --git a/src/main/java/com/builtbroken/minecraft/prefab/TileEntityInv.java b/src/main/java/com/builtbroken/minecraft/prefab/TileEntityInv.java index 90500595..c394f537 100644 --- a/src/main/java/com/builtbroken/minecraft/prefab/TileEntityInv.java +++ b/src/main/java/com/builtbroken/minecraft/prefab/TileEntityInv.java @@ -3,7 +3,6 @@ package com.builtbroken.minecraft.prefab; import java.util.ArrayList; import java.util.List; -import resonatninduction.tilenetwork.prefab.NetworkTileEntities; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ISidedInventory; @@ -11,6 +10,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.common.ForgeDirection; +import resonatninduction.tilenetwork.prefab.NetworkTileEntities; import universalelectricity.api.vector.Vector3; import calclavia.lib.access.AccessGroup; import calclavia.lib.access.AccessUser; diff --git a/src/main/java/com/builtbroken/minecraft/prefab/TileEntityMachine.java b/src/main/java/com/builtbroken/minecraft/prefab/TileEntityMachine.java index 350fb69e..2eedd538 100644 --- a/src/main/java/com/builtbroken/minecraft/prefab/TileEntityMachine.java +++ b/src/main/java/com/builtbroken/minecraft/prefab/TileEntityMachine.java @@ -23,8 +23,6 @@ import cpw.mods.fml.common.network.Player; public abstract class TileEntityMachine extends TileEntityInv implements ISidedInventory, IExternalInv, ISimplePacketReceiver, IExtraTileEntityInfo { - /** Tick by which this machine stops working */ - protected int disabledTicks = 0; /** Number of players with the machine's gui container open */ protected int playersUsingMachine = 0; /** Is the machine functioning normally */ @@ -81,12 +79,6 @@ public abstract class TileEntityMachine extends TileEntityInv implements ISidedI } this.sendGUIPacket(); } - - if (this.disabledTicks > 0) - { - this.disabledTicks--; - this.whileDisable(); - } } /** Can this tile function, or run threw normal processes */ @@ -157,20 +149,6 @@ public abstract class TileEntityMachine extends TileEntityInv implements ISidedI } } - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.disabledTicks = nbt.getInteger("disabledTicks"); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("disabledTicks", this.disabledTicks); - } - @Override public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) { diff --git a/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiButtonImage.java b/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiButtonImage.java index 22c0f59d..b8601951 100644 --- a/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiButtonImage.java +++ b/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiButtonImage.java @@ -6,6 +6,7 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +import resonantinduction.Reference; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -13,7 +14,7 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiButtonImage extends GuiButton { - public static final ResourceLocation TEXTURE = new ResourceLocation(DarkCore.DOMAIN, DarkCore.GUI_DIRECTORY + "gui_button.png"); + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_button.png"); private ButtonIcon buttonIcon = ButtonIcon.BLANK; diff --git a/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiMachineContainer.java b/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiMachineContainer.java index 3834da95..b3492ff6 100644 --- a/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiMachineContainer.java +++ b/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiMachineContainer.java @@ -12,6 +12,8 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import resonantinduction.Reference; + import com.builtbroken.minecraft.prefab.TileEntityMachine; import com.builtbroken.minecraft.prefab.invgui.GuiButtonImage.ButtonIcon; @@ -31,7 +33,7 @@ public abstract class GuiMachineContainer extends GuiContainer guiIcon3 = ButtonIcon.BLANK; protected String invName = "Home", invName2 = "2", invName3 = "3"; - public ResourceLocation TEXTURE = new ResourceLocation(DarkCore.DOMAIN, DarkCore.GUI_DIRECTORY + "gui_grey.png"); + public ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_grey.png"); protected int containerWidth; protected int containerHeight; diff --git a/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiMessageBox.java b/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiMessageBox.java index 95f0da00..d0d803a0 100644 --- a/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiMessageBox.java +++ b/src/main/java/com/builtbroken/minecraft/prefab/invgui/GuiMessageBox.java @@ -5,12 +5,13 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +import resonantinduction.Reference; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; public class GuiMessageBox extends GuiBase { - public static final ResourceLocation TEXTURE = new ResourceLocation(DarkCore.DOMAIN, DarkCore.GUI_DIRECTORY + "gui_message_box.png"); + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "gui_message_box.png"); GuiBase returnGuiYes, returnGuiNo; int id; diff --git a/src/main/java/com/builtbroken/minecraft/recipes/MachineRecipeHandler.java b/src/main/java/com/builtbroken/minecraft/recipes/MachineRecipeHandler.java index 3d80d64b..68616be5 100644 --- a/src/main/java/com/builtbroken/minecraft/recipes/MachineRecipeHandler.java +++ b/src/main/java/com/builtbroken/minecraft/recipes/MachineRecipeHandler.java @@ -2,12 +2,12 @@ package com.builtbroken.minecraft.recipes; import java.util.Random; -import resonantinduction.api.IProcessable; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; +import resonantinduction.api.IProcessable; import calclavia.lib.utility.AutoCraftingManager; import com.builtbroken.common.Pair; diff --git a/src/main/java/resonantinduction/api/IProcessable.java b/src/main/java/resonantinduction/api/IProcessable.java index d589c136..626ec27a 100644 --- a/src/main/java/resonantinduction/api/IProcessable.java +++ b/src/main/java/resonantinduction/api/IProcessable.java @@ -1,9 +1,9 @@ package resonantinduction.api; -import com.builtbroken.minecraft.recipes.ProcessorType; - import net.minecraft.item.ItemStack; +import com.builtbroken.minecraft.recipes.ProcessorType; + /** * Simple interface that allows an item to control how its salvaged, processed, or refined by a * processor. This is 100% optional as the processor by default can break down most items. The only diff --git a/src/main/java/resonantinduction/api/fluid/INetworkFluidPart.java b/src/main/java/resonantinduction/api/fluid/INetworkFluidPart.java index df94ead7..4ae83e73 100644 --- a/src/main/java/resonantinduction/api/fluid/INetworkFluidPart.java +++ b/src/main/java/resonantinduction/api/fluid/INetworkFluidPart.java @@ -1,10 +1,10 @@ package resonantinduction.api.fluid; -import resonatninduction.tilenetwork.INetworkPart; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +import resonatninduction.tilenetwork.INetworkPart; /** * Interface used by part that are members of a fluid tile network. Parts in the network will act as diff --git a/src/main/java/resonantinduction/archaic/ArcClientProxy.java b/src/main/java/resonantinduction/archaic/ArcClientProxy.java new file mode 100644 index 00000000..4ac6d08f --- /dev/null +++ b/src/main/java/resonantinduction/archaic/ArcClientProxy.java @@ -0,0 +1,6 @@ +package resonantinduction.archaic; + +public class ArcClientProxy extends ArcCommonProxy +{ + +} diff --git a/src/main/java/resonantinduction/archaic/ArcCommonProxy.java b/src/main/java/resonantinduction/archaic/ArcCommonProxy.java new file mode 100644 index 00000000..42090a84 --- /dev/null +++ b/src/main/java/resonantinduction/archaic/ArcCommonProxy.java @@ -0,0 +1,35 @@ +package resonantinduction.archaic; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import cpw.mods.fml.common.network.IGuiHandler; + +public class ArcCommonProxy implements IGuiHandler +{ + public void preInit() + { + }; + + public void init() + { + }; + + public void postInit() + { + }; + + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/resonantinduction/archaic/ArchaicTier.java b/src/main/java/resonantinduction/archaic/ArchaicTier.java new file mode 100644 index 00000000..cd0f3b77 --- /dev/null +++ b/src/main/java/resonantinduction/archaic/ArchaicTier.java @@ -0,0 +1,54 @@ +package resonantinduction.archaic; + +import java.util.Arrays; +import java.util.logging.Logger; + +import resonantinduction.Reference; +import resonantinduction.core.ResonantInduction; +import calclavia.lib.utility.LanguageUtility; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.NetworkRegistry; + +@Mod(modid = ArchaicTier.ID, name = Reference.NAME + " Archaic Tier", version = Reference.VERSION, dependencies = "required-after:" + ResonantInduction.ID) +public class ArchaicTier +{ + /** Mod Information */ + public static final String ID = "ResonantInduction|Archaic"; + + @Instance(ID) + public static ResonantInduction INSTANCE; + + @SidedProxy(clientSide = "resonantinduction.archaic.ArcClientProxy", serverSide = "resonantinduction.archaic.ArcCommonProxy") + public static ArcCommonProxy proxy; + + @Mod.Metadata(ID) + public static ModMetadata metadata; + + public static final Logger LOGGER = Logger.getLogger(Reference.NAME); + + @EventHandler + public void preInit(FMLPreInitializationEvent evt) + { + NetworkRegistry.instance().registerGuiHandler(this, proxy); + } + + @EventHandler + public void init(FMLInitializationEvent evt) + { + metadata.modId = ID; + metadata.name = Reference.NAME + " Archaic Tier"; + metadata.description = LanguageUtility.getLocal("meta.resonantinduction.archaic.description"); + metadata.url = "http://calclavia.com/resonant-induction"; + metadata.logoFile = "ri_logo.png"; + metadata.version = Reference.VERSION + "." + Reference.BUILD_VERSION; + metadata.authorList = Arrays.asList(new String[] { "Calclavia", "DarkCow" }); + metadata.credits = LanguageUtility.getLocal("meta.resonantinduction.credits"); + metadata.autogenerated = false; + } +} diff --git a/src/main/java/resonantinduction/blocks/BlockGasOre.java b/src/main/java/resonantinduction/blocks/BlockGasOre.java index 06281bd5..db0dbe75 100644 --- a/src/main/java/resonantinduction/blocks/BlockGasOre.java +++ b/src/main/java/resonantinduction/blocks/BlockGasOre.java @@ -20,7 +20,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; import resonantinduction.Reference; -import resonantinduction.core.ResonantInductionTabs; import resonantinduction.core.Settings; import resonantinduction.transport.fluid.EnumGas; import universalelectricity.api.vector.Vector3; @@ -43,8 +42,7 @@ public class BlockGasOre extends Block implements IFluidBlock public BlockGasOre() { super(Settings.CONFIGURATION.getBlock("GasBlock", Settings.getNextBlockID()).getInt(), gas); - this.setUnlocalizedName("DMBlockGas"); - this.setCreativeTab(ResonantInductionTabs.tabIndustrial()); + this.setUnlocalizedName("BlockGas"); this.setTickRandomly(true); } diff --git a/src/main/java/resonantinduction/client/ClientProxy.java b/src/main/java/resonantinduction/client/ClientProxy.java index 8d0018ee..f55ec687 100644 --- a/src/main/java/resonantinduction/client/ClientProxy.java +++ b/src/main/java/resonantinduction/client/ClientProxy.java @@ -7,8 +7,6 @@ import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.MinecraftForge; -import resonantinduction.client.gui.GuiBatteryBox; import resonantinduction.client.gui.GuiEncoderCoder; import resonantinduction.client.gui.GuiEncoderHelp; import resonantinduction.client.gui.GuiEncoderInventory; @@ -30,7 +28,6 @@ import resonantinduction.client.render.RenderTurkey; import resonantinduction.core.misc.EntityFarmEgg; import resonantinduction.core.misc.EntityTurkey; import resonantinduction.core.recipe.RecipeLoader; -import resonantinduction.energy.battery.TileBatteryBox; import resonantinduction.mechanics.CommonProxy; import resonantinduction.mechanics.processor.TileEntityProcessor; import resonantinduction.transport.encoder.TileEntityEncoder; diff --git a/src/main/java/resonantinduction/client/gui/EnumTaskIcon.java b/src/main/java/resonantinduction/client/gui/EnumTaskIcon.java index 14077a0e..6b3815bb 100644 --- a/src/main/java/resonantinduction/client/gui/EnumTaskIcon.java +++ b/src/main/java/resonantinduction/client/gui/EnumTaskIcon.java @@ -1,21 +1,29 @@ package resonantinduction.client.gui; -/** - * Used to reference icons in the gui coder sheet +/** Used to reference icons in the gui coder sheet * - * @author DarkGuardsman - */ + * @author DarkGuardsman */ public enum EnumTaskIcon { - VERT_LINE(0, 0), HORT_LINE(20, 0), ARROW_UP(40, 0), ARROW_RIGHT(60, 0), ARROW_DOWN(80, 0), - ARROW_LEFT(100, 0), VERT_LINE_DOT(120, 0), HORT_LINE_DOT(140, 0), LEFT_UP_BEND(160, 0), - LEFT_DOWN_BEND(180, 0), RIGHT_UP_BEND(200, 0), RIGHT_DOWN_BEND(220, 0); + VERT_LINE(0, 0), + HORT_LINE(20, 0), + ARROW_UP(40, 0), + ARROW_RIGHT(60, 0), + ARROW_DOWN(80, 0), + ARROW_LEFT(100, 0), + VERT_LINE_DOT(120, 0), + HORT_LINE_DOT(140, 0), + LEFT_UP_BEND(160, 0), + LEFT_DOWN_BEND(180, 0), + RIGHT_UP_BEND(200, 0), + RIGHT_DOWN_BEND(220, 0); - int uu, vv; - int sizeX = 20, sizeY = 20; + int uu, vv; + int sizeX = 20, sizeY = 20; - private EnumTaskIcon(int uu, int vv) - { - - } + private EnumTaskIcon(int uu, int vv) + { + this.uu = uu; + this.vv = vv; + } } diff --git a/src/main/java/resonantinduction/client/gui/GuiBatteryBox.java b/src/main/java/resonantinduction/client/gui/GuiBatteryBox.java deleted file mode 100644 index a5939fa5..00000000 --- a/src/main/java/resonantinduction/client/gui/GuiBatteryBox.java +++ /dev/null @@ -1,64 +0,0 @@ -package resonantinduction.client.gui; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import resonantinduction.Reference; -import resonantinduction.energy.battery.ContainerBatteryBox; -import resonantinduction.energy.battery.TileBatteryBox; -import universalelectricity.api.energy.UnitDisplay; -import universalelectricity.api.energy.UnitDisplay.Unit; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiBatteryBox extends GuiContainer -{ - private static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_DIRECTORY + "battery_box.png"); - - private TileBatteryBox tileEntity; - - private int containerWidth; - private int containerHeight; - - public GuiBatteryBox(InventoryPlayer par1InventoryPlayer, TileBatteryBox batteryBox) - { - super(new ContainerBatteryBox(par1InventoryPlayer, batteryBox)); - this.tileEntity = batteryBox; - } - - /** Draw the foreground layer for the GuiContainer (everything in front of the items) */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) - { - this.fontRenderer.drawString(this.tileEntity.getInvName(), 65, 6, 4210752); - String displayJoules = UnitDisplay.getDisplayShort(tileEntity.getEnergyStored(), Unit.JOULES) + " of"; - String displayMaxJoules = UnitDisplay.getDisplayShort(tileEntity.getMaxEnergyStored(), Unit.JOULES); - String displayVoltage = "Voltage: " + (int) (this.tileEntity.getVoltage() * 1000); - - this.fontRenderer.drawString(displayJoules, 122 - this.fontRenderer.getStringWidth(displayJoules) / 2, 30, 4210752); - this.fontRenderer.drawString(displayMaxJoules, 122 - this.fontRenderer.getStringWidth(displayMaxJoules) / 2, 40, 4210752); - this.fontRenderer.drawString(displayVoltage, 122 - this.fontRenderer.getStringWidth(displayVoltage) / 2, 60, 4210752); - this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); - } - - /** Draw the background layer for the GuiContainer (everything behind the items) */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) - { - this.mc.renderEngine.bindTexture(TEXTURE); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - this.containerWidth = (this.width - this.xSize) / 2; - this.containerHeight = (this.height - this.ySize) / 2; - // Background energy bar - this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize); - // Foreground energy bar - int scale = (int) ((this.tileEntity.getEnergyStored() / this.tileEntity.getMaxEnergyStored()) * 72); - this.drawTexturedModalRect(containerWidth + 87, containerHeight + 52, 176, 0, scale, 20); - } -} diff --git a/src/main/java/resonantinduction/client/gui/GuiImprinter.java b/src/main/java/resonantinduction/client/gui/GuiImprinter.java index 2c4d68c8..e2f83818 100644 --- a/src/main/java/resonantinduction/client/gui/GuiImprinter.java +++ b/src/main/java/resonantinduction/client/gui/GuiImprinter.java @@ -9,6 +9,7 @@ import org.lwjgl.opengl.GL11; import resonantinduction.Reference; import resonantinduction.transport.imprinter.ContainerImprinter; import resonantinduction.transport.imprinter.TileEntityImprinter; +import calclavia.lib.utility.LanguageUtility; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -32,7 +33,7 @@ public class GuiImprinter extends GuiContainer { this.fontRenderer.drawString("Use Inventories:", 70, 58, 4210752); this.fontRenderer.drawString("" + this.tileEntity.searchInventories, 105, 67, 4210752); - this.fontRenderer.drawString(TranslationHelper.getLocal("tile.imprinter.name"), 68, 6, 4210752); + this.fontRenderer.drawString(LanguageUtility.getLocal("tile.imprinter.name"), 68, 6, 4210752); } /** Draw the background layer for the GuiContainer (everything behind the items) */ diff --git a/src/main/java/resonantinduction/core/base/BlockBase.java b/src/main/java/resonantinduction/core/base/BlockBase.java index 14db2f37..caf7ad91 100644 --- a/src/main/java/resonantinduction/core/base/BlockBase.java +++ b/src/main/java/resonantinduction/core/base/BlockBase.java @@ -5,7 +5,6 @@ package resonantinduction.core.base; import net.minecraftforge.common.Configuration; import resonantinduction.Reference; -import resonantinduction.core.ResonantInduction; import resonantinduction.core.ResonantInductionTabs; import resonantinduction.core.Settings; import universalelectricity.api.UniversalElectricity; diff --git a/src/main/java/resonantinduction/core/base/ItemBase.java b/src/main/java/resonantinduction/core/base/ItemBase.java index 9b999d86..cbd4f067 100644 --- a/src/main/java/resonantinduction/core/base/ItemBase.java +++ b/src/main/java/resonantinduction/core/base/ItemBase.java @@ -3,7 +3,6 @@ package resonantinduction.core.base; import net.minecraft.item.Item; import net.minecraftforge.common.Configuration; import resonantinduction.Reference; -import resonantinduction.core.ResonantInduction; import resonantinduction.core.ResonantInductionTabs; import resonantinduction.core.Settings; diff --git a/src/main/java/resonantinduction/core/recipe/RecipeLoader.java b/src/main/java/resonantinduction/core/recipe/RecipeLoader.java index 0f8869e5..8bb5a0a9 100644 --- a/src/main/java/resonantinduction/core/recipe/RecipeLoader.java +++ b/src/main/java/resonantinduction/core/recipe/RecipeLoader.java @@ -10,7 +10,6 @@ import net.minecraftforge.common.Configuration; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -import resonantinduction.blocks.BlockBasalt; import resonantinduction.core.misc.EnumTool; import resonantinduction.core.resource.ItemOreDirv; import resonantinduction.core.resource.ItemParts.Parts; diff --git a/src/main/java/resonantinduction/core/resource/ItemBlockOre.java b/src/main/java/resonantinduction/core/resource/ItemBlockOre.java index 19c15d79..5bef738a 100644 --- a/src/main/java/resonantinduction/core/resource/ItemBlockOre.java +++ b/src/main/java/resonantinduction/core/resource/ItemBlockOre.java @@ -2,8 +2,8 @@ package resonantinduction.core.resource; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import resonantinduction.Reference; import resonantinduction.blocks.BlockOre.OreData; -import resonantinduction.transport.ResonantInductionTransport; public class ItemBlockOre extends ItemBlock { @@ -26,7 +26,7 @@ public class ItemBlockOre extends ItemBlock { if (par1ItemStack != null && par1ItemStack.getItemDamage() < OreData.values().length) { - return "tile." + ResonantInductionTransport.PREFIX + OreData.values()[par1ItemStack.getItemDamage()].name + "Ore"; + return "tile." + Reference.PREFIX + OreData.values()[par1ItemStack.getItemDamage()].name + "Ore"; } return super.getUnlocalizedName(); } diff --git a/src/main/java/resonantinduction/core/resource/ItemOreDirv.java b/src/main/java/resonantinduction/core/resource/ItemOreDirv.java index da8fd75d..ca8e678c 100644 --- a/src/main/java/resonantinduction/core/resource/ItemOreDirv.java +++ b/src/main/java/resonantinduction/core/resource/ItemOreDirv.java @@ -11,8 +11,10 @@ import net.minecraftforge.common.Configuration; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.oredict.OreDictionary; +import resonantinduction.Reference; import resonantinduction.api.events.LaserEvent; -import resonantinduction.transport.ResonantInductionTransport; +import resonantinduction.core.Settings; +import resonantinduction.core.base.ItemBase; import com.builtbroken.minecraft.EnumMaterial; import com.builtbroken.minecraft.EnumOrePart; @@ -26,11 +28,11 @@ import cpw.mods.fml.relauncher.SideOnly; * * @author DarkGuardsman */ -public class ItemOreDirv extends ItemBasic implements IExtraItemInfo +public class ItemOreDirv extends ItemBase implements IExtraItemInfo { public ItemOreDirv() { - super(DarkCore.getNextItemId(), "Metal_Parts", ResonantInductionTransport.CONFIGURATION); + super("Metal_Parts", Settings.getNextItemID()); this.setHasSubtypes(true); this.setCreativeTab(CreativeTabs.tabMaterials); MinecraftForge.EVENT_BUS.register(this); @@ -41,7 +43,7 @@ public class ItemOreDirv extends ItemBasic implements IExtraItemInfo { if (itemStack != null) { - return "item." + ResonantInductionTransport.PREFIX + EnumOrePart.getFullName(itemStack.getItemDamage()); + return "item." + Reference.PREFIX + EnumOrePart.getFullName(itemStack.getItemDamage()); } else { @@ -66,7 +68,7 @@ public class ItemOreDirv extends ItemBasic implements IExtraItemInfo { if (mat.shouldCreateItem(part)) { - mat.itemIcons[part.ordinal()] = iconRegister.registerIcon(ResonantInductionTransport.PREFIX + mat.simpleName + part.simpleName); + mat.itemIcons[part.ordinal()] = iconRegister.registerIcon(Reference.PREFIX + mat.simpleName + part.simpleName); } } } diff --git a/src/main/java/resonantinduction/core/resource/ItemParts.java b/src/main/java/resonantinduction/core/resource/ItemParts.java index 4d33f75b..22b0c42e 100644 --- a/src/main/java/resonantinduction/core/resource/ItemParts.java +++ b/src/main/java/resonantinduction/core/resource/ItemParts.java @@ -8,7 +8,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraftforge.common.Configuration; import net.minecraftforge.oredict.OreDictionary; -import resonantinduction.transport.ResonantInductionTransport; +import resonantinduction.Reference; +import resonantinduction.core.Settings; +import resonantinduction.core.base.ItemBase; import com.builtbroken.minecraft.IExtraInfo.IExtraItemInfo; @@ -21,11 +23,11 @@ import cpw.mods.fml.relauncher.SideOnly; * * @author DarkGuardsman */ -public class ItemParts extends ItemBasic implements IExtraItemInfo +public class ItemParts extends ItemBase implements IExtraItemInfo { public ItemParts() { - super(DarkCore.getNextItemId(), "DMParts", ResonantInductionTransport.CONFIGURATION); + super("DMParts", Settings.getNextItemID()); this.setHasSubtypes(true); this.setMaxDamage(0); this.setMaxStackSize(64); @@ -60,7 +62,7 @@ public class ItemParts extends ItemBasic implements IExtraItemInfo super.registerIcons(iconRegister); for (Parts part : Parts.values()) { - part.icon = iconRegister.registerIcon(ResonantInductionTransport.PREFIX + "part." + part.name); + part.icon = iconRegister.registerIcon(Reference.PREFIX + "part." + part.name); } } diff --git a/src/main/java/resonantinduction/energy/battery/BlockBatteryBox.java b/src/main/java/resonantinduction/energy/battery/BlockBatteryBox.java deleted file mode 100644 index 1a628565..00000000 --- a/src/main/java/resonantinduction/energy/battery/BlockBatteryBox.java +++ /dev/null @@ -1,143 +0,0 @@ -package resonantinduction.energy.battery; - -import java.util.List; -import java.util.Set; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.core.Settings; -import resonantinduction.energy.ResonantInductionEnergy; -import universalelectricity.api.UniversalElectricity; -import universalelectricity.api.energy.IConductor; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.utility.HelperMethods; - -import com.builtbroken.common.Pair; -import com.builtbroken.minecraft.prefab.BlockMachine; - -/** - * Block for energy storage devices - * - * @author Rseifert - */ -public class BlockBatteryBox extends BlockMachine -{ - public BlockBatteryBox() - { - super(Settings.CONFIGURATION, "DMEnergyStorage", UniversalElectricity.machine); - this.setCreativeTab(ResonantInductionTabs.CORE); - } - - @Override - public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) - { - Vector3 vec = new Vector3(x, y, z); - int meta = vec.getBlockMetadata(world); - if (side == (meta)) - { - return this.iconOutput; - } - return vec.clone().modifyPositionFromSide(ForgeDirection.getOrientation(side)).getTileEntity(world) instanceof IConductor ? this.iconInput : this.blockIcon; - - } - - @Override - public boolean onMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) - { - int metadata = par1World.getBlockMetadata(x, y, z); - - if (!par1World.isRemote) - { - par5EntityPlayer.openGui(ResonantInductionEnergy.INSTANCE, 0, par1World, x, y, z); - - } - return true; - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote) - { - int metadata = world.getBlockMetadata(x, y, z); - if (metadata >= 5) - { - world.setBlockMetadataWithNotify(x, y, z, 0, 3); - } - else - { - world.setBlockMetadataWithNotify(x, y, z, metadata + 1, 3); - } - } - return true; - } - - @Override - public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote) - { - world.setBlockMetadataWithNotify(x, y, z, side, 3); - } - return true; - } - - @Override - public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - if (!world.isRemote) - { - ItemStack batBoxStack = ItemBlockEnergyStorage.getWrenchedBatteryBox(world, new Vector3(x, y, z)); - if (entityPlayer.getHeldItem() == null) - { - entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, batBoxStack); - } - else - { - HelperMethods.dropItemStack(world, new Vector3(x, y, z), batBoxStack, false); - } - world.setBlockToAir(x, y, z); - } - return true; - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - list.add(new Pair>("DCTileBatBox", TileBatteryBox.class)); - - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - return new TileBatteryBox(); - } - - @Override - public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public int damageDropped(int metadata) - { - return 0; - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - return new ItemStack(this, 1, 0); - } - -} diff --git a/src/main/java/resonantinduction/energy/battery/ContainerBatteryBox.java b/src/main/java/resonantinduction/energy/battery/ContainerBatteryBox.java deleted file mode 100644 index 2b354eac..00000000 --- a/src/main/java/resonantinduction/energy/battery/ContainerBatteryBox.java +++ /dev/null @@ -1,106 +0,0 @@ -package resonantinduction.energy.battery; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import universalelectricity.api.item.IEnergyItem; - -import com.builtbroken.minecraft.prefab.invgui.SlotSpecific; - -public class ContainerBatteryBox extends Container -{ - private TileBatteryBox tileEntity; - - public ContainerBatteryBox(InventoryPlayer par1InventoryPlayer, TileBatteryBox batteryBox) - { - this.tileEntity = batteryBox; - // Top slot for battery output - this.addSlotToContainer(new SlotSpecific(batteryBox, 0, 33, 24, IEnergyItem.class)); - // Bottom slot for batter input - this.addSlotToContainer(new SlotSpecific(batteryBox, 1, 33, 48, IEnergyItem.class)); - int var3; - - for (var3 = 0; var3 < 3; ++var3) - { - for (int var4 = 0; var4 < 9; ++var4) - { - this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); - } - } - - for (var3 = 0; var3 < 9; ++var3) - { - this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) - { - return this.tileEntity.isUseableByPlayer(par1EntityPlayer); - } - - /** Called to transfer a stack from one inventory to the other eg. when shift clicking. */ - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slotID) - { - ItemStack returnStack = null; - Slot slot = (Slot) this.inventorySlots.get(slotID); - - if (slot != null && slot.getHasStack()) - { - ItemStack itemStack = slot.getStack(); - returnStack = itemStack.copy(); - - if (slotID != 0 && slotID != 1) - { - if (this.getSlot(0).isItemValid(itemStack)) - { - if (((IEnergyItem) itemStack.getItem()).getEnergy(itemStack) > 0) - { - if (!this.mergeItemStack(itemStack, 1, 2, false)) - { - return null; - } - } - else - { - if (!this.mergeItemStack(itemStack, 0, 1, false)) - { - return null; - } - } - } - - else if (slotID >= 30 && slotID < 38 && !this.mergeItemStack(itemStack, 3, 30, false)) - { - return null; - } - } - else if (!this.mergeItemStack(itemStack, 3, 38, false)) - { - return null; - } - - if (itemStack.stackSize == 0) - { - slot.putStack((ItemStack) null); - } - else - { - slot.onSlotChanged(); - } - - if (itemStack.stackSize == returnStack.stackSize) - { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemStack); - } - - return returnStack; - } -} diff --git a/src/main/java/resonantinduction/energy/battery/ItemBlockEnergyStorage.java b/src/main/java/resonantinduction/energy/battery/ItemBlockEnergyStorage.java deleted file mode 100644 index ce4e7917..00000000 --- a/src/main/java/resonantinduction/energy/battery/ItemBlockEnergyStorage.java +++ /dev/null @@ -1,124 +0,0 @@ -package resonantinduction.energy.battery; - -import java.util.List; - -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.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import resonantinduction.core.recipe.RecipeLoader; -import universalelectricity.api.vector.Vector3; - -/** - * 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 void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) - { - if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("wrenched")) - { - NBTBase energy = stack.getTagCompound().getTag("energy"); - if (energy instanceof NBTTagFloat) - { - list.add("Energy: " + (long) (stack.getTagCompound().getFloat("energy") * 1000)); - } - else if (energy instanceof NBTTagLong) - { - list.add("Energy: " + stack.getTagCompound().getLong("energy")); - } - } - } - - @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 TileBatteryBox) - { - ((TileBatteryBox) entity).getInventory().loadInv(stack.getTagCompound()); - NBTBase energy = stack.getTagCompound().getTag("energy"); - if (energy instanceof NBTTagFloat) - { - ((TileBatteryBox) entity).setEnergy(ForgeDirection.UNKNOWN, (long) (stack.getTagCompound().getFloat("energy") * 1000)); - } - else if (energy instanceof NBTTagLong) - { - ((TileBatteryBox) entity).setEnergy(ForgeDirection.UNKNOWN, stack.getTagCompound().getLong("energy")); - } - - } - } - } - - return true; - } - - public static ItemStack getWrenchedBatteryBox(World world, Vector3 vec) - { - ItemStack itemStack = new ItemStack(RecipeLoader.blockBatBox); - TileEntity entity = vec.getTileEntity(world); - if (entity instanceof TileBatteryBox) - { - if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - itemStack.getTagCompound().setBoolean("wrenched", true); - itemStack.getTagCompound().setFloat("energy", ((TileBatteryBox) entity).getEnergyStored()); - ((TileBatteryBox) entity).getInventory().saveInv(itemStack.getTagCompound()); - ((TileBatteryBox) entity).getInventory().clear(); - } - return itemStack; - } - - @Override - public int getItemStackLimit(ItemStack stack) - { - if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("wrenched")) - { - return 1; - } - return this.getItemStackLimit(); - } -} diff --git a/src/main/java/resonantinduction/energy/battery/TileBatteryBox.java b/src/main/java/resonantinduction/energy/battery/TileBatteryBox.java deleted file mode 100644 index 83341572..00000000 --- a/src/main/java/resonantinduction/energy/battery/TileBatteryBox.java +++ /dev/null @@ -1,145 +0,0 @@ -package resonantinduction.energy.battery; - -import java.util.EnumSet; - -import net.minecraft.inventory.Container; -import net.minecraft.network.packet.Packet; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.api.CompatibilityModule; -import calclavia.lib.network.PacketHandler; - -import com.builtbroken.minecraft.prefab.TileEntityEnergyMachine; -import com.google.common.io.ByteArrayDataInput; - -import cpw.mods.fml.common.network.Player; -import cpw.mods.fml.common.registry.LanguageRegistry; - -/** - * Simple in out battery box - * - * @author DarkGuardsman - */ -public class TileBatteryBox extends TileEntityEnergyMachine -{ - public TileBatteryBox() - { - super(10000, 5000000); - this.invSlots = 2; - this.hasGUI = true; - } - - @Override - public void updateEntity() - { - super.updateEntity(); - - if (!this.worldObj.isRemote && this.enabled) - { - /** Recharges electric item. */ - this.setEnergy(ForgeDirection.UNKNOWN, this.getEnergy(ForgeDirection.UNKNOWN) - CompatibilityModule.chargeItem(this.getStackInSlot(0), Math.min(10000, this.getEnergyStored()), true)); - /** Decharge electric item. */ - this.setEnergy(ForgeDirection.UNKNOWN, this.getEnergy(ForgeDirection.UNKNOWN) + CompatibilityModule.dischargeItem(this.getStackInSlot(1), Math.min(10000, this.getEnergyCapacity(ForgeDirection.UNKNOWN) - this.getEnergyStored()), true)); - /** Output to network, or connected machines */ - this.produce(); - } - } - - @Override - protected boolean consumePower(long watts, boolean doDrain) - { - return true; - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return true; - } - - @Override - public EnumSet getOutputDirections() - { - return EnumSet.of(ForgeDirection.getOrientation(this.getBlockMetadata())); - } - - /** - * The electrical input direction. - * - * @return The direction that electricity is entered into the tile. Return null for no input. By - * default you can accept power from all sides. - */ - @Override - public EnumSet getInputDirections() - { - EnumSet et = EnumSet.allOf(ForgeDirection.class); - et.remove(ForgeDirection.getOrientation(this.getBlockMetadata())); - et.remove(ForgeDirection.UNKNOWN); - return et; - } - - @Override - public boolean simplePacket(String id, ByteArrayDataInput dis, Player player) - { - boolean r = super.simplePacket(id, dis, player); - try - { - - if (this.worldObj.isRemote && !r) - { - if (id.equalsIgnoreCase("desc")) - { - this.setEnergy(ForgeDirection.UNKNOWN, dis.readLong()); - this.setMaxEnergyStored(dis.readLong()); - return true; - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - return r; - } - - @Override - public Packet getDescriptionPacket() - { - return PacketHandler.instance().getTilePacket(this.getChannel(), "desc", this, this.getEnergyStored(), this.getMaxEnergyStored()); - } - - @Override - public Packet getGUIPacket() - { - return this.getDescriptionPacket(); - } - - @Override - public Class getContainer() - { - return ContainerBatteryBox.class; - } - - @Override - public String getInvName() - { - return LanguageRegistry.instance().getStringLocalization("tile.batterybox.name"); - } - - @Override - public int getInventoryStackLimit() - { - return 1; - } - - @Override - public boolean isInvNameLocalized() - { - return true; - } - - @Override - public int[] getAccessibleSlotsFromSide(int slotID) - { - return new int[] { 0, 1 }; - } -} diff --git a/src/main/java/resonantinduction/energy/wire/ItemWire.java b/src/main/java/resonantinduction/energy/wire/ItemWire.java index 39f1a7ba..435039a1 100644 --- a/src/main/java/resonantinduction/energy/wire/ItemWire.java +++ b/src/main/java/resonantinduction/energy/wire/ItemWire.java @@ -14,8 +14,8 @@ import net.minecraftforge.common.ForgeDirection; import org.lwjgl.input.Keyboard; import resonantinduction.Reference; -import resonantinduction.core.ResonantInduction; import resonantinduction.core.ResonantInductionTabs; +import resonantinduction.core.Settings; import resonantinduction.core.Utility; import resonantinduction.energy.wire.flat.PartFlatWire; import resonantinduction.energy.wire.flat.RenderFlatWire; @@ -40,7 +40,7 @@ public class ItemWire extends JItemMultiPart public ItemWire(int id) { - super(ResonantInduction.CONFIGURATION.get(Configuration.CATEGORY_ITEM, "wire", id).getInt(id)); + super(Settings.CONFIGURATION.get(Configuration.CATEGORY_ITEM, "wire", id).getInt(id)); this.setUnlocalizedName(Reference.PREFIX + "wire"); this.setCreativeTab(ResonantInductionTabs.CORE); this.setHasSubtypes(true); @@ -128,7 +128,7 @@ public class ItemWire extends JItemMultiPart RenderFlatWire.flatWireTexture = register.registerIcon(Reference.PREFIX + "models/flatWire"); RenderPartWire.wireIcon = register.registerIcon(Reference.PREFIX + "models/wire"); - RenderPartWire.insulationIcon = register.registerIcon(Reference.PREFIX + "models/insulation" + (ResonantInduction.LO_FI_INSULATION ? "tiny" : "")); + RenderPartWire.insulationIcon = register.registerIcon(Reference.PREFIX + "models/insulation" + (Settings.LO_FI_INSULATION ? "tiny" : "")); } @Override diff --git a/src/main/java/resonantinduction/mechanics/armbot/BlockArmbot.java b/src/main/java/resonantinduction/mechanics/armbot/BlockArmbot.java index be465526..706d3c65 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/BlockArmbot.java +++ b/src/main/java/resonantinduction/mechanics/armbot/BlockArmbot.java @@ -10,24 +10,23 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import resonantinduction.blocks.BlockAssembly; import resonantinduction.client.render.BlockRenderingHandler; import resonantinduction.client.render.RenderArmbot; -import resonantinduction.transport.ResonantInductionTransport; +import resonantinduction.core.Settings; import universalelectricity.api.UniversalElectricity; import calclavia.lib.multiblock.link.IMultiBlock; import com.builtbroken.common.Pair; +import com.builtbroken.minecraft.prefab.BlockMachine; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockArmbot extends BlockAssembly +public class BlockArmbot extends BlockMachine { public BlockArmbot() { - super("armbot", UniversalElectricity.machine); - DarkCore.requestMultiBlock(ResonantInductionTransport.MOD_ID); + super(Settings.CONFIGURATION,"armbot", UniversalElectricity.machine); } @Override diff --git a/src/main/java/resonantinduction/mechanics/armbot/Program.java b/src/main/java/resonantinduction/mechanics/armbot/Program.java index c7223668..d57219ff 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/Program.java +++ b/src/main/java/resonantinduction/mechanics/armbot/Program.java @@ -13,6 +13,7 @@ import resonantinduction.api.coding.IProgrammableMachine; import resonantinduction.api.coding.ITask; import resonantinduction.api.coding.TaskRegistry; import universalelectricity.api.vector.Vector2; +import calclavia.lib.utility.NBTUtility; public class Program implements IProgram { @@ -282,7 +283,7 @@ public class Program implements IProgram taskList = new NBTTagList(); for (Entry var : this.varables.entrySet()) { - taskList.appendTag(NBTFileHelper.saveObject(var.getKey(), var.getValue())); + taskList.appendTag(NBTUtility.saveObject(var.getKey(), var.getValue())); } nbt.setTag("vars", taskList); return nbt; @@ -332,7 +333,7 @@ public class Program implements IProgram for (int s = 0; s < taskList.tagCount(); ++s) { NBTTagCompound tag = (NBTTagCompound) taskList.tagAt(s); - this.varables.put(tag.getName(), NBTFileHelper.loadObject(tag, tag.getName())); + this.varables.put(tag.getName(), NBTUtility.loadObject(tag, tag.getName())); } } diff --git a/src/main/java/resonantinduction/mechanics/armbot/TaskBase.java b/src/main/java/resonantinduction/mechanics/armbot/TaskBase.java index 92054534..4f4cbdd9 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/TaskBase.java +++ b/src/main/java/resonantinduction/mechanics/armbot/TaskBase.java @@ -10,6 +10,7 @@ import resonantinduction.api.coding.IProgrammableMachine; import resonantinduction.api.coding.ITask; import resonantinduction.api.coding.args.ArgumentData; import universalelectricity.api.vector.Vector2; +import calclavia.lib.utility.NBTUtility; /** @author DarkGuardsman */ public abstract class TaskBase implements ITask @@ -137,7 +138,7 @@ public abstract class TaskBase implements ITask NBTTagCompound parms = nbt.getCompoundTag("args"); for (ArgumentData arg : this.getArgs()) { - Object obj = NBTFileHelper.loadObject(parms, arg.getName()); + Object obj = NBTUtility.loadObject(parms, arg.getName()); if (arg.isValid(obj)) { arg.setData(obj); @@ -154,7 +155,7 @@ public abstract class TaskBase implements ITask NBTTagCompound parms = new NBTTagCompound(); for (ArgumentData arg : this.getArgs()) { - NBTFileHelper.saveObject(parms, arg.getName(), arg.getData()); + NBTUtility.saveObject(parms, arg.getName(), arg.getData()); } nbt.setCompoundTag("args", parms); } diff --git a/src/main/java/resonantinduction/mechanics/armbot/TileEntityArmbot.java b/src/main/java/resonantinduction/mechanics/armbot/TileEntityArmbot.java index 915a671a..aa1a2b0a 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/TileEntityArmbot.java +++ b/src/main/java/resonantinduction/mechanics/armbot/TileEntityArmbot.java @@ -12,6 +12,7 @@ import net.minecraftforge.common.ForgeDirection; import resonantinduction.api.IArmbot; import resonantinduction.api.coding.IProgram; import resonantinduction.api.coding.ProgramHelper; +import resonantinduction.core.ResonantInduction; import resonantinduction.core.recipe.RecipeLoader; import resonantinduction.mechanics.armbot.command.TaskDrop; import resonantinduction.mechanics.armbot.command.TaskGOTO; @@ -23,19 +24,21 @@ import resonantinduction.transport.TileEntityAssembly; import resonantinduction.transport.encoder.ItemDisk; import universalelectricity.api.vector.Vector2; import universalelectricity.api.vector.Vector3; +import calclavia.lib.multiblock.link.IBlockActivate; import calclavia.lib.multiblock.link.IMultiBlock; import calclavia.lib.network.PacketHandler; +import calclavia.lib.utility.HelperMethods; +import calclavia.lib.utility.LanguageUtility; +import calclavia.lib.utility.MathHelper; import com.builtbroken.common.Pair; -import com.builtbroken.minecraft.helpers.HelperMethods; -import com.builtbroken.minecraft.helpers.MathHelper; import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.Player; import cpw.mods.fml.relauncher.Side; -public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IArmbot, IBlockActivated +public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IArmbot, IBlockActivate { protected int ROTATION_SPEED = 6; @@ -194,7 +197,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, @Override public String getInvName() { - return TranslationHelper.getLocal("tile.armbot.name"); + return LanguageUtility.getLocal("tile.armbot.name"); } public String getCommandDisplayText() @@ -298,7 +301,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, @Override public Packet getDescriptionPacket() { - return ResonantInductionTransport.getTilePacket().getPacket(this, "armbot", this.functioning, this.targetYaw, this.targetPitch, this.actualYaw, this.actualPitch); + return ResonantInduction.getTilePacket().getPacket(this, "armbot", this.functioning, this.targetYaw, this.targetPitch, this.actualYaw, this.actualPitch); } public void sendGrabItemToClient() diff --git a/src/main/java/resonantinduction/mechanics/armbot/command/TaskBreak.java b/src/main/java/resonantinduction/mechanics/armbot/command/TaskBreak.java index ed8064e6..e8f91d7a 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/command/TaskBreak.java +++ b/src/main/java/resonantinduction/mechanics/armbot/command/TaskBreak.java @@ -12,9 +12,9 @@ import resonantinduction.api.coding.ITask; import resonantinduction.mechanics.armbot.TaskBaseArmbot; import resonantinduction.mechanics.armbot.TaskBaseProcess; import universalelectricity.api.vector.Vector3; +import calclavia.lib.utility.HelperMethods; import com.builtbroken.common.Pair; -import com.builtbroken.minecraft.helpers.HelperMethods; /** * Used by arms to break a specific block in a position. diff --git a/src/main/java/resonantinduction/mechanics/armbot/command/TaskGive.java b/src/main/java/resonantinduction/mechanics/armbot/command/TaskGive.java index c1466b17..93f8ba9b 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/command/TaskGive.java +++ b/src/main/java/resonantinduction/mechanics/armbot/command/TaskGive.java @@ -18,7 +18,6 @@ import universalelectricity.api.vector.Vector3; import calclavia.lib.utility.InvInteractionHelper; import com.builtbroken.common.science.units.UnitHelper; -import com.builtbroken.minecraft.helpers.MathHelper; public class TaskGive extends TaskBaseArmbot { diff --git a/src/main/java/resonantinduction/mechanics/armbot/command/TaskRotateBy.java b/src/main/java/resonantinduction/mechanics/armbot/command/TaskRotateBy.java index f9751377..3357d05c 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/command/TaskRotateBy.java +++ b/src/main/java/resonantinduction/mechanics/armbot/command/TaskRotateBy.java @@ -10,7 +10,6 @@ import resonantinduction.mechanics.armbot.TaskBaseProcess; import universalelectricity.api.vector.Vector2; import com.builtbroken.common.science.units.UnitHelper; -import com.builtbroken.minecraft.helpers.MathHelper; /** * Rotates an armbot by a set amount diff --git a/src/main/java/resonantinduction/mechanics/armbot/command/TaskRotateTo.java b/src/main/java/resonantinduction/mechanics/armbot/command/TaskRotateTo.java index ccab02c7..8fb0319c 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/command/TaskRotateTo.java +++ b/src/main/java/resonantinduction/mechanics/armbot/command/TaskRotateTo.java @@ -10,7 +10,6 @@ import resonantinduction.mechanics.armbot.TaskBaseProcess; import universalelectricity.api.vector.Vector2; import com.builtbroken.common.science.units.UnitHelper; -import com.builtbroken.minecraft.helpers.MathHelper; /** * Rotates the armbot to a specific direction. diff --git a/src/main/java/resonantinduction/mechanics/armbot/command/TaskTake.java b/src/main/java/resonantinduction/mechanics/armbot/command/TaskTake.java index 4f4d3267..90daac3a 100644 --- a/src/main/java/resonantinduction/mechanics/armbot/command/TaskTake.java +++ b/src/main/java/resonantinduction/mechanics/armbot/command/TaskTake.java @@ -17,7 +17,6 @@ import universalelectricity.api.vector.Vector3; import calclavia.lib.utility.InvInteractionHelper; import com.builtbroken.common.science.units.UnitHelper; -import com.builtbroken.minecraft.helpers.MathHelper; public class TaskTake extends TaskBaseArmbot { diff --git a/src/main/java/resonantinduction/mechanics/machine/mining/TileLaserDrill.java b/src/main/java/resonantinduction/mechanics/machine/mining/TileLaserDrill.java index 63ce39cf..794026a0 100644 --- a/src/main/java/resonantinduction/mechanics/machine/mining/TileLaserDrill.java +++ b/src/main/java/resonantinduction/mechanics/machine/mining/TileLaserDrill.java @@ -2,13 +2,13 @@ package resonantinduction.mechanics.machine.mining; import java.awt.Color; -import resonantinduction.api.events.LaserEvent; import net.minecraft.network.packet.Packet; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.MinecraftForge; +import resonantinduction.api.events.LaserEvent; import universalelectricity.api.vector.Vector3; import calclavia.lib.network.PacketHandler; import calclavia.lib.utility.RayTraceHelper; diff --git a/src/main/java/resonantinduction/mechanics/machine/mining/TileMiningLaser.java b/src/main/java/resonantinduction/mechanics/machine/mining/TileMiningLaser.java index 9cc647d4..fa5b87ec 100644 --- a/src/main/java/resonantinduction/mechanics/machine/mining/TileMiningLaser.java +++ b/src/main/java/resonantinduction/mechanics/machine/mining/TileMiningLaser.java @@ -2,13 +2,13 @@ package resonantinduction.mechanics.machine.mining; import java.awt.Color; -import resonantinduction.api.events.LaserEvent; import net.minecraft.network.packet.Packet; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.MinecraftForge; +import resonantinduction.api.events.LaserEvent; import universalelectricity.api.vector.Vector3; import calclavia.lib.network.PacketHandler; import calclavia.lib.utility.RayTraceHelper; diff --git a/src/main/java/resonantinduction/transport/BlockTurntable.java b/src/main/java/resonantinduction/transport/BlockTurntable.java index 7f417f38..351a18d3 100644 --- a/src/main/java/resonantinduction/transport/BlockTurntable.java +++ b/src/main/java/resonantinduction/transport/BlockTurntable.java @@ -13,7 +13,6 @@ import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; -import resonantinduction.blocks.BlockAssembly; import universalelectricity.api.vector.Vector3; import com.builtbroken.minecraft.interfaces.IRotatable; diff --git a/src/main/java/resonantinduction/transport/CommonProxy.java b/src/main/java/resonantinduction/transport/CommonProxy.java index 1dfb3abb..4e8170c0 100644 --- a/src/main/java/resonantinduction/transport/CommonProxy.java +++ b/src/main/java/resonantinduction/transport/CommonProxy.java @@ -9,8 +9,6 @@ import java.util.zip.ZipInputStream; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import resonantinduction.energy.battery.ContainerBatteryBox; -import resonantinduction.energy.battery.TileBatteryBox; import resonantinduction.mechanics.generator.steam.TileEntitySteamGen; import resonantinduction.mechanics.processor.ContainerProcessor; import resonantinduction.mechanics.processor.TileEntityProcessor; diff --git a/src/main/java/resonantinduction/transport/ResonantInductionTransport.java b/src/main/java/resonantinduction/transport/ResonantInductionTransport.java index f158df4f..462ba086 100644 --- a/src/main/java/resonantinduction/transport/ResonantInductionTransport.java +++ b/src/main/java/resonantinduction/transport/ResonantInductionTransport.java @@ -16,7 +16,6 @@ import net.minecraftforge.oredict.OreDictionary; import org.modstats.Modstats; import resonantinduction.api.coding.TaskRegistry; -import resonantinduction.blocks.BlockBasalt; import resonantinduction.blocks.BlockColorGlass; import resonantinduction.blocks.BlockColorGlowGlass; import resonantinduction.blocks.BlockColorSand; @@ -41,8 +40,6 @@ import resonantinduction.core.resource.ItemBlockOre; import resonantinduction.core.resource.ItemOreDirv; import resonantinduction.core.resource.ItemParts; import resonantinduction.core.resource.ItemParts.Parts; -import resonantinduction.energy.battery.BlockBatteryBox; -import resonantinduction.energy.battery.ItemBlockEnergyStorage; import resonantinduction.mechanics.armbot.BlockArmbot; import resonantinduction.mechanics.armbot.command.TaskBreak; import resonantinduction.mechanics.armbot.command.TaskDrop; diff --git a/src/main/java/resonantinduction/transport/TileEntityAssembly.java b/src/main/java/resonantinduction/transport/TileEntityAssembly.java index 4102a8e8..bb7128a6 100644 --- a/src/main/java/resonantinduction/transport/TileEntityAssembly.java +++ b/src/main/java/resonantinduction/transport/TileEntityAssembly.java @@ -4,12 +4,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import resonatninduction.tilenetwork.INetworkEnergyPart; -import resonatninduction.tilenetwork.ITileNetwork; -import resonatninduction.tilenetwork.prefab.NetworkSharedPower; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.ForgeDirection; +import resonatninduction.tilenetwork.INetworkEnergyPart; +import resonatninduction.tilenetwork.ITileNetwork; +import resonatninduction.tilenetwork.prefab.NetworkSharedPower; import universalelectricity.api.vector.Vector3; import com.builtbroken.minecraft.prefab.TileEntityEnergyMachine; diff --git a/src/main/java/resonantinduction/transport/encoder/BlockEncoder.java b/src/main/java/resonantinduction/transport/encoder/BlockEncoder.java index 270dea65..aeabffd8 100644 --- a/src/main/java/resonantinduction/transport/encoder/BlockEncoder.java +++ b/src/main/java/resonantinduction/transport/encoder/BlockEncoder.java @@ -10,7 +10,6 @@ import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import resonantinduction.Reference; -import resonantinduction.blocks.BlockAssembly; import resonantinduction.core.Settings; import resonantinduction.transport.ResonantInductionTransport; diff --git a/src/main/java/resonantinduction/transport/encoder/ItemDisk.java b/src/main/java/resonantinduction/transport/encoder/ItemDisk.java index 90528c20..97bbbcf7 100644 --- a/src/main/java/resonantinduction/transport/encoder/ItemDisk.java +++ b/src/main/java/resonantinduction/transport/encoder/ItemDisk.java @@ -11,7 +11,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import resonantinduction.Reference; import resonantinduction.core.ResonantInductionTabs; -import resonantinduction.transport.ResonantInductionTransport; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -21,7 +20,7 @@ public class ItemDisk extends Item { super(id); this.setUnlocalizedName("disk"); - this.setCreativeTab(ResonantInductionTabs.tabAutomation()); + this.setCreativeTab(ResonantInductionTabs.CORE); this.setHasSubtypes(true); } diff --git a/src/main/java/resonantinduction/transport/encoder/TileEntityEncoder.java b/src/main/java/resonantinduction/transport/encoder/TileEntityEncoder.java index 584f09c8..1a4ccf04 100644 --- a/src/main/java/resonantinduction/transport/encoder/TileEntityEncoder.java +++ b/src/main/java/resonantinduction/transport/encoder/TileEntityEncoder.java @@ -123,7 +123,7 @@ public class TileEntityEncoder extends TileEntityMachine implements ISidedInvent if (dis.readBoolean()) { Program program = new Program(); - program.load(PacketHandler.instance().readNBTTagCompound(dis)); + program.load(PacketHandler.readNBTTagCompound(dis)); this.program = program; } else @@ -139,7 +139,7 @@ public class TileEntityEncoder extends TileEntityMachine implements ISidedInvent { ITask task = TaskRegistry.getCommand(dis.readUTF()); task.setPosition(dis.readInt(), dis.readInt()); - task.load(PacketHandler.instance().readNBTTagCompound(dis)); + task.load(PacketHandler.readNBTTagCompound(dis)); this.getProgram().setTaskAt(task.getCol(), task.getRow(), task); this.sendGUIPacket(); return true; @@ -148,7 +148,7 @@ public class TileEntityEncoder extends TileEntityMachine implements ISidedInvent { ITask task = TaskRegistry.getCommand(dis.readUTF()); task.setPosition(dis.readInt(), dis.readInt()); - task.load(PacketHandler.instance().readNBTTagCompound(dis)); + task.load(PacketHandler.readNBTTagCompound(dis)); this.getProgram().insertTask(task.getCol(), task.getRow(), task); this.sendGUIPacket(); return true; diff --git a/src/main/java/resonantinduction/transport/fluid/BlockKitchenSink.java b/src/main/java/resonantinduction/transport/fluid/BlockKitchenSink.java index da463162..e4818db3 100644 --- a/src/main/java/resonantinduction/transport/fluid/BlockKitchenSink.java +++ b/src/main/java/resonantinduction/transport/fluid/BlockKitchenSink.java @@ -10,7 +10,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import resonantinduction.blocks.BlockHydraulic; import resonantinduction.client.render.BlockRenderHelper; import resonantinduction.core.Settings; import calclavia.lib.utility.FluidHelper; diff --git a/src/main/java/resonantinduction/transport/fluid/BlockSteamPiston.java b/src/main/java/resonantinduction/transport/fluid/BlockSteamPiston.java index 66d730a6..d4ffbe1e 100644 --- a/src/main/java/resonantinduction/transport/fluid/BlockSteamPiston.java +++ b/src/main/java/resonantinduction/transport/fluid/BlockSteamPiston.java @@ -8,7 +8,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import resonantinduction.blocks.BlockHydraulic; import resonantinduction.core.Settings; import resonantinduction.mechanics.generator.steam.TileEntitySteamPiston; diff --git a/src/main/java/resonantinduction/transport/fluid/TileEntityReleaseValve.java b/src/main/java/resonantinduction/transport/fluid/TileEntityReleaseValve.java index 7984a2ef..365e931c 100644 --- a/src/main/java/resonantinduction/transport/fluid/TileEntityReleaseValve.java +++ b/src/main/java/resonantinduction/transport/fluid/TileEntityReleaseValve.java @@ -10,8 +10,8 @@ import resonantinduction.api.fluid.INetworkPipe; import resonantinduction.transport.fluid.network.NetworkPipes; import resonantinduction.transport.fluid.prefab.TileEntityFluidDevice; import resonatninduction.tilenetwork.ITileConnector; +import calclavia.lib.utility.HelperMethods; -import com.builtbroken.minecraft.helpers.HelperMethods; import com.builtbroken.minecraft.interfaces.IReadOut; public class TileEntityReleaseValve extends TileEntityFluidDevice implements ITileConnector, IReadOut diff --git a/src/main/java/resonantinduction/transport/fluid/prefab/TileEntityFluidDevice.java b/src/main/java/resonantinduction/transport/fluid/prefab/TileEntityFluidDevice.java index 2a8c6c4c..49cfc104 100644 --- a/src/main/java/resonantinduction/transport/fluid/prefab/TileEntityFluidDevice.java +++ b/src/main/java/resonantinduction/transport/fluid/prefab/TileEntityFluidDevice.java @@ -2,10 +2,10 @@ package resonantinduction.transport.fluid.prefab; import java.util.Random; -import resonatninduction.tilenetwork.ITileConnector; -import resonatninduction.tilenetwork.prefab.NetworkTileEntities; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.ForgeDirection; +import resonatninduction.tilenetwork.ITileConnector; +import resonatninduction.tilenetwork.prefab.NetworkTileEntities; import calclavia.lib.prefab.tile.TileAdvanced; import com.builtbroken.minecraft.interfaces.IReadOut; diff --git a/src/main/java/resonantinduction/transport/fluid/pump/BlockConstructionPump.java b/src/main/java/resonantinduction/transport/fluid/pump/BlockConstructionPump.java index 483b880d..08c11f7c 100644 --- a/src/main/java/resonantinduction/transport/fluid/pump/BlockConstructionPump.java +++ b/src/main/java/resonantinduction/transport/fluid/pump/BlockConstructionPump.java @@ -13,10 +13,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import resonantinduction.Reference; import resonantinduction.client.render.BlockRenderHelper; import resonantinduction.core.Settings; import resonantinduction.core.recipe.RecipeLoader; -import resonantinduction.transport.ResonantInductionTransport; import resonatninduction.tilenetwork.prefab.NetworkTileEntities; import com.builtbroken.common.Pair; @@ -40,7 +40,7 @@ public class BlockConstructionPump extends BlockMachine @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon(ResonantInductionTransport.PREFIX + "ironMachineSide"); + this.blockIcon = par1IconRegister.registerIcon(Reference.PREFIX + "ironMachineSide"); } @Override diff --git a/src/main/java/resonantinduction/transport/fluid/pump/BlockDrain.java b/src/main/java/resonantinduction/transport/fluid/pump/BlockDrain.java index 152e9074..539d0422 100644 --- a/src/main/java/resonantinduction/transport/fluid/pump/BlockDrain.java +++ b/src/main/java/resonantinduction/transport/fluid/pump/BlockDrain.java @@ -14,8 +14,8 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; +import resonantinduction.Reference; import resonantinduction.core.Settings; -import resonantinduction.transport.ResonantInductionTransport; import com.builtbroken.common.Pair; import com.builtbroken.minecraft.prefab.BlockMachine; @@ -40,9 +40,9 @@ public class BlockDrain extends BlockMachine @Override public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon(ResonantInductionTransport.PREFIX + "ironMachineSide"); - this.drainIcon = par1IconRegister.registerIcon(ResonantInductionTransport.PREFIX + "drain"); - this.fillIcon = par1IconRegister.registerIcon(ResonantInductionTransport.PREFIX + "drain2"); + this.blockIcon = par1IconRegister.registerIcon(Reference.PREFIX + "ironMachineSide"); + this.drainIcon = par1IconRegister.registerIcon(Reference.PREFIX + "drain"); + this.fillIcon = par1IconRegister.registerIcon(Reference.PREFIX + "drain2"); } @Override diff --git a/src/main/java/resonantinduction/transport/hopper/BlockAdvancedHopper.java b/src/main/java/resonantinduction/transport/hopper/BlockAdvancedHopper.java index 831b226c..5658cee5 100644 --- a/src/main/java/resonantinduction/transport/hopper/BlockAdvancedHopper.java +++ b/src/main/java/resonantinduction/transport/hopper/BlockAdvancedHopper.java @@ -6,6 +6,7 @@ import java.util.Set; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; @@ -14,7 +15,6 @@ import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import resonantinduction.client.render.RenderAdvancedHopper; -import resonantinduction.core.ResonantInductionTabs; import resonantinduction.core.Settings; import com.builtbroken.common.Pair; @@ -40,7 +40,7 @@ public class BlockAdvancedHopper extends BlockMachine public BlockAdvancedHopper() { super(Settings.CONFIGURATION, "DMHopper", Material.iron); - this.setCreativeTab(ResonantInductionTabs.tabAutomation()); + this.setCreativeTab(CreativeTabs.tabRedstone); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } diff --git a/src/main/java/resonantinduction/transport/hopper/TileEntityAdvancedHopper.java b/src/main/java/resonantinduction/transport/hopper/TileEntityAdvancedHopper.java index 3db53b5e..f2aa0efb 100644 --- a/src/main/java/resonantinduction/transport/hopper/TileEntityAdvancedHopper.java +++ b/src/main/java/resonantinduction/transport/hopper/TileEntityAdvancedHopper.java @@ -9,10 +9,9 @@ import net.minecraftforge.common.ForgeDirection; import resonantinduction.transport.imprinter.ItemImprinter; import resonantinduction.transport.imprinter.TileEntityFilterable; import universalelectricity.api.vector.Vector3; +import calclavia.lib.utility.HelperMethods; import calclavia.lib.utility.InvInteractionHelper; -import com.builtbroken.minecraft.helpers.HelperMethods; - /** * Advanced version of the hopper with features such as redstone control, sorting, filtering, and * crate version. diff --git a/src/main/java/resonantinduction/transport/imprinter/BlockImprinter.java b/src/main/java/resonantinduction/transport/imprinter/BlockImprinter.java index 02500203..b258ac74 100644 --- a/src/main/java/resonantinduction/transport/imprinter/BlockImprinter.java +++ b/src/main/java/resonantinduction/transport/imprinter/BlockImprinter.java @@ -13,6 +13,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import resonantinduction.Reference; import resonantinduction.core.Settings; import resonantinduction.mechanics.CommonProxy; import resonantinduction.transport.ResonantInductionTransport; @@ -38,9 +39,9 @@ public class BlockImprinter extends BlockMachine @Override public void registerIcons(IconRegister iconReg) { - this.imprinter_side = iconReg.registerIcon(ResonantInductionTransport.PREFIX + "imprinter_side"); - this.imprinter_top = iconReg.registerIcon(ResonantInductionTransport.PREFIX + "imprinter_top"); - this.imprinter_bottom = iconReg.registerIcon(ResonantInductionTransport.PREFIX + "imprinter_bottom"); + this.imprinter_side = iconReg.registerIcon(Reference.PREFIX + "imprinter_side"); + this.imprinter_top = iconReg.registerIcon(Reference.PREFIX + "imprinter_top"); + this.imprinter_bottom = iconReg.registerIcon(Reference.PREFIX + "imprinter_bottom"); } @Override diff --git a/src/main/java/resonantinduction/transport/imprinter/ItemImprinter.java b/src/main/java/resonantinduction/transport/imprinter/ItemImprinter.java index 66673247..c0729a7b 100644 --- a/src/main/java/resonantinduction/transport/imprinter/ItemImprinter.java +++ b/src/main/java/resonantinduction/transport/imprinter/ItemImprinter.java @@ -13,9 +13,9 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import resonantinduction.Reference; import resonantinduction.core.ResonantInductionTabs; import resonantinduction.core.Settings; -import resonantinduction.transport.ResonantInductionTransport; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -25,7 +25,7 @@ public class ItemImprinter extends Item { super(Settings.CONFIGURATION.getItem("imprint", id).getInt()); this.setUnlocalizedName("imprint"); - this.setCreativeTab(ResonantInductionTabs.tabAutomation()); + this.setCreativeTab(ResonantInductionTabs.CORE); this.setHasSubtypes(true); this.maxStackSize = 1; } @@ -34,7 +34,7 @@ public class ItemImprinter extends Item @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { - this.itemIcon = par1IconRegister.registerIcon(ResonantInductionTransport.PREFIX + "imprint"); + this.itemIcon = par1IconRegister.registerIcon(Reference.PREFIX + "imprint"); } @Override diff --git a/src/main/java/resonantinduction/transport/imprinter/TileEntityImprinter.java b/src/main/java/resonantinduction/transport/imprinter/TileEntityImprinter.java index 03370015..5f670aeb 100644 --- a/src/main/java/resonantinduction/transport/imprinter/TileEntityImprinter.java +++ b/src/main/java/resonantinduction/transport/imprinter/TileEntityImprinter.java @@ -18,6 +18,7 @@ import universalelectricity.api.vector.Vector3; import calclavia.lib.prefab.tile.TileAdvanced; import calclavia.lib.utility.AutoCraftingManager; import calclavia.lib.utility.AutoCraftingManager.IAutoCrafter; +import calclavia.lib.utility.LanguageUtility; import com.builtbroken.common.Pair; import com.builtbroken.minecraft.prefab.invgui.ISlotPickResult; @@ -167,7 +168,7 @@ public class TileEntityImprinter extends TileAdvanced implements ISidedInventory @Override public String getInvName() { - return TranslationUtility.getLocal("tile.imprinter.name"); + return LanguageUtility.getLocal("tile.imprinter.name"); } @Override diff --git a/src/main/java/resonantinduction/transport/logistic/BlockDetector.java b/src/main/java/resonantinduction/transport/logistic/BlockDetector.java index 3c4c389b..176e082f 100644 --- a/src/main/java/resonantinduction/transport/logistic/BlockDetector.java +++ b/src/main/java/resonantinduction/transport/logistic/BlockDetector.java @@ -14,8 +14,8 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; +import resonantinduction.Reference; import resonantinduction.client.render.RenderDetector; -import resonantinduction.transport.ResonantInductionTransport; import resonantinduction.transport.imprinter.BlockImprintable; import universalelectricity.api.UniversalElectricity; @@ -74,8 +74,8 @@ public class BlockDetector extends BlockImprintable public void registerIcons(IconRegister iconReg) { super.registerIcons(iconReg); - this.eye_green = iconReg.registerIcon(ResonantInductionTransport.PREFIX + "detector_green"); - this.eye_red = iconReg.registerIcon(ResonantInductionTransport.PREFIX + "detector_red"); + this.eye_green = iconReg.registerIcon(Reference.PREFIX + "detector_green"); + this.eye_red = iconReg.registerIcon(Reference.PREFIX + "detector_red"); } @Override diff --git a/src/main/java/resonantinduction/transport/logistic/BlockRejector.java b/src/main/java/resonantinduction/transport/logistic/BlockRejector.java index 5991af6d..2b4631f5 100644 --- a/src/main/java/resonantinduction/transport/logistic/BlockRejector.java +++ b/src/main/java/resonantinduction/transport/logistic/BlockRejector.java @@ -8,9 +8,9 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Icon; import net.minecraft.world.World; +import resonantinduction.Reference; import resonantinduction.client.render.BlockRenderingHandler; import resonantinduction.client.render.RenderRejector; -import resonantinduction.transport.ResonantInductionTransport; import resonantinduction.transport.imprinter.BlockImprintable; import universalelectricity.api.UniversalElectricity; @@ -59,8 +59,8 @@ public class BlockRejector extends BlockImprintable @Override public void registerIcons(IconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon(ResonantInductionTransport.PREFIX + "imprinter_bottom"); - this.front = par1IconRegister.registerIcon(ResonantInductionTransport.PREFIX + "disk_tray"); + this.blockIcon = par1IconRegister.registerIcon(Reference.PREFIX + "imprinter_bottom"); + this.front = par1IconRegister.registerIcon(Reference.PREFIX + "disk_tray"); } @Override diff --git a/src/main/java/resonantinduction/transport/logistic/TileEntityDetector.java b/src/main/java/resonantinduction/transport/logistic/TileEntityDetector.java index 7eb7d3dc..c39a34f8 100644 --- a/src/main/java/resonantinduction/transport/logistic/TileEntityDetector.java +++ b/src/main/java/resonantinduction/transport/logistic/TileEntityDetector.java @@ -76,7 +76,7 @@ public class TileEntityDetector extends TileEntityFilterable } } - PacketHandler.instance().sendPacketToClients(getDescriptionPacket()); + PacketHandler.sendPacketToClients(getDescriptionPacket()); } } } diff --git a/src/main/java/resonantinduction/transport/vechicle/ItemVehicleSpawn.java b/src/main/java/resonantinduction/transport/vechicle/ItemVehicleSpawn.java index 3ed813d5..07cf363b 100644 --- a/src/main/java/resonantinduction/transport/vechicle/ItemVehicleSpawn.java +++ b/src/main/java/resonantinduction/transport/vechicle/ItemVehicleSpawn.java @@ -12,7 +12,7 @@ import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import resonantinduction.core.ResonantInductionTabs; +import resonantinduction.core.Settings; /** * Basic item used to spawn a vehicle @@ -23,9 +23,8 @@ public class ItemVehicleSpawn extends Item { public ItemVehicleSpawn() { - super(DarkCore.getNextItemId()); + super(Settings.CONFIGURATION.getItem("ItemCar",Settings.getNextItemID()).getInt()); this.setUnlocalizedName("Vehicle"); - this.setCreativeTab(ResonantInductionTabs.tabIndustrial()); } @Override diff --git a/src/main/java/resonatninduction/tilenetwork/prefab/NetworkPathFinder.java b/src/main/java/resonatninduction/tilenetwork/prefab/NetworkPathFinder.java index 505d48d4..6a90229c 100644 --- a/src/main/java/resonatninduction/tilenetwork/prefab/NetworkPathFinder.java +++ b/src/main/java/resonatninduction/tilenetwork/prefab/NetworkPathFinder.java @@ -3,9 +3,9 @@ package resonatninduction.tilenetwork.prefab; import java.util.HashSet; import java.util.Set; -import resonatninduction.tilenetwork.INetworkPart; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import resonatninduction.tilenetwork.INetworkPart; import universalelectricity.api.vector.Vector3; import calclavia.lib.path.IPathCallBack; import calclavia.lib.path.Pathfinder; diff --git a/src/main/java/resonatninduction/tilenetwork/prefab/NetworkResourceSupply.java b/src/main/java/resonatninduction/tilenetwork/prefab/NetworkResourceSupply.java index 8cea353c..084bfab3 100644 --- a/src/main/java/resonatninduction/tilenetwork/prefab/NetworkResourceSupply.java +++ b/src/main/java/resonatninduction/tilenetwork/prefab/NetworkResourceSupply.java @@ -3,9 +3,9 @@ package resonatninduction.tilenetwork.prefab; import java.util.HashMap; import java.util.List; -import resonatninduction.tilenetwork.INetworkPart; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; +import resonatninduction.tilenetwork.INetworkPart; /** * Network that supplies resources to tiles that demand a set resource diff --git a/src/main/java/resonatninduction/tilenetwork/prefab/NetworkSharedPower.java b/src/main/java/resonatninduction/tilenetwork/prefab/NetworkSharedPower.java index 7b041dff..85889f96 100644 --- a/src/main/java/resonatninduction/tilenetwork/prefab/NetworkSharedPower.java +++ b/src/main/java/resonatninduction/tilenetwork/prefab/NetworkSharedPower.java @@ -1,8 +1,8 @@ package resonatninduction.tilenetwork.prefab; +import net.minecraft.tileentity.TileEntity; import resonatninduction.tilenetwork.INetworkEnergyPart; import resonatninduction.tilenetwork.INetworkPart; -import net.minecraft.tileentity.TileEntity; import com.builtbroken.minecraft.interfaces.IPowerLess; diff --git a/src/main/java/resonatninduction/tilenetwork/prefab/NetworkTileEntities.java b/src/main/java/resonatninduction/tilenetwork/prefab/NetworkTileEntities.java index 3b9fa693..d9edddc4 100644 --- a/src/main/java/resonatninduction/tilenetwork/prefab/NetworkTileEntities.java +++ b/src/main/java/resonatninduction/tilenetwork/prefab/NetworkTileEntities.java @@ -5,10 +5,10 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import resonatninduction.tilenetwork.INetworkPart; -import resonatninduction.tilenetwork.ITileNetwork; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; +import resonatninduction.tilenetwork.INetworkPart; +import resonatninduction.tilenetwork.ITileNetwork; import universalelectricity.api.vector.Vector3; import universalelectricity.api.vector.VectorHelper; import calclavia.lib.path.Pathfinder;