Package be.seeseemelk.mockbukkit
Class ChunkMock
java.lang.Object
be.seeseemelk.mockbukkit.ChunkMock
- All Implemented Interfaces:
Chunk
,PersistentDataHolder
Mock implementation of a
Chunk
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.Chunk
Chunk.LoadLevel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addPluginChunkTicket
(@NotNull Plugin plugin) boolean
boolean
boolean
@NotNull Block
getBlock
(int x, int y, int z) @NotNull Block
getBlock
(@NotNull Coordinate coordinate) Gets a block at aCoordinate
.Gets all blocks in this chunk.@NotNull ChunkSnapshot
@NotNull ChunkSnapshot
getChunkSnapshot
(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) @NotNull ChunkSnapshot
getChunkSnapshot
(boolean b, boolean b1, boolean b2, boolean b3) Entity[]
long
@NotNull Chunk.LoadLevel
@NotNull PersistentDataContainer
@NotNull Collection<Plugin>
@NotNull Collection<GeneratedStructure>
@NotNull Collection<GeneratedStructure>
getStructures
(@NotNull Structure structure) @NotNull BlockState[]
getTileEntities
(boolean useSnapshot) @NotNull Collection<BlockState>
getTileEntities
(@NotNull Predicate<? super Block> blockPredicate, boolean useSnapshot) @NotNull World
getWorld()
int
getX()
int
getZ()
int
hashCode()
boolean
boolean
boolean
boolean
isLoaded()
boolean
boolean
load()
boolean
load
(boolean generate) boolean
removePluginChunkTicket
(@NotNull Plugin plugin) void
setForceLoaded
(boolean forced) void
setInhabitedTime
(long ticks) void
setSlimeChunk
(boolean isSlimeChunk) Sets the return value ofisSlimeChunk()
.boolean
unload()
boolean
unload
(boolean save) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bukkit.Chunk
getChunkKey
-
Constructor Details
-
ChunkMock
Constructs a newChunkMock
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() -
getZ
public int getZ() -
isGenerated
public boolean isGenerated()- Specified by:
isGenerated
in interfaceChunk
-
getTileEntities
- Specified by:
getTileEntities
in interfaceChunk
-
getTileEntities
@NotNull public @NotNull Collection<BlockState> getTileEntities(@NotNull @NotNull Predicate<? super Block> blockPredicate, boolean useSnapshot) - Specified by:
getTileEntities
in interfaceChunk
-
getWorld
-
getBlock
-
getBlock
Gets a block at aCoordinate
.- Parameters:
coordinate
- The coordinate at which to get the block.- Returns:
- The block at the provided coordinate.
-
getBlocks
Gets all blocks in this chunk.- Returns:
- A list of all blocks in this chunk.
-
getChunkSnapshot
- Specified by:
getChunkSnapshot
in interfaceChunk
-
getChunkSnapshot
@NotNull public @NotNull ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) - Specified by:
getChunkSnapshot
in interfaceChunk
-
getChunkSnapshot
@NotNull public @NotNull ChunkSnapshot getChunkSnapshot(boolean b, boolean b1, boolean b2, boolean b3) - Specified by:
getChunkSnapshot
in interfaceChunk
-
isEntitiesLoaded
public boolean isEntitiesLoaded()- Specified by:
isEntitiesLoaded
in interfaceChunk
-
getEntities
- Specified by:
getEntities
in interfaceChunk
-
getTileEntities
- Specified by:
getTileEntities
in interfaceChunk
-
isLoaded
public boolean isLoaded() -
load
public boolean load(boolean generate) -
load
public boolean load() -
unload
public boolean unload(boolean save) -
unload
public boolean unload() -
setSlimeChunk
public void setSlimeChunk(boolean isSlimeChunk) Sets the return value ofisSlimeChunk()
.- Parameters:
isSlimeChunk
- Whether this is a slime chunk.
-
isSlimeChunk
public boolean isSlimeChunk()- Specified by:
isSlimeChunk
in interfaceChunk
-
hashCode
public int hashCode() -
equals
-
isForceLoaded
public boolean isForceLoaded()- Specified by:
isForceLoaded
in interfaceChunk
-
setForceLoaded
public void setForceLoaded(boolean forced) - Specified by:
setForceLoaded
in interfaceChunk
-
addPluginChunkTicket
- Specified by:
addPluginChunkTicket
in interfaceChunk
-
removePluginChunkTicket
- Specified by:
removePluginChunkTicket
in interfaceChunk
-
getPluginChunkTickets
- Specified by:
getPluginChunkTickets
in interfaceChunk
-
getInhabitedTime
public long getInhabitedTime()- Specified by:
getInhabitedTime
in interfaceChunk
-
setInhabitedTime
public void setInhabitedTime(long ticks) - Specified by:
setInhabitedTime
in interfaceChunk
-
contains
-
contains
-
getLoadLevel
- Specified by:
getLoadLevel
in interfaceChunk
-
getStructures
- Specified by:
getStructures
in interfaceChunk
-
getStructures
@NotNull public @NotNull Collection<GeneratedStructure> getStructures(@NotNull @NotNull Structure structure) - Specified by:
getStructures
in interfaceChunk
-
getPersistentDataContainer
- Specified by:
getPersistentDataContainer
in interfacePersistentDataHolder
-