Class BeehiveBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BeehiveBlockEntity
- All Implemented Interfaces:
TypedInstance<BlockEntityType<?>>, DebugValueSource, IAttachmentHolder, IBlockEntityExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classstatic enumstatic final recordNested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final org.slf4j.Loggerstatic final intprivate static final intstatic final intprivate static final intprivate @Nullable BlockPosprivate final List<BeehiveBlockEntity.BeeData> private static final StringFields inherited from class BlockEntity
level, remove, worldPositionFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOccupant(Bee bee) protected voidapplyImplicitComponents(DataComponentGetter components) protected voidcollectImplicitComponents(DataComponentMap.Builder components) voidemptyAllLivingFromHive(@Nullable Player player, BlockState state, BeehiveBlockEntity.BeeReleaseStatus releaseReason) private List<BeehiveBlockEntity.Occupant> getBees()static intgetHoneyLevel(BlockState blockState) intprivate booleanbooleanisEmpty()booleanbooleanisFull()booleanprotected voidloadAdditional(ValueInput input) voidregisterDebugValues(ServerLevel level, DebugValueSource.Registration registration) releaseAllOccupants(BlockState state, BeehiveBlockEntity.BeeReleaseStatus releaseStatus) private static booleanreleaseOccupant(Level level, BlockPos blockPos, BlockState state, BeehiveBlockEntity.Occupant beeData, @Nullable List<Entity> spawned, BeehiveBlockEntity.BeeReleaseStatus releaseStatus, @Nullable BlockPos savedFlowerPos) voidremoveComponentsFromTag(ValueOutput output) protected voidsaveAdditional(ValueOutput output) static voidserverTick(Level level, BlockPos blockPos, BlockState state, BeehiveBlockEntity entity) voidvoidstoreBee(BeehiveBlockEntity.Occupant occupant) private static voidtickOccupants(Level level, BlockPos pos, BlockState state, List<BeehiveBlockEntity.BeeData> stored, @Nullable BlockPos savedFlowerPos) Methods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setComponents, setData, setLevel, setRemoved, syncData, triggerEvent, typeHolderMethods inherited from class AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TAG_FLOWER_POS
- See Also:
-
BEES
- See Also:
-
IGNORED_BEE_TAGS
-
MAX_OCCUPANTS
public static final int MAX_OCCUPANTS- See Also:
-
MIN_TICKS_BEFORE_REENTERING_HIVE
private static final int MIN_TICKS_BEFORE_REENTERING_HIVE- See Also:
-
MIN_OCCUPATION_TICKS_NECTAR
private static final int MIN_OCCUPATION_TICKS_NECTAR- See Also:
-
MIN_OCCUPATION_TICKS_NECTARLESS
public static final int MIN_OCCUPATION_TICKS_NECTARLESS- See Also:
-
stored
-
savedFlowerPos
-
-
Constructor Details
-
BeehiveBlockEntity
-
-
Method Details
-
setChanged
public void setChanged()- Overrides:
setChangedin classBlockEntity
-
isFireNearby
public boolean isFireNearby() -
isEmpty
public boolean isEmpty() -
isFull
public boolean isFull() -
emptyAllLivingFromHive
public void emptyAllLivingFromHive(@Nullable Player player, BlockState state, BeehiveBlockEntity.BeeReleaseStatus releaseReason) -
releaseAllOccupants
private List<Entity> releaseAllOccupants(BlockState state, BeehiveBlockEntity.BeeReleaseStatus releaseStatus) -
getOccupantCount
public int getOccupantCount() -
getHoneyLevel
-
isSedated
public boolean isSedated() -
addOccupant
-
storeBee
-
releaseOccupant
private static boolean releaseOccupant(Level level, BlockPos blockPos, BlockState state, BeehiveBlockEntity.Occupant beeData, @Nullable List<Entity> spawned, BeehiveBlockEntity.BeeReleaseStatus releaseStatus, @Nullable BlockPos savedFlowerPos) -
hasSavedFlowerPos
private boolean hasSavedFlowerPos() -
tickOccupants
private static void tickOccupants(Level level, BlockPos pos, BlockState state, List<BeehiveBlockEntity.BeeData> stored, @Nullable BlockPos savedFlowerPos) -
serverTick
public static void serverTick(Level level, BlockPos blockPos, BlockState state, BeehiveBlockEntity entity) -
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
applyImplicitComponents
- Overrides:
applyImplicitComponentsin classBlockEntity
-
collectImplicitComponents
- Overrides:
collectImplicitComponentsin classBlockEntity
-
removeComponentsFromTag
- Overrides:
removeComponentsFromTagin classBlockEntity
-
getBees
-
registerDebugValues
- Specified by:
registerDebugValuesin interfaceDebugValueSource- Overrides:
registerDebugValuesin classBlockEntity
-