Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<properties>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.proc>full</maven.compiler.proc>
<denareconomy.version>0.2.0</denareconomy.version>
<rpcharacters.version>2.0.1</rpcharacters.version>
<simplefactions.version>3.0.1</simplefactions.version>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/tfminecraft/games/display/WorldAnchors.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public static Interaction spawnInteraction(Location location, float width, float
});
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public static TextDisplay spawnLabel(Location location, String text) {
if (location == null || location.getWorld() == null) {
return null;
Expand Down Expand Up @@ -77,6 +79,8 @@ public static String tableId(Entity entity) {
return entity.getPersistentDataContainer().get(Keys.tableId(), PersistentDataType.STRING);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public static void setText(UUID entityId, String text) {
if (entityId == null) {
return;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/tfminecraft/games/gui/GameSelectGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ private GameSelectGui() {}

public static final GameSelectGui INSTANCE = new GameSelectGui();

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public static void open(Player player, boolean requireDeck, Location pending) {
GameSelectHolder holder = new GameSelectHolder(requireDeck, pending);
Inventory inventory = Bukkit.createInventory(holder, SIZE, Messages.get("place.gui_title"));
Expand All @@ -42,6 +44,8 @@ public static void open(Player player, boolean requireDeck, Location pending) {
player.openInventory(inventory);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private static ItemStack gameIcon(String gameId, String nameKey) {
ItemStack item = TLibs.getItemAPI().getCreator().getItemFromPath(Cache.iconOf(gameId));
if (item == null) {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/net/tfminecraft/games/gui/TableOptionsGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public static void openEdit(Player player, Table table) {
open(player, false, null, table.getId(), table.getGameId(), TableHouse.from(table));
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private static void open(Player player, boolean requireDeck, Location pending, UUID editId, String gameId,
TableHouse house) {
if (player == null || house == null) {
Expand Down Expand Up @@ -132,6 +134,8 @@ private static String boxesLabel(int n) {
return n < 1 ? Messages.get("place.options_boxes_open") : String.valueOf(n);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private static ItemStack toggle(Material material, String action, boolean on, String name, String lore) {
ItemStack item = named(material, action, name);
ItemMeta meta = item.getItemMeta();
Expand All @@ -142,6 +146,8 @@ private static ItemStack toggle(Material material, String action, boolean on, St
return item;
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private static ItemStack valueItem(Material material, String action, String name) {
ItemStack item = named(material, action, name);
ItemMeta meta = item.getItemMeta();
Expand All @@ -152,6 +158,8 @@ private static ItemStack valueItem(Material material, String action, String name
return item;
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private static ItemStack named(Material material, String action, String name) {
ItemStack item = new ItemStack(material);
ItemMeta meta = item.getItemMeta();
Expand Down Expand Up @@ -253,6 +261,8 @@ private static void startChat(Player player, TableOptionsHolder holder, ChatFiel
}, CHAT_TICKS);
}

// Retain Bukkit chat-event ordering and String message semantics for existing integrations.
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.LOWEST)
public void onChat(AsyncPlayerChatEvent event) {
ChatPrompt prompt = prompts.get(event.getPlayer().getUniqueId());
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/tfminecraft/games/help/HelpBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public boolean isEmpty() {
/**
* Show the book without giving one away. The player is left holding whatever they had.
*/
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public void openFor(Player player) {
if (player == null || isEmpty()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private static WagerItemOverride readOverride(ConfigurationSection section, Stri
}

// Existing configuration accepts legacy enum names and aliases; registry keys are not equivalent.
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
public static Sound parseSound(String raw, String path, Sound unknownFallback) {
if (raw == null || raw.isBlank()) {
return null;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/tfminecraft/games/table/TableManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ public void onInteractAtEntity(PlayerInteractAtEntityEvent event) {
tryDraw(player, table);
}

// Retain Bukkit chat-event ordering and String message semantics for existing integrations.
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayChat(AsyncPlayerChatEvent event) {
String action = playWord(event.getMessage());
Expand Down Expand Up @@ -4957,6 +4959,8 @@ private static void readStakeData(Table table, StakeData data) {
data.streetId, data.anchorX, data.anchorZ, data.x, data.z);
}

// Preserve the existing serialized item format so previously saved graves remain readable.
@SuppressWarnings("deprecation")
private static String encodeItem(ItemStack item) {
if (item == null) {
return null;
Expand All @@ -4972,6 +4976,8 @@ private static String encodeItem(ItemStack item) {
}
}

// Preserve the existing serialized item format so previously saved graves remain readable.
@SuppressWarnings("deprecation")
private static ItemStack decodeItem(String raw) {
if (raw == null || raw.isBlank()) {
return null;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/tfminecraft/games/wager/WagerChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public static void sendProposed(Player viewer, String playerName, ItemStack item
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw " + viewer.getName() + " " + root);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public static String itemTitle(ItemStack item) {
if (item == null) {
return "item";
Expand All @@ -56,6 +58,8 @@ public static String itemTitle(ItemStack item) {
return Character.toUpperCase(raw.charAt(0)) + raw.substring(1);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private static String hoverBody(ItemStack item, String title) {
StringBuilder body = new StringBuilder(title);
ItemMeta meta = item != null ? item.getItemMeta() : null;
Expand Down