Package be.seeseemelk.mockbukkit
Class WorldMock
java.lang.Object
be.seeseemelk.mockbukkit.WorldMock
- All Implemented Interfaces:
PersistentDataViewHolder,FeatureFlagSetHolder,net.kyori.adventure.audience.Audience,net.kyori.adventure.audience.ForwardingAudience,net.kyori.adventure.key.Keyed,net.kyori.adventure.pointer.Pointered,WorldInfo,Keyed,Metadatable,PersistentDataHolder,PluginMessageRecipient,RegionAccessor,World
Mock implementation of a
World.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.kyori.adventure.audience.ForwardingAudience
net.kyori.adventure.audience.ForwardingAudience.SingleNested classes/interfaces inherited from interface org.bukkit.World
World.ChunkLoadCallback, World.Environment, World.Spigot -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new mock world with a height of 128 and will spawn grass until ayof 4.WorldMock(@NotNull WorldCreator creator) Creates a new mock world.Creates a new mock world with a height of 128.Creates a new mock world with a specific height from 0.Creates a new mock world.Creates a new mock world with a specific height from 0.Creates a new mock world. -
Method Summary
Modifier and TypeMethodDescription<T extends Entity>
TaddEntity(T t) booleanaddPluginChunkTicket(int x, int z, Plugin plugin) booleanvoidclearMetadata(Plugin plugin) @NotNull BlockMockcreateBlock(@NotNull Coordinate c) Makes sure that a certain block exists on the coordinate.<T extends Entity>
TcreateEntity(@NotNull Location location, @NotNull Class<T> aClass) booleancreateExplosion(double x, double y, double z, float power) booleancreateExplosion(double x, double y, double z, float power, boolean setFire) booleancreateExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) booleancreateExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) booleancreateExplosion(@NotNull Location loc, float power) booleancreateExplosion(@NotNull Location loc, float power, boolean setFire) booleancreateExplosion(@Nullable Entity source, @NotNull Location loc, float power, boolean setFire, boolean breakBlocks) booleancreateExplosion(Entity source, @NotNull Location loc, float power, boolean setFire, boolean breakBlocks, boolean excludeSourceFromDamage) booleancreateExplosion(Location loc, float power, boolean setFire, boolean breakBlocks) booleancreateExplosion(Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) @NotNull Item@NotNull ItemdropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function) @NotNull ItemdropItemNaturally(@NotNull Location loc, @NotNull ItemStack item) @NotNull ItemdropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function) @Nullable LocationfindLightningRod(@NotNull Location location) @Nullable LocationfindLightningTarget(@NotNull Location location) booleangenerateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type) booleangenerateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Consumer<? super BlockState> stateConsumer) booleangenerateTree(Location location, Random random, TreeType type, Predicate<? super BlockState> statePredicate) booleangenerateTree(Location location, TreeType type) booleangenerateTree(Location loc, TreeType type, BlockChangeDelegate delegate) Deprecated.booleanbooleanintDeprecated.intDeprecated.@NotNull BiomegetBiome(int x, int z) Deprecated.@NotNull BiomegetBiome(int x, int y, int z) @NotNull Biomeprotected @NotNull Map<Coordinate, Biome> Gets a map of what biome is at each coordinate.@Nullable BiomeProvider@NotNull BlockMockgetBlockAt(int x, int y, int z) @NotNull BlockMockgetBlockAt(@NotNull Coordinate coordinate) Gets the block at a coordinate.@NotNull BlockMockgetBlockAt(@NotNull Location location) @NotNull BlockgetBlockAtKey(long key) Deprecated.@NotNull BlockDatagetBlockData(int x, int y, int z) @NotNull BlockDatagetBlockData(@NotNull Location location) @NotNull BlockStategetBlockState(int x, int y, int z) @NotNull BlockStategetBlockState(@NotNull Location location) @NotNull ChunkMockgetChunkAt(int x, int z) @NotNull ChunkMockgetChunkAt(int x, int z, boolean generate) @NotNull ChunkMockgetChunkAt(@NotNull ChunkCoordinate coordinate) Gets the chunk at a specific chunk coordinate.@NotNull ChunkgetChunkAt(@NotNull Location location) @NotNull ChunkgetChunkAt(@NotNull Block block) @NotNull CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) intint@NotNull BiomegetComputedBiome(int x, int y, int z) double@NotNull Difficulty@NotNull ChunkSnapshotMockgetEmptyChunkSnapshot(int chunkX, int chunkZ, boolean includeBiome, boolean includeBiomeTempRain) <T extends Entity>
@NotNull Collection<T> getEntitiesByClass(@NotNull Class<T> cls) final <T extends Entity>
@NotNull Collection<T> getEntitiesByClass(Class<T> @NotNull ... classes) @NotNull Collection<Entity> getEntitiesByClasses(Class<?> @NotNull ... classes) @Nullable Entityint@NotNull World.Environment@NotNull Set<FeatureFlag> @NotNull FluidDatagetFluidData(int i, int i1, int i2) @NotNull Collection<Chunk> long<T> TgetGameRuleDefault(GameRule<T> rule) String @NotNull []getGameRuleValue(@Nullable String rule) Deprecated.<T> TgetGameRuleValue(@NotNull GameRule<T> rule) long@NotNull BlockgetHighestBlockAt(int x, int z) @NotNull BlockgetHighestBlockAt(int x, int z, @NotNull HeightMap heightMap) @NotNull BlockgetHighestBlockAt(Location location) @NotNull BlockgetHighestBlockAt(Location location, @NotNull HeightMap heightMap) intgetHighestBlockYAt(int x, int z) intgetHighestBlockYAt(int x, int z, @NotNull HeightMap heightMap) intgetHighestBlockYAt(@NotNull Location location) intgetHighestBlockYAt(Location location, @NotNull HeightMap heightMap) doublegetHumidity(int x, int z) Deprecated.doublegetHumidity(int x, int y, int z) @NotNull Collection<Material> @NotNull Collection<Chunk> getIntersectingChunks(@NotNull BoundingBox box) boolean@NotNull NamespacedKeygetKey()@NotNull List<LivingEntity> Chunk @NotNull []@NotNull LocationgetLocationAtKey(long key) intint@NotNull List<MetadataValue> getMetadata(@NotNull String metadataKey) intintDeprecated.@NotNull MoonPhase@NotNull StringgetName()@NotNull Collection<Entity> getNearbyEntities(Location location, double x, double y, double z) @NotNull Collection<Entity> getNearbyEntities(Location location, double x, double y, double z, Predicate<? super Entity> filter) @NotNull Collection<Entity> getNearbyEntities(BoundingBox boundingBox) @NotNull Collection<Entity> getNearbyEntities(BoundingBox boundingBox, Predicate<? super Entity> filter) intDeprecated.@NotNull PersistentDataContainerint@NotNull Collection<Player> getPlayersSeeingChunk(int i, int i1) @NotNull Collection<Player> getPlayersSeeingChunk(@NotNull Chunk chunk) @NotNull Map<Plugin, Collection<Chunk>> @NotNull Collection<Plugin> getPluginChunkTickets(int x, int z) @NotNull List<BlockPopulator> booleangetPVP()@Nullable RaidgetRaid(int id) getRaids()intlonggetSeed()intintintgetSpawnLimit(@NotNull SpawnCategory spawnCategory) final intgetSpawnLimitUnsafe(SpawnCategory spawnCategory) @NotNull Location@NotNull Collection<GeneratedStructure> getStructures(int x, int z) @NotNull Collection<GeneratedStructure> getStructures(int x, int z, @NotNull Structure structure) doublegetTemperature(int x, int z) Deprecated.doublegetTemperature(int x, int y, int z) intintlongDeprecated.longDeprecated.longDeprecated.longgetTicksPerSpawns(@NotNull SpawnCategory spawnCategory) longDeprecated.longDeprecated.longDeprecated.intlonggetTime()@NotNull MaterialgetType(int x, int y, int z) @NotNull Material@NotNull UUIDgetUID()intfloatdoubleintDeprecated.intDeprecated.intDeprecated.int@NotNull WorldBorderMock@NotNull FileDeprecated.booleanbooleanhasCollisionsIn(@NotNull BoundingBox boundingBox) booleanhasMetadata(@NotNull String metadataKey) booleanhasRaids()booleanbooleanhasStorm()booleanhasStructureAt(@NotNull Position position, @NotNull Structure structure) booleanbooleanbooleanisChunkForceLoaded(int x, int z) booleanisChunkGenerated(int x, int z) booleanisChunkInUse(int x, int z) Deprecated.booleanisChunkLoaded(int x, int z) booleanisChunkLoaded(Chunk chunk) booleanbooleanbooleanbooleanisGameRule(@Nullable String rule) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanlineOfSightExists(@NotNull Location from, @NotNull Location to) voidloadChunk(int x, int z) booleanloadChunk(int x, int z, boolean generate) void@Nullable BiomeSearchResultlocateNearestBiome(@NotNull Location origin, int radius, int horizontalInterval, int verticalInterval, @NotNull Biome... biomes) @Nullable BiomeSearchResultlocateNearestBiome(@NotNull Location origin, int radius, @NotNull Biome... biomes) @Nullable LocationlocateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius) @Nullable LocationlocateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius, int step) locateNearestRaid(Location location, int radius) @Nullable StructureSearchResultlocateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored) @Nullable StructureSearchResultlocateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored) locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored) Deprecated.voidplayEffect(@NotNull Location location, @NotNull Effect effect, int data) voidplayEffect(@NotNull Location location, @NotNull Effect effect, int data, int radius) <T> voidplayEffect(@NotNull Location location, @NotNull Effect effect, T data) <T> voidplayEffect(@NotNull Location location, @NotNull Effect effect, T data, int radius) voidplayNote(@NotNull Location loc, @NotNull Instrument instrument, @NotNull Note note) voidvoidplaySound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) voidplaySound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed) voidvoidplaySound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) voidplaySound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed) voidvoidplaySound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) voidplaySound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed) voidplaySound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed) voidplaySound(@Nullable Entity entity, @Nullable Sound sound, @Nullable SoundCategory category, float volume, float pitch) void@Nullable RayTraceResultrayTrace(@NotNull Position start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<? super Entity> filter, @Nullable Predicate<? super Block> canCollide) rayTrace(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate<? super Entity> filter) @Nullable RayTraceResultrayTraceBlocks(@NotNull Position start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, @Nullable Predicate<? super Block> canCollide) rayTraceBlocks(Location start, Vector direction, double maxDistance) rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) @Nullable RayTraceResultrayTraceEntities(@NotNull Position start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<? super Entity> filter) rayTraceEntities(Location start, Vector direction, double maxDistance) rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize) rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate<? super Entity> filter) rayTraceEntities(Location start, Vector direction, double maxDistance, Predicate<? super Entity> filter) booleanrefreshChunk(int x, int z) Deprecated.booleanregenerateChunk(int x, int z) Deprecated.voidremoveMetadata(@NotNull String metadataKey, @NotNull Plugin owningPlugin) booleanremovePluginChunkTicket(int x, int z, Plugin plugin) voidremovePluginChunkTickets(Plugin plugin) voidsave()voidsendGameEvent(@Nullable Entity sourceEntity, @NotNull GameEvent gameEvent, @NotNull Vector position) voidsendPluginMessage(@NotNull Plugin source, @NotNull String channel, byte[] message) voidsetAmbientSpawnLimit(int limit) Deprecated.voidsetAnimalSpawnLimit(int limit) Deprecated.voidsetAutoSave(boolean value) voidvoidDeprecated.voidvoidsetBlockData(int x, int y, int z, @NotNull BlockData blockData) voidsetBlockData(@NotNull Location location, @NotNull BlockData blockData) voidsetChunkForceLoaded(int x, int z, boolean forced) voidsetClearWeatherDuration(int duration) voidsetDifficulty(@NotNull Difficulty difficulty) voidsetEnvironment(World.Environment environment) Set a new environment type for this world.voidsetFullTime(long time) <T> booleansetGameRule(GameRule<T> rule, T newValue) booleansetGameRuleValue(@Nullable String rule, @NotNull String value) Deprecated.voidsetHardcore(boolean hardcore) voidsetKeepSpawnInMemory(boolean keepLoaded) voidsetMetadata(@NotNull String metadataKey, @NotNull MetadataValue newMetadataValue) voidsetMonsterSpawnLimit(int limit) Deprecated.voidGive a new name to this world.voidsetNoTickViewDistance(int viewDistance) Deprecated.voidsetPVP(boolean pvp) voidsetSendViewDistance(int viewDistance) voidsetSimulationDistance(int simulationDistance) voidsetSpawnFlags(boolean allowMonsters, boolean allowAnimals) voidsetSpawnLimit(@NotNull SpawnCategory spawnCategory, int limit) booleansetSpawnLocation(int x, int y, int z) booleansetSpawnLocation(int x, int y, int z, float angle) booleansetSpawnLocation(@NotNull Location location) voidsetStorm(boolean hasStorm) voidsetThunderDuration(int duration) voidsetThundering(boolean thundering) voidsetTicksPerAmbientSpawns(int ticksPerAmbientSpawns) Deprecated.voidsetTicksPerAnimalSpawns(int ticksPerAnimalSpawns) Deprecated.voidsetTicksPerMonsterSpawns(int ticksPerMonsterSpawns) Deprecated.voidsetTicksPerSpawns(@NotNull SpawnCategory spawnCategory, int ticksPerCategorySpawn) voidsetTicksPerWaterAmbientSpawns(int ticksPerAmbientSpawns) Deprecated.voidsetTicksPerWaterSpawns(int ticksPerWaterSpawns) Deprecated.voidsetTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) Deprecated.voidsetTime(long time) voidvoidvoidsetViewDistance(int viewDistance) voidsetVoidDamageAmount(float v) voidsetVoidDamageEnabled(boolean b) voidsetVoidDamageMinBuildHeightOffset(double v) voidsetWaterAmbientSpawnLimit(int limit) Deprecated.voidsetWaterAnimalSpawnLimit(int limit) Deprecated.voidsetWaterUndergroundCreatureSpawnLimit(int limit) Deprecated.voidsetWeatherDuration(int duration) <T extends Entity>
T<T extends Entity>
Tspawn(@NotNull Location location, @NotNull Class<T> clazz, boolean randomizeData, @Nullable Consumer<? super T> function) <T extends Entity>
Tspawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<? super T> function, @NotNull CreatureSpawnEvent.SpawnReason reason) <T extends LivingEntity>
Tspawn(@NotNull Location location, @NotNull Class<T> clazz, @NotNull CreatureSpawnEvent.SpawnReason spawnReason, boolean randomizeData, @Nullable Consumer<? super T> function) <T extends Entity>
Tspawn(@Nullable Location location, @Nullable Class<T> clazz, @Nullable Consumer<? super T> function, @NotNull CreatureSpawnEvent.SpawnReason reason, boolean randomizeData, boolean callSpawnEvent) Spawns an entity.@NotNull ArrowspawnArrow(Location location, Vector direction, float speed, float spread) <T extends AbstractArrow>
TspawnArrow(Location location, Vector direction, float speed, float spread, Class<T> clazz) @NotNull EntityspawnEntity(@NotNull Location loc, @NotNull EntityType type) @NotNull EntityspawnEntity(@NotNull Location loc, @NotNull EntityType type, boolean randomizeData) @NotNull FallingBlockspawnFallingBlock(@NotNull Location location, @NotNull Material material, byte data) Deprecated.@NotNull FallingBlockspawnFallingBlock(@NotNull Location location, @NotNull BlockData data) @NotNull FallingBlockspawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) <T> voidspawnParticle(@NotNull Particle particle, @Nullable List<Player> receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) voidspawnParticle(Particle particle, double x, double y, double z, int count) voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) <T> voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) <T> voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) <T> voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) <T> voidspawnParticle(Particle particle, double x, double y, double z, int count, T data) voidspawnParticle(Particle particle, Location location, int count) voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) <T> voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) <T> voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) <T> voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) <T> voidspawnParticle(Particle particle, Location location, int count, T data) @NotNull World.Spigotspigot()@NotNull LightningStrikestrikeLightning(Location loc) @NotNull LightningStrikebooleanunloadChunk(int x, int z) booleanunloadChunk(int x, int z, boolean save) booleanunloadChunk(@NotNull Chunk chunk) booleanunloadChunkRequest(int x, int z) @NotNull BiomeProviderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.kyori.adventure.audience.Audience
deleteMessage, openBook, removeResourcePacks, removeResourcePacks, removeResourcePacks, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, showTitle, stopSoundMethods inherited from interface io.papermc.paper.world.flag.FeatureFlagSetHolder
isEnabledMethods inherited from interface net.kyori.adventure.audience.ForwardingAudience
clearResourcePacks, clearTitle, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, playSound, playSound, playSound, pointers, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendTitlePart, showBossBar, stopSoundMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFromMethods inherited from interface org.bukkit.RegionAccessor
getFluidData, getFluidData, spawn, spawn, spawn, spawnEntity, spawnEntityMethods inherited from interface org.bukkit.World
audiences, createExplosion, createExplosion, createExplosion, createExplosion, createExplosion, getChunkAt, getChunkAt, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsync, getChunkAtAsyncUrgently, getChunkAtAsyncUrgently, getChunkAtAsyncUrgently, getChunkAtAsyncUrgently, getChunkAtAsyncUrgently, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyEntitiesByType, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyLivingEntities, getNearbyPlayers, getNearbyPlayers, getNearbyPlayers, getNearbyPlayers, getNearbyPlayers, getNearbyPlayers, isChunkGenerated, isPositionLoaded, spawnParticle
-
Constructor Details
-
WorldMock
Creates a new mock world.- Parameters:
defaultBlock- The block that is spawned at locations 1 tograssHeightminHeight- The minimum height of the world.maxHeight- The maximum height of the world.grassHeight- The lastyat whichdefaultBlockwill spawn.
-
WorldMock
public WorldMock(Material defaultBlock, Biome defaultBiome, int minHeight, int maxHeight, int grassHeight) Creates a new mock world.- Parameters:
defaultBlock- The block that is spawned at locations 1 tograssHeightdefaultBiome- The biome that every block will be in by default.minHeight- The minimum height of the world.maxHeight- The maximum height of the world.grassHeight- The lastyat whichdefaultBlockwill spawn.
-
WorldMock
Creates a new mock world.- Parameters:
creator- TheWorldCreatorto use to create the world.
-
WorldMock
Creates a new mock world with a specific height from 0.- Parameters:
defaultBlock- The block that is spawned at locations 1 tograssHeightdefaultBiome- The biome that every block will be in by default.maxHeight- The maximum height of the world.grassHeight- The lastyat whichdefaultBlockwill spawn.
-
WorldMock
Creates a new mock world with a specific height from 0.- Parameters:
defaultBlock- The block that is spawned at locations 1 tograssHeightmaxHeight- The maximum height of the world.grassHeight- The lastyat whichdefaultBlockwill spawn.
-
WorldMock
Creates a new mock world with a height of 128.- Parameters:
defaultBlock- The block that is spawned at locations 1 tograssHeightgrassHeight- The lastyat whichdefaultBlockwill spawn.
-
WorldMock
public WorldMock()Creates a new mock world with a height of 128 and will spawn grass until ayof 4.
-
-
Method Details
-
createBlock
Makes sure that a certain block exists on the coordinate. Returns that block.- Parameters:
c- Creates a block on the given coordinate.- Returns:
- A newly created block at that location.
-
isVoidDamageEnabled
public boolean isVoidDamageEnabled()- Specified by:
isVoidDamageEnabledin interfaceWorld
-
setVoidDamageEnabled
public void setVoidDamageEnabled(boolean b) - Specified by:
setVoidDamageEnabledin interfaceWorld
-
getVoidDamageAmount
public float getVoidDamageAmount()- Specified by:
getVoidDamageAmountin interfaceWorld
-
setVoidDamageAmount
public void setVoidDamageAmount(float v) - Specified by:
setVoidDamageAmountin interfaceWorld
-
getVoidDamageMinBuildHeightOffset
public double getVoidDamageMinBuildHeightOffset()- Specified by:
getVoidDamageMinBuildHeightOffsetin interfaceWorld
-
setVoidDamageMinBuildHeightOffset
public void setVoidDamageMinBuildHeightOffset(double v) - Specified by:
setVoidDamageMinBuildHeightOffsetin interfaceWorld
-
getEntityCount
public int getEntityCount()- Specified by:
getEntityCountin interfaceWorld
-
getTileEntityCount
public int getTileEntityCount()- Specified by:
getTileEntityCountin interfaceWorld
-
getTickableTileEntityCount
public int getTickableTileEntityCount()- Specified by:
getTickableTileEntityCountin interfaceWorld
-
getChunkCount
public int getChunkCount()- Specified by:
getChunkCountin interfaceWorld
-
getPlayerCount
public int getPlayerCount()- Specified by:
getPlayerCountin interfaceWorld
-
hasStructureAt
public boolean hasStructureAt(@NotNull @NotNull Position position, @NotNull @NotNull Structure structure) - Specified by:
hasStructureAtin interfaceWorld
-
getMoonPhase
- Specified by:
getMoonPhasein interfaceRegionAccessor
-
lineOfSightExists
- Specified by:
lineOfSightExistsin interfaceRegionAccessor
-
hasCollisionsIn
- Specified by:
hasCollisionsInin interfaceRegionAccessor
-
getBlockAt
- Specified by:
getBlockAtin interfaceWorld
-
getBlockAt
Gets the block at a coordinate.- Parameters:
coordinate- The coordinate at which to get the block.- Returns:
- The block.
-
getBlockAt
- Specified by:
getBlockAtin interfaceWorld
-
getBlockAtKey
Deprecated.- Specified by:
getBlockAtKeyin interfaceWorld
-
getLocationAtKey
- Specified by:
getLocationAtKeyin interfaceWorld
-
getName
-
setName
Give a new name to this world.- Parameters:
name- The new name of this world.
-
getUID
-
getSpawnLocation
- Specified by:
getSpawnLocationin interfaceWorld
-
setSpawnLocation
- Specified by:
setSpawnLocationin interfaceWorld
-
setSpawnLocation
public boolean setSpawnLocation(int x, int y, int z) - Specified by:
setSpawnLocationin interfaceWorld
-
getEntities
- Specified by:
getEntitiesin interfaceRegionAccessor- Specified by:
getEntitiesin interfaceWorld
-
getChunkAt
- Specified by:
getChunkAtin interfaceWorld
-
getChunkAt
- Specified by:
getChunkAtin interfaceWorld
-
getChunkAt
Gets the chunk at a specific chunk coordinate.If there is no chunk recorded at the location, one will be created.
- Parameters:
coordinate- The coordinate at which to get the chunk.- Returns:
- The chunk at the location.
-
sendPluginMessage
public void sendPluginMessage(@NotNull @NotNull Plugin source, @NotNull @NotNull String channel, byte[] message) - Specified by:
sendPluginMessagein interfacePluginMessageRecipient
-
getListeningPluginChannels
- Specified by:
getListeningPluginChannelsin interfacePluginMessageRecipient
-
setMetadata
public void setMetadata(@NotNull @NotNull String metadataKey, @NotNull @NotNull MetadataValue newMetadataValue) - Specified by:
setMetadatain interfaceMetadatable
-
getMetadata
- Specified by:
getMetadatain interfaceMetadatable
-
hasMetadata
- Specified by:
hasMetadatain interfaceMetadatable
-
removeMetadata
public void removeMetadata(@NotNull @NotNull String metadataKey, @NotNull @NotNull Plugin owningPlugin) - Specified by:
removeMetadatain interfaceMetadatable
-
clearMetadata
- See Also:
-
getHighestBlockYAt
public int getHighestBlockYAt(int x, int z) - Specified by:
getHighestBlockYAtin interfaceRegionAccessor
-
getHighestBlockYAt
- Specified by:
getHighestBlockYAtin interfaceRegionAccessor
-
getHighestBlockAt
- Specified by:
getHighestBlockAtin interfaceWorld
-
getHighestBlockAt
- Specified by:
getHighestBlockAtin interfaceWorld
-
getChunkAt
- Specified by:
getChunkAtin interfaceWorld
-
getChunkAt
- Specified by:
getChunkAtin interfaceWorld
-
isChunkLoaded
- Specified by:
isChunkLoadedin interfaceWorld
-
getLoadedChunks
- Specified by:
getLoadedChunksin interfaceWorld
-
loadChunk
-
isChunkLoaded
public boolean isChunkLoaded(int x, int z) - Specified by:
isChunkLoadedin interfaceWorld
-
isChunkInUse
Deprecated.- Specified by:
isChunkInUsein interfaceWorld
-
loadChunk
public void loadChunk(int x, int z) -
loadChunk
public boolean loadChunk(int x, int z, boolean generate) -
unloadChunk
- Specified by:
unloadChunkin interfaceWorld
-
unloadChunk
public boolean unloadChunk(int x, int z) - Specified by:
unloadChunkin interfaceWorld
-
unloadChunk
public boolean unloadChunk(int x, int z, boolean save) - Specified by:
unloadChunkin interfaceWorld
-
unloadChunkRequest
public boolean unloadChunkRequest(int x, int z) - Specified by:
unloadChunkRequestin interfaceWorld
-
regenerateChunk
Deprecated.- Specified by:
regenerateChunkin interfaceWorld
-
refreshChunk
Deprecated.- Specified by:
refreshChunkin interfaceWorld
-
getPlayersSeeingChunk
- Specified by:
getPlayersSeeingChunkin interfaceWorld
-
getPlayersSeeingChunk
- Specified by:
getPlayersSeeingChunkin interfaceWorld
-
dropItem
-
dropItem
-
dropItemNaturally
@NotNull public @NotNull Item dropItemNaturally(@NotNull @NotNull Location loc, @NotNull @NotNull ItemStack item) - Specified by:
dropItemNaturallyin interfaceWorld
-
dropItemNaturally
@NotNull public @NotNull Item dropItemNaturally(@NotNull @NotNull Location location, @NotNull @NotNull ItemStack item, @Nullable @Nullable Consumer<? super Item> function) - Specified by:
dropItemNaturallyin interfaceWorld
-
spawnArrow
@NotNull public @NotNull Arrow spawnArrow(Location location, Vector direction, float speed, float spread) - Specified by:
spawnArrowin interfaceWorld
-
generateTree
- Specified by:
generateTreein interfaceWorld
-
generateTree
@Deprecated(since="1.17") public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) Deprecated.- Specified by:
generateTreein interfaceWorld
-
generateTree
public boolean generateTree(Location location, Random random, TreeType type, Predicate<? super BlockState> statePredicate) - Specified by:
generateTreein interfaceRegionAccessor
-
spawn
@NotNull public <T extends Entity> T spawn(@NotNull @NotNull Location location, @NotNull @NotNull Class<T> clazz) throws IllegalArgumentException - Specified by:
spawnin interfaceRegionAccessor- Throws:
IllegalArgumentException
-
spawn
@NotNull public <T extends Entity> T spawn(@NotNull @NotNull Location location, @NotNull @NotNull Class<T> clazz, boolean randomizeData, @Nullable @Nullable Consumer<? super T> function) throws IllegalArgumentException - Specified by:
spawnin interfaceRegionAccessor- Throws:
IllegalArgumentException
-
spawn
@NotNull public <T extends Entity> T spawn(@NotNull @NotNull Location location, @NotNull @NotNull Class<T> clazz, @Nullable @Nullable Consumer<? super T> function, @NotNull CreatureSpawnEvent.SpawnReason reason) throws IllegalArgumentException - Specified by:
spawnin interfaceRegionAccessor- Throws:
IllegalArgumentException
-
spawn
@NotNull public <T extends Entity> T spawn(@Nullable @Nullable Location location, @Nullable @Nullable Class<T> clazz, @Nullable @Nullable Consumer<? super T> function, @NotNull CreatureSpawnEvent.SpawnReason reason, boolean randomizeData, boolean callSpawnEvent) Spawns an entity.- Type Parameters:
T- The entity type.- Parameters:
location- The location to spawn the entity at.clazz- The class of entity to spawn. This should be the class of the Bukkit interface, not the mock.function- A function to call once the entity has been spawned.reason- The reason for spawning the entity.randomizeData- Whether data should be randomized. Currently, does nothing.callSpawnEvent- Whether the entities spawn event should be called- Returns:
- The spawned entity.
-
spawnEntity
@NotNull public @NotNull Entity spawnEntity(@NotNull @NotNull Location loc, @NotNull @NotNull EntityType type) - Specified by:
spawnEntityin interfaceRegionAccessor
-
spawnEntity
@NotNull public @NotNull Entity spawnEntity(@NotNull @NotNull Location loc, @NotNull @NotNull EntityType type, boolean randomizeData) - Specified by:
spawnEntityin interfaceRegionAccessor
-
strikeLightning
- Specified by:
strikeLightningin interfaceWorld
-
strikeLightningEffect
- Specified by:
strikeLightningEffectin interfaceWorld
-
findLightningRod
- Specified by:
findLightningRodin interfaceWorld
-
findLightningTarget
- Specified by:
findLightningTargetin interfaceWorld
-
getLivingEntities
- Specified by:
getLivingEntitiesin interfaceRegionAccessor- Specified by:
getLivingEntitiesin interfaceWorld
-
getEntitiesByClass
@SafeVarargs @NotNull public final <T extends Entity> @NotNull Collection<T> getEntitiesByClass(Class<T> @NotNull ... classes) - Specified by:
getEntitiesByClassin interfaceWorld
-
getEntitiesByClass
@NotNull public <T extends Entity> @NotNull Collection<T> getEntitiesByClass(@NotNull @NotNull Class<T> cls) - Specified by:
getEntitiesByClassin interfaceRegionAccessor- Specified by:
getEntitiesByClassin interfaceWorld
-
getEntitiesByClasses
- Specified by:
getEntitiesByClassesin interfaceRegionAccessor- Specified by:
getEntitiesByClassesin interfaceWorld
-
createEntity
@NotNull public <T extends Entity> T createEntity(@NotNull @NotNull Location location, @NotNull @NotNull Class<T> aClass) - Specified by:
createEntityin interfaceRegionAccessor
-
getChunkAtAsync
@NotNull public @NotNull CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) - Specified by:
getChunkAtAsyncin interfaceWorld
-
getPlayers
- Specified by:
getPlayersin interfaceWorld
-
getNearbyEntities
@NotNull public @NotNull Collection<Entity> getNearbyEntities(Location location, double x, double y, double z) - Specified by:
getNearbyEntitiesin interfaceWorld
-
getEntity
-
getTime
public long getTime() -
setTime
public void setTime(long time) -
getFullTime
public long getFullTime()- Specified by:
getFullTimein interfaceWorld
-
setFullTime
public void setFullTime(long time) - Specified by:
setFullTimein interfaceWorld
-
isDayTime
public boolean isDayTime() -
hasStorm
public boolean hasStorm() -
setStorm
public void setStorm(boolean hasStorm) -
getWeatherDuration
public int getWeatherDuration()- Specified by:
getWeatherDurationin interfaceWorld
-
setWeatherDuration
public void setWeatherDuration(int duration) - Specified by:
setWeatherDurationin interfaceWorld
-
isThundering
public boolean isThundering()- Specified by:
isThunderingin interfaceWorld
-
setThundering
public void setThundering(boolean thundering) - Specified by:
setThunderingin interfaceWorld
-
getThunderDuration
public int getThunderDuration()- Specified by:
getThunderDurationin interfaceWorld
-
setThunderDuration
public void setThunderDuration(int duration) - Specified by:
setThunderDurationin interfaceWorld
-
isClearWeather
public boolean isClearWeather()- Specified by:
isClearWeatherin interfaceWorld
-
getClearWeatherDuration
public int getClearWeatherDuration()- Specified by:
getClearWeatherDurationin interfaceWorld
-
setClearWeatherDuration
public void setClearWeatherDuration(int duration) - Specified by:
setClearWeatherDurationin interfaceWorld
-
createExplosion
public boolean createExplosion(double x, double y, double z, float power) - Specified by:
createExplosionin interfaceWorld
-
createExplosion
public boolean createExplosion(double x, double y, double z, float power, boolean setFire) - Specified by:
createExplosionin interfaceWorld
-
createExplosion
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) - Specified by:
createExplosionin interfaceWorld
-
createExplosion
- Specified by:
createExplosionin interfaceWorld
-
createExplosion
- Specified by:
createExplosionin interfaceWorld
-
createExplosion
public boolean createExplosion(Entity source, @NotNull @NotNull Location loc, float power, boolean setFire, boolean breakBlocks, boolean excludeSourceFromDamage) - Specified by:
createExplosionin interfaceWorld
-
createExplosion
public boolean createExplosion(@Nullable @Nullable Entity source, @NotNull @NotNull Location loc, float power, boolean setFire, boolean breakBlocks) - Specified by:
createExplosionin interfaceWorld
-
getEnvironment
- Specified by:
getEnvironmentin interfaceWorldInfo
-
setEnvironment
Set a new environment type for this world.- Parameters:
environment- The world environnement type.
-
getSeed
public long getSeed() -
getPVP
public boolean getPVP() -
setPVP
public void setPVP(boolean pvp) -
getGenerator
- Specified by:
getGeneratorin interfaceWorld
-
getBiomeProvider
- Specified by:
getBiomeProviderin interfaceWorld
-
save
public void save() -
getPopulators
- Specified by:
getPopulatorsin interfaceWorld
-
spawn
@NotNull public <T extends LivingEntity> T spawn(@NotNull @NotNull Location location, @NotNull @NotNull Class<T> clazz, @NotNull CreatureSpawnEvent.SpawnReason spawnReason, boolean randomizeData, @Nullable @Nullable Consumer<? super T> function) throws IllegalArgumentException - Specified by:
spawnin interfaceWorld- Throws:
IllegalArgumentException
-
spawnFallingBlock
@NotNull public @NotNull FallingBlock spawnFallingBlock(@NotNull @NotNull Location location, @NotNull @NotNull MaterialData data) throws IllegalArgumentException - Specified by:
spawnFallingBlockin interfaceWorld- Throws:
IllegalArgumentException
-
spawnFallingBlock
@Deprecated(since="1.7.5") @NotNull public @NotNull FallingBlock spawnFallingBlock(@NotNull @NotNull Location location, @NotNull @NotNull Material material, byte data) throws IllegalArgumentException Deprecated.- Specified by:
spawnFallingBlockin interfaceWorld- Throws:
IllegalArgumentException
-
spawnFallingBlock
@NotNull public @NotNull FallingBlock spawnFallingBlock(@NotNull @NotNull Location location, @NotNull @NotNull BlockData data) throws IllegalArgumentException - Specified by:
spawnFallingBlockin interfaceWorld- Throws:
IllegalArgumentException
-
playEffect
public void playEffect(@NotNull @NotNull Location location, @NotNull @NotNull Effect effect, int data) - Specified by:
playEffectin interfaceWorld
-
playEffect
public void playEffect(@NotNull @NotNull Location location, @NotNull @NotNull Effect effect, int data, int radius) - Specified by:
playEffectin interfaceWorld
-
playEffect
public <T> void playEffect(@NotNull @NotNull Location location, @NotNull @NotNull Effect effect, T data) - Specified by:
playEffectin interfaceWorld
-
playEffect
public <T> void playEffect(@NotNull @NotNull Location location, @NotNull @NotNull Effect effect, @Nullable T data, int radius) - Specified by:
playEffectin interfaceWorld
-
getEmptyChunkSnapshot
@NotNull public @NotNull ChunkSnapshotMock getEmptyChunkSnapshot(int chunkX, int chunkZ, boolean includeBiome, boolean includeBiomeTempRain) - Specified by:
getEmptyChunkSnapshotin interfaceWorld
-
setSpawnFlags
public void setSpawnFlags(boolean allowMonsters, boolean allowAnimals) - Specified by:
setSpawnFlagsin interfaceWorld
-
getAllowAnimals
public boolean getAllowAnimals()- Specified by:
getAllowAnimalsin interfaceWorld
-
getAllowMonsters
public boolean getAllowMonsters()- Specified by:
getAllowMonstersin interfaceWorld
-
getBiome
Deprecated. -
setBiome
Deprecated. -
getTemperature
Deprecated.- Specified by:
getTemperaturein interfaceWorld
-
getHumidity
Deprecated.- Specified by:
getHumidityin interfaceWorld
-
getMinHeight
public int getMinHeight()- Specified by:
getMinHeightin interfaceWorldInfo
-
getMaxHeight
public int getMaxHeight()- Specified by:
getMaxHeightin interfaceWorldInfo
-
vanillaBiomeProvider
- Specified by:
vanillaBiomeProviderin interfaceWorldInfo
-
getSeaLevel
public int getSeaLevel()- Specified by:
getSeaLevelin interfaceWorld
-
getKeepSpawnInMemory
public boolean getKeepSpawnInMemory()- Specified by:
getKeepSpawnInMemoryin interfaceWorld
-
setKeepSpawnInMemory
public void setKeepSpawnInMemory(boolean keepLoaded) - Specified by:
setKeepSpawnInMemoryin interfaceWorld
-
isAutoSave
public boolean isAutoSave()- Specified by:
isAutoSavein interfaceWorld
-
setAutoSave
public void setAutoSave(boolean value) - Specified by:
setAutoSavein interfaceWorld
-
getDifficulty
- Specified by:
getDifficultyin interfaceWorld
-
setDifficulty
- Specified by:
setDifficultyin interfaceWorld
-
getWorldFolder
- Specified by:
getWorldFolderin interfaceWorld
-
getWorldType
Deprecated.- Specified by:
getWorldTypein interfaceWorld
-
canGenerateStructures
public boolean canGenerateStructures()- Specified by:
canGenerateStructuresin interfaceWorld
-
getTicksPerAnimalSpawns
Deprecated.- Specified by:
getTicksPerAnimalSpawnsin interfaceWorld
-
setTicksPerAnimalSpawns
Deprecated.- Specified by:
setTicksPerAnimalSpawnsin interfaceWorld
-
getTicksPerMonsterSpawns
Deprecated.- Specified by:
getTicksPerMonsterSpawnsin interfaceWorld
-
setTicksPerMonsterSpawns
Deprecated.- Specified by:
setTicksPerMonsterSpawnsin interfaceWorld
-
getMonsterSpawnLimit
Deprecated.- Specified by:
getMonsterSpawnLimitin interfaceWorld
-
setMonsterSpawnLimit
Deprecated.- Specified by:
setMonsterSpawnLimitin interfaceWorld
-
getAnimalSpawnLimit
Deprecated.- Specified by:
getAnimalSpawnLimitin interfaceWorld
-
setAnimalSpawnLimit
Deprecated.- Specified by:
setAnimalSpawnLimitin interfaceWorld
-
getWaterAnimalSpawnLimit
Deprecated.- Specified by:
getWaterAnimalSpawnLimitin interfaceWorld
-
setWaterAnimalSpawnLimit
Deprecated.- Specified by:
setWaterAnimalSpawnLimitin interfaceWorld
-
getWaterUndergroundCreatureSpawnLimit
Deprecated.- Specified by:
getWaterUndergroundCreatureSpawnLimitin interfaceWorld
-
setWaterUndergroundCreatureSpawnLimit
Deprecated.- Specified by:
setWaterUndergroundCreatureSpawnLimitin interfaceWorld
-
getAmbientSpawnLimit
Deprecated.- Specified by:
getAmbientSpawnLimitin interfaceWorld
-
setAmbientSpawnLimit
Deprecated.- Specified by:
setAmbientSpawnLimitin interfaceWorld
-
playSound
-
playSound
-
playSound
public void playSound(@NotNull @NotNull Location location, @NotNull @NotNull Sound sound, @NotNull @NotNull SoundCategory category, float volume, float pitch) -
playSound
public void playSound(@NotNull @NotNull Location location, @NotNull @NotNull String sound, @NotNull @NotNull SoundCategory category, float volume, float pitch) -
playSound
-
playSound
-
playSound
public void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull String sound, @NotNull @NotNull SoundCategory category, float volume, float pitch) -
playSound
public void playSound(@Nullable @Nullable Entity entity, @Nullable @Nullable Sound sound, @Nullable @Nullable SoundCategory category, float volume, float pitch) -
getGameRules
- Specified by:
getGameRulesin interfaceWorld
-
getGameRuleValue
Deprecated.- Specified by:
getGameRuleValuein interfaceWorld
-
setGameRuleValue
@Deprecated(since="1.13") public boolean setGameRuleValue(@Nullable @Nullable String rule, @NotNull @NotNull String value) Deprecated.- Specified by:
setGameRuleValuein interfaceWorld
-
isGameRule
- Specified by:
isGameRulein interfaceWorld
-
getWorldBorder
- Specified by:
getWorldBorderin interfaceWorld
-
spawnParticle
- Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
- Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
- Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
- Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public <T> void spawnParticle(@NotNull @NotNull Particle particle, @Nullable @Nullable List<Player> receivers, @Nullable @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force) - Specified by:
spawnParticlein interfaceWorld
-
getGameRuleValue
- Specified by:
getGameRuleValuein interfaceWorld
-
getGameRuleDefault
- Specified by:
getGameRuleDefaultin interfaceWorld
-
setGameRule
- Specified by:
setGameRulein interfaceWorld
-
isChunkGenerated
public boolean isChunkGenerated(int x, int z) - Specified by:
isChunkGeneratedin interfaceWorld
-
getNearbyEntities
@NotNull public @NotNull Collection<Entity> getNearbyEntities(Location location, double x, double y, double z, Predicate<? super Entity> filter) - Specified by:
getNearbyEntitiesin interfaceWorld
-
getNearbyEntities
- Specified by:
getNearbyEntitiesin interfaceWorld
-
getNearbyEntities
@NotNull public @NotNull Collection<Entity> getNearbyEntities(BoundingBox boundingBox, Predicate<? super Entity> filter) - Specified by:
getNearbyEntitiesin interfaceWorld
-
rayTraceEntities
- Specified by:
rayTraceEntitiesin interfaceWorld
-
rayTraceEntities
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize) - Specified by:
rayTraceEntitiesin interfaceWorld
-
rayTraceEntities
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, Predicate<? super Entity> filter) - Specified by:
rayTraceEntitiesin interfaceWorld
-
rayTraceEntities
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate<? super Entity> filter) - Specified by:
rayTraceEntitiesin interfaceWorld
-
locateNearestBiome
@Nullable public @Nullable BiomeSearchResult locateNearestBiome(@NotNull @NotNull Location origin, int radius, int horizontalInterval, int verticalInterval, @NotNull @NotNull Biome... biomes) - Specified by:
locateNearestBiomein interfaceWorld
-
locateNearestBiome
@Nullable public @Nullable BiomeSearchResult locateNearestBiome(@NotNull @NotNull Location origin, int radius, @NotNull @NotNull Biome... biomes) - Specified by:
locateNearestBiomein interfaceWorld
-
rayTrace
@Nullable public @Nullable RayTraceResult rayTrace(@NotNull @NotNull Position start, @NotNull @NotNull Vector direction, double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable @Nullable Predicate<? super Entity> filter, @Nullable @Nullable Predicate<? super Block> canCollide) -
rayTraceBlocks
@Nullable public @Nullable RayTraceResult rayTraceBlocks(@NotNull @NotNull Position start, @NotNull @NotNull Vector direction, double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, @Nullable @Nullable Predicate<? super Block> canCollide) - Specified by:
rayTraceBlocksin interfaceWorld
-
rayTraceEntities
@Nullable public @Nullable RayTraceResult rayTraceEntities(@NotNull @NotNull Position start, @NotNull @NotNull Vector direction, double maxDistance, double raySize, @Nullable @Nullable Predicate<? super Entity> filter) - Specified by:
rayTraceEntitiesin interfaceWorld
-
rayTraceBlocks
- Specified by:
rayTraceBlocksin interfaceWorld
-
rayTraceBlocks
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) - Specified by:
rayTraceBlocksin interfaceWorld
-
rayTraceBlocks
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) - Specified by:
rayTraceBlocksin interfaceWorld
-
rayTrace
public RayTraceResult rayTrace(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate<? super Entity> filter) -
spawnParticle
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) - Specified by:
spawnParticlein interfaceWorld
-
spawnParticle
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) - Specified by:
spawnParticlein interfaceWorld
-
locateNearestStructure
@Deprecated(since="1.19") public Location locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored) Deprecated.- Specified by:
locateNearestStructurein interfaceWorld
-
locateNearestStructure
@Nullable public @Nullable StructureSearchResult locateNearestStructure(@NotNull @NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored) - Specified by:
locateNearestStructurein interfaceWorld
-
locateNearestStructure
@Nullable public @Nullable StructureSearchResult locateNearestStructure(@NotNull @NotNull Location origin, @NotNull @NotNull Structure structure, int radius, boolean findUnexplored) - Specified by:
locateNearestStructurein interfaceWorld
-
locateNearestBiome
@Nullable public @Nullable Location locateNearestBiome(@NotNull @NotNull Location origin, @NotNull @NotNull Biome biome, int radius) - Specified by:
locateNearestBiomein interfaceWorld
-
locateNearestBiome
@Nullable public @Nullable Location locateNearestBiome(@NotNull @NotNull Location origin, @NotNull @NotNull Biome biome, int radius, int step) - Specified by:
locateNearestBiomein interfaceWorld
-
addEntity
- Specified by:
addEntityin interfaceRegionAccessor
-
getCoordinateScale
public double getCoordinateScale()- Specified by:
getCoordinateScalein interfaceWorld
-
isFixedTime
public boolean isFixedTime()- Specified by:
isFixedTimein interfaceWorld
-
getInfiniburn
- Specified by:
getInfiniburnin interfaceWorld
-
sendGameEvent
public void sendGameEvent(@Nullable @Nullable Entity sourceEntity, @NotNull @NotNull GameEvent gameEvent, @NotNull @NotNull Vector position) - Specified by:
sendGameEventin interfaceWorld
-
isChunkForceLoaded
public boolean isChunkForceLoaded(int x, int z) - Specified by:
isChunkForceLoadedin interfaceWorld
-
setChunkForceLoaded
public void setChunkForceLoaded(int x, int z, boolean forced) - Specified by:
setChunkForceLoadedin interfaceWorld
-
getForceLoadedChunks
- Specified by:
getForceLoadedChunksin interfaceWorld
-
addPluginChunkTicket
- Specified by:
addPluginChunkTicketin interfaceWorld
-
removePluginChunkTicket
- Specified by:
removePluginChunkTicketin interfaceWorld
-
removePluginChunkTickets
- Specified by:
removePluginChunkTicketsin interfaceWorld
-
getPluginChunkTickets
- Specified by:
getPluginChunkTicketsin interfaceWorld
-
getPluginChunkTickets
- Specified by:
getPluginChunkTicketsin interfaceWorld
-
getIntersectingChunks
- Specified by:
getIntersectingChunksin interfaceWorld
-
spawnArrow
@NotNull public <T extends AbstractArrow> T spawnArrow(Location location, Vector direction, float speed, float spread, Class<T> clazz) - Specified by:
spawnArrowin interfaceWorld
-
locateNearestRaid
- Specified by:
locateNearestRaidin interfaceWorld
-
getRaid
-
getRaids
-
createExplosion
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) - Specified by:
createExplosionin interfaceWorld
-
createExplosion
- Specified by:
createExplosionin interfaceWorld
-
createExplosion
public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) - Specified by:
createExplosionin interfaceWorld
-
getHighestBlockYAt
- Specified by:
getHighestBlockYAtin interfaceRegionAccessor
-
getHighestBlockYAt
- Specified by:
getHighestBlockYAtin interfaceRegionAccessor
-
getHighestBlockAt
@NotNull public @NotNull Block getHighestBlockAt(int x, int z, @NotNull @NotNull HeightMap heightMap) - Specified by:
getHighestBlockAtin interfaceWorld
-
getHighestBlockAt
@NotNull public @NotNull Block getHighestBlockAt(Location location, @NotNull @NotNull HeightMap heightMap) - Specified by:
getHighestBlockAtin interfaceWorld
-
getBiome
- Specified by:
getBiomein interfaceRegionAccessor
-
getBiome
- Specified by:
getBiomein interfaceRegionAccessor
-
getComputedBiome
- Specified by:
getComputedBiomein interfaceRegionAccessor
-
setBiome
- Specified by:
setBiomein interfaceRegionAccessor
-
setBiome
- Specified by:
setBiomein interfaceRegionAccessor
-
getBiomeMap
Gets a map of what biome is at each coordinate.- Returns:
- A clone of the internal biome map.
-
getDefaultBiome
- Returns:
- The default biome of this world.
-
getBlockState
- Specified by:
getBlockStatein interfaceRegionAccessor
-
getBlockState
- Specified by:
getBlockStatein interfaceRegionAccessor
-
getFluidData
- Specified by:
getFluidDatain interfaceRegionAccessor
-
getBlockData
- Specified by:
getBlockDatain interfaceRegionAccessor
-
getBlockData
- Specified by:
getBlockDatain interfaceRegionAccessor
-
getType
- Specified by:
getTypein interfaceRegionAccessor
-
getType
- Specified by:
getTypein interfaceRegionAccessor
-
setBlockData
public void setBlockData(@NotNull @NotNull Location location, @NotNull @NotNull BlockData blockData) - Specified by:
setBlockDatain interfaceRegionAccessor
-
setBlockData
- Specified by:
setBlockDatain interfaceRegionAccessor
-
setType
- Specified by:
setTypein interfaceRegionAccessor
-
setType
- Specified by:
setTypein interfaceRegionAccessor
-
generateTree
public boolean generateTree(@NotNull @NotNull Location location, @NotNull @NotNull Random random, @NotNull @NotNull TreeType type) - Specified by:
generateTreein interfaceRegionAccessor
-
generateTree
public boolean generateTree(@NotNull @NotNull Location location, @NotNull @NotNull Random random, @NotNull @NotNull TreeType type, @Nullable @Nullable Consumer<? super BlockState> stateConsumer) - Specified by:
generateTreein interfaceRegionAccessor
-
getTemperature
public double getTemperature(int x, int y, int z) - Specified by:
getTemperaturein interfaceWorld
-
getHumidity
public double getHumidity(int x, int y, int z) - Specified by:
getHumidityin interfaceWorld
-
getLogicalHeight
public int getLogicalHeight()- Specified by:
getLogicalHeightin interfaceWorld
-
isNatural
public boolean isNatural() -
isBedWorks
public boolean isBedWorks()- Specified by:
isBedWorksin interfaceWorld
-
hasSkyLight
public boolean hasSkyLight()- Specified by:
hasSkyLightin interfaceWorld
-
hasCeiling
public boolean hasCeiling()- Specified by:
hasCeilingin interfaceWorld
-
isPiglinSafe
public boolean isPiglinSafe()- Specified by:
isPiglinSafein interfaceWorld
-
isRespawnAnchorWorks
public boolean isRespawnAnchorWorks()- Specified by:
isRespawnAnchorWorksin interfaceWorld
-
hasRaids
public boolean hasRaids() -
isUltraWarm
public boolean isUltraWarm()- Specified by:
isUltraWarmin interfaceWorld
-
isHardcore
public boolean isHardcore()- Specified by:
isHardcorein interfaceWorld
-
setHardcore
public void setHardcore(boolean hardcore) - Specified by:
setHardcorein interfaceWorld
-
getTicksPerWaterSpawns
Deprecated.- Specified by:
getTicksPerWaterSpawnsin interfaceWorld
-
setTicksPerWaterSpawns
Deprecated.- Specified by:
setTicksPerWaterSpawnsin interfaceWorld
-
getTicksPerAmbientSpawns
Deprecated.- Specified by:
getTicksPerAmbientSpawnsin interfaceWorld
-
setTicksPerAmbientSpawns
Deprecated.- Specified by:
setTicksPerAmbientSpawnsin interfaceWorld
-
getEnderDragonBattle
- Specified by:
getEnderDragonBattlein interfaceWorld
-
getFeatureFlags
- Specified by:
getFeatureFlagsin interfaceFeatureFlagSetHolder- Specified by:
getFeatureFlagsin interfaceWorld
-
setSpawnLocation
public boolean setSpawnLocation(int x, int y, int z, float angle) - Specified by:
setSpawnLocationin interfaceWorld
-
getTicksPerWaterAmbientSpawns
Deprecated.- Specified by:
getTicksPerWaterAmbientSpawnsin interfaceWorld
-
setTicksPerWaterAmbientSpawns
Deprecated.- Specified by:
setTicksPerWaterAmbientSpawnsin interfaceWorld
-
getTicksPerWaterUndergroundCreatureSpawns
Deprecated.- Specified by:
getTicksPerWaterUndergroundCreatureSpawnsin interfaceWorld
-
setTicksPerWaterUndergroundCreatureSpawns
@Deprecated(since="1.18") public void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) Deprecated.- Specified by:
setTicksPerWaterUndergroundCreatureSpawnsin interfaceWorld
-
getWaterAmbientSpawnLimit
Deprecated.- Specified by:
getWaterAmbientSpawnLimitin interfaceWorld
-
setWaterAmbientSpawnLimit
Deprecated.- Specified by:
setWaterAmbientSpawnLimitin interfaceWorld
-
getViewDistance
public int getViewDistance()- Specified by:
getViewDistancein interfaceWorld
-
setViewDistance
public void setViewDistance(int viewDistance) - Specified by:
setViewDistancein interfaceWorld
-
setSimulationDistance
public void setSimulationDistance(int simulationDistance) - Specified by:
setSimulationDistancein interfaceWorld
-
getNoTickViewDistance
Deprecated.- Specified by:
getNoTickViewDistancein interfaceWorld
-
setNoTickViewDistance
Deprecated.- Specified by:
setNoTickViewDistancein interfaceWorld
-
getSendViewDistance
public int getSendViewDistance()- Specified by:
getSendViewDistancein interfaceWorld
-
setSendViewDistance
public void setSendViewDistance(int viewDistance) - Specified by:
setSendViewDistancein interfaceWorld
-
getStructures
- Specified by:
getStructuresin interfaceWorld
-
getStructures
@NotNull public @NotNull Collection<GeneratedStructure> getStructures(int x, int z, @NotNull @NotNull Structure structure) - Specified by:
getStructuresin interfaceWorld
-
spigot
-
getGameTime
public long getGameTime()- Specified by:
getGameTimein interfaceWorld
-
getSimulationDistance
public int getSimulationDistance()- Specified by:
getSimulationDistancein interfaceWorld
-
getPersistentDataContainer
- Specified by:
getPersistentDataContainerin interfacePersistentDataHolder- Specified by:
getPersistentDataContainerin interfacePersistentDataViewHolder
-
getTicksPerSpawns
- Specified by:
getTicksPerSpawnsin interfaceWorld
-
setTicksPerSpawns
public void setTicksPerSpawns(@NotNull @NotNull SpawnCategory spawnCategory, int ticksPerCategorySpawn) - Specified by:
setTicksPerSpawnsin interfaceWorld
-
getSpawnLimit
- Specified by:
getSpawnLimitin interfaceWorld
-
getSpawnLimitUnsafe
-
setSpawnLimit
- Specified by:
setSpawnLimitin interfaceWorld
-
playNote
public void playNote(@NotNull @NotNull Location loc, @NotNull @NotNull Instrument instrument, @NotNull @NotNull Note note) -
playSound
public void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull String sound, @NotNull @NotNull SoundCategory category, float volume, float pitch, long seed) -
playSound
public void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull Sound sound, @NotNull @NotNull SoundCategory category, float volume, float pitch, long seed) -
playSound
public void playSound(@NotNull @NotNull Location location, @NotNull @NotNull String sound, @NotNull @NotNull SoundCategory category, float volume, float pitch, long seed) -
playSound
public void playSound(@NotNull @NotNull Location location, @NotNull @NotNull Sound sound, @NotNull @NotNull SoundCategory category, float volume, float pitch, long seed) -
getKey
- Specified by:
getKeyin interfaceKeyed- Specified by:
getKeyin interfaceRegionAccessor
-