Class 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
  • 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: 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
    • 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:
      writePacketNBT in class SimpleInventoryBlockEntity
    • readPacketNBT

      public void readPacketNBT(net.minecraft.nbt.CompoundTag cmp, net.minecraft.core.HolderLookup.Provider registries)
      Overrides:
      readPacketNBT in class SimpleInventoryBlockEntity
    • 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
    • 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
    • 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: 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
    • getVariant

      public ManaSpreaderBlock.Variant getVariant()
    • checkForReceiver

      public void checkForReceiver()
    • runBurstSimulation

      public ManaBurst runBurstSimulation()
      Specified by:
      runBurstSimulation in interface ManaSpreader
    • getLensController

      public ControlLensItem getLensController(net.minecraft.world.item.ItemStack stack)
    • onClientDisplayTick

      public void onClientDisplayTick()
      Description copied from interface: ManaCollector
      Called every tick on the client case the player is holding a Wand of the Forest.
      Specified by:
      onClientDisplayTick in interface ManaCollector
    • getManaYieldMultiplier

      public float getManaYieldMultiplier(ManaBurst burst)
      Description copied from interface: ManaCollector
      Get 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:
      getManaYieldMultiplier in interface ManaCollector
    • createItemHandler

      protected net.minecraft.world.SimpleContainer createItemHandler()
      Specified by:
      createItemHandler in class SimpleInventoryBlockEntity
    • setChanged

      public void setChanged()
      Specified by:
      setChanged in interface net.minecraft.world.Container
      Overrides:
      setChanged in class net.minecraft.world.level.block.entity.BlockEntity
    • getBinding

      public net.minecraft.core.BlockPos getBinding()
      Description copied from interface: Bound
      Gets where this block is bound to
      Specified by:
      getBinding in interface Bound
    • getMaxMana

      public int getMaxMana()
      Description copied from interface: ManaCollector
      Gets the maximum amount of mana this collector can have.
      Specified by:
      getMaxMana in interface ManaCollector
    • getInputKey

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

      public String getOutputKey()
      Specified by:
      getOutputKey in interface KeyLocked
    • 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: WandBindable
      Return true if the Wand can select this tile.
      Specified by:
      canSelect in interface WandBindable
    • 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: WandBindable
      Call 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:
      bindTo in interface WandBindable
    • markDispatchable

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

      public float getRotationX()
      Specified by:
      getRotationX in interface ManaSpreader
      Returns:
      The X rotation, in degrees
    • getRotationY

      public float getRotationY()
      Specified by:
      getRotationY in interface ManaSpreader
      Returns:
      The Y rotation, in degrees
    • setRotationX

      public void setRotationX(float rot)
      Description copied from interface: ManaSpreader
      Set the X rotation
      Specified by:
      setRotationX in interface ManaSpreader
      Parameters:
      rot - X rotation, in degrees
    • setRotationY

      public void setRotationY(float rot)
      Description copied from interface: ManaSpreader
      Set the Y rotation
      Specified by:
      setRotationY in interface ManaSpreader
      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: ManaSpreader
      This should be called after rotation setting is done to allow for the block to re-calculate.
      Specified by:
      commitRedirection in interface ManaSpreader
    • setCanShoot

      public void setCanShoot(boolean canShoot)
      Specified by:
      setCanShoot in interface ManaSpreader
    • getBurstParticleTick

      public int getBurstParticleTick()
      Specified by:
      getBurstParticleTick in interface ManaSpreader
    • setBurstParticleTick

      public void setBurstParticleTick(int i)
      Specified by:
      setBurstParticleTick in interface ManaSpreader
    • getLastBurstDeathTick

      public int getLastBurstDeathTick()
      Specified by:
      getLastBurstDeathTick in interface ManaSpreader
    • setLastBurstDeathTick

      public void setLastBurstDeathTick(int i)
      Specified by:
      setLastBurstDeathTick in interface ManaSpreader
    • pingback

      public void pingback(ManaBurst burst, UUID expectedIdentity)
      Description copied from interface: ManaSpreader
      Pings 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:
      pingback in interface ManaSpreader
    • getIdentifier

      public UUID getIdentifier()
      Specified by:
      getIdentifier in interface ManaSpreader
      Returns:
      A unique and persistent identifier for this spreader