Class HTBlockEntity
-
- All Implemented Interfaces:
-
hiiragi283.core.api.block.entity.HTAbstractBlockEntity,hiiragi283.core.api.block.entity.HTOwnedBlockEntity,hiiragi283.core.api.block.entity.HTSoundPlayerBlockEntity,hiiragi283.core.api.storage.HTHandlerProvider,hiiragi283.core.api.storage.energy.HTEnergyHandler,hiiragi283.core.api.storage.energy.HTSidedEnergyStorage,hiiragi283.core.api.storage.fluid.HTFluidHandler,hiiragi283.core.api.storage.fluid.HTSidedFluidHandler,hiiragi283.core.api.storage.item.HTItemHandler,hiiragi283.core.api.storage.item.HTSidedItemHandler,net.minecraft.world.Nameable,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.common.extensions.IBlockEntityExtension,net.neoforged.neoforge.energy.IEnergyStorage,net.neoforged.neoforge.fluids.capability.IFluidHandler,net.neoforged.neoforge.items.IItemHandler
public abstract class HTBlockEntity extends HTExtendedBlockEntity implements Nameable, HTEnergyHandler, HTFluidHandler, HTHandlerProvider, HTItemHandler, HTOwnedBlockEntity, HTSoundPlayerBlockEntity
キャパビリティやオーナーを保持するHTExtendedBlockEntityの拡張クラス
-
-
Field Summary
Fields Modifier and Type Field Description private final Integerticksprivate final List<HTBlockEntityComponent>componentsprivate UUIDownerIdprivate final Integerslotsprivate final BlockEntityType<?>typeprivate final ModelDatamodelDataprivate final BlockPosblockPosprivate final CompoundTagpersistentDataprivate final Integertanksprivate final IntegermaxEnergyStoredprivate final IntegerenergyStoredprivate BlockStateblockStateprivate final BooleanisRemovedprivate final ClientboundBlockEntityDataPacketupdatePacketprivate final Levellevelprivate final Componentnameprivate final ComponentcustomNameprivate final ComponentdisplayName
-
Constructor Summary
Constructors Constructor Description HTBlockEntity(HTDeferredBlockEntityType<?> type, BlockPos pos, BlockState state)
-
Method Summary
-
Methods inherited from class hiiragi283.core.api.storage.item.HTSidedItemHandler
extractItem, getItemSideFor, getSlotLimit, getSlots, getSlots, getStackInSlot, insertItem, isItemValid -
Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadWithComponents, onlyOpCanSetNbt, removeComponentsFromTag, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setComponents, triggerEvent -
Methods inherited from class net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onLoad, requestModelDataUpdate -
Methods inherited from class hiiragi283.core.common.block.entity.HTBlockEntity
getBlockPos, getCustomName, getLevel, getName -
Methods inherited from class hiiragi283.core.api.storage.fluid.HTSidedFluidHandler
drain, drain, fill, getFluidInTank, getFluidSideFor, getTankCapacity, getTanks, getTanks, isFluidValid -
Methods inherited from class hiiragi283.core.api.storage.energy.HTSidedEnergyStorage
canExtract, canReceive, extractEnergy, getEnergySideFor, getEnergyStored, getEnergyStored, getMaxEnergyStored, getMaxEnergyStored, receiveEnergy -
Methods inherited from class hiiragi283.core.common.block.entity.HTExtendedBlockEntity
getComparatorOutput, getDeferredType, getReducedUpdateTag, getUpdatePacket, getUpdatePacket, getUpdateTag, handleUpdateTag, neighborChanged, onDataPacket, onRemove, onUpdateLevel, onUpdatedState, sendUpdatePacket, setBlockState, setBlockState, setChanged, setLevel, setRemoved -
Methods inherited from class net.minecraft.world.Nameable
getDisplayName, hasCustomName -
Methods inherited from class net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getData, getExistingData, getExistingData, getExistingDataOrNull, getExistingDataOrNull, hasAttachments, hasData, hasData, removeData, removeData, setData, setData, syncData, syncData -
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
serializeAttachments -
Methods inherited from class hiiragi283.core.api.block.entity.HTAbstractBlockEntity
getRegistryAccess, getServerLevel -
Methods inherited from class hiiragi283.core.api.storage.energy.HTEnergyHandler
extractEnergy, getEnergyStored, getMaxEnergyStored, receiveEnergy -
Methods inherited from class hiiragi283.core.api.storage.fluid.HTFluidHandler
drain, drain, fill, getFluidInTank, getFluidTank, getTankCapacity, getTanks, isFluidValid -
Methods inherited from class hiiragi283.core.api.storage.item.HTItemHandler
extractItem, getItemSlot, getSlotLimit, getSlots, getStackInSlot, insertItem, isItemValid -
Methods inherited from class hiiragi283.core.api.block.entity.HTOwnedBlockEntity
getFakePlayer, getOwnerName, getOwnerOrFake, getOwnerPlayer, getOwnerPlayer -
Methods inherited from class hiiragi283.core.api.block.entity.HTSoundPlayerBlockEntity
getSoundPos, getSoundSource, playSound -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
HTBlockEntity
HTBlockEntity(HTDeferredBlockEntityType<?> type, BlockPos pos, BlockState state)
-
-
Method Detail
-
getComponents
final List<HTBlockEntityComponent> getComponents()
-
getOwnerId
final UUID getOwnerId()
-
setOwnerId
final Unit setOwnerId(UUID value)
-
onBlockRemoved
Unit onBlockRemoved(BlockState state, Level level, BlockPos pos)
-
addComponent
final Unit addComponent(HTBlockEntityComponent component)
-
initReducedUpdateTag
Unit initReducedUpdateTag(HTValueOutput output)
-
handleUpdateTag
Unit handleUpdateTag(HTValueInput input)
-
getName
final Component getName()
-
getCustomName
final Component getCustomName()
-
hasFluidHandler
Boolean hasFluidHandler()
-
getFluidTanks
final List<HTResourceSlot<HTFluidResourceType>> getFluidTanks(Direction side)
指定した面からHTFluidTankの一覧を取得します。
-
getFluidHandler
final IFluidHandler getFluidHandler(Direction direction)
指定した面からIFluidHandlerを取得します。
- Returns:
取得できなかった場合は
null
-
applyFluidTanks
final Unit applyFluidTanks(List<HTResourceSlot<HTFluidResourceType>> containers, HTAttachedFluids contents)
-
collectFluidTanks
final HTAttachedFluids collectFluidTanks(List<HTResourceSlot<HTFluidResourceType>> containers)
-
hasEnergyStorage
final Boolean hasEnergyStorage()
-
getEnergyBattery
final HTEnergyBattery getEnergyBattery(Direction side)
指定した面からHTEnergyBatteryを取得します。
- Returns:
取得できない場合は
null
-
getEnergyStorage
final IEnergyStorage getEnergyStorage(Direction direction)
指定した面からIEnergyStorageを取得します。
- Returns:
取得できなかった場合は
null
-
applyEnergyBattery
final Unit applyEnergyBattery(List<HTEnergyBattery> containers, HTAttachedEnergy contents)
-
collectEnergyBattery
final HTAttachedEnergy collectEnergyBattery(List<HTEnergyBattery> containers)
-
hasItemHandler
final Boolean hasItemHandler()
-
getItemSlots
final List<HTResourceSlot<HTItemResourceType>> getItemSlots(Direction side)
指定した面からHTItemSlotの一覧を取得します。
-
getItemHandler
final IItemHandler getItemHandler(Direction direction)
指定した面からIItemHandlerを取得します。
- Returns:
取得できなかった場合は
null
-
applyItemSlots
final Unit applyItemSlots(List<HTResourceSlot<HTItemResourceType>> containers, HTAttachedItems contents)
-
collectItemSlots
final HTAttachedItems collectItemSlots(List<HTResourceSlot<HTItemResourceType>> containers)
-
tickClient
final static Unit tickClient(Level level, BlockPos pos, BlockState state, HTBlockEntity blockEntity)
-
tickServer
final static Unit tickServer(Level level, BlockPos pos, BlockState state, HTBlockEntity blockEntity)
-
-
-
-