Class AllayMock

All Implemented Interfaces:
MessageTarget, Frictional, net.kyori.adventure.audience.Audience, net.kyori.adventure.pointer.Pointered, net.kyori.adventure.sound.Sound.Emitter, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, Attributable, CommandSender, Allay, Creature, Damageable, Entity, LivingEntity, Mob, InventoryHolder, Lootable, Metadatable, Nameable, Permissible, ServerOperator, PersistentDataHolder, ProjectileSource

public class AllayMock extends CreatureMock implements Allay
Mock implementation of an Allay.
See Also:
  • Constructor Details

    • AllayMock

      public AllayMock(@NotNull @NotNull ServerMock server, @NotNull @NotNull UUID uuid)
      Constructs a new AgeableMock on the provided ServerMock with a specified UUID.
      Parameters:
      server - The server to create the entity on.
      uuid - The UUID of the entity.
  • Method Details

    • simulatePlayerInteract

      public void simulatePlayerInteract(@NotNull @NotNull Material material)
      Simulates the Interaction of a Player with the Allay to set it's current item.
      Parameters:
      material - The Material of the Item the Allay should collect
    • simulateItemRetrieval

      @Nullable public @Nullable ItemStack simulateItemRetrieval()
      Simulate the retrieval of the Allay's current items.
      Returns:
      A List of ItemStacks that the Allay is holding
    • simulateItemPickup

      public void simulateItemPickup(@NotNull @NotNull ItemStack item)
      Simulate the Allay picking up an ItemStack from the ground. If the Itemstack is not of the current Type, this will throw a IllegalArgumentException. If the Inventory is full, this will throw a IllegalStateException.
      Parameters:
      item - The ItemStack to pick up
    • assertCurrentItem

      public void assertCurrentItem(@NotNull @NotNull Material item)
      Asserts that the Allay uses the given Material to pick up an ItemStack from the ground.
      Parameters:
      item - The Material to pick up
    • assertCurrentItem

      public void assertCurrentItem(@NotNull @NotNull Material item, @Nullable @Nullable String message)
      Asserts that the Allay uses the given Material to pick up an ItemStack from the ground.
      Parameters:
      item - The Material to pick up
      message - The message to display if the assertion fails
    • getInventory

      @NotNull public @NotNull Inventory getInventory()
      Specified by:
      getInventory in interface InventoryHolder
    • assertInventoryContains

      public void assertInventoryContains(ItemStack item)
      Asserts that the Allay's inventory contains an item.
      Parameters:
      item - The item to check.
    • assertInventoryContains

      public void assertInventoryContains(ItemStack item, String s)
      Asserts that the Allay's inventory contains an item.
      Parameters:
      item - The item to check.
      s - The message to fail with.
    • canDuplicate

      public boolean canDuplicate()
      Specified by:
      canDuplicate in interface Allay
    • setCanDuplicate

      public void setCanDuplicate(boolean canDuplicate)
      Specified by:
      setCanDuplicate in interface Allay
    • getDuplicationCooldown

      public long getDuplicationCooldown()
      Specified by:
      getDuplicationCooldown in interface Allay
    • setDuplicationCooldown

      public void setDuplicationCooldown(long cooldown)
      Specified by:
      setDuplicationCooldown in interface Allay
    • resetDuplicationCooldown

      public void resetDuplicationCooldown()
      Specified by:
      resetDuplicationCooldown in interface Allay
    • isDancing

      public boolean isDancing()
      Specified by:
      isDancing in interface Allay
    • startDancing

      public void startDancing(@NotNull @NotNull Location location)
      Specified by:
      startDancing in interface Allay
    • startDancing

      public void startDancing()
      Specified by:
      startDancing in interface Allay
    • stopDancing

      public void stopDancing()
      Specified by:
      stopDancing in interface Allay
    • duplicateAllay

      @Nullable public @Nullable Allay duplicateAllay()
      Specified by:
      duplicateAllay in interface Allay
    • getJukebox

      @Nullable public @Nullable Location getJukebox()
      Specified by:
      getJukebox in interface Allay
    • getType

      public EntityType getType()
      Specified by:
      getType in interface Entity
      Overrides:
      getType in class EntityMock