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:
DebugValueSource,IAttachmentHolder,IBlockEntityExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.BlockEntityPathElementNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate intprivate longprivate longprivate static final Stringprivate Directionprivate ItemStackprivate static final Stringprivate static final org.slf4j.Loggerprivate static final Stringprivate static final Stringprivate ResourceKey<LootTable> private longprivate static final intFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbrush(long pStartTick, ServerLevel pLevel, LivingEntity pBrusher, Direction pHitDirection, ItemStack pStack) private voidbrushingCompleted(ServerLevel pLevel, LivingEntity pBrusher, ItemStack pStack) voidcheckReset(ServerLevel pLevel) private voiddropContent(ServerLevel pLevel, LivingEntity pBrusher, ItemStack pStack) private intgetItem()getUpdateTag(HolderLookup.Provider p_323531_) protected voidloadAdditional(ValueInput p_422299_) protected voidsaveAdditional(ValueOutput p_421746_) voidsetLootTable(ResourceKey<LootTable> pLootTable, long pSeed) private booleantryLoadLootTable(ValueInput pInput) private booleantrySaveLootTable(ValueOutput pOutput) private voidunpackLootTable(ServerLevel pLevel, LivingEntity pBrusher, ItemStack pStack) Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, 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, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.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 pStartTick, ServerLevel pLevel, LivingEntity pBrusher, Direction pHitDirection, ItemStack pStack) -
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
-