Class BeaconBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BeaconBlockEntity
- All Implemented Interfaces:
TypedInstance<BlockEntityType<?>>, DebugValueSource, MenuConstructor, BeaconBeamOwner, MenuProvider, Nameable, IAttachmentHolder, IBlockEntityExtension, IMenuProviderExtension
public class BeaconBlockEntity
extends BlockEntity
implements MenuProvider, Nameable, BeaconBeamOwner
-
Nested Class Summary
Nested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface BeaconBeamOwner
BeaconBeamOwner.SectionNested classes/interfaces inherited from interface DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionA list of effects that beacons can apply.private List<BeaconBeamOwner.Section> A list of beam segments for this beacon.private static final intprivate List<BeaconBeamOwner.Section> static final intstatic final intstatic final intprivate final ContainerDataprivate static final Componentprivate intprivate intThe number of levels of this beacon's pyramid.private LockCodeprivate static final intprivate @Nullable ComponentThe custom name for this beacon.static final intThe primary effect given by this beacon.The secondary effect given by this beacon.private static final Stringprivate static final StringFields inherited from class BlockEntity
level, remove, worldPositionFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidapplyEffects(Level level, BlockPos worldPosition, int levels, @Nullable Holder<MobEffect> primaryPower, @Nullable Holder<MobEffect> secondaryPower) protected voidapplyImplicitComponents(DataComponentGetter components) protected voidcollectImplicitComponents(DataComponentMap.Builder components) @Nullable AbstractContainerMenucreateMenu(int containerId, Inventory inventory, Player player) filterEffect(@Nullable Holder<MobEffect> effect) @Nullable ComponentgetName()getUpdateTag(HolderLookup.Provider registries) protected voidloadAdditional(ValueInput input) loadEffect(ValueInput input, String field) static voidplaySound(Level level, BlockPos worldPosition, SoundEvent event) voidremoveComponentsFromTag(ValueOutput output) protected voidsaveAdditional(ValueOutput output) voidsetCustomName(@Nullable Component name) Sets the custom name for this beacon.voidvoidprivate static voidstoreEffect(ValueOutput output, String field, @Nullable Holder<MobEffect> effect) static voidtick(Level level, BlockPos pos, BlockState selfState, BeaconBlockEntity entity) private static intupdateBase(Level level, int x, int y, int z) Methods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, 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, requestModelDataUpdateMethods inherited from interface IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen, writeClientSideDataMethods inherited from interface Nameable
getPlainTextName, hasCustomName
-
Field Details
-
MAX_LEVELS
private static final int MAX_LEVELS- See Also:
-
BEACON_EFFECTS
-
VALID_EFFECTS
-
DATA_LEVELS
public static final int DATA_LEVELS- See Also:
-
DATA_PRIMARY
public static final int DATA_PRIMARY- See Also:
-
DATA_SECONDARY
public static final int DATA_SECONDARY- See Also:
-
NUM_DATA_VALUES
public static final int NUM_DATA_VALUES- See Also:
-
BLOCKS_CHECK_PER_TICK
private static final int BLOCKS_CHECK_PER_TICK- See Also:
-
DEFAULT_NAME
-
TAG_PRIMARY
- See Also:
-
TAG_SECONDARY
- See Also:
-
beamSections
A list of beam segments for this beacon. -
checkingBeamSections
-
levels
private int levelsThe number of levels of this beacon's pyramid. -
lastCheckY
private int lastCheckY -
-
secondaryPower
-
name
The custom name for this beacon. -
lockKey
-
dataAccess
-
-
Constructor Details
-
BeaconBlockEntity
-
-
Method Details
-
filterEffect
-
tick
-
updateBase
-
setRemoved
public void setRemoved()- Overrides:
setRemovedin classBlockEntity
-
applyEffects
-
playSound
-
getBeamSections
- Specified by:
getBeamSectionsin interfaceBeaconBeamOwner
-
getUpdatePacket
- Overrides:
getUpdatePacketin classBlockEntity
-
getUpdateTag
- Overrides:
getUpdateTagin classBlockEntity
-
storeEffect
private static void storeEffect(ValueOutput output, String field, @Nullable Holder<MobEffect> effect) -
loadEffect
-
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
setCustomName
Sets the custom name for this beacon. -
getCustomName
- Specified by:
getCustomNamein interfaceNameable
-
createMenu
public @Nullable AbstractContainerMenu createMenu(int containerId, Inventory inventory, Player player) - Specified by:
createMenuin interfaceMenuConstructor
-
getDisplayName
- Specified by:
getDisplayNamein interfaceMenuProvider- Specified by:
getDisplayNamein interfaceNameable
-
getName
-
applyImplicitComponents
- Overrides:
applyImplicitComponentsin classBlockEntity
-
collectImplicitComponents
- Overrides:
collectImplicitComponentsin classBlockEntity
-
removeComponentsFromTag
- Overrides:
removeComponentsFromTagin classBlockEntity
-
setLevel
- Overrides:
setLevelin classBlockEntity
-