Class ChunkMock

java.lang.Object
be.seeseemelk.mockbukkit.ChunkMock
All Implemented Interfaces:
Chunk, PersistentDataHolder

public class ChunkMock extends Object implements Chunk
Mock implementation of a Chunk.
  • Constructor Details

    • ChunkMock

      protected ChunkMock(World world, int x, int z)
      Constructs a new ChunkMock for the provided world, at the specified coordinates.
      Parameters:
      world - The world the chunk is in.
      x - The X coordinate of the chunk.
      z - The Y coordinate of the chunk.
  • Method Details

    • getX

      public int getX()
      Specified by:
      getX in interface Chunk
    • getZ

      public int getZ()
      Specified by:
      getZ in interface Chunk
    • isGenerated

      public boolean isGenerated()
      Specified by:
      isGenerated in interface Chunk
    • getTileEntities

      @NotNull public @NotNull BlockState[] getTileEntities(boolean useSnapshot)
      Specified by:
      getTileEntities in interface Chunk
    • getTileEntities

      @NotNull public @NotNull Collection<BlockState> getTileEntities(@NotNull @NotNull Predicate<? super Block> blockPredicate, boolean useSnapshot)
      Specified by:
      getTileEntities in interface Chunk
    • getWorld

      @NotNull public @NotNull World getWorld()
      Specified by:
      getWorld in interface Chunk
    • getBlock

      @NotNull public @NotNull Block getBlock(int x, int y, int z)
      Specified by:
      getBlock in interface Chunk
    • getBlock

      @NotNull public @NotNull Block getBlock(@NotNull @NotNull Coordinate coordinate)
      Gets a block at a Coordinate.
      Parameters:
      coordinate - The coordinate at which to get the block.
      Returns:
      The block at the provided coordinate.
    • getBlocks

      @NotNull public @NotNull List<Block> getBlocks()
      Gets all blocks in this chunk.
      Returns:
      A list of all blocks in this chunk.
    • getChunkSnapshot

      @NotNull public @NotNull ChunkSnapshot getChunkSnapshot()
      Specified by:
      getChunkSnapshot in interface Chunk
    • getChunkSnapshot

      @NotNull public @NotNull ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain)
      Specified by:
      getChunkSnapshot in interface Chunk
    • getChunkSnapshot

      @NotNull public @NotNull ChunkSnapshot getChunkSnapshot(boolean b, boolean b1, boolean b2, boolean b3)
      Specified by:
      getChunkSnapshot in interface Chunk
    • isEntitiesLoaded

      public boolean isEntitiesLoaded()
      Specified by:
      isEntitiesLoaded in interface Chunk
    • getEntities

      public Entity[] getEntities()
      Specified by:
      getEntities in interface Chunk
    • getTileEntities

      public BlockState[] getTileEntities()
      Specified by:
      getTileEntities in interface Chunk
    • isLoaded

      public boolean isLoaded()
      Specified by:
      isLoaded in interface Chunk
    • load

      public boolean load(boolean generate)
      Specified by:
      load in interface Chunk
    • load

      public boolean load()
      Specified by:
      load in interface Chunk
    • unload

      public boolean unload(boolean save)
      Specified by:
      unload in interface Chunk
    • unload

      public boolean unload()
      Specified by:
      unload in interface Chunk
    • setSlimeChunk

      public void setSlimeChunk(boolean isSlimeChunk)
      Sets the return value of isSlimeChunk().
      Parameters:
      isSlimeChunk - Whether this is a slime chunk.
    • isSlimeChunk

      public boolean isSlimeChunk()
      Specified by:
      isSlimeChunk in interface Chunk
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • isForceLoaded

      public boolean isForceLoaded()
      Specified by:
      isForceLoaded in interface Chunk
    • setForceLoaded

      public void setForceLoaded(boolean forced)
      Specified by:
      setForceLoaded in interface Chunk
    • addPluginChunkTicket

      public boolean addPluginChunkTicket(@NotNull @NotNull Plugin plugin)
      Specified by:
      addPluginChunkTicket in interface Chunk
    • removePluginChunkTicket

      public boolean removePluginChunkTicket(@NotNull @NotNull Plugin plugin)
      Specified by:
      removePluginChunkTicket in interface Chunk
    • getPluginChunkTickets

      @NotNull public @NotNull Collection<Plugin> getPluginChunkTickets()
      Specified by:
      getPluginChunkTickets in interface Chunk
    • getInhabitedTime

      public long getInhabitedTime()
      Specified by:
      getInhabitedTime in interface Chunk
    • setInhabitedTime

      public void setInhabitedTime(long ticks)
      Specified by:
      setInhabitedTime in interface Chunk
    • contains

      public boolean contains(@NotNull @NotNull BlockData block)
      Specified by:
      contains in interface Chunk
    • contains

      public boolean contains(@NotNull @NotNull Biome biome)
      Specified by:
      contains in interface Chunk
    • getLoadLevel

      @NotNull public @NotNull Chunk.LoadLevel getLoadLevel()
      Specified by:
      getLoadLevel in interface Chunk
    • getStructures

      @NotNull public @NotNull Collection<GeneratedStructure> getStructures()
      Specified by:
      getStructures in interface Chunk
    • getStructures

      @NotNull public @NotNull Collection<GeneratedStructure> getStructures(@NotNull @NotNull Structure structure)
      Specified by:
      getStructures in interface Chunk
    • getPersistentDataContainer

      @NotNull public @NotNull PersistentDataContainer getPersistentDataContainer()
      Specified by:
      getPersistentDataContainer in interface PersistentDataHolder