Class ManaSpreaderBlockEntity
java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
vazkii.botania.common.block.block_entity.BotaniaBlockEntity
vazkii.botania.common.block.block_entity.SimpleInventoryBlockEntity
vazkii.botania.common.block.block_entity.ExposedSimpleInventoryBlockEntity
vazkii.botania.common.block.block_entity.mana.ManaSpreaderBlockEntity
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container,net.minecraft.world.WorldlyContainer,Bound,Wandable,WandBindable,KeyLocked,ManaCollector,ManaReceiver,ManaSpreader,ThrottledPacket
public class ManaSpreaderBlockEntity
extends ExposedSimpleInventoryBlockEntity
implements WandBindable, KeyLocked, ThrottledPacket, ManaSpreader, Wandable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput -
Field Summary
FieldsModifier and TypeFieldDescriptionintbooleanintdoubledoubledouble@Nullable net.minecraft.world.item.DyeColorintfloatfloatFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface vazkii.botania.api.block.Bound
UNBOUND_POSFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFERFields inherited from interface vazkii.botania.api.mana.ManaReceiver
ID -
Constructor Summary
ConstructorsConstructorDescriptionManaSpreaderBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbindTo(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) Call to bind the TileEntity to where the player clicked.booleanCan this tile receive mana from bursts? Generally set to false for implementations of ManaCollector.booleancanSelect(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) Return true if the Wand can select this tile.voidvoidThis should be called after rotation setting is done to allow for the block to re-calculate.static voidcommonTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, ManaSpreaderBlockEntity self) protected net.minecraft.world.SimpleContainernet.minecraft.core.BlockPosGets where this block is bound tointintGets the amount of mana currently in this block.intgetLensController(net.minecraft.world.item.ItemStack stack) net.minecraft.world.level.Levelnet.minecraft.core.BlockPosfloatgetManaYieldMultiplier(ManaBurst burst) Get the multiplier of mana to input into the block, 1.0 is the original amount of mana in the burst.intGets the maximum amount of mana this collector can have.floatfloatbooleanisFull()Is this Mana Receiver is full? Being full means no mana bursts will be sent.voidvoidmirror(net.minecraft.world.level.block.Mirror mirror) voidCalled every tick on the client case the player is holding a Wand of the Forest.booleanonUsedByWand(@Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.core.Direction side) Called when the block is used by a wand.voidPings this object back, telling it that the burst passed in is still alive in the world.voidreadPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) voidreceiveMana(int mana) Called when this receiver receives mana.voidrotate(net.minecraft.world.level.block.Rotation rotation) voidsetBurstParticleTick(int i) voidsetCanShoot(boolean canShoot) voidvoidsetLastBurstDeathTick(int i) voidvoidsetRotationX(float rot) Set the X rotationvoidsetRotationY(float rot) Set the Y rotationvoidwritePacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) Methods inherited from class vazkii.botania.common.block.block_entity.ExposedSimpleInventoryBlockEntity
canPlaceItem, canPlaceItemThroughFace, canTakeItemThroughFace, countItem, getContainerSize, getItem, getMaxStackSize, getSlotsForFace, hasAnyOf, isEmpty, removeItem, removeItemNoUpdate, setItem, startOpen, stillValid, stopOpenMethods inherited from class vazkii.botania.common.block.block_entity.SimpleInventoryBlockEntity
clearContent, getItemHandler, inventorySizeMethods inherited from class vazkii.botania.common.block.block_entity.BotaniaBlockEntity
getUpdatePacket, getUpdateTag, loadAdditional, saveAdditionalMethods 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, setComponents, setLevel, triggerEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Clearable
clearContentMethods inherited from interface net.minecraft.world.Container
canTakeItem, getMaxStackSize, hasAnyMatching
-
Field Details
-
rotationX
public float rotationX -
rotationY
public float rotationY -
paddingColor
@Nullable public @Nullable net.minecraft.world.item.DyeColor paddingColor -
canShootBurst
public boolean canShootBurst -
lastBurstDeathTick
public int lastBurstDeathTick -
burstParticleTick
public int burstParticleTick -
pingbackTicks
public int pingbackTicks -
lastPingbackX
public double lastPingbackX -
lastPingbackY
public double lastPingbackY -
lastPingbackZ
public double lastPingbackZ
-
-
Constructor Details
-
ManaSpreaderBlockEntity
public ManaSpreaderBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
isFull
public boolean isFull()Description copied from interface:ManaReceiverIs this Mana Receiver is full? Being full means no mana bursts will be sent.- Specified by:
isFullin interfaceManaReceiver
-
receiveMana
public void receiveMana(int mana) Description copied from interface:ManaReceiverCalled when this receiver receives mana.- Specified by:
receiveManain interfaceManaReceiver
-
setRemoved
public void setRemoved()- Overrides:
setRemovedin classnet.minecraft.world.level.block.entity.BlockEntity
-
commonTick
public static void commonTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, ManaSpreaderBlockEntity self) -
writePacketNBT
public void writePacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
writePacketNBTin classSimpleInventoryBlockEntity
-
readPacketNBT
public void readPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
readPacketNBTin classSimpleInventoryBlockEntity
-
canReceiveManaFromBursts
public boolean canReceiveManaFromBursts()Description copied from interface:ManaReceiverCan this tile receive mana from bursts? Generally set to false for implementations of ManaCollector.- Specified by:
canReceiveManaFromBurstsin interfaceManaReceiver
-
getManaReceiverLevel
public net.minecraft.world.level.Level getManaReceiverLevel()- Specified by:
getManaReceiverLevelin interfaceManaReceiver
-
getManaReceiverPos
public net.minecraft.core.BlockPos getManaReceiverPos()- Specified by:
getManaReceiverPosin interfaceManaReceiver
-
getCurrentMana
public int getCurrentMana()Description copied from interface:ManaReceiverGets the amount of mana currently in this block.- Specified by:
getCurrentManain interfaceManaReceiver
-
onUsedByWand
public boolean onUsedByWand(@Nullable @Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.core.Direction side) Description copied from interface:WandableCalled when the block is used by a wand.- Specified by:
onUsedByWandin interfaceWandable- Parameters:
player- Null if the block is being wanded by a dispenser
-
getVariant
-
checkForReceiver
public void checkForReceiver() -
runBurstSimulation
- Specified by:
runBurstSimulationin interfaceManaSpreader
-
getLensController
-
onClientDisplayTick
public void onClientDisplayTick()Description copied from interface:ManaCollectorCalled every tick on the client case the player is holding a Wand of the Forest.- Specified by:
onClientDisplayTickin interfaceManaCollector
-
getManaYieldMultiplier
Description copied from interface:ManaCollectorGet the multiplier of mana to input into the block, 1.0 is the original amount of mana in the burst. 0.9, for example, is 90%, so 10% of the mana in the burst will get dissipated.- Specified by:
getManaYieldMultiplierin interfaceManaCollector
-
createItemHandler
protected net.minecraft.world.SimpleContainer createItemHandler()- Specified by:
createItemHandlerin classSimpleInventoryBlockEntity
-
setChanged
public void setChanged()- Specified by:
setChangedin interfacenet.minecraft.world.Container- Overrides:
setChangedin classnet.minecraft.world.level.block.entity.BlockEntity
-
getBinding
public net.minecraft.core.BlockPos getBinding()Description copied from interface:BoundGets where this block is bound to- Specified by:
getBindingin interfaceBound
-
getMaxMana
public int getMaxMana()Description copied from interface:ManaCollectorGets the maximum amount of mana this collector can have.- Specified by:
getMaxManain interfaceManaCollector
-
getInputKey
- Specified by:
getInputKeyin interfaceKeyLocked
-
getOutputKey
- Specified by:
getOutputKeyin interfaceKeyLocked
-
canSelect
public boolean canSelect(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) Description copied from interface:WandBindableReturn true if the Wand can select this tile.- Specified by:
canSelectin interfaceWandBindable
-
bindTo
public boolean bindTo(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) Description copied from interface:WandBindableCall to bind the TileEntity to where the player clicked. Return true to deselect the TileEntity for another bind or false case the TileEntity should stay selected.- Specified by:
bindToin interfaceWandBindable
-
markDispatchable
public void markDispatchable()- Specified by:
markDispatchablein interfaceThrottledPacket
-
getRotationX
public float getRotationX()- Specified by:
getRotationXin interfaceManaSpreader- Returns:
- The X rotation, in degrees
-
getRotationY
public float getRotationY()- Specified by:
getRotationYin interfaceManaSpreader- Returns:
- The Y rotation, in degrees
-
setRotationX
public void setRotationX(float rot) Description copied from interface:ManaSpreaderSet the X rotation- Specified by:
setRotationXin interfaceManaSpreader- Parameters:
rot- X rotation, in degrees
-
setRotationY
public void setRotationY(float rot) Description copied from interface:ManaSpreaderSet the Y rotation- Specified by:
setRotationYin interfaceManaSpreader- Parameters:
rot- Y rotation, in degrees
-
rotate
public void rotate(net.minecraft.world.level.block.Rotation rotation) -
mirror
public void mirror(net.minecraft.world.level.block.Mirror mirror) -
commitRedirection
public void commitRedirection()Description copied from interface:ManaSpreaderThis should be called after rotation setting is done to allow for the block to re-calculate.- Specified by:
commitRedirectionin interfaceManaSpreader
-
setCanShoot
public void setCanShoot(boolean canShoot) - Specified by:
setCanShootin interfaceManaSpreader
-
getBurstParticleTick
public int getBurstParticleTick()- Specified by:
getBurstParticleTickin interfaceManaSpreader
-
setBurstParticleTick
public void setBurstParticleTick(int i) - Specified by:
setBurstParticleTickin interfaceManaSpreader
-
getLastBurstDeathTick
public int getLastBurstDeathTick()- Specified by:
getLastBurstDeathTickin interfaceManaSpreader
-
setLastBurstDeathTick
public void setLastBurstDeathTick(int i) - Specified by:
setLastBurstDeathTickin interfaceManaSpreader
-
pingback
Description copied from interface:ManaSpreaderPings this object back, telling it that the burst passed in is still alive in the world. The UUID parameter should be the UUID with which the burst was created, this is used to let the object handle the check for if it's the correct ID internally. ManaBurst implementations should do this every tick.- Specified by:
pingbackin interfaceManaSpreader
-
getIdentifier
- Specified by:
getIdentifierin interfaceManaSpreader- Returns:
- A unique and persistent identifier for this spreader
-