Class BellBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BellBlockEntity
- All Implemented Interfaces:
TypedInstance<BlockEntityType<?>>, DebugValueSource, IAttachmentHolder, IBlockEntityExtension
-
Nested Class Summary
Nested ClassesNested 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 intprivate static final intprivate static final intprivate static final intprivate longprivate static final intprivate static final intprivate List<LivingEntity> private booleanprivate intA tick counter before raiders are revealed.private static final intbooleanintHow many ticks the bell has been ringing.private static final intFields inherited from class BlockEntity
level, remove, worldPositionFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanareRaidersNearby(BlockPos bellPos, List<LivingEntity> nearbyEntities) static voidclientTick(Level level, BlockPos pos, BlockState state, BellBlockEntity entity) private static voidglow(LivingEntity raider) private static booleanisRaiderWithinRange(BlockPos blockPos, LivingEntity entity) private static voidmakeRaidersGlow(Level level, BlockPos blockPos, List<LivingEntity> nearbyEntities) voidstatic voidserverTick(Level level, BlockPos pos, BlockState state, BellBlockEntity entity) private static voidshowBellParticles(Level level, BlockPos bellPos, List<LivingEntity> nearbyEntities) private static voidtick(Level level, BlockPos pos, BlockState state, BellBlockEntity entity, BellBlockEntity.ResonationEndAction onResonationEnd) booleantriggerEvent(int b0, int b1) private voidMethods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadAdditional, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeComponentsFromTag, removeData, saveAdditional, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, syncData, 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
-
DURATION
private static final int DURATION- See Also:
-
GLOW_DURATION
private static final int GLOW_DURATION- See Also:
-
MIN_TICKS_BETWEEN_SEARCHES
private static final int MIN_TICKS_BETWEEN_SEARCHES- See Also:
-
MAX_RESONATION_TICKS
private static final int MAX_RESONATION_TICKS- See Also:
-
TICKS_BEFORE_RESONATION
private static final int TICKS_BEFORE_RESONATION- See Also:
-
SEARCH_RADIUS
private static final int SEARCH_RADIUS- See Also:
-
HEAR_BELL_RADIUS
private static final int HEAR_BELL_RADIUS- See Also:
-
HIGHLIGHT_RAIDERS_RADIUS
private static final int HIGHLIGHT_RAIDERS_RADIUS- See Also:
-
lastRingTimestamp
private long lastRingTimestamp -
ticks
public int ticksHow many ticks the bell has been ringing. -
shaking
public boolean shaking -
clickDirection
-
nearbyEntities
-
resonating
private boolean resonating -
resonationTicks
private int resonationTicksA tick counter before raiders are revealed. AtTICKS_BEFORE_RESONATIONticks, the resonation sound is played, and atMAX_RESONATION_TICKS, nearby raiders are revealed.
-
-
Constructor Details
-
BellBlockEntity
-
-
Method Details
-
triggerEvent
public boolean triggerEvent(int b0, int b1) - Overrides:
triggerEventin classBlockEntity
-
tick
private static void tick(Level level, BlockPos pos, BlockState state, BellBlockEntity entity, BellBlockEntity.ResonationEndAction onResonationEnd) -
clientTick
-
serverTick
-
onHit
-
updateEntities
private void updateEntities() -
areRaidersNearby
-
makeRaidersGlow
private static void makeRaidersGlow(Level level, BlockPos blockPos, List<LivingEntity> nearbyEntities) -
showBellParticles
private static void showBellParticles(Level level, BlockPos bellPos, List<LivingEntity> nearbyEntities) -
isRaiderWithinRange
-
glow
-