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>
<tlibs.version>2.0.0</tlibs.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ private static List<ItemStack> decodeItems(List<String> raw) {
return out;
}

// 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;
try (ByteArrayOutputStream bytes = new ByteArrayOutputStream();
Expand All @@ -207,6 +209,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;
try (ByteArrayInputStream bytes = new ByteArrayInputStream(Base64.getDecoder().decode(raw));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public static NamespacedKey pageKey() {
return new NamespacedKey(Woodworking.plugin, "ww_page");
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public void openCategories(Player player) {
Inventory inv = Woodworking.plugin.getServer().createInventory(null, 27, CATEGORY_TITLE);
int slot = 0;
Expand All @@ -66,6 +68,8 @@ public void openCategories(Player player) {
player.openInventory(inv);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public void openProjects(Player player, WoodCategory category, int page) {
if (page < 0) page = 0;
Inventory inv = Woodworking.plugin.getServer().createInventory(null, 54, PROJECT_TITLE);
Expand Down Expand Up @@ -93,6 +97,8 @@ public void openProjects(Player player, WoodCategory category, int page) {
player.openInventory(inv);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private ItemStack decorateProject(ItemStack icon, WoodProject project) {
ItemMeta meta = icon.getItemMeta();
if (meta == null) return icon;
Expand All @@ -111,6 +117,8 @@ private ItemStack decorateProject(ItemStack icon, WoodProject project) {
return icon;
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private ItemStack pageButton(String name, String categoryId, int page) {
ItemStack item = new ItemStack(Material.ARROW);
ItemMeta meta = item.getItemMeta();
Expand Down Expand Up @@ -144,6 +152,8 @@ private ItemStack iconFromPath(String path, String label) {
return copy;
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private void fillEmpty(Inventory inv) {
ItemStack fill = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta meta = fill.getItemMeta();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ public void onFurnitureBreak(FurnitureBreakEvent e) {
}
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
@EventHandler
public void onMenuClick(InventoryClickEvent e) {
String title = e.getView().getTitle();
Expand Down Expand Up @@ -240,6 +242,8 @@ public void onMenuClick(InventoryClickEvent e) {
p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_PLACE, 0.8f, 2f);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private void handleRightClick(PlayerInteractEvent e) {
Player p = e.getPlayer();
ItemStack hand = p.getInventory().getItemInMainHand();
Expand Down Expand Up @@ -293,6 +297,8 @@ private void handleRightClick(PlayerInteractEvent e) {
}
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private void handleLeftClick(PlayerInteractEvent e) {
Player p = e.getPlayer();
WoodStation station = get(e.getClickedBlock().getLocation());
Expand Down Expand Up @@ -385,6 +391,8 @@ private void sendStatus(Player p, WoodStation station) {
p.sendMessage("§cSHIFT + LEFT CLICK with the branding tool to cancel the project!");
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private void completeCraft(Player p, WoodStation station) {
WoodProject project = station.getProject();
String path = project.getItem();
Expand Down