From cb934a6030995f6f1911aca31530324b56c5632b Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Tue, 3 Sep 2013 03:08:26 -0400 Subject: [PATCH] import changes --- .../dark/assembly/common/ALRecipeLoader.java | 2 +- .../dark/assembly/common/AssemblyLine.java | 6 ++--- .../assembly/common/armbot/BlockArmbot.java | 2 +- .../common/armbot/TileEntityArmbot.java | 6 ++--- .../common/armbot/command/CommandBreak.java | 2 +- .../common/armbot/command/CommandPowerTo.java | 2 +- .../common/imprinter/ContainerImprinter.java | 8 +++--- .../common/imprinter/TileEntityImprinter.java | 10 +++---- .../common/machine/BlockAssembly.java | 2 +- .../common/machine/InvInteractionHelper.java | 2 +- .../common/machine/InventoryCrate.java | 2 +- .../common/machine/NetworkAssembly.java | 10 +++---- .../common/machine/TileEntityAssembly.java | 15 +++-------- .../common/machine/TileEntityCrate.java | 4 +-- .../machine/belt/TileEntityConveyorBelt.java | 27 ++++++++++++++----- .../crane/TileEntityCraneController.java | 2 +- .../machine/encoder/ContainerEncoder.java | 2 +- 17 files changed, 53 insertions(+), 51 deletions(-) diff --git a/src/minecraft/dark/assembly/common/ALRecipeLoader.java b/src/minecraft/dark/assembly/common/ALRecipeLoader.java index 7770b934..2ce20dec 100644 --- a/src/minecraft/dark/assembly/common/ALRecipeLoader.java +++ b/src/minecraft/dark/assembly/common/ALRecipeLoader.java @@ -7,7 +7,7 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; import dark.assembly.common.machine.BlockCrate; -import dark.common.RecipeLoader; +import dark.core.common.RecipeLoader; public class ALRecipeLoader extends RecipeLoader { diff --git a/src/minecraft/dark/assembly/common/AssemblyLine.java b/src/minecraft/dark/assembly/common/AssemblyLine.java index 67d8ad31..53001af3 100644 --- a/src/minecraft/dark/assembly/common/AssemblyLine.java +++ b/src/minecraft/dark/assembly/common/AssemblyLine.java @@ -51,9 +51,9 @@ import dark.assembly.common.machine.crane.TileEntityCraneRail; import dark.assembly.common.machine.encoder.BlockEncoder; import dark.assembly.common.machine.encoder.ItemDisk; import dark.assembly.common.machine.encoder.TileEntityEncoder; -import dark.common.DarkMain; -import dark.common.BlockRegistry.BlockData; -import dark.prefab.ModPrefab; +import dark.core.common.DarkMain; +import dark.core.common.BlockRegistry.BlockData; +import dark.core.prefab.ModPrefab; @ModstatInfo(prefix = "asmline") @Mod(modid = AssemblyLine.CHANNEL, name = AssemblyLine.MOD_NAME, version = DarkMain.VERSION, dependencies = "required-after:DarkCore", useMetadata = true) diff --git a/src/minecraft/dark/assembly/common/armbot/BlockArmbot.java b/src/minecraft/dark/assembly/common/armbot/BlockArmbot.java index 1aa63be9..5bc9e9db 100644 --- a/src/minecraft/dark/assembly/common/armbot/BlockArmbot.java +++ b/src/minecraft/dark/assembly/common/armbot/BlockArmbot.java @@ -12,7 +12,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.common.machine.BlockAssembly; -import dark.prefab.IMultiBlock; +import dark.core.prefab.IMultiBlock; public class BlockArmbot extends BlockAssembly { diff --git a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java index a4bb653f..918fc473 100644 --- a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java +++ b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java @@ -40,9 +40,9 @@ import dark.assembly.common.armbot.command.CommandRotateTo; import dark.assembly.common.armbot.command.CommandUse; import dark.assembly.common.machine.TileEntityAssembly; import dark.assembly.common.machine.encoder.ItemDisk; -import dark.common.DarkMain; -import dark.prefab.IMultiBlock; -import dark.prefab.helpers.ItemWorldHelper; +import dark.core.common.DarkMain; +import dark.core.prefab.IMultiBlock; +import dark.core.prefab.helpers.ItemWorldHelper; public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IPacketReceiver, IArmbot, IPeripheral { diff --git a/src/minecraft/dark/assembly/common/armbot/command/CommandBreak.java b/src/minecraft/dark/assembly/common/armbot/command/CommandBreak.java index b258651b..0bbb00a8 100644 --- a/src/minecraft/dark/assembly/common/armbot/command/CommandBreak.java +++ b/src/minecraft/dark/assembly/common/armbot/command/CommandBreak.java @@ -6,7 +6,7 @@ import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import universalelectricity.core.vector.Vector3; -import dark.prefab.helpers.ItemWorldHelper; +import dark.core.prefab.helpers.ItemWorldHelper; /** Used by arms to break a specific block in a position. * diff --git a/src/minecraft/dark/assembly/common/armbot/command/CommandPowerTo.java b/src/minecraft/dark/assembly/common/armbot/command/CommandPowerTo.java index c0c2376f..50e37ff3 100644 --- a/src/minecraft/dark/assembly/common/armbot/command/CommandPowerTo.java +++ b/src/minecraft/dark/assembly/common/armbot/command/CommandPowerTo.java @@ -9,7 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; -import dark.prefab.helpers.ItemWorldHelper; +import dark.core.prefab.helpers.ItemWorldHelper; public class CommandPowerTo extends Command { diff --git a/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java b/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java index 47900240..d8c4f735 100644 --- a/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java +++ b/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java @@ -6,10 +6,10 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import dark.assembly.common.AssemblyLine; -import dark.prefab.invgui.ISlotWatcher; -import dark.prefab.invgui.SlotCraftingResult; -import dark.prefab.invgui.SlotRestricted; -import dark.prefab.invgui.WatchedSlot; +import dark.core.prefab.invgui.ISlotWatcher; +import dark.core.prefab.invgui.SlotCraftingResult; +import dark.core.prefab.invgui.SlotRestricted; +import dark.core.prefab.invgui.WatchedSlot; public class ContainerImprinter extends Container implements ISlotWatcher { diff --git a/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java b/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java index 310adea3..0afdf6b1 100644 --- a/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java +++ b/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java @@ -27,11 +27,11 @@ import com.google.common.io.ByteArrayDataInput; import dark.assembly.api.IArmbot; import dark.assembly.api.IArmbotUseable; import dark.assembly.common.AssemblyLine; -import dark.prefab.TileEntityMulti; -import dark.prefab.helpers.AutoCraftingManager; -import dark.prefab.helpers.AutoCraftingManager.IAutoCrafter; -import dark.prefab.helpers.Pair; -import dark.prefab.invgui.ISlotPickResult; +import dark.core.prefab.TileEntityMulti; +import dark.core.prefab.helpers.AutoCraftingManager; +import dark.core.prefab.helpers.Pair; +import dark.core.prefab.helpers.AutoCraftingManager.IAutoCrafter; +import dark.core.prefab.invgui.ISlotPickResult; public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInventory, IArmbotUseable, IPacketReceiver, ISlotPickResult, IAutoCrafter { diff --git a/src/minecraft/dark/assembly/common/machine/BlockAssembly.java b/src/minecraft/dark/assembly/common/machine/BlockAssembly.java index 079c6730..8b8eb684 100644 --- a/src/minecraft/dark/assembly/common/machine/BlockAssembly.java +++ b/src/minecraft/dark/assembly/common/machine/BlockAssembly.java @@ -8,7 +8,7 @@ import net.minecraft.util.Icon; import net.minecraft.world.World; import dark.assembly.common.AssemblyLine; import dark.assembly.common.TabAssemblyLine; -import dark.prefab.BlockMachine; +import dark.core.prefab.BlockMachine; public abstract class BlockAssembly extends BlockMachine { diff --git a/src/minecraft/dark/assembly/common/machine/InvInteractionHelper.java b/src/minecraft/dark/assembly/common/machine/InvInteractionHelper.java index 17c8b715..fa21e5f6 100644 --- a/src/minecraft/dark/assembly/common/machine/InvInteractionHelper.java +++ b/src/minecraft/dark/assembly/common/machine/InvInteractionHelper.java @@ -12,7 +12,7 @@ import net.minecraft.tileentity.TileEntityChest; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; -import dark.prefab.TileEntityMulti; +import dark.core.prefab.TileEntityMulti; public class InvInteractionHelper { diff --git a/src/minecraft/dark/assembly/common/machine/InventoryCrate.java b/src/minecraft/dark/assembly/common/machine/InventoryCrate.java index f8bd7acf..f5819853 100644 --- a/src/minecraft/dark/assembly/common/machine/InventoryCrate.java +++ b/src/minecraft/dark/assembly/common/machine/InventoryCrate.java @@ -3,7 +3,7 @@ package dark.assembly.common.machine; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import dark.prefab.invgui.InvChest; +import dark.core.prefab.invgui.InvChest; public class InventoryCrate extends InvChest { diff --git a/src/minecraft/dark/assembly/common/machine/NetworkAssembly.java b/src/minecraft/dark/assembly/common/machine/NetworkAssembly.java index d480c6b9..8b0f59a9 100644 --- a/src/minecraft/dark/assembly/common/machine/NetworkAssembly.java +++ b/src/minecraft/dark/assembly/common/machine/NetworkAssembly.java @@ -10,9 +10,9 @@ import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.block.IElectrical; import universalelectricity.core.block.IElectricalStorage; import universalelectricity.core.vector.Vector3; -import dark.interfaces.INetworkEnergyPart; -import dark.interfaces.INetworkPart; -import dark.prefab.tilenetwork.NetworkSharedPower; +import dark.core.interfaces.INetworkEnergyPart; +import dark.core.interfaces.INetworkPart; +import dark.core.prefab.tilenetwork.NetworkSharedPower; public class NetworkAssembly extends NetworkSharedPower { @@ -61,10 +61,6 @@ public class NetworkAssembly extends NetworkSharedPower { lastTime = time; } - if(time - lastTime < damandUpdateDelay) - { - return lastDemand; - } currentDemand += getNetworkPartsDemand(); Iterator it = this.powerLoads.iterator(); while (it.hasNext()) diff --git a/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java b/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java index 1267c71a..d4f45e52 100644 --- a/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java @@ -10,10 +10,10 @@ import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.electricity.ElectricityPack; import universalelectricity.core.vector.Vector3; import dark.assembly.common.AssemblyLine; -import dark.interfaces.INetworkEnergyPart; -import dark.prefab.TileEntityMachine; -import dark.prefab.tilenetwork.NetworkSharedPower; -import dark.prefab.tilenetwork.NetworkTileEntities; +import dark.core.interfaces.INetworkEnergyPart; +import dark.core.prefab.TileEntityMachine; +import dark.core.prefab.tilenetwork.NetworkSharedPower; +import dark.core.prefab.tilenetwork.NetworkTileEntities; /** A class to be inherited by all machines on the assembly line. This class acts as a single peace * in a network of similar tiles allowing all to share power from one or more sources @@ -68,11 +68,6 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN this.updateTick = ((int) random.nextInt(1 + refresh_diff) + refresh_min_rate); this.refresh(); } - this.running = this.canRun(); - if (running != prevRunning) - { - this.sendPowerUpdate(); - } } this.onUpdate(); @@ -152,7 +147,6 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN { this.assemblyNetwork = (NetworkAssembly) network; } - } @Override @@ -164,7 +158,6 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN @Override public float receiveElectricity(ForgeDirection from, ElectricityPack receive, boolean doReceive) { - System.out.println("AssemblyTile has recieve power packet: " + (receive != null ? receive.toString() : "null")); return this.getTileNetwork().dumpPower(this, receive.getWatts(), doReceive); } diff --git a/src/minecraft/dark/assembly/common/machine/TileEntityCrate.java b/src/minecraft/dark/assembly/common/machine/TileEntityCrate.java index 3ccc674b..b25918f3 100644 --- a/src/minecraft/dark/assembly/common/machine/TileEntityCrate.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityCrate.java @@ -15,8 +15,8 @@ import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import dark.assembly.common.AssemblyLine; -import dark.interfaces.IExternalInv; -import dark.prefab.TileEntityInv; +import dark.core.interfaces.IExternalInv; +import dark.core.prefab.TileEntityInv; public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, IExternalInv { diff --git a/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java b/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java index 5352ec57..25bd0da0 100644 --- a/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java +++ b/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java @@ -20,6 +20,9 @@ import dark.assembly.api.IBelt; import dark.assembly.common.AssemblyLine; import dark.assembly.common.machine.TileEntityAssembly; +/** Conveyer belt TileEntity that allows entities of all kinds to be moved + * + * @author DarkGuardsman */ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacketReceiver, IBelt, IRotatable { @@ -33,12 +36,16 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke public static final int MAX_FRAME = 13; public static final int MAX_SLANT_FRAME = 23; - + /** Packet name to ID the packet containing info on the angle of the belt */ + public static final String slantPacketID = "slantPacket"; + /** Acceleration of entities on the belt */ public final float acceleration = 0.01f; + /** max speed of entities on the belt */ public final float maxSpeed = 0.1f; /** Current rotation of the model wheels */ public float wheelRotation = 0; - private int animFrame = 0; // this is from 0 to 15 + /** Frame count for texture animation from 0 - maxFrame */ + private int animFrame = 0; private SlantType slantType = SlantType.NONE; /** Entities that are ignored allowing for other tiles to interact with them */ public List IgnoreList = new ArrayList(); @@ -49,8 +56,9 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke } @Override - public void onUpdate() + public void updateEntity() { + super.updateEntity(); /* PROCESSES IGNORE LIST AND REMOVES UNNEED ENTRIES */ Iterator it = this.IgnoreList.iterator(); while (it.hasNext()) @@ -60,8 +68,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke it.remove(); } } - - if (this.worldObj.isRemote && this.isRunning() && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord)) + if (this.worldObj.isRemote && this.isRunning()) { if (this.ticks % 10 == 0 && this.worldObj.isRemote && this.worldObj.getBlockId(this.xCoord - 1, this.yCoord, this.zCoord) != AssemblyLine.recipeLoader.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != AssemblyLine.recipeLoader.blockConveyorBelt.blockID) { @@ -93,10 +100,16 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke } + @Override + public boolean canRun() + { + return super.canRun() && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord); + } + @Override public Packet getDescriptionPacket() { - return PacketManager.getPacket(AssemblyLine.CHANNEL, this, "beltSlant", this.slantType.ordinal()); + return PacketManager.getPacket(AssemblyLine.CHANNEL, this, slantPacketID, this.slantType.ordinal()); } public SlantType getSlant() @@ -161,7 +174,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke { try { - if (id.equalsIgnoreCase("beltSlant")) + if (id.equalsIgnoreCase(slantPacketID)) { this.slantType = SlantType.values()[dis.readInt()]; return true; diff --git a/src/minecraft/dark/assembly/common/machine/crane/TileEntityCraneController.java b/src/minecraft/dark/assembly/common/machine/crane/TileEntityCraneController.java index 3a4462d2..fb355f0c 100644 --- a/src/minecraft/dark/assembly/common/machine/crane/TileEntityCraneController.java +++ b/src/minecraft/dark/assembly/common/machine/crane/TileEntityCraneController.java @@ -7,7 +7,7 @@ import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; import dark.assembly.api.ICraneStructure; import dark.assembly.common.machine.TileEntityAssembly; -import dark.common.DarkMain; +import dark.core.common.DarkMain; public class TileEntityCraneController extends TileEntityAssembly implements ICraneStructure { diff --git a/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java b/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java index 8b1e07fa..30a1fc43 100644 --- a/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java +++ b/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java @@ -6,7 +6,7 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import dark.assembly.common.AssemblyLine; -import dark.prefab.invgui.SlotRestricted; +import dark.core.prefab.invgui.SlotRestricted; public class ContainerEncoder extends Container {