Class BrushableBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BrushableBlockEntity
- All Implemented Interfaces:
TypedInstance<BlockEntityType<?>>, DebugValueSource, IAttachmentHolder, IBlockEntityExtension
-
Nested Class Summary
Nested 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 intprivate longprivate longprivate static final Stringprivate @Nullable Directionprivate ItemStackprivate static final Stringprivate static final org.slf4j.Loggerprivate static final Stringprivate static final Stringprivate @Nullable ResourceKey<LootTable> private longprivate static final intFields inherited from class BlockEntity
level, remove, worldPositionFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbrush(long gameTime, ServerLevel level, LivingEntity user, Direction direction, ItemStack brush) private voidbrushingCompleted(ServerLevel level, LivingEntity user, ItemStack brush) voidcheckReset(ServerLevel level) private voiddropContent(ServerLevel level, LivingEntity user, ItemStack brush) private int@Nullable DirectiongetItem()getUpdateTag(HolderLookup.Provider registries) protected voidloadAdditional(ValueInput input) protected voidsaveAdditional(ValueOutput output) voidsetLootTable(ResourceKey<LootTable> lootTable, long seed) private booleantryLoadLootTable(ValueInput input) private booleantrySaveLootTable(ValueOutput base) private voidunpackLootTable(ServerLevel level, LivingEntity user, ItemInstance brush) Methods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeComponentsFromTag, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, 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 -
LOOT_TABLE_TAG
- See Also:
-
LOOT_TABLE_SEED_TAG
- See Also:
-
HIT_DIRECTION_TAG
- See Also:
-
ITEM_TAG
- See Also:
-
BRUSH_COOLDOWN_TICKS
private static final int BRUSH_COOLDOWN_TICKS- See Also:
-
BRUSH_RESET_TICKS
private static final int BRUSH_RESET_TICKS- See Also:
-
REQUIRED_BRUSHES_TO_BREAK
private static final int REQUIRED_BRUSHES_TO_BREAK- See Also:
-
brushCount
private int brushCount -
brushCountResetsAtTick
private long brushCountResetsAtTick -
coolDownEndsAtTick
private long coolDownEndsAtTick -
item
-
hitDirection
-
lootTable
-
lootTableSeed
private long lootTableSeed
-
-
Constructor Details
-
BrushableBlockEntity
-
-
Method Details
-
brush
public boolean brush(long gameTime, ServerLevel level, LivingEntity user, Direction direction, ItemStack brush) -
unpackLootTable
-
brushingCompleted
-
dropContent
-
checkReset
-
tryLoadLootTable
-
trySaveLootTable
-
getUpdateTag
- Overrides:
getUpdateTagin classBlockEntity
-
getUpdatePacket
- Overrides:
getUpdatePacketin classBlockEntity
-
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
setLootTable
-
getCompletionState
private int getCompletionState() -
getHitDirection
-
getItem
-