Package vazkii.botania.api.block_entity
Class SpecialFlowerBlockEntity
java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
vazkii.botania.api.block_entity.SpecialFlowerBlockEntity
- All Implemented Interfaces:
FloatingFlowerProvider
- Direct Known Subclasses:
BergamuteBlockEntity,BindableSpecialFlowerBlockEntity,ManastarBlockEntity,PureDaisyBlockEntity
public abstract class SpecialFlowerBlockEntity
extends net.minecraft.world.level.block.entity.BlockEntity
implements FloatingFlowerProvider
Common superclass of all magical flower block entities
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intbooleantrue if this flower is working on Enchanted Soilbooleantrue if this flower is working on Enchanted Soil and this is the second tickstatic final intstatic final StringintFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPosition -
Constructor Summary
ConstructorsConstructorDescriptionSpecialFlowerBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcommonTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, SpecialFlowerBlockEntity self) voidemitParticle(net.minecraft.core.particles.ParticleOptions options, double xOffset, double yOffset, double zOffset, double xSpeed, double ySpeed, double zSpeed) intfinal net.minecraft.core.BlockPos@Nullable FloatingFlowerintReturns the additional delay in ticks that an item must be on the ground before this flower will act on it.abstract @Nullable RadiusDescriptorReturns a descriptor for the radius of this sub tile.@Nullable Object@Nullable RadiusDescriptorReturns a descriptor for this flower's secondary radius.net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> @NotNull net.minecraft.nbt.CompoundTaggetUpdateTag(net.minecraft.core.HolderLookup.Provider registries) final booleanbooleanbooleanGets if this SubTileEntity is affected by Enchanted Soil's speed boost.final voidloadAdditional(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) voidreadFromPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) Reads data from a network packet.final voidsaveAdditional(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) final voidsetFloating(boolean floating) WARNING: This should only be called during or soon after construction.voidsetPlacedBy(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, @Nullable net.minecraft.world.entity.LivingEntity placer, net.minecraft.world.item.ItemStack stack) Called when this sub tile is placed in the world (by an entity).voidsync()protected voidvoidwriteToPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) Writes some extra data to a network packet.Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setLevel, setRemoved, triggerEvent
-
Field Details
-
PODZOL_DELAY
public static final int PODZOL_DELAY- See Also:
-
MYCELIUM_DELAY
public static final int MYCELIUM_DELAY- See Also:
-
ticksExisted
public int ticksExisted -
overgrowth
public boolean overgrowthtrue if this flower is working on Enchanted Soil -
overgrowthBoost
public boolean overgrowthBoosttrue if this flower is working on Enchanted Soil and this is the second tick -
TAG_TICKS_EXISTED
- See Also:
-
-
Constructor Details
-
SpecialFlowerBlockEntity
public SpecialFlowerBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
commonTick
public static void commonTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, SpecialFlowerBlockEntity self) -
getFloatingData
- Specified by:
getFloatingDatain interfaceFloatingFlowerProvider
-
isFloating
public final boolean isFloating() -
setFloating
public final void setFloating(boolean floating) WARNING: This should only be called during or soon after construction. Switching between nonfloating/floating at play time is not supported and a fresh Block Entity should be created instead. -
isOnSpecialSoil
public boolean isOnSpecialSoil() -
getEffectivePos
public final net.minecraft.core.BlockPos getEffectivePos()- Returns:
- Where this flower's effects are centered at. This can differ from the true TE location due to red string spoofers.
-
tickFlower
protected void tickFlower() -
loadAdditional
public final void loadAdditional(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
loadAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
saveAdditional
public final void saveAdditional(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdateTag
@NotNull public @NotNull net.minecraft.nbt.CompoundTag getUpdateTag(net.minecraft.core.HolderLookup.Provider registries) - Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
writeToPacketNBT
public void writeToPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) Writes some extra data to a network packet. This data is read by readFromPacketNBT on the client that receives the packet. Note: This method is also used to write to the world NBT. -
readFromPacketNBT
public void readFromPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) Reads data from a network packet. This data is written by writeToPacketNBT in the server. Note: This method is also used to read from the world NBT. -
getUpdatePacket
public net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getUpdatePacket()- Overrides:
getUpdatePacketin classnet.minecraft.world.level.block.entity.BlockEntity
-
sync
public void sync() -
setPlacedBy
public void setPlacedBy(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, @Nullable @Nullable net.minecraft.world.entity.LivingEntity placer, net.minecraft.world.item.ItemStack stack) Called when this sub tile is placed in the world (by an entity). -
getRadius
Returns a descriptor for the radius of this sub tile. This is called while a player is looking at the block with a Manaseer Monocle. -
getSecondaryRadius
Returns a descriptor for this flower's secondary radius. Use for e.g. when a flower has different ranges for picking up and using dropped items. Called when the player is looking at the block with a Manaseer Monocle. -
isOvergrowthAffected
public boolean isOvergrowthAffected()Gets if this SubTileEntity is affected by Enchanted Soil's speed boost. -
getComparatorSignal
public int getComparatorSignal() -
getModulatedDelay
public int getModulatedDelay()Returns the additional delay in ticks that an item must be on the ground before this flower will act on it. -
getRenderData
-
emitParticle
public void emitParticle(net.minecraft.core.particles.ParticleOptions options, double xOffset, double yOffset, double zOffset, double xSpeed, double ySpeed, double zSpeed)
-