public class TileTank extends TileBC_Neptune implements net.minecraft.util.ITickable, IDebuggable, IFluidHandlerAdv
Modifier and Type | Field and Description |
---|---|
static IdAllocator |
IDS |
static int |
NET_FLUID_DELTA |
FluidSmoother |
smoothedTank |
Tank |
tank |
caps, DEBUG, deltaManager, itemManager, NET_ADV_DEBUG, NET_ADV_DEBUG_DISABLE, NET_GUI_DATA, NET_GUI_DELTA_CLEAR, NET_GUI_DELTA_SINGLE, NET_GUI_TICK, NET_REDRAW, NET_REN_DELTA_CLEAR, NET_REN_DELTA_SINGLE, NET_RENDER_DATA, tankManager
Modifier | Constructor and Description |
---|---|
|
TileTank() |
protected |
TileTank(int capacity) |
protected |
TileTank(Tank tank) |
Modifier and Type | Method and Description |
---|---|
void |
balanceTankFluids()
Moves fluids around to their preferred positions.
|
boolean |
canConnectTo(TileTank other,
net.minecraft.util.EnumFacing direction)
Tests to see if this tank can connect to the other one, in the given direction.
|
static boolean |
canTanksConnect(TileTank from,
TileTank to,
net.minecraft.util.EnumFacing direction)
Helper for
canConnectTo(TileTank, EnumFacing) that only returns true if both tanks can connect to each
other. |
net.minecraftforge.fluids.FluidStack |
drain(net.minecraftforge.fluids.FluidStack resource,
boolean doDrain) |
net.minecraftforge.fluids.FluidStack |
drain(IFluidFilter filter,
int maxDrain,
boolean doDrain)
Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
|
net.minecraftforge.fluids.FluidStack |
drain(int maxDrain,
boolean doDrain) |
int |
fill(net.minecraftforge.fluids.FluidStack resource,
boolean doFill) |
int |
getComparatorLevel() |
void |
getDebugInfo(java.util.List<java.lang.String> left,
java.util.List<java.lang.String> right,
net.minecraft.util.EnumFacing side)
Get the debug information from a tile entity as a list of strings, used for the F3 debug menu.
|
FluidSmoother.FluidStackInterp |
getFluidForRender(float partialTicks) |
IdAllocator |
getIdAllocator() |
net.minecraftforge.fluids.capability.IFluidTankProperties[] |
getTankProperties() |
boolean |
onActivated(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.EnumHand hand,
net.minecraft.util.EnumFacing facing,
float hitX,
float hitY,
float hitZ) |
void |
onPlacedBy(net.minecraft.entity.EntityLivingBase placer,
net.minecraft.item.ItemStack stack) |
void |
readPayload(int id,
PacketBufferBC buffer,
net.minecraftforge.fml.relauncher.Side side,
net.minecraftforge.fml.common.network.simpleimpl.MessageContext ctx) |
void |
update() |
void |
writePayload(int id,
PacketBufferBC buffer,
net.minecraftforge.fml.relauncher.Side side) |
addDrops, canEditOther, canInteractWith, cannotUpdate, canPlayerEdit, createAndSendGuiMessage, createAndSendGuiMessage, createAndSendMessage, createAndSendMessage, createMessage, createNetworkUpdate, disableDebugging, doesExistInWorld, enableDebugging, getCapability, getCurrentState, getCurrentStateForBlock, getDebugRenderer, getLocalState, getLocalTile, getNeighbourState, getNeighbourTile, getOffsetState, getOffsetTile, getOwner, getPermBlock, getUpdatePacket, getUpdateTag, handleUpdateTag, hasCapability, isBeingDebugged, markChunkDirty, migrateOldNBT, onDataPacket, onExplode, onNeighbourBlockChanged, onPlayerClose, onPlayerOpen, onRemove, onSlotChange, readFromNBT, receivePayload, redrawBlock, sendDebugState, sendNetworkGuiTick, sendNetworkGuiUpdate, sendNetworkUpdate, sendNetworkUpdate, setWorldCreate, shouldRefresh, writeToNBT
addInfoToCrashReport, canRenderBreaking, create, deserializeNBT, getBlockMetadata, getBlockType, getDisplayName, getDistanceSq, getKey, getMaxRenderDistanceSquared, getPos, getRenderBoundingBox, getTileData, getWorld, hasFastRenderer, hasWorld, invalidate, isInvalid, markDirty, mirror, onChunkUnload, onLoad, onlyOpsCanSetNbt, receiveClientEvent, register, restrictNBTCopy, rotate, serializeNBT, setPos, setWorld, shouldRenderInPass, updateContainingBlockInfo, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getClientDebugInfo
public static final IdAllocator IDS
public static final int NET_FLUID_DELTA
public final Tank tank
public final FluidSmoother smoothedTank
public TileTank()
protected TileTank(int capacity)
protected TileTank(Tank tank)
public IdAllocator getIdAllocator()
getIdAllocator
in class TileBC_Neptune
IdAllocator
that allocates all ID's for this class, and its parent classes. All subclasses
should override this if they allocate their own ids after calling
IdAllocator.makeChild(String)
public int getComparatorLevel()
public void update()
update
in interface net.minecraft.util.ITickable
public void onPlacedBy(net.minecraft.entity.EntityLivingBase placer, net.minecraft.item.ItemStack stack)
onPlacedBy
in class TileBC_Neptune
public void balanceTankFluids()
public boolean onActivated(net.minecraft.entity.player.EntityPlayer player, net.minecraft.util.EnumHand hand, net.minecraft.util.EnumFacing facing, float hitX, float hitY, float hitZ)
onActivated
in class TileBC_Neptune
public void writePayload(int id, PacketBufferBC buffer, net.minecraftforge.fml.relauncher.Side side)
writePayload
in class TileBC_Neptune
public void readPayload(int id, PacketBufferBC buffer, net.minecraftforge.fml.relauncher.Side side, net.minecraftforge.fml.common.network.simpleimpl.MessageContext ctx) throws java.io.IOException
readPayload
in class TileBC_Neptune
ctx
- The context. Will be null if this is a generic update payloadjava.io.IOException
- if something went wrongpublic void getDebugInfo(java.util.List<java.lang.String> left, java.util.List<java.lang.String> right, net.minecraft.util.EnumFacing side)
IDebuggable
getDebugInfo
in interface IDebuggable
side
- The side the block was clicked on, may be null if we don't know, or is the "centre" sidepublic FluidSmoother.FluidStackInterp getFluidForRender(float partialTicks)
public boolean canConnectTo(TileTank other, net.minecraft.util.EnumFacing direction)
EnumFacing.UP
or EnumFacing.DOWN
, however addons are free to call with any of the other 4
non-null faces. (Although an addon calling from other faces must provide some way of transferring fluids around).other
- The other tank.direction
- The direction that the other tank is, from this tank.public static boolean canTanksConnect(TileTank from, TileTank to, net.minecraft.util.EnumFacing direction)
canConnectTo(TileTank, EnumFacing)
that only returns true if both tanks can connect to each
other.from
- to
- direction
- The direction from the "from" tank, to the "to" tank, such that
Objects.equals(
from.getPos()
.offset(direction)
, to.getPos()
) returns true.public net.minecraftforge.fluids.capability.IFluidTankProperties[] getTankProperties()
getTankProperties
in interface net.minecraftforge.fluids.capability.IFluidHandler
public int fill(net.minecraftforge.fluids.FluidStack resource, boolean doFill)
fill
in interface net.minecraftforge.fluids.capability.IFluidHandler
public net.minecraftforge.fluids.FluidStack drain(int maxDrain, boolean doDrain)
drain
in interface net.minecraftforge.fluids.capability.IFluidHandler
public net.minecraftforge.fluids.FluidStack drain(net.minecraftforge.fluids.FluidStack resource, boolean doDrain)
drain
in interface net.minecraftforge.fluids.capability.IFluidHandler
public net.minecraftforge.fluids.FluidStack drain(IFluidFilter filter, int maxDrain, boolean doDrain)
IFluidHandlerAdv
drain
in interface IFluidHandlerAdv
filter
- A filter to filter the possible fluids that can be extracted.maxDrain
- The maximum amount of fluid to draindoDrain
- If false, drain will only be simulated.