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
.@NotNull ChunkSnapshot
@NotNull ChunkSnapshot
getChunkSnapshot
(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) Entity[]
long
@NotNull Chunk.LoadLevel
@NotNull PersistentDataContainer
@NotNull Collection<Plugin>
@NotNull BlockState[]
getTileEntities
(boolean useSnapshot) @NotNull Collection<BlockState>
getTileEntities
(@NotNull Predicate<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) 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() -
getTileEntities
@NotNull public @NotNull Collection<BlockState> getTileEntities(@NotNull @NotNull Predicate<Block> blockPredicate, boolean useSnapshot) - Specified by:
getTileEntities
in interfaceChunk
-
isGenerated
public boolean isGenerated()- Specified by:
isGenerated
in interfaceChunk
-
getTileEntities
- 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.
-
getChunkSnapshot
- Specified by:
getChunkSnapshot
in interfaceChunk
-
getChunkSnapshot
@NotNull public @NotNull ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) - 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() -
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
-
getPersistentDataContainer
- Specified by:
getPersistentDataContainer
in interfacePersistentDataHolder
-