Class ManaPoolBlockEntity

java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
vazkii.botania.common.block.block_entity.BotaniaBlockEntity
vazkii.botania.common.block.block_entity.mana.ManaPoolBlockEntity
All Implemented Interfaces:
Wandable, KeyLocked, ManaPool, ManaReceiver, SparkAttachable, ThrottledPacket

public class ManaPoolBlockEntity extends BotaniaBlockEntity implements ManaPool, KeyLocked, SparkAttachable, ThrottledPacket, Wandable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity

    net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final float
     
    static final float
     
    static final float
     

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from interface vazkii.botania.api.mana.ManaReceiver

    ID

    Fields inherited from interface vazkii.botania.api.mana.spark.SparkAttachable

    ID

    Fields inherited from interface vazkii.botania.api.block.Wandable

    ID
  • Constructor Summary

    Constructors
    Constructor
    Description
    ManaPoolBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return true if this Tile no longer requires mana and all Sparks transferring mana to it should cancel their transfer.
    static int
    calculateComparatorLevel(int mana, int max)
     
    boolean
    canAttachSpark(net.minecraft.world.item.ItemStack stack)
    Can this block have a Spark attached to it.
    boolean
    Can this tile receive mana from bursts? Generally set to false for implementations of ManaCollector.
    static void
    clientTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, ManaPoolBlockEntity self)
     
    boolean
    collideEntityItem(net.minecraft.world.entity.item.ItemEntity item)
     
    void
    craftingEffect(boolean playSound)
     
    Gets the Spark that is attached to this block.
    int
    Returns how much space for mana is available in this block, normally the total - the current.
    Optional<net.minecraft.world.item.DyeColor>
     
    int
    Gets the amount of mana currently in this block.
     
    net.minecraft.world.level.Level
     
    net.minecraft.core.BlockPos
     
    getMatchingRecipe(@NotNull net.minecraft.world.item.ItemStack stack, @NotNull net.minecraft.world.level.block.state.BlockState state)
     
    int
     
     
    boolean
    Is this Mana Receiver is full? Being full means no mana bursts will be sent.
    boolean
    Returns false if the mana pool is accepting power from other power items, true if it's sending power into them.
    void
     
    boolean
    onUsedByWand(@Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.core.Direction side)
    Called when the block is used by a wand.
    void
    readPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries)
     
    void
    receiveMana(int mana)
    Called when this receiver receives mana.
    static void
    serverTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, ManaPoolBlockEntity self)
     
    void
    setColor(Optional<net.minecraft.world.item.DyeColor> color)
    Sets the color of this pool.
    void
     
    boolean
    triggerEvent(int event, int param)
     
    void
    writePacketNBT(@NotNull 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, saveAdditional

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface vazkii.botania.api.mana.spark.SparkAttachable

    attachSpark
  • Field Details

  • Constructor Details

    • ManaPoolBlockEntity

      public ManaPoolBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • isFull

      public boolean isFull()
      Description copied from interface: ManaReceiver
      Is this Mana Receiver is full? Being full means no mana bursts will be sent.
      Specified by:
      isFull in interface ManaReceiver
    • receiveMana

      public void receiveMana(int mana)
      Description copied from interface: ManaReceiver
      Called when this receiver receives mana.
      Specified by:
      receiveMana in interface ManaReceiver
    • setRemoved

      public void setRemoved()
      Overrides:
      setRemoved in class net.minecraft.world.level.block.entity.BlockEntity
    • calculateComparatorLevel

      public static int calculateComparatorLevel(int mana, int max)
    • getMatchingRecipe

      public ManaInfusionRecipe getMatchingRecipe(@NotNull @NotNull net.minecraft.world.item.ItemStack stack, @NotNull @NotNull net.minecraft.world.level.block.state.BlockState state)
    • collideEntityItem

      public boolean collideEntityItem(net.minecraft.world.entity.item.ItemEntity item)
    • craftingEffect

      public void craftingEffect(boolean playSound)
    • triggerEvent

      public boolean triggerEvent(int event, int param)
      Overrides:
      triggerEvent in class net.minecraft.world.level.block.entity.BlockEntity
    • clientTick

      public static void clientTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, ManaPoolBlockEntity self)
    • serverTick

      public static void serverTick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos worldPosition, net.minecraft.world.level.block.state.BlockState state, ManaPoolBlockEntity self)
    • writePacketNBT

      public void writePacketNBT(@NotNull @NotNull net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries)
      Overrides:
      writePacketNBT in class BotaniaBlockEntity
    • readPacketNBT

      public void readPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries)
      Overrides:
      readPacketNBT in class BotaniaBlockEntity
    • onUsedByWand

      public boolean onUsedByWand(@Nullable @Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.core.Direction side)
      Description copied from interface: Wandable
      Called when the block is used by a wand.
      Specified by:
      onUsedByWand in interface Wandable
      Parameters:
      player - Null if the block is being wanded by a dispenser
    • canReceiveManaFromBursts

      public boolean canReceiveManaFromBursts()
      Description copied from interface: ManaReceiver
      Can this tile receive mana from bursts? Generally set to false for implementations of ManaCollector.
      Specified by:
      canReceiveManaFromBursts in interface ManaReceiver
    • isOutputtingPower

      public boolean isOutputtingPower()
      Description copied from interface: ManaPool
      Returns false if the mana pool is accepting power from other power items, true if it's sending power into them.
      Specified by:
      isOutputtingPower in interface ManaPool
    • getManaReceiverLevel

      public net.minecraft.world.level.Level getManaReceiverLevel()
      Specified by:
      getManaReceiverLevel in interface ManaReceiver
    • getManaReceiverPos

      public net.minecraft.core.BlockPos getManaReceiverPos()
      Specified by:
      getManaReceiverPos in interface ManaReceiver
    • getCurrentMana

      public int getCurrentMana()
      Description copied from interface: ManaReceiver
      Gets the amount of mana currently in this block.
      Specified by:
      getCurrentMana in interface ManaReceiver
    • getMaxMana

      public int getMaxMana()
      Specified by:
      getMaxMana in interface ManaPool
      Returns:
      Maximum amount of storable mana
    • getInputKey

      public String getInputKey()
      Specified by:
      getInputKey in interface KeyLocked
    • getOutputKey

      public String getOutputKey()
      Specified by:
      getOutputKey in interface KeyLocked
    • canAttachSpark

      public boolean canAttachSpark(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: SparkAttachable
      Can this block have a Spark attached to it. Note that this will not unattach the Spark if it's changed later.
      Specified by:
      canAttachSpark in interface SparkAttachable
    • getAttachedSpark

      public ManaSpark getAttachedSpark()
      Description copied from interface: SparkAttachable
      Gets the Spark that is attached to this block. A common implementation is to check for Spark entities above using world.getEntitiesWithinAABB()
      Specified by:
      getAttachedSpark in interface SparkAttachable
    • areIncomingTranfersDone

      public boolean areIncomingTranfersDone()
      Description copied from interface: SparkAttachable
      Return true if this Tile no longer requires mana and all Sparks transferring mana to it should cancel their transfer.
      Specified by:
      areIncomingTranfersDone in interface SparkAttachable
    • getAvailableSpaceForMana

      public int getAvailableSpaceForMana()
      Description copied from interface: SparkAttachable
      Returns 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:
      getAvailableSpaceForMana in interface SparkAttachable
    • getColor

      public Optional<net.minecraft.world.item.DyeColor> getColor()
      Specified by:
      getColor in interface ManaPool
      Returns:
      The color of this pool.
    • setColor

      public void setColor(Optional<net.minecraft.world.item.DyeColor> color)
      Description copied from interface: ManaPool
      Sets the color of this pool.
      Specified by:
      setColor in interface ManaPool
      Parameters:
      color - The color to set.
    • markDispatchable

      public void markDispatchable()
      Specified by:
      markDispatchable in interface ThrottledPacket