Package com.ultikits.ultitools.utils
Class XVersionUtils
java.lang.Object
com.ultikits.ultitools.utils.XVersionUtils
Cross-version compatibility utility class using XSeries.
Replaces the old VersionWrapper dynamic loading mechanism.
Minimum supported version: 1.13+
- Since:
- 6.2.0
- Author:
- wisdomme
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.ItemStackGet colored bed.static org.bukkit.block.BlockFacegetBlockFace(org.bukkit.block.Block placedBlock) Get block face direction.static org.bukkit.inventory.ItemStackgetColoredPlaneGlass(Colors color) Get colored stained glass pane.static org.bukkit.inventory.ItemStackgetColoredWool(Colors color) Get colored wool.static org.bukkit.inventory.ItemStackgetEmailMaterial(boolean isRead) Get email material (paper for unread, filled map for read).static org.bukkit.inventory.ItemStackGet ender eye.static org.bukkit.inventory.ItemStackGet grass block.static org.bukkit.inventory.ItemStackgetHead(org.bukkit.OfflinePlayer player) Get player head.static intgetItemDurability(org.bukkit.inventory.ItemStack itemStack) Get item durability.static org.bukkit.inventory.ItemStackgetItemInHand(org.bukkit.entity.Player player, boolean isMainHand) Get item in player's hand.static org.bukkit.inventory.ItemStackgetSign()Get oak sign.static org.bukkit.SoundGet sound using XSound for cross-version compatibility.static org.bukkit.scoreboard.ObjectiveregisterNewObjective(org.bukkit.scoreboard.Scoreboard scoreboard, String name, String criteria, String displayName) Register a new scoreboard objective.static voidsendActionBar(org.bukkit.entity.Player player, String message) Send action bar message to player.static voidsendPlayerList(org.bukkit.entity.Player player, String header, String footer) Set player list header and footer.
-
Constructor Details
-
XVersionUtils
private XVersionUtils()
-
-
Method Details
-
getColoredPlaneGlass
Get colored stained glass pane.- Parameters:
color- the color- Returns:
- colored glass pane ItemStack
-
getColoredWool
Get colored wool.- Parameters:
color- the color- Returns:
- colored wool ItemStack
-
getSign
public static org.bukkit.inventory.ItemStack getSign()Get oak sign.- Returns:
- sign ItemStack
-
getEndEye
public static org.bukkit.inventory.ItemStack getEndEye()Get ender eye.- Returns:
- ender eye ItemStack
-
getEmailMaterial
public static org.bukkit.inventory.ItemStack getEmailMaterial(boolean isRead) Get email material (paper for unread, filled map for read).- Parameters:
isRead- whether the email is read- Returns:
- email material ItemStack
-
getHead
public static org.bukkit.inventory.ItemStack getHead(org.bukkit.OfflinePlayer player) Get player head.- Parameters:
player- the player- Returns:
- player head ItemStack
-
getGrassBlock
public static org.bukkit.inventory.ItemStack getGrassBlock()Get grass block.- Returns:
- grass block ItemStack
-
registerNewObjective
public static org.bukkit.scoreboard.Objective registerNewObjective(org.bukkit.scoreboard.Scoreboard scoreboard, String name, String criteria, String displayName) Register a new scoreboard objective.- Parameters:
scoreboard- the scoreboardname- objective namecriteria- criteria stringdisplayName- display name- Returns:
- the objective
-
getSound
Get sound using XSound for cross-version compatibility.- Parameters:
sound- the sound enum- Returns:
- the bukkit Sound, or null if not found
-
getBed
Get colored bed.- Parameters:
bedColor- the bed color- Returns:
- bed ItemStack
-
getItemDurability
public static int getItemDurability(org.bukkit.inventory.ItemStack itemStack) Get item durability.- Parameters:
itemStack- the item- Returns:
- remaining durability
-
getItemInHand
public static org.bukkit.inventory.ItemStack getItemInHand(org.bukkit.entity.Player player, boolean isMainHand) Get item in player's hand.- Parameters:
player- the playerisMainHand- whether to get main hand item- Returns:
- item in hand
-
sendActionBar
Send action bar message to player.- Parameters:
player- the playermessage- the message
-
sendPlayerList
Set player list header and footer.- Parameters:
player- the playerheader- header textfooter- footer text
-
getBlockFace
public static org.bukkit.block.BlockFace getBlockFace(org.bukkit.block.Block placedBlock) Get block face direction.- Parameters:
placedBlock- the placed block- Returns:
- the block face
-