Skip to content

Commit ce98c7d

Browse files
committed
fix: resolve Paper API build warnings
1 parent 1f1af0e commit ce98c7d

11 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<properties>
1212
<maven.compiler.release>21</maven.compiler.release>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<maven.compiler.proc>full</maven.compiler.proc>
1415
<project.build.outputTimestamp>2026-09-22T00:00:00Z</project.build.outputTimestamp>
1516
<tlibs.version>2.0.0</tlibs.version>
1617
</properties>

‎src/main/java/net/tfminecraft/advancedcrafting/AdvancedCrafting.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ public void reload() {
191191
loadConfigs();
192192
revisionTracker.flush();
193193
}
194+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
195+
@SuppressWarnings("deprecation")
194196
public void reloadMessage(Player p) {
195197
p.sendMessage(ChatColor.GREEN + "[AdvancedCrafting]" + ChatColor.YELLOW + " Reloading plugin...");
196198
reload();

‎src/main/java/net/tfminecraft/advancedcrafting/database/AlloyDatabase.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ public String getRawData(String key, HashMap<String, Object> defaults) {
281281
: (defaults.containsKey(key) ? defaults.get(key).toString() : key);
282282
}
283283

284+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
285+
@SuppressWarnings("deprecation")
284286
public String getString(String key, HashMap<String, Object> defaults) {
285287
return ChatColor.translateAlternateColorCodes('&', getRawData(key, defaults));
286288
}

‎src/main/java/net/tfminecraft/advancedcrafting/database/Database.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ public String getRawData(String key, HashMap<String, Object> defaults) {
155155
: (defaults.containsKey(key) ? defaults.get(key).toString() : key);
156156
}
157157

158+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
159+
@SuppressWarnings("deprecation")
158160
public String getString(String key, HashMap<String, Object> defaults) {
159161
return ChatColor.translateAlternateColorCodes('&', getRawData(key, defaults));
160162
}

‎src/main/java/net/tfminecraft/advancedcrafting/managers/AlloyManager.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ public void run() {
100100
}.runTaskTimer(AdvancedCrafting.plugin, 0, 20L);
101101
}
102102

103+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
104+
@SuppressWarnings("deprecation")
103105
@EventHandler
104106
public void addIngredient(PlayerInteractEvent e) {
105107
if(!e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) return;
@@ -158,6 +160,8 @@ public void addIngredient(PlayerInteractEvent e) {
158160
p.sendTitle("§aAdded "+i.getItemMeta().getDisplayName(), station.getStatus(), 5, 30, 5);
159161
i.setAmount(i.getAmount()-1);
160162
}
163+
// Keep the existing legacy text representation, formatting, and exact-string comparisons. This path mutates the existing ItemStack; replacing it would change aliases held by callers.
164+
@SuppressWarnings("deprecation")
161165
public void forgeAlloy(PlayerInteractEvent e) {
162166
Block b = e.getClickedBlock();
163167
Player p = e.getPlayer();
@@ -187,6 +191,8 @@ public void forgeAlloy(PlayerInteractEvent e) {
187191
}
188192
}
189193

194+
// This path mutates the existing ItemStack; replacing it would change aliases held by callers.
195+
@SuppressWarnings("deprecation")
190196
public void nameAlloy(Player p, String s) {
191197
if(!naming.containsKey(p)) {
192198
p.sendMessage("§cYou have no alloy to name");

‎src/main/java/net/tfminecraft/advancedcrafting/managers/CraftingManager.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ public void onIaFurnitureBreak(FurnitureBreakEvent e) {
278278
discardBrokenStation(loc);
279279
}
280280

281+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
282+
@SuppressWarnings("deprecation")
281283
private void discardBrokenStation(Location loc) {
282284
if (!hasStation(loc)) {
283285
return;
@@ -383,6 +385,8 @@ public void applyHit(PlayerInteractEvent e) {
383385
}
384386

385387

388+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
389+
@SuppressWarnings("deprecation")
386390
@EventHandler
387391
public void invenClick(InventoryClickEvent e) {
388392
Player p = (Player) e.getWhoClicked();

‎src/main/java/net/tfminecraft/advancedcrafting/managers/InventoryManager.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
public class InventoryManager {
3232
public static final String STAT_PREVIEW_TITLE = "§7Stat Preview";
3333

34+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
35+
@SuppressWarnings("deprecation")
3436
public void categoryView(Player p) {
3537
Inventory i = AdvancedCrafting.plugin.getServer().createInventory(null, 27, "§7Select Category");
3638
int x = 0;
@@ -51,6 +53,8 @@ public void categoryView(Player p) {
5153
}
5254
p.openInventory(i);
5355
}
56+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
57+
@SuppressWarnings("deprecation")
5458
public void recipeView(Player p, RecipeCategory c) {
5559
Inventory i = AdvancedCrafting.plugin.getServer().createInventory(null, 27, "§7Select Recipe");
5660
int x = 0;
@@ -72,6 +76,8 @@ public void recipeView(Player p, RecipeCategory c) {
7276
p.openInventory(i);
7377
}
7478

79+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
80+
@SuppressWarnings("deprecation")
7581
public void templatePreviewView(Player p, StatData source) {
7682
int count = 0;
7783
for (StatTemplate template : StatTemplateLoader.getAll()) {
@@ -107,6 +113,8 @@ public void templatePreviewView(Player p, StatData source) {
107113
p.openInventory(i);
108114
}
109115

116+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
117+
@SuppressWarnings("deprecation")
110118
private ItemStack getTemplatePreviewItem(StatData source, StatTemplate template) {
111119
ItemStack icon = template.getIcon();
112120
ItemStack item = icon != null ? icon.clone() : new ItemStack(Material.BARRIER, 1);
@@ -119,6 +127,8 @@ private ItemStack getTemplatePreviewItem(StatData source, StatTemplate template)
119127
return item;
120128
}
121129

130+
// Keep the existing legacy text representation, formatting, and exact-string comparisons. This path mutates the existing ItemStack; replacing it would change aliases held by callers.
131+
@SuppressWarnings("deprecation")
122132
private ItemStack getCategoryItem(RecipeCategory c) {
123133
ItemStack i = new ItemStack(Material.BARRIER, 1);
124134
if(c.getRecipes().size() == 0) {
@@ -149,6 +159,8 @@ private ItemStack getCategoryItem(RecipeCategory c) {
149159
return i;
150160
}
151161

162+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
163+
@SuppressWarnings("deprecation")
152164
private ItemStack getRecipeItem(CraftingRecipe r) {
153165
ItemStack fallback = new ItemStack(Material.BARRIER, 1);
154166
ItemAPI api = TLibs.getItemAPI();

‎src/main/java/net/tfminecraft/advancedcrafting/objects/crafting/CraftingStation.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ public HashMap<IngredientType, IntCounter> getTypes() {
174174
return types;
175175
}
176176

177+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
178+
@SuppressWarnings("deprecation")
177179
public StationFeedback addMaterial(Player p, ItemStack i) {
178180
CraftStack c = new CraftStack(i);
179181
if(!c.isAlloy() && !c.isIngredient()) {
@@ -380,6 +382,8 @@ private void warnOvershootHits(Player p) {
380382
}
381383
}
382384

385+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
386+
@SuppressWarnings("deprecation")
383387
private StationFeedback createItem(Player p, Double forcedQualityPercent) {
384388
if (!checkItems(p)) {
385389
return StationFeedback.LACKING_ITEMS;
@@ -498,6 +502,8 @@ private StationFeedback createItem(Player p, Double forcedQualityPercent) {
498502
return StationFeedback.SUCCESS;
499503
}
500504

505+
// This path mutates the existing ItemStack; replacing it would change aliases held by callers.
506+
@SuppressWarnings("deprecation")
501507
private ItemStack applyModel(ItemStack i, ModelScheme scheme) {
502508
String path = scheme.getModel(recipe.getType());
503509
if(path == null) {
@@ -530,6 +536,8 @@ public StationFeedback hit(Player p, ItemStack i) {
530536

531537
}
532538

539+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
540+
@SuppressWarnings("deprecation")
533541
private void addHit(Player p, CraftingHit hit) {
534542
if(hits.containsKey(hit)) {
535543
hits.get(hit).increaseCurrent(1);

‎src/main/java/net/tfminecraft/advancedcrafting/objects/ingredients/Ingredient.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public IngredientData getIngredientData() {
6161
}
6262

6363

64+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
65+
@SuppressWarnings("deprecation")
6466
public void buildTo(ItemStack i) {
6567
ItemMeta m = i.getItemMeta();
6668
m.getPersistentDataContainer().set(PDCKeys.ingredientId(), PersistentDataType.STRING, id);

‎src/main/java/net/tfminecraft/advancedcrafting/utils/AcItemLoreRefresher.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public static boolean isOutdated(ItemStack item) {
4242
return getLiveRevision(item) > AcItemTags.getStoredRevision(item);
4343
}
4444

45+
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
46+
@SuppressWarnings("deprecation")
4547
public static RefreshResult refresh(ItemStack item) {
4648
if (item == null || item.getType().isAir() || !item.hasItemMeta()) {
4749
return RefreshResult.unchanged();

0 commit comments

Comments
 (0)