This commit is contained in:
DarkGuardsman 2013-09-18 06:56:30 -04:00
parent 06b8321792
commit cc4134652f
13 changed files with 29 additions and 36 deletions

View file

@ -104,7 +104,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
}
}
if (this.isRunning())
if (this.isFunctioning())
{
if (!this.worldObj.isRemote)
{

View file

@ -27,11 +27,11 @@ import dark.assembly.api.IArmbot;
import dark.assembly.api.IArmbotUseable;
import dark.core.common.DarkMain;
import dark.core.network.PacketHandler;
import dark.core.prefab.TileEntityMulti;
import dark.core.prefab.helpers.AutoCraftingManager;
import dark.core.prefab.helpers.AutoCraftingManager.IAutoCrafter;
import dark.core.prefab.helpers.Pair;
import dark.core.prefab.invgui.ISlotPickResult;
import dark.core.prefab.machine.TileEntityMulti;
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.core.prefab.BlockMachine;
import dark.core.prefab.machine.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.core.prefab.TileEntityMulti;
import dark.core.prefab.machine.TileEntityMulti;
public class InvInteractionHelper
{

View file

@ -11,7 +11,7 @@ import universalelectricity.core.electricity.ElectricityPack;
import universalelectricity.core.vector.Vector3;
import dark.api.parts.INetworkEnergyPart;
import dark.assembly.common.AssemblyLine;
import dark.core.prefab.TileEntityMachine;
import dark.core.prefab.machine.TileEntityEnergyMachine;
import dark.core.prefab.tilenetwork.NetworkSharedPower;
import dark.core.prefab.tilenetwork.NetworkTileEntities;
@ -19,7 +19,7 @@ import dark.core.prefab.tilenetwork.NetworkTileEntities;
* in a network of similar tiles allowing all to share power from one or more sources
*
* @author DarkGuardsman */
public abstract class TileEntityAssembly extends TileEntityMachine implements INetworkEnergyPart
public abstract class TileEntityAssembly extends TileEntityEnergyMachine implements INetworkEnergyPart
{
/** lowest value the network can update at */
public static int refresh_min_rate = 20;
@ -61,7 +61,6 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN
super.updateEntity();
if (!this.worldObj.isRemote)
{
this.prevRunning = this.running;
if (ticks % updateTick == 0)
{
@ -74,10 +73,10 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN
}
@Override
public boolean canRun()
public boolean canFunction()
{
//TODO add check for network power
return super.canRun() || AssemblyLine.REQUIRE_NO_POWER;
return super.canFunction() || AssemblyLine.REQUIRE_NO_POWER;
}
/** Same as updateEntity */
@ -87,12 +86,6 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN
}
/** Checks to see if this assembly tile can run using several methods */
public boolean isRunning()
{
return this.running;
}
@Override
public boolean canTileConnect(Connection type, ForgeDirection dir)
{

View file

@ -15,7 +15,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import dark.core.common.DarkMain;
import dark.core.network.PacketHandler;
import dark.core.prefab.TileEntityInv;
import dark.core.prefab.machine.TileEntityInv;
public class TileEntityCrate extends TileEntityInv implements IPacketReceiver
{

View file

@ -35,7 +35,7 @@ public class TileEntityManipulator extends TileEntityFilterable implements IRota
{
if (!this.worldObj.isRemote)
{
if (!this.isDisabled() && this.isRunning())
if (this.isFunctioning())
{
if (!this.isOutput)
{

View file

@ -38,7 +38,7 @@ public class TileEntityRejector extends TileEntityFilterable
try
{
if (this.isRunning())
if (this.isFunctioning())
{
/** Find all entities in the position in which this block is facing and attempt
* to push it out of the way. */

View file

@ -245,7 +245,7 @@ public class BlockConveyorBelt extends BlockAssembly
{
return;
}
if (tileEntity.isRunning() && !world.isBlockIndirectlyGettingPowered(x, y, z))
if (tileEntity.isFunctioning() && !world.isBlockIndirectlyGettingPowered(x, y, z))
{
float acceleration = tileEntity.acceleration;
float maxSpeed = tileEntity.maxSpeed;

View file

@ -68,7 +68,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke
it.remove();
}
}
if (this.worldObj.isRemote && this.isRunning())
if (this.worldObj.isRemote && this.isFunctioning())
{
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)
{
@ -101,9 +101,9 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke
}
@Override
public boolean canRun()
public boolean canFunction()
{
return super.canRun() && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord);
return super.canFunction() && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord);
}
@Override

View file

@ -18,9 +18,9 @@ import dark.assembly.client.render.BlockRenderingHandler;
import dark.assembly.common.AssemblyLine;
import dark.assembly.common.CommonProxy;
import dark.assembly.common.TabAssemblyLine;
import dark.core.prefab.BlockMachine;
import dark.core.prefab.IExtraObjectInfo;
import dark.core.prefab.helpers.Pair;
import dark.core.prefab.machine.BlockMachine;
public class BlockProcessor extends BlockMachine implements IExtraObjectInfo
{

View file

@ -135,7 +135,7 @@ public class ContainerProcessor extends Container
return null;
}
}
else if (tileEntity.isBattery(slotStack))
else if (tileEntity.isBatteryItem(slotStack))
{
if (!this.mergeItemStack(slotStack, tileEntity.slotBatteryCharge, 2, false))
{

View file

@ -13,13 +13,13 @@ import dark.api.ProcessorRecipes.ProcessorType;
import dark.assembly.common.machine.processor.BlockProcessor.ProcessorData;
import dark.core.interfaces.IInvBox;
import dark.core.network.PacketHandler;
import dark.core.prefab.TileEntityMachine;
import dark.core.prefab.invgui.InvChest;
import dark.core.prefab.machine.TileEntityEnergyMachine;
/** Basic A -> B recipe processor machine designed mainly to handle ore blocks
*
* @author DarkGuardsman */
public class TileEntityProcessor extends TileEntityMachine
public class TileEntityProcessor extends TileEntityEnergyMachine
{
public int slotInput = 0, slotOutput = 1, slotBatteryCharge = 2, slotBatteryDrain = 3;
@ -51,7 +51,7 @@ public class TileEntityProcessor extends TileEntityMachine
{
this.getProcessorData();
super.updateEntity();
if (this.running)
if (this.isFunctioning())
{
this.doAnimation();
@ -137,9 +137,9 @@ public class TileEntityProcessor extends TileEntityMachine
}
@Override
public boolean canRun()
public boolean canFunction()
{
return super.canRun() && this.canProcess();
return super.canFunction() && this.canProcess();
}
/** Can the machine process the itemStack */
@ -211,7 +211,7 @@ public class TileEntityProcessor extends TileEntityMachine
{
return true;
}
if (slotBatteryDrain == slot && this.isBattery(stack))
if (slotBatteryDrain == slot && this.isBatteryItem(stack))
{
return true;
}
@ -262,7 +262,7 @@ public class TileEntityProcessor extends TileEntityMachine
{
if (!this.worldObj.isRemote && entity instanceof EntityPlayerMP)
{
((EntityPlayerMP) entity).playerNetServerHandler.sendPacketToPlayer(PacketHandler.instance().getPacket(this.getChannel(), this, TilePacketTypes.GUI.name, this.processingTicks, this.processingTime, this.energyStored));
((EntityPlayerMP) entity).playerNetServerHandler.sendPacketToPlayer(PacketHandler.instance().getPacket(this.getChannel(), this, SimplePacketTypes.GUI.name, this.processingTicks, this.processingTime, this.energyStored));
}
}
@ -275,7 +275,7 @@ public class TileEntityProcessor extends TileEntityMachine
{
if (this.worldObj.isRemote)
{
if (id.equalsIgnoreCase(TilePacketTypes.GUI.name))
if (id.equalsIgnoreCase(SimplePacketTypes.GUI.name))
{
this.processingTicks = dis.readInt();
this.processingTime = dis.readInt();