Package com.plotsquared.bukkit.util
Class BukkitUtil
java.lang.Object
com.plotsquared.core.util.WorldUtil
com.plotsquared.bukkit.util.BukkitUtil
-
Field Summary
Modifier and TypeFieldDescriptionstatic final net.kyori.adventure.platform.bukkit.BukkitAudiences
static final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer
static final net.kyori.adventure.text.minimessage.MiniMessage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull BukkitPlayer
Turn a BukkitPlayer
into a PlotSquaredPlotPlayer
adaptComplete
(@NonNull Location location) void
getBiome
(@NonNull String world, int x, int z, @NonNull Consumer<com.sk89q.worldedit.world.biome.BiomeType> result) @NonNull com.sk89q.worldedit.world.biome.BiomeType
getBiomeSynchronous
(@NonNull String world, int x, int z) void
getBlock
(@NonNull Location location, @NonNull Consumer<com.sk89q.worldedit.world.block.BlockState> result) @NonNull com.sk89q.worldedit.world.block.BlockState
getBlockSynchronous
(@NonNull Location location) Set<com.sk89q.worldedit.math.BlockVector2>
getChunkChunks
(String world) @NonNull StringComparison<com.sk89q.worldedit.world.block.BlockState>.ComparisonResult
getClosestBlock
(@NonNull String name) @org.checkerframework.checker.index.qual.NonNegative int
getFoodLevel
(@NonNull PlotPlayer<?> player) @org.checkerframework.checker.index.qual.NonNegative double
getHealth
(@NonNull PlotPlayer<?> player) void
getHighestBlock
(@NonNull String world, int x, int z, @NonNull IntConsumer result) @org.checkerframework.checker.index.qual.NonNegative int
getHighestBlockSynchronous
(@NonNull String world, int x, int z) getSignSynchronous
(@NonNull Location location) @org.checkerframework.checker.index.qual.NonNegative int
getTileEntityCount
(@NonNull String world, @NonNull com.sk89q.worldedit.math.BlockVector2 chunk) @NonNull Collection<com.sk89q.worldedit.world.block.BlockType>
getTypesInCategory
(@NonNull String category) @NonNull com.sk89q.worldedit.world.World
getWeWorld
(@NonNull String world) Get a BukkitWorld
from its nameboolean
isBlockSame
(@NonNull com.sk89q.worldedit.world.block.BlockState block1, @NonNull com.sk89q.worldedit.world.block.BlockState block2) boolean
void
refreshChunk
(int x, int z, String world) void
void
setFoodLevel
(@NonNull PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative int foodLevel) void
setHealth
(@NonNull PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative double health) void
setSign
(@NonNull Location location, @NonNull Caption[] lines, @NonNull net.kyori.adventure.text.minimessage.Template... replacements) void
-
Field Details
-
BUKKIT_AUDIENCES
public static final net.kyori.adventure.platform.bukkit.BukkitAudiences BUKKIT_AUDIENCES -
LEGACY_COMPONENT_SERIALIZER
public static final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer LEGACY_COMPONENT_SERIALIZER -
MINI_MESSAGE
public static final net.kyori.adventure.text.minimessage.MiniMessage MINI_MESSAGE
-
-
Constructor Details
-
BukkitUtil
public BukkitUtil()
-
-
Method Details
-
adapt
Turn a BukkitPlayer
into a PlotSquaredPlotPlayer
- Parameters:
player
- Bukkit player- Returns:
- PlotSquared player
-
adapt
Turn a BukkitLocation
into a PlotSquaredLocation
. This only copies the 4-tuple (world,x,y,z) and does not include the yaw and the pitch- Parameters:
location
- Bukkit location- Returns:
- PlotSquared location
-
adaptComplete
Turn a BukkitLocation
into a PlotSquaredLocation
. This copies the entire 6-tuple (world,x,y,z,yaw,pitch).- Parameters:
location
- Bukkit location- Returns:
- PlotSquared location
-
adapt
Turn a PlotSquaredLocation
into a BukkitLocation
. This only copies the 4-tuple (world,x,y,z) and does not include the yaw and the pitch- Parameters:
location
- PlotSquared location- Returns:
- Bukkit location
-
getWorld
Get a BukkitWorld
from its name- Parameters:
string
- World name- Returns:
- World if it exists, or
null
-
isBlockSame
public boolean isBlockSame(@NonNull com.sk89q.worldedit.world.block.BlockState block1, @NonNull com.sk89q.worldedit.world.block.BlockState block2) - Specified by:
isBlockSame
in classWorldUtil
-
isWorld
-
getBiome
-
getBiomeSynchronous
public @NonNull com.sk89q.worldedit.world.biome.BiomeType getBiomeSynchronous(@NonNull String world, int x, int z) - Specified by:
getBiomeSynchronous
in classWorldUtil
-
getHighestBlock
- Specified by:
getHighestBlock
in classWorldUtil
-
getHighestBlockSynchronous
public @org.checkerframework.checker.index.qual.NonNegative int getHighestBlockSynchronous(@NonNull String world, int x, int z) - Specified by:
getHighestBlockSynchronous
in classWorldUtil
-
getSignSynchronous
- Specified by:
getSignSynchronous
in classWorldUtil
-
getSpawn
-
setSpawn
-
saveWorld
-
getClosestBlock
public @NonNull StringComparison<com.sk89q.worldedit.world.block.BlockState>.ComparisonResult getClosestBlock(@NonNull String name) - Specified by:
getClosestBlock
in classWorldUtil
-
getWeWorld
- Specified by:
getWeWorld
in classWorldUtil
-
refreshChunk
- Specified by:
refreshChunk
in classWorldUtil
-
getBlock
-
getBlockSynchronous
public @NonNull com.sk89q.worldedit.world.block.BlockState getBlockSynchronous(@NonNull Location location) - Specified by:
getBlockSynchronous
in classWorldUtil
-
getHealth
public @org.checkerframework.checker.index.qual.NonNegative double getHealth(@NonNull PlotPlayer<?> player) -
getFoodLevel
public @org.checkerframework.checker.index.qual.NonNegative int getFoodLevel(@NonNull PlotPlayer<?> player) - Specified by:
getFoodLevel
in classWorldUtil
-
setHealth
public void setHealth(@NonNull PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative double health) -
setFoodLevel
public void setFoodLevel(@NonNull PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative int foodLevel) - Specified by:
setFoodLevel
in classWorldUtil
-
getTypesInCategory
public @NonNull Set<com.sk89q.worldedit.world.entity.EntityType> getTypesInCategory(@NonNull String category) - Specified by:
getTypesInCategory
in classWorldUtil
-
getTileEntityTypes
- Specified by:
getTileEntityTypes
in classWorldUtil
-
getTileEntityCount
public @org.checkerframework.checker.index.qual.NonNegative int getTileEntityCount(@NonNull String world, @NonNull com.sk89q.worldedit.math.BlockVector2 chunk) - Specified by:
getTileEntityCount
in classWorldUtil
-
getChunkChunks
- Overrides:
getChunkChunks
in classWorldUtil
-