import changes

This commit is contained in:
DarkGuardsman 2013-09-03 03:08:26 -04:00
parent 841032a784
commit cb934a6030
17 changed files with 53 additions and 51 deletions

View file

@ -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
{

View file

@ -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)

View file

@ -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
{

View file

@ -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
{

View file

@ -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.
*

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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<TileEntity> it = this.powerLoads.iterator();
while (it.hasNext())

View file

@ -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);
}

View file

@ -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
{

View file

@ -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<Entity> IgnoreList = new ArrayList<Entity>();
@ -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<Entity> 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;

View file

@ -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
{

View file

@ -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
{