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+
使用 XSeries 实现跨版本兼容的工具类。 替代旧的 VersionWrapper 动态加载机制。 最低支持版本: 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.使用 XSound 获取跨版本兼容的声音
- 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.给玩家发送 Action Bar 消息
- 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
-