Class BeaconMock

All Implemented Interfaces:
LockableTileState, Beacon, BlockState, Lockable, TileState, Metadatable, Nameable, PersistentDataHolder

public class BeaconMock extends TileStateMock implements Beacon
Mock implementation of a Beacon.
See Also:
  • Constructor Details

    • BeaconMock

      public BeaconMock(@NotNull @NotNull Material material)
      Constructs a new BeaconMock for the provided Material. Only supports Material.BARREL
      Parameters:
      material - The material this state is for.
    • BeaconMock

      protected BeaconMock(@NotNull @NotNull Block block)
      Constructs a new BeaconMock for the provided Block. Only supports Material.BEACON
      Parameters:
      block - The block this state is for.
    • BeaconMock

      protected BeaconMock(@NotNull @NotNull BeaconMock state)
      Constructs a new BeaconMock by cloning the data from an existing one.
      Parameters:
      state - The state to clone.
  • Method Details

    • getSnapshot

      @NotNull public @NotNull BlockState getSnapshot()
      Description copied from class: BlockStateMock
      This returns a copy of this BlockStateMock. Inheritents of this class should override this method!
      Specified by:
      getSnapshot in class TileStateMock
      Returns:
      A snapshot of this BlockStateMock.
    • getEntitiesInRange

      @NotNull public @NotNull Collection<LivingEntity> getEntitiesInRange()
      Specified by:
      getEntitiesInRange in interface Beacon
    • updateTier

      public void updateTier()
      Calculates the Beacon's tier based off the blocks below it, just as in vanilla.
    • setTier

      @Test public void setTier(int tier)
      Sets the tier of the Beacon. Clamped between 1-4 (inclusive).
      Parameters:
      tier - The tier to set.
    • getTier

      public int getTier()
      Specified by:
      getTier in interface Beacon
    • getPrimaryEffect

      @Nullable public @Nullable PotionEffect getPrimaryEffect()
      Specified by:
      getPrimaryEffect in interface Beacon
    • setPrimaryEffect

      public void setPrimaryEffect(@Nullable @Nullable PotionEffectType effect)
      Specified by:
      setPrimaryEffect in interface Beacon
    • getSecondaryEffect

      @Nullable public @Nullable PotionEffect getSecondaryEffect()
      Specified by:
      getSecondaryEffect in interface Beacon
    • setSecondaryEffect

      public void setSecondaryEffect(@Nullable @Nullable PotionEffectType effect)
      Specified by:
      setSecondaryEffect in interface Beacon
    • getEffectRange

      public double getEffectRange()
      Specified by:
      getEffectRange in interface Beacon
    • setEffectRange

      public void setEffectRange(double range)
      Specified by:
      setEffectRange in interface Beacon
    • resetEffectRange

      public void resetEffectRange()
      Specified by:
      resetEffectRange in interface Beacon
    • customName

      @Nullable public @Nullable net.kyori.adventure.text.Component customName()
      Specified by:
      customName in interface Nameable
    • customName

      public void customName(@Nullable @Nullable net.kyori.adventure.text.Component customName)
      Specified by:
      customName in interface Nameable
    • getCustomName

      @Nullable public @Nullable String getCustomName()
      Specified by:
      getCustomName in interface Nameable
    • setCustomName

      public void setCustomName(@Nullable @Nullable String name)
      Specified by:
      setCustomName in interface Nameable
    • isLocked

      public boolean isLocked()
      Specified by:
      isLocked in interface Lockable
    • getLock

      @NotNull public @NotNull String getLock()
      Specified by:
      getLock in interface Lockable
    • setLock

      public void setLock(@Nullable @Nullable String key)
      Specified by:
      setLock in interface Lockable