Class ManaEnchanterBlockEntity
java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
vazkii.botania.common.block.block_entity.BotaniaBlockEntity
vazkii.botania.common.block.block_entity.ManaEnchanterBlockEntity
- All Implemented Interfaces:
net.minecraft.world.Clearable,Wandable,ManaReceiver,SparkAttachable
public class ManaEnchanterBlockEntity
extends BotaniaBlockEntity
implements ManaReceiver, SparkAttachable, Wandable, net.minecraft.world.Clearable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classNested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput -
Field Summary
FieldsModifier and TypeFieldDescriptionnet.minecraft.world.item.ItemStackstatic final Supplier<vazkii.patchouli.api.IMultiblock> intintFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface vazkii.botania.api.mana.ManaReceiver
IDFields inherited from interface vazkii.botania.api.mana.spark.SparkAttachable
ID -
Constructor Summary
ConstructorsConstructorDescriptionManaEnchanterBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn true if this Tile no longer requires mana and all Sparks transferring mana to it should cancel their transfer.booleancanAttachSpark(net.minecraft.world.item.ItemStack stack) Can this block have a Spark attached to it.static net.minecraft.core.Direction.AxiscanEnchanterExist(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) booleanCan this tile receive mana from bursts? Generally set to false for implementations of ManaCollector.voidstatic voidcommonTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, ManaEnchanterBlockEntity self) Gets the Spark that is attached to this block.intReturns how much space for mana is available in this block, normally the total - the current.intGets the amount of mana currently in this block.net.minecraft.world.level.Levelnet.minecraft.core.BlockPosbooleanisFull()Is this Mana Receiver is full? Being full means no mana bursts will be sent.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.voidreadPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) voidreceiveMana(int mana) Called when this receiver receives mana.voidsync()booleantriggerEvent(int event, int param) voidwritePacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) Methods 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, setChanged, setComponents, setLevel, setRemovedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface vazkii.botania.api.mana.spark.SparkAttachable
attachSpark
-
Field Details
-
MULTIBLOCK
-
stage
-
stageTicks
public int stageTicks -
stage3EndTicks
public int stage3EndTicks -
itemToEnchant
public net.minecraft.world.item.ItemStack itemToEnchant
-
-
Constructor Details
-
ManaEnchanterBlockEntity
public ManaEnchanterBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
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
-
commonTick
public static void commonTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, ManaEnchanterBlockEntity self) -
triggerEvent
public boolean triggerEvent(int event, int param) - Overrides:
triggerEventin classnet.minecraft.world.level.block.entity.BlockEntity
-
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
-
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
-
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
-
sync
public void sync() -
writePacketNBT
public void writePacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
writePacketNBTin classBotaniaBlockEntity
-
readPacketNBT
public void readPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries) - Overrides:
readPacketNBTin classBotaniaBlockEntity
-
canEnchanterExist
@Nullable public static net.minecraft.core.Direction.Axis canEnchanterExist(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) -
canAttachSpark
public boolean canAttachSpark(net.minecraft.world.item.ItemStack stack) Description copied from interface:SparkAttachableCan this block have a Spark attached to it. Note that this will not unattach the Spark if it's changed later.- Specified by:
canAttachSparkin interfaceSparkAttachable
-
getAttachedSpark
Description copied from interface:SparkAttachableGets the Spark that is attached to this block. A common implementation is to check for Spark entities above using world.getEntitiesWithinAABB()- Specified by:
getAttachedSparkin interfaceSparkAttachable
-
areIncomingTranfersDone
public boolean areIncomingTranfersDone()Description copied from interface:SparkAttachableReturn true if this Tile no longer requires mana and all Sparks transferring mana to it should cancel their transfer.- Specified by:
areIncomingTranfersDonein interfaceSparkAttachable
-
getAvailableSpaceForMana
public int getAvailableSpaceForMana()Description copied from interface:SparkAttachableReturns how much space for mana is available in this block, normally the total - the current. Should NEVER return negative values. Make sure to check against that.- Specified by:
getAvailableSpaceForManain interfaceSparkAttachable
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable
-