Package com.plotsquared.bukkit.util
Class BukkitUtil
java.lang.Object
com.plotsquared.core.util.WorldUtil
com.plotsquared.bukkit.util.BukkitUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.kyori.adventure.platform.bukkit.BukkitAudiencesstatic final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializerstatic final net.kyori.adventure.text.minimessage.MiniMessage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull BukkitPlayerTurn a BukkitPlayerinto a PlotSquaredPlotPlayeradaptComplete(@NonNull Location location) voidgetBiome(@NonNull String world, int x, int z, @NonNull Consumer<com.sk89q.worldedit.world.biome.BiomeType> result) @NonNull com.sk89q.worldedit.world.biome.BiomeTypegetBiomeSynchronous(@NonNull String world, int x, int z) voidgetBlock(@NonNull Location location, @NonNull Consumer<com.sk89q.worldedit.world.block.BlockState> result) @NonNull com.sk89q.worldedit.world.block.BlockStategetBlockSynchronous(@NonNull Location location) Set<com.sk89q.worldedit.math.BlockVector2>getChunkChunks(String world) @NonNull StringComparison<com.sk89q.worldedit.world.block.BlockState>.ComparisonResultgetClosestBlock(@NonNull String name) @org.checkerframework.checker.index.qual.NonNegative intgetFoodLevel(@NonNull PlotPlayer<?> player) @org.checkerframework.checker.index.qual.NonNegative doublegetHealth(@NonNull PlotPlayer<?> player) voidgetHighestBlock(@NonNull String world, int x, int z, @NonNull IntConsumer result) @org.checkerframework.checker.index.qual.NonNegative intgetHighestBlockSynchronous(@NonNull String world, int x, int z) getSignSynchronous(@NonNull Location location) @org.checkerframework.checker.index.qual.NonNegative intgetTileEntityCount(@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.WorldgetWeWorld(@NonNull String world) Get a BukkitWorldfrom its namebooleanisBlockSame(@NonNull com.sk89q.worldedit.world.block.BlockState block1, @NonNull com.sk89q.worldedit.world.block.BlockState block2) booleanvoidrefreshChunk(int x, int z, String world) voidvoidsetFoodLevel(@NonNull PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative int foodLevel) voidsetHealth(@NonNull PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative double health) voidsetSign(@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 BukkitPlayerinto a PlotSquaredPlotPlayer- Parameters:
player- Bukkit player- Returns:
- PlotSquared player
-
adapt
Turn a BukkitLocationinto 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 BukkitLocationinto a PlotSquaredLocation. This copies the entire 6-tuple (world,x,y,z,yaw,pitch).- Parameters:
location- Bukkit location- Returns:
- PlotSquared location
-
adapt
Turn a PlotSquaredLocationinto 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 BukkitWorldfrom 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:
isBlockSamein classWorldUtil
-
isWorld
-
getBiome
-
getBiomeSynchronous
public @NonNull com.sk89q.worldedit.world.biome.BiomeType getBiomeSynchronous(@NonNull String world, int x, int z) - Specified by:
getBiomeSynchronousin classWorldUtil
-
getHighestBlock
- Specified by:
getHighestBlockin classWorldUtil
-
getHighestBlockSynchronous
public @org.checkerframework.checker.index.qual.NonNegative int getHighestBlockSynchronous(@NonNull String world, int x, int z) - Specified by:
getHighestBlockSynchronousin classWorldUtil
-
getSignSynchronous
- Specified by:
getSignSynchronousin classWorldUtil
-
getSpawn
-
setSpawn
-
saveWorld
-
setSign
-
getClosestBlock
public @NonNull StringComparison<com.sk89q.worldedit.world.block.BlockState>.ComparisonResult getClosestBlock(@NonNull String name) - Specified by:
getClosestBlockin classWorldUtil
-
getWeWorld
- Specified by:
getWeWorldin classWorldUtil
-
refreshChunk
- Specified by:
refreshChunkin classWorldUtil
-
getBlock
-
getBlockSynchronous
public @NonNull com.sk89q.worldedit.world.block.BlockState getBlockSynchronous(@NonNull Location location) - Specified by:
getBlockSynchronousin 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:
getFoodLevelin 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:
setFoodLevelin classWorldUtil
-
getTypesInCategory
public @NonNull Set<com.sk89q.worldedit.world.entity.EntityType> getTypesInCategory(@NonNull String category) - Specified by:
getTypesInCategoryin classWorldUtil
-
getTileEntityTypes
- Specified by:
getTileEntityTypesin classWorldUtil
-
getTileEntityCount
public @org.checkerframework.checker.index.qual.NonNegative int getTileEntityCount(@NonNull String world, @NonNull com.sk89q.worldedit.math.BlockVector2 chunk) - Specified by:
getTileEntityCountin classWorldUtil
-
getChunkChunks
- Overrides:
getChunkChunksin classWorldUtil
-