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>
<project.build.outputTimestamp>2026-09-22T00:00:00Z</project.build.outputTimestamp>
<tlibs.version>2.0.0</tlibs.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ public void reload() {
loadConfigs();
revisionTracker.flush();
}
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public void reloadMessage(Player p) {
p.sendMessage(ChatColor.GREEN + "[AdvancedCrafting]" + ChatColor.YELLOW + " Reloading plugin...");
reload();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ public String getRawData(String key, HashMap<String, Object> defaults) {
: (defaults.containsKey(key) ? defaults.get(key).toString() : key);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public String getString(String key, HashMap<String, Object> defaults) {
return ChatColor.translateAlternateColorCodes('&', getRawData(key, defaults));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ public String getRawData(String key, HashMap<String, Object> defaults) {
: (defaults.containsKey(key) ? defaults.get(key).toString() : key);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public String getString(String key, HashMap<String, Object> defaults) {
return ChatColor.translateAlternateColorCodes('&', getRawData(key, defaults));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public void run() {
}.runTaskTimer(AdvancedCrafting.plugin, 0, 20L);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
@EventHandler
public void addIngredient(PlayerInteractEvent e) {
if(!e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) return;
Expand Down Expand Up @@ -158,6 +160,8 @@ public void addIngredient(PlayerInteractEvent e) {
p.sendTitle("§aAdded "+i.getItemMeta().getDisplayName(), station.getStatus(), 5, 30, 5);
i.setAmount(i.getAmount()-1);
}
// 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.
@SuppressWarnings("deprecation")
public void forgeAlloy(PlayerInteractEvent e) {
Block b = e.getClickedBlock();
Player p = e.getPlayer();
Expand Down Expand Up @@ -187,6 +191,8 @@ public void forgeAlloy(PlayerInteractEvent e) {
}
}

// This path mutates the existing ItemStack; replacing it would change aliases held by callers.
@SuppressWarnings("deprecation")
public void nameAlloy(Player p, String s) {
if(!naming.containsKey(p)) {
p.sendMessage("§cYou have no alloy to name");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ public void onIaFurnitureBreak(FurnitureBreakEvent e) {
discardBrokenStation(loc);
}

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


// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
@EventHandler
public void invenClick(InventoryClickEvent e) {
Player p = (Player) e.getWhoClicked();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
public class InventoryManager {
public static final String STAT_PREVIEW_TITLE = "§7Stat Preview";

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public void categoryView(Player p) {
Inventory i = AdvancedCrafting.plugin.getServer().createInventory(null, 27, "§7Select Category");
int x = 0;
Expand All @@ -51,6 +53,8 @@ public void categoryView(Player p) {
}
p.openInventory(i);
}
// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public void recipeView(Player p, RecipeCategory c) {
Inventory i = AdvancedCrafting.plugin.getServer().createInventory(null, 27, "§7Select Recipe");
int x = 0;
Expand All @@ -72,6 +76,8 @@ public void recipeView(Player p, RecipeCategory c) {
p.openInventory(i);
}

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

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

// 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.
@SuppressWarnings("deprecation")
private ItemStack getCategoryItem(RecipeCategory c) {
ItemStack i = new ItemStack(Material.BARRIER, 1);
if(c.getRecipes().size() == 0) {
Expand Down Expand Up @@ -149,6 +159,8 @@ private ItemStack getCategoryItem(RecipeCategory c) {
return i;
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private ItemStack getRecipeItem(CraftingRecipe r) {
ItemStack fallback = new ItemStack(Material.BARRIER, 1);
ItemAPI api = TLibs.getItemAPI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ public HashMap<IngredientType, IntCounter> getTypes() {
return types;
}

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

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private StationFeedback createItem(Player p, Double forcedQualityPercent) {
if (!checkItems(p)) {
return StationFeedback.LACKING_ITEMS;
Expand Down Expand Up @@ -498,6 +502,8 @@ private StationFeedback createItem(Player p, Double forcedQualityPercent) {
return StationFeedback.SUCCESS;
}

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

}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
private void addHit(Player p, CraftingHit hit) {
if(hits.containsKey(hit)) {
hits.get(hit).increaseCurrent(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public IngredientData getIngredientData() {
}


// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public void buildTo(ItemStack i) {
ItemMeta m = i.getItemMeta();
m.getPersistentDataContainer().set(PDCKeys.ingredientId(), PersistentDataType.STRING, id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public static boolean isOutdated(ItemStack item) {
return getLiveRevision(item) > AcItemTags.getStoredRevision(item);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public static RefreshResult refresh(ItemStack item) {
if (item == null || item.getType().isAir() || !item.hasItemMeta()) {
return RefreshResult.unchanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public static void applyPdc(ItemStack item, int loreIndex, int tier) {
item.setItemMeta(meta);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public static void applyTierLine(ItemStack item, int tier) {
if (item == null || !item.hasItemMeta() || tier <= 0) {
return;
Expand All @@ -57,6 +59,8 @@ public static void applyTierLine(ItemStack item, int tier) {
applyPdc(item, tierIndex, tier);
}

// Keep the existing legacy text representation, formatting, and exact-string comparisons.
@SuppressWarnings("deprecation")
public static void refreshTierLine(ItemStack item, int tier) {
if (item == null || !item.hasItemMeta() || tier <= 0) {
return;
Expand Down