Package com.plotsquared.bukkit.util
Class BukkitUtil
java.lang.Object
com.plotsquared.core.util.WorldUtil
com.plotsquared.bukkit.util.BukkitUtil
public class BukkitUtil
extends com.plotsquared.core.util.WorldUtil
-
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 TypeMethodDescriptionTurn a PlotSquaredLocationinto a BukkitLocation.static @NonNull BukkitPlayerTurn a BukkitPlayerinto a PlotSquaredPlotPlayerstatic @NonNull com.plotsquared.core.location.LocationTurn a BukkitLocationinto a PlotSquaredLocation.static @NonNull com.plotsquared.core.location.LocationadaptComplete(@NonNull Location location) Turn a BukkitLocationinto a PlotSquaredLocation.voidgetBiomeSynchronous(@NonNull String world, int x, int z) voidgetBlock(@NonNull com.plotsquared.core.location.Location location, @NonNull Consumer<BlockState> result) getBlockSynchronous(@NonNull com.plotsquared.core.location.Location location) getChunkChunks(String world) @NonNull com.plotsquared.core.util.StringComparison<BlockState>.com.plotsquared.core.util.StringComparison.ComparisonResultgetClosestBlock(@NonNull String name) @org.checkerframework.checker.index.qual.NonNegative intgetFoodLevel(@NonNull com.plotsquared.core.player.PlotPlayer<?> player) @org.checkerframework.checker.index.qual.NonNegative doublevoidgetHighestBlock(@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 com.plotsquared.core.location.Location location) @NonNull com.plotsquared.core.location.Location@org.checkerframework.checker.index.qual.NonNegative intgetTileEntityCount(@NonNull String world, @NonNull BlockVector2 chunk) getTypesInCategory(@NonNull String category) getWeWorld(@NonNull String world) Get a BukkitWorldfrom its namebooleanisBlockSame(@NonNull BlockState block1, @NonNull BlockState block2) booleanvoidrefreshChunk(int x, int z, String world) voidvoidvoidsetFoodLevel(@NonNull com.plotsquared.core.player.PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative int foodLevel) voidsetHealth(@NonNull com.plotsquared.core.player.PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative double health) voidsetSign(@NonNull com.plotsquared.core.location.Location location, @NonNull com.plotsquared.core.configuration.caption.Caption[] lines, @NonNull net.kyori.adventure.text.minimessage.Template... replacements) voidMethods inherited from class com.plotsquared.core.util.WorldUtil
setBiome, upload
-
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
public static @NonNull com.plotsquared.core.location.Location adaptComplete(@NonNull Location location) 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
- Specified by:
isBlockSamein classcom.plotsquared.core.util.WorldUtil
-
isWorld
- Specified by:
isWorldin classcom.plotsquared.core.util.WorldUtil
-
getBiome
- Specified by:
getBiomein classcom.plotsquared.core.util.WorldUtil
-
getBiomeSynchronous
- Specified by:
getBiomeSynchronousin classcom.plotsquared.core.util.WorldUtil
-
getHighestBlock
- Specified by:
getHighestBlockin classcom.plotsquared.core.util.WorldUtil
-
getHighestBlockSynchronous
public @org.checkerframework.checker.index.qual.NonNegative int getHighestBlockSynchronous(@NonNull String world, int x, int z) - Specified by:
getHighestBlockSynchronousin classcom.plotsquared.core.util.WorldUtil
-
getSignSynchronous
public @NonNull String[] getSignSynchronous(@NonNull com.plotsquared.core.location.Location location) - Specified by:
getSignSynchronousin classcom.plotsquared.core.util.WorldUtil
-
getSpawn
- Specified by:
getSpawnin classcom.plotsquared.core.util.WorldUtil
-
setSpawn
- Specified by:
setSpawnin classcom.plotsquared.core.util.WorldUtil
-
saveWorld
- Specified by:
saveWorldin classcom.plotsquared.core.util.WorldUtil
-
setSign
public void setSign(@NonNull com.plotsquared.core.location.Location location, @NonNull com.plotsquared.core.configuration.caption.Caption[] lines, @NonNull net.kyori.adventure.text.minimessage.Template... replacements) - Specified by:
setSignin classcom.plotsquared.core.util.WorldUtil
-
getClosestBlock
public @NonNull com.plotsquared.core.util.StringComparison<BlockState>.com.plotsquared.core.util.StringComparison.ComparisonResult getClosestBlock(@NonNull String name) - Specified by:
getClosestBlockin classcom.plotsquared.core.util.WorldUtil
-
setBiomes
public void setBiomes(@NonNull String worldName, @NonNull CuboidRegion region, @NonNull BiomeType biomeType) - Specified by:
setBiomesin classcom.plotsquared.core.util.WorldUtil
-
getWeWorld
- Specified by:
getWeWorldin classcom.plotsquared.core.util.WorldUtil
-
refreshChunk
- Specified by:
refreshChunkin classcom.plotsquared.core.util.WorldUtil
-
getBlock
public void getBlock(@NonNull com.plotsquared.core.location.Location location, @NonNull Consumer<BlockState> result) - Specified by:
getBlockin classcom.plotsquared.core.util.WorldUtil
-
getBlockSynchronous
public @NonNull BlockState getBlockSynchronous(@NonNull com.plotsquared.core.location.Location location) - Specified by:
getBlockSynchronousin classcom.plotsquared.core.util.WorldUtil
-
getHealth
public @org.checkerframework.checker.index.qual.NonNegative double getHealth(@NonNull com.plotsquared.core.player.PlotPlayer<?> player) - Specified by:
getHealthin classcom.plotsquared.core.util.WorldUtil
-
getFoodLevel
public @org.checkerframework.checker.index.qual.NonNegative int getFoodLevel(@NonNull com.plotsquared.core.player.PlotPlayer<?> player) - Specified by:
getFoodLevelin classcom.plotsquared.core.util.WorldUtil
-
setHealth
public void setHealth(@NonNull com.plotsquared.core.player.PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative double health) - Specified by:
setHealthin classcom.plotsquared.core.util.WorldUtil
-
setFoodLevel
public void setFoodLevel(@NonNull com.plotsquared.core.player.PlotPlayer<?> player, @org.checkerframework.checker.index.qual.NonNegative int foodLevel) - Specified by:
setFoodLevelin classcom.plotsquared.core.util.WorldUtil
-
getTypesInCategory
- Specified by:
getTypesInCategoryin classcom.plotsquared.core.util.WorldUtil
-
getTileEntityTypes
- Specified by:
getTileEntityTypesin classcom.plotsquared.core.util.WorldUtil
-
getTileEntityCount
public @org.checkerframework.checker.index.qual.NonNegative int getTileEntityCount(@NonNull String world, @NonNull BlockVector2 chunk) - Specified by:
getTileEntityCountin classcom.plotsquared.core.util.WorldUtil
-
getChunkChunks
- Overrides:
getChunkChunksin classcom.plotsquared.core.util.WorldUtil
-