Package com.hbm_m.blockentity.machines
Class MachineFoundryChannelBlockEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
com.hbm_m.blockentity.machines.MachineFoundryChannelBlockEntity
- All Implemented Interfaces:
ICrucibleAcceptor,net.minecraftforge.common.capabilities.ICapabilityProvider,net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>,net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>,net.minecraftforge.common.extensions.IForgeBlockEntity,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
public class MachineFoundryChannelBlockEntity
extends net.minecraft.world.level.block.entity.BlockEntity
implements ICrucibleAcceptor
Port of the 1.7.10 TileEntityFoundryChannel.
Every 5 ticks: first tries to flow the whole content into an adjacent
non-channel ICrucibleAcceptor (e.g. a foundry outlet); if none accepts,
the content is equalized/swapped with ALL neighbouring channels.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
Field Summary
FieldsModifier and TypeFieldDescriptionintstatic final intintFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
INFINITE_EXTENT_AABB -
Constructor Summary
ConstructorsConstructorDescriptionMachineFoundryChannelBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAcceptPartialFlow(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, MaterialStack stack) Whether material may flow in sideways from the given side.booleancanAcceptPartialPour(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, MaterialStack stack) Whether material may be poured in from above (side is usually UP).flow(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, MaterialStack stack) Sideways flow.intnet.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener>net.minecraft.nbt.CompoundTagvoidload(net.minecraft.nbt.CompoundTag tag) pour(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, MaterialStack stack) Pour from above.protected voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) static voidtick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, MachineFoundryChannelBlockEntity be) Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEventMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity
deserializeNBT, getModelData, getRenderBoundingBox, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
-
Field Details
-
CAPACITY
public static final int CAPACITY- See Also:
-
type
-
amount
public int amount -
lastFlow
public int lastFlow
-
-
Constructor Details
-
MachineFoundryChannelBlockEntity
public MachineFoundryChannelBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
tick
public static void tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, MachineFoundryChannelBlockEntity be) -
getCapacity
public int getCapacity() -
canAcceptPartialFlow
public boolean canAcceptPartialFlow(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, MaterialStack stack) Description copied from interface:ICrucibleAcceptorWhether material may flow in sideways from the given side.- Specified by:
canAcceptPartialFlowin interfaceICrucibleAcceptor
-
flow
@Nullable public MaterialStack flow(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, MaterialStack stack) Description copied from interface:ICrucibleAcceptorSideways flow. Returns the leftover, or null if fully accepted.- Specified by:
flowin interfaceICrucibleAcceptor
-
canAcceptPartialPour
public boolean canAcceptPartialPour(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, MaterialStack stack) Description copied from interface:ICrucibleAcceptorWhether material may be poured in from above (side is usually UP).- Specified by:
canAcceptPartialPourin interfaceICrucibleAcceptor
-
pour
@Nullable public MaterialStack pour(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, MaterialStack stack) Description copied from interface:ICrucibleAcceptorPour from above. Returns the leftover, or null if fully accepted.- Specified by:
pourin interfaceICrucibleAcceptor
-
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag()- Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdatePacket
public net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getUpdatePacket()- Overrides:
getUpdatePacketin classnet.minecraft.world.level.block.entity.BlockEntity
-