T - The subclass of TankInventoryTileEntity, will be in
most cases just the extension class.O - The type of upgrade behaviour object.public abstract class WorkingTileEntity<T extends org.cyclops.cyclopscore.tileentity.TankInventoryTileEntity,O> extends TickingTankInventoryTileEntity<T> implements IUpgradable<T,O>
TickingTankInventoryTileEntity| Modifier and Type | Field and Description |
|---|---|
static int |
INVENTORY_SIZE_UPGRADES
Size of the upgrades inventory.
|
static Upgrades.Upgrade |
UPGRADE_EFFICIENCY |
static Upgrades.Upgrade |
UPGRADE_SPEED |
static Upgrades.Upgrade |
UPGRADE_TIER1 |
static Upgrades.Upgrade |
UPGRADE_TIER2 |
static Upgrades.Upgrade |
UPGRADE_TIER3 |
protected java.util.Map<Upgrades.Upgrade,IUpgradeBehaviour<T,O>> |
upgradeBehaviour |
tickingTileComponentsendUpdateOnTankChanged, tankSizeinventory, slotSides| Constructor and Description |
|---|
WorkingTileEntity(int inventorySize,
java.lang.String inventoryName,
int tankSize,
java.lang.String tankName,
net.minecraftforge.fluids.Fluid acceptedFluid)
Make a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
canConsume(net.minecraft.item.ItemStack itemStack)
Check if the given item can be infused.
|
abstract boolean |
canWork()
Check if this tile is valid and can start working.
|
net.minecraft.item.ItemStack |
decrStackSize(int slotId,
int count) |
int |
getBasicInventorySize() |
int |
getNewState()
Get the new (numerical) state for this tile entity.
|
protected float |
getRequiredWorkTicks() |
java.util.Map<Upgrades.Upgrade,IUpgradeBehaviour<T,O>> |
getUpgradeBehaviour() |
protected java.util.List<net.minecraft.item.ItemStack> |
getUpgradeItems() |
abstract int |
getUpgradeLevel(net.minecraft.item.ItemStack itemStack)
Get the level of upgrade corresponding to the given itemstack.
|
java.util.Map<Upgrades.Upgrade,java.lang.Integer> |
getUpgradeLevels() |
java.util.Set<Upgrades.Upgrade> |
getUpgrades() |
abstract Upgrades.Upgrade |
getUpgradeType(net.minecraft.item.ItemStack itemStack)
Get the type of upgrade corresponding to the given itemstack.
|
protected int |
getWorkTick() |
protected abstract int |
getWorkTicker() |
int |
getWorkTickScaled(int scale)
Get the work progress scaled, to be used in GUI's.
|
protected boolean |
isUpgradeSlot(int slotId) |
boolean |
isVisuallyWorking()
If the furnace should visually (blockState icon) show it is working, should only be
called client-side.
|
boolean |
isWorking()
If this tile is working.
|
void |
onStateChanged()
What needs to happen when the (numerical) state is changed.
|
boolean |
onUpgradeSlotChanged(int slotId,
net.minecraft.item.ItemStack oldItemStack,
net.minecraft.item.ItemStack itemStack) |
protected void |
resetUpgradeLevels() |
void |
resetWork()
Resets the ticks of the work.
|
void |
resetWork(boolean hardReset)
Resets the ticks of the work.
|
void |
setInventorySlotContents(int slotId,
net.minecraft.item.ItemStack itemStack) |
addTicker, getCurrentState, getTickers, readFromNBT, updateTileEntity, writeToNBTcanDrain, canFill, drain, drain, drain, drain, fill, fill, getTank, getTankInfo, isSendUpdateOnTankChanged, newTank, onSendUpdate, setSendUpdateOnTankChangedaddSlotsToSide, getInventory, getSlotsForFacecanAccess, canExtractItem, canInsertItem, clear, closeInventory, getDisplayName, getField, getFieldCount, getInventoryStackLimit, getName, getSizeInventory, getStackInSlot, hasCustomName, isItemValidForSlot, isSendUpdateOnInventoryChanged, isUseableByPlayer, onInventoryChanged, openInventory, removeStackFromSlot, setField, setSendUpdateOnInventoryChangedaddCapabilityInternal, addCapabilitySided, afterSendUpdate, beforeSendUpdate, canInteractWith, destroy, getBlock, getCapabilities, getCapability, getDescriptionPacket, getNBTTagCompound, getRotation, getUpdateBackoffTicks, hasCapability, isRotatable, isTicking, onDataPacket, onLoad, onUpdateReceived, readGeneratedFieldsFromNBT, sendImmediateUpdate, sendUpdate, setRotatable, setRotation, shouldRefresh, writeGeneratedFieldsToNBTaddInfoToCrashReport, addMapping, canRenderBreaking, createTileEntity, deserializeNBT, func_183000_F, getBlockMetadata, getBlockType, getDistanceSq, getMaxRenderDistanceSquared, getPos, getRenderBoundingBox, getTileData, getWorld, hasFastRenderer, hasWorldObj, invalidate, isInvalid, markDirty, onChunkUnload, receiveClientEvent, restrictNBTCopy, serializeNBT, setPos, setWorldObj, shouldRenderInPass, updateContainingBlockInfo, validatepublic static final int INVENTORY_SIZE_UPGRADES
public static final Upgrades.Upgrade UPGRADE_TIER1
public static final Upgrades.Upgrade UPGRADE_TIER2
public static final Upgrades.Upgrade UPGRADE_TIER3
public static final Upgrades.Upgrade UPGRADE_SPEED
public static final Upgrades.Upgrade UPGRADE_EFFICIENCY
protected java.util.Map<Upgrades.Upgrade,IUpgradeBehaviour<T extends org.cyclops.cyclopscore.tileentity.TankInventoryTileEntity,O>> upgradeBehaviour
public WorkingTileEntity(int inventorySize,
java.lang.String inventoryName,
int tankSize,
java.lang.String tankName,
net.minecraftforge.fluids.Fluid acceptedFluid)
inventorySize - Amount of slots in the inventory.inventoryName - Internal name of the inventory.tankSize - Size (mB) of the tank.tankName - Internal name of the tank.acceptedFluid - Type of Fluid to accept.public abstract boolean canConsume(net.minecraft.item.ItemStack itemStack)
itemStack - The item to check.public abstract boolean canWork()
public boolean isWorking()
public boolean isVisuallyWorking()
public int getWorkTickScaled(int scale)
scale - The scale this progress should be applied to.protected abstract int getWorkTicker()
protected int getWorkTick()
protected float getRequiredWorkTicks()
public void resetWork()
public void resetWork(boolean hardReset)
hardReset - If the tick and required tick should also be set to zero.public int getNewState()
TickingTankInventoryTileEntitygetNewState in class TickingTankInventoryTileEntity<T extends org.cyclops.cyclopscore.tileentity.TankInventoryTileEntity>public void onStateChanged()
TickingTankInventoryTileEntityonStateChanged in class TickingTankInventoryTileEntity<T extends org.cyclops.cyclopscore.tileentity.TankInventoryTileEntity>protected java.util.List<net.minecraft.item.ItemStack> getUpgradeItems()
public abstract Upgrades.Upgrade getUpgradeType(net.minecraft.item.ItemStack itemStack)
itemStack - The itemstack. Not null.public abstract int getUpgradeLevel(net.minecraft.item.ItemStack itemStack)
itemStack - The itemstack. Not null.protected void resetUpgradeLevels()
protected boolean isUpgradeSlot(int slotId)
public boolean onUpgradeSlotChanged(int slotId,
net.minecraft.item.ItemStack oldItemStack,
net.minecraft.item.ItemStack itemStack)
public net.minecraft.item.ItemStack decrStackSize(int slotId,
int count)
decrStackSize in interface net.minecraft.inventory.IInventorydecrStackSize in class org.cyclops.cyclopscore.tileentity.InventoryTileEntityBasepublic void setInventorySlotContents(int slotId,
net.minecraft.item.ItemStack itemStack)
setInventorySlotContents in interface net.minecraft.inventory.IInventorysetInventorySlotContents in class org.cyclops.cyclopscore.tileentity.InventoryTileEntityBasepublic java.util.Map<Upgrades.Upgrade,java.lang.Integer> getUpgradeLevels()
public java.util.Map<Upgrades.Upgrade,IUpgradeBehaviour<T,O>> getUpgradeBehaviour()
getUpgradeBehaviour in interface IUpgradable<T extends org.cyclops.cyclopscore.tileentity.TankInventoryTileEntity,O>public java.util.Set<Upgrades.Upgrade> getUpgrades()
public int getBasicInventorySize()