Changes
This commit is contained in:
parent
06b8321792
commit
cc4134652f
13 changed files with 29 additions and 36 deletions
|
@ -104,7 +104,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isRunning())
|
if (this.isFunctioning())
|
||||||
{
|
{
|
||||||
if (!this.worldObj.isRemote)
|
if (!this.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,11 +27,11 @@ import dark.assembly.api.IArmbot;
|
||||||
import dark.assembly.api.IArmbotUseable;
|
import dark.assembly.api.IArmbotUseable;
|
||||||
import dark.core.common.DarkMain;
|
import dark.core.common.DarkMain;
|
||||||
import dark.core.network.PacketHandler;
|
import dark.core.network.PacketHandler;
|
||||||
import dark.core.prefab.TileEntityMulti;
|
|
||||||
import dark.core.prefab.helpers.AutoCraftingManager;
|
import dark.core.prefab.helpers.AutoCraftingManager;
|
||||||
import dark.core.prefab.helpers.AutoCraftingManager.IAutoCrafter;
|
import dark.core.prefab.helpers.AutoCraftingManager.IAutoCrafter;
|
||||||
import dark.core.prefab.helpers.Pair;
|
import dark.core.prefab.helpers.Pair;
|
||||||
import dark.core.prefab.invgui.ISlotPickResult;
|
import dark.core.prefab.invgui.ISlotPickResult;
|
||||||
|
import dark.core.prefab.machine.TileEntityMulti;
|
||||||
|
|
||||||
public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInventory, IArmbotUseable, IPacketReceiver, ISlotPickResult, IAutoCrafter
|
public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInventory, IArmbotUseable, IPacketReceiver, ISlotPickResult, IAutoCrafter
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.util.Icon;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import dark.assembly.common.AssemblyLine;
|
import dark.assembly.common.AssemblyLine;
|
||||||
import dark.assembly.common.TabAssemblyLine;
|
import dark.assembly.common.TabAssemblyLine;
|
||||||
import dark.core.prefab.BlockMachine;
|
import dark.core.prefab.machine.BlockMachine;
|
||||||
|
|
||||||
public abstract class BlockAssembly extends BlockMachine
|
public abstract class BlockAssembly extends BlockMachine
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.tileentity.TileEntityChest;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
import universalelectricity.core.vector.Vector3;
|
import universalelectricity.core.vector.Vector3;
|
||||||
import dark.core.prefab.TileEntityMulti;
|
import dark.core.prefab.machine.TileEntityMulti;
|
||||||
|
|
||||||
public class InvInteractionHelper
|
public class InvInteractionHelper
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ import universalelectricity.core.electricity.ElectricityPack;
|
||||||
import universalelectricity.core.vector.Vector3;
|
import universalelectricity.core.vector.Vector3;
|
||||||
import dark.api.parts.INetworkEnergyPart;
|
import dark.api.parts.INetworkEnergyPart;
|
||||||
import dark.assembly.common.AssemblyLine;
|
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.NetworkSharedPower;
|
||||||
import dark.core.prefab.tilenetwork.NetworkTileEntities;
|
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
|
* in a network of similar tiles allowing all to share power from one or more sources
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @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 */
|
/** lowest value the network can update at */
|
||||||
public static int refresh_min_rate = 20;
|
public static int refresh_min_rate = 20;
|
||||||
|
@ -61,7 +61,6 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if (!this.worldObj.isRemote)
|
if (!this.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
this.prevRunning = this.running;
|
|
||||||
|
|
||||||
if (ticks % updateTick == 0)
|
if (ticks % updateTick == 0)
|
||||||
{
|
{
|
||||||
|
@ -74,10 +73,10 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IN
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRun()
|
public boolean canFunction()
|
||||||
{
|
{
|
||||||
//TODO add check for network power
|
//TODO add check for network power
|
||||||
return super.canRun() || AssemblyLine.REQUIRE_NO_POWER;
|
return super.canFunction() || AssemblyLine.REQUIRE_NO_POWER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Same as updateEntity */
|
/** 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
|
@Override
|
||||||
public boolean canTileConnect(Connection type, ForgeDirection dir)
|
public boolean canTileConnect(Connection type, ForgeDirection dir)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import dark.core.common.DarkMain;
|
import dark.core.common.DarkMain;
|
||||||
import dark.core.network.PacketHandler;
|
import dark.core.network.PacketHandler;
|
||||||
import dark.core.prefab.TileEntityInv;
|
import dark.core.prefab.machine.TileEntityInv;
|
||||||
|
|
||||||
public class TileEntityCrate extends TileEntityInv implements IPacketReceiver
|
public class TileEntityCrate extends TileEntityInv implements IPacketReceiver
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class TileEntityManipulator extends TileEntityFilterable implements IRota
|
||||||
{
|
{
|
||||||
if (!this.worldObj.isRemote)
|
if (!this.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
if (!this.isDisabled() && this.isRunning())
|
if (this.isFunctioning())
|
||||||
{
|
{
|
||||||
if (!this.isOutput)
|
if (!this.isOutput)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class TileEntityRejector extends TileEntityFilterable
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (this.isRunning())
|
if (this.isFunctioning())
|
||||||
{
|
{
|
||||||
/** Find all entities in the position in which this block is facing and attempt
|
/** Find all entities in the position in which this block is facing and attempt
|
||||||
* to push it out of the way. */
|
* to push it out of the way. */
|
||||||
|
|
|
@ -245,7 +245,7 @@ public class BlockConveyorBelt extends BlockAssembly
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tileEntity.isRunning() && !world.isBlockIndirectlyGettingPowered(x, y, z))
|
if (tileEntity.isFunctioning() && !world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||||
{
|
{
|
||||||
float acceleration = tileEntity.acceleration;
|
float acceleration = tileEntity.acceleration;
|
||||||
float maxSpeed = tileEntity.maxSpeed;
|
float maxSpeed = tileEntity.maxSpeed;
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke
|
||||||
it.remove();
|
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)
|
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
|
@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
|
@Override
|
||||||
|
|
|
@ -18,9 +18,9 @@ import dark.assembly.client.render.BlockRenderingHandler;
|
||||||
import dark.assembly.common.AssemblyLine;
|
import dark.assembly.common.AssemblyLine;
|
||||||
import dark.assembly.common.CommonProxy;
|
import dark.assembly.common.CommonProxy;
|
||||||
import dark.assembly.common.TabAssemblyLine;
|
import dark.assembly.common.TabAssemblyLine;
|
||||||
import dark.core.prefab.BlockMachine;
|
|
||||||
import dark.core.prefab.IExtraObjectInfo;
|
import dark.core.prefab.IExtraObjectInfo;
|
||||||
import dark.core.prefab.helpers.Pair;
|
import dark.core.prefab.helpers.Pair;
|
||||||
|
import dark.core.prefab.machine.BlockMachine;
|
||||||
|
|
||||||
public class BlockProcessor extends BlockMachine implements IExtraObjectInfo
|
public class BlockProcessor extends BlockMachine implements IExtraObjectInfo
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class ContainerProcessor extends Container
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tileEntity.isBattery(slotStack))
|
else if (tileEntity.isBatteryItem(slotStack))
|
||||||
{
|
{
|
||||||
if (!this.mergeItemStack(slotStack, tileEntity.slotBatteryCharge, 2, false))
|
if (!this.mergeItemStack(slotStack, tileEntity.slotBatteryCharge, 2, false))
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,13 +13,13 @@ import dark.api.ProcessorRecipes.ProcessorType;
|
||||||
import dark.assembly.common.machine.processor.BlockProcessor.ProcessorData;
|
import dark.assembly.common.machine.processor.BlockProcessor.ProcessorData;
|
||||||
import dark.core.interfaces.IInvBox;
|
import dark.core.interfaces.IInvBox;
|
||||||
import dark.core.network.PacketHandler;
|
import dark.core.network.PacketHandler;
|
||||||
import dark.core.prefab.TileEntityMachine;
|
|
||||||
import dark.core.prefab.invgui.InvChest;
|
import dark.core.prefab.invgui.InvChest;
|
||||||
|
import dark.core.prefab.machine.TileEntityEnergyMachine;
|
||||||
|
|
||||||
/** Basic A -> B recipe processor machine designed mainly to handle ore blocks
|
/** Basic A -> B recipe processor machine designed mainly to handle ore blocks
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class TileEntityProcessor extends TileEntityMachine
|
public class TileEntityProcessor extends TileEntityEnergyMachine
|
||||||
{
|
{
|
||||||
public int slotInput = 0, slotOutput = 1, slotBatteryCharge = 2, slotBatteryDrain = 3;
|
public int slotInput = 0, slotOutput = 1, slotBatteryCharge = 2, slotBatteryDrain = 3;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ public class TileEntityProcessor extends TileEntityMachine
|
||||||
{
|
{
|
||||||
this.getProcessorData();
|
this.getProcessorData();
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if (this.running)
|
if (this.isFunctioning())
|
||||||
{
|
{
|
||||||
this.doAnimation();
|
this.doAnimation();
|
||||||
|
|
||||||
|
@ -137,9 +137,9 @@ public class TileEntityProcessor extends TileEntityMachine
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRun()
|
public boolean canFunction()
|
||||||
{
|
{
|
||||||
return super.canRun() && this.canProcess();
|
return super.canFunction() && this.canProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Can the machine process the itemStack */
|
/** Can the machine process the itemStack */
|
||||||
|
@ -211,7 +211,7 @@ public class TileEntityProcessor extends TileEntityMachine
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (slotBatteryDrain == slot && this.isBattery(stack))
|
if (slotBatteryDrain == slot && this.isBatteryItem(stack))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ public class TileEntityProcessor extends TileEntityMachine
|
||||||
{
|
{
|
||||||
if (!this.worldObj.isRemote && entity instanceof EntityPlayerMP)
|
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 (this.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
if (id.equalsIgnoreCase(TilePacketTypes.GUI.name))
|
if (id.equalsIgnoreCase(SimplePacketTypes.GUI.name))
|
||||||
{
|
{
|
||||||
this.processingTicks = dis.readInt();
|
this.processingTicks = dis.readInt();
|
||||||
this.processingTime = dis.readInt();
|
this.processingTime = dis.readInt();
|
||||||
|
|
Loading…
Reference in a new issue