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
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public boolean start(Player player, ItemStack result) {
return false;
}
if (busy) {
player.sendMessage("§cForge is busy — wait for the current strike.");
player.sendMessage(de.aetherion.core.exile.Say.t(player,
"§cThe anvil is busy. Wait for the current strike.", "§cDer Amboss ist besetzt. Warte auf den Schlag davor."));
return false;
}
station.ensureResolved();
Expand Down Expand Up @@ -146,7 +147,7 @@ public boolean start(Player player, ItemStack result) {
savePending(player.getUniqueId(), held);

player.closeInventory();
forgehandSay(player, "Into the frame — keep an eye on it.");
brannSay(player, "Onto the anvil. Keep an eye on it.", "Auf den Amboss. Behalt es im Auge.");
player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_PLACE, 0.7f, 0.9f);
world.playSound(itemAt, Sound.BLOCK_ANVIL_PLACE, 0.8f, 0.85f);

Expand Down Expand Up @@ -240,8 +241,8 @@ private void complete(Session session) {
HudFocus.clear(player, FOCUS);
give(player, session.result);
clearPending(session.playerId);
forgehandSay(player, "Done — Tier " + BlueprintUpgrade.roman(session.tier)
+ ". Hot off the anvil.");
brannSay(player, "Done. Tier " + BlueprintUpgrade.roman(session.tier) + ", hot off the anvil.",
"Fertig. Stufe " + BlueprintUpgrade.roman(session.tier) + ", frisch vom Amboss.");
de.aetherion.items.mining.MineIsleHook.forged(player, session.tier, station.anvilCenter());
player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_USE, 0.85f, 1.15f);
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 0.45f, 1.35f);
Expand Down Expand Up @@ -273,9 +274,9 @@ public void onJoin(PlayerJoinEvent event) {
}
give(player, pending);
clearPending(player.getUniqueId());
forgehandSay(player, "Caught you — Tier "
+ BlueprintUpgrade.roman(BlueprintUpgrade.tier(pending))
+ " finished while you were gone.");
String tier = BlueprintUpgrade.roman(BlueprintUpgrade.tier(pending));
brannSay(player, "There you are. Tier " + tier + " was finished while you were gone.",
"Da bist du ja. Stufe " + tier + " wurde fertig, während du weg warst.");
}, 40L);
}

Expand Down Expand Up @@ -314,14 +315,9 @@ private static void give(Player player, ItemStack item) {
}
}

private static void forgehandSay(Player player, String line) {
try {
Class.forName("de.aetherion.quests.npc.LivingNpcProfile")
.getMethod("say", Player.class, String.class, String.class, String.class)
.invoke(null, player, "eldervale_upgrade", "Forgehand", line);
} catch (Throwable ignored) {
player.sendMessage("§6Forgehand §8⟫ §f" + line);
}
/** Brann works the anvil since the isle has one forge (2026-12-04); before, the Forgehand spoke here. */
private static void brannSay(Player player, String english, String german) {
player.sendMessage("§6Brann §8» §f" + de.aetherion.core.exile.Say.t(player, english, german));
}

private void savePending(UUID id, ItemStack item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ private Location forgehandHint() {
if (fromNpc != null) {
return fromNpc;
}
// one forge since 2026-12-04: the Forgehand's row is gone, Quests keeps his spot in forge-site.yml
Location handed = readSpot("AetherionQuests/forge-site.yml", "site.");
if (handed != null) {
return handed;
}
World world = Bukkit.getWorld("world");
if (world == null && !Bukkit.getWorlds().isEmpty()) {
world = Bukkit.getWorlds().get(0);
Expand All @@ -152,13 +157,16 @@ private Location forgehandHint() {
}

private Location readNpcLocation() {
return readSpot("AetherionQuests/npcs.yml", "npcs.eldervale_upgrade.");
}

private static Location readSpot(String relative, String base) {
try {
File file = new File(Bukkit.getPluginsFolder(), "AetherionQuests/npcs.yml");
File file = new File(Bukkit.getPluginsFolder(), relative);
if (!file.exists()) {
return null;
}
YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
String base = "npcs.eldervale_upgrade.";
if (!config.contains(base + "x")) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Set;

/**
* Blueprint tool tiers T1–T4 via Upgrade Stones II/III/IV (Eldervale Forgehand only).
* Blueprint tool tiers T1–T4 via Upgrade Stones II/III/IV (only at Brann's forge on the Mining Isle).
*/
public final class BlueprintUpgrade {

Expand Down Expand Up @@ -112,7 +112,7 @@ public static ItemStack createStone(int targetTier) {
// Short, complete lines (≤46 visible). The pipeline adds type, flavor and the rarity footer.
meta.setLore(List.of(
"§eUse: §7Raise a §bBlueprint tool §7to §fTier " + roman(use) + "§7.",
"§7Apply it at the §6Eldervale Forgehand§7.",
"§7Brann raises the tool at his §6forge§7 on the Mining Isle.",
"§8Needs Tier " + roman(use - 1) + " first."
));
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ public ItemValueService(JavaPlugin plugin, ItemManager itemManager) {
/**
* Bundled economy.yml version. 3 = P2 progression (Signature recipes, diving craft, Trophies).
* 4 = A-60: T4/T5 ladder slots take 16 Compressed instead of one Compacted, so those 50 pieces list lower.
* 5 = one forge on the Mining Isle: Brann forges the Upgrade Stones from isle ore, so the three stones list far
* lower (a stone listed at 1.28 million that costs 5,000 coins and some iron would print coins at the buyback).
*/
public static final int ECONOMY_VERSION = 4;
public static final int ECONOMY_VERSION = 5;

/** The pieces economy v4 re-prices (A-60). A v3 live file gets only these patched in. */
private static final java.util.regex.Pattern V4_LADDER = java.util.regex.Pattern.compile(
"(combat|mining|farming|foraging|fishing)_(helmet|chestplate|leggings|boots|sword|pickaxe|hoe|axe|rod)_[45]");
/** The pieces economy v5 re-prices. A v3 or v4 live file gets only these patched in. */
private static final java.util.regex.Pattern V5_STONES = java.util.regex.Pattern.compile("blueprint_upgrade_stone_[234]");

private static void ensureEconomyFile(JavaPlugin plugin, File file) {
final int expectedVersion = ECONOMY_VERSION;
Expand All @@ -63,8 +67,12 @@ private static void ensureEconomyFile(JavaPlugin plugin, File file) {
}
YamlConfiguration existing = YamlConfiguration.loadConfiguration(file);
int version = existing.getInt("economy-version", 1);
if (version == 3 && expectedVersion == 4) {
patchV4(plugin, file, existing);
if (version == 3 || version == 4) {
// never replace a live file for a handful of values: patch them in
if (version == 3) {
patch(plugin, file, existing, 3, 4, V4_LADDER, "T4/T5 ladder values (A-60)");
}
patch(plugin, file, existing, 4, 5, V5_STONES, "Upgrade Stone values (one forge)");
return;
}
if (version < expectedVersion) {
Expand All @@ -83,10 +91,11 @@ private static void ensureEconomyFile(JavaPlugin plugin, File file) {
}

/**
* v3 → v4 without touching anything else in the live file: only the T4/T5 ladder values come from the bundled
* file (the old file is kept as economy.yml.v3.bak).
* One version step without touching anything else in the live file: only the crafted values that match
* {@code keys} come from the bundled file (the old file is kept as economy.yml.v&lt;from&gt;.bak).
*/
private static void patchV4(JavaPlugin plugin, File file, YamlConfiguration existing) {
private static void patch(JavaPlugin plugin, File file, YamlConfiguration existing, int from, int to,
java.util.regex.Pattern keys, String what) {
java.io.InputStream bundledStream = plugin.getResource("economy.yml");
if (bundledStream == null) {
return;
Expand All @@ -102,26 +111,26 @@ private static void patchV4(JavaPlugin plugin, File file, YamlConfiguration exis
if (crafted == null) {
return;
}
File backup = new File(file.getParentFile(), "economy.yml.v3.bak");
File backup = new File(file.getParentFile(), "economy.yml.v" + from + ".bak");
try {
java.nio.file.Files.copy(file.toPath(), backup.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
} catch (java.io.IOException exception) {
plugin.getLogger().warning("Could not back up economy.yml before the v4 patch: " + exception.getMessage());
plugin.getLogger().warning("Could not back up economy.yml before the v" + to + " patch: " + exception.getMessage());
}
int patched = 0;
for (String key : crafted.getKeys(false)) {
if (V4_LADDER.matcher(key).matches()) {
if (keys.matcher(key).matches()) {
existing.set("crafted." + key, crafted.getLong(key));
patched++;
}
}
existing.set("economy-version", 4);
existing.set("economy-version", to);
try {
existing.save(file);
plugin.getLogger().info("economy.yml patched to version 4: " + patched + " T4/T5 ladder values (A-60); old file kept as "
+ backup.getName() + ".");
plugin.getLogger().info("economy.yml patched to version " + to + ": " + patched + " " + what
+ "; old file kept as " + backup.getName() + ".");
} catch (java.io.IOException exception) {
plugin.getLogger().warning("Could not save the economy.yml v4 patch: " + exception.getMessage());
plugin.getLogger().warning("Could not save the economy.yml v" + to + " patch: " + exception.getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,25 +726,8 @@ public void registerAll() {
de.aetherion.items.economy.Signatures.display("prize_crop"), customItem.createDungeonCore(),
new CraftedPredecessorRequirement("mining_pickaxe_3"));

registerSimple(
"vein_siphon",
RecipeCategory.MINING,
customItem.createVeinSiphon(),
Rarity.RARE,
List.of("IRI", "RPR", "IRI"),
createMixedIngredients(
'I',
new ItemStack(Material.IRON_INGOT),
'R',
new ItemStack(Material.REDSTONE),
'P',
customItem.createMiningPickaxe()
),
new BlueprintUnlockRequirement(
de.aetherion.items.blueprint.BlueprintUnlockService.VEIN_SIPHON,
"Turn in Blueprint: Vein Siphon at the Surveyor"
)
);
// No recipe for the Vein Siphon: the Surveyor's stamp hands the tool over, as an item of its own.
// The September recipe took a Mining Pickaxe for it; blueprint tools are never built from the pick.

FarmingItems farming = customItem.farming();
registerSimple(
Expand Down Expand Up @@ -2225,54 +2208,8 @@ private void registerMaterialProgression() {
);
}

/*
* Blueprint Upgrade Stones — steep Eldervale progression (II/III/IV).
* Stone II unlocks on Eldervale discover (no fake T1). III/IV chain off prior craft.
*/
{
Map<Character, ItemStack> stone2 = new LinkedHashMap<>();
stone2.put('I', CompressedResource.RAW_IRON.compacted());
stone2.put('D', CompressedResource.DIAMOND.compressed());
registerSimple(
"blueprint_upgrade_stone_2",
RecipeCategory.MINING,
customItem.createBlueprintUpgradeStone2(),
Rarity.EPIC,
List.of("III", "IDI", "III"),
stone2,
new HubSpawnUnlockRequirement("eldervale", "Discover Eldervale")
);
}
{
Map<Character, ItemStack> stone3 = new LinkedHashMap<>();
stone3.put('D', CompressedResource.DIAMOND.compacted());
stone3.put('N', new ItemStack(Material.NETHERITE_SCRAP));
stone3.put('G', CompressedResource.RAW_GOLD.compacted());
registerSimple(
"blueprint_upgrade_stone_3",
RecipeCategory.MINING,
customItem.createBlueprintUpgradeStone3(),
Rarity.LEGENDARY,
List.of("DDD", "GNG", "DDD"),
stone3,
new CraftedPredecessorRequirement("blueprint_upgrade_stone_2")
);
}
{
Map<Character, ItemStack> stone4 = new LinkedHashMap<>();
stone4.put('D', CompressedResource.DIAMOND.compacted());
stone4.put('A', new ItemStack(Material.ANCIENT_DEBRIS));
stone4.put('B', new ItemStack(Material.NETHERITE_BLOCK));
registerSimple(
"blueprint_upgrade_stone_4",
RecipeCategory.MINING,
customItem.createBlueprintUpgradeStone4(),
Rarity.MYTHIC,
List.of("DDD", "ABA", "DDD"),
stone4,
new CraftedPredecessorRequirement("blueprint_upgrade_stone_3")
);
}
// Upgrade Stones II to IV have no recipe here any more: Brann forges them at the one forge on the Mining Isle
// (Mining ForgeWorks#stoneCost). The old recipes asked 131,072 iron for the first stone.
}


Expand Down
9 changes: 5 additions & 4 deletions AetherionItems/src/main/resources/economy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

# 3 = P2 progression (T4/T5 Signature recipes, diving craft, spectacle_star, Signatures)
# 4 = A-60: T4/T5 ladder slots take 16 Compressed instead of one Compacted; only those 50 values changed
economy-version: 4
# 5 = one forge on the Mining Isle: Upgrade Stones II to IV are forged by Brann from isle ore; only those 3 values changed
economy-version: 5

vanilla:
COBBLESTONE: 1
Expand Down Expand Up @@ -165,9 +166,9 @@ resources:
crafted:
ashen_cleaver: 45000
birch_booster: 12
blueprint_upgrade_stone_2: 1283093
blueprint_upgrade_stone_3: 3180058
blueprint_upgrade_stone_4: 2973983
blueprint_upgrade_stone_2: 16641
blueprint_upgrade_stone_3: 76539
blueprint_upgrade_stone_4: 715257
bone_boots: 931
bone_chestplate: 1862
bone_helmet: 1164
Expand Down
1 change: 1 addition & 0 deletions AetherionItems/src/main/resources/lang/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@ text:
- {en: "§dThe lesser phial tastes like a shorter bad idea.", de: "§dDie geringe Phiole schmeckt nach einer kürzeren dummen Idee."}
- {en: "§5The phial tastes like a bad idea that worked.", de: "§5Die Phiole schmeckt nach einer dummen Idee, die klappte."}
- {en: "§7Apply it at the §6Eldervale Forgehand§7.", de: "§7Beim §6Eldervale Forgehand§7 anwenden."}
- {en: "§7Brann raises the tool at his §6forge§7 on the Mining Isle.", de: "§7Brann hebt das Werkzeug an seiner §6Schmiede§7 auf der Mining-Insel."}
- {en: "§7Boss drop. Pick a set. Dungeons keep their Floor I vestige.", de: "§7Boss-Drop. Wähl ein Set. Dungeons behalten ihr Vestige von Etage I."}
- {en: "§eRight-click §7to pick a shape.", de: "§eRechtsklick §7zum Wählen einer Form."}
- {en: "§8Sword · Bow · Wand · Maul · Staff", de: "§8Schwert · Bogen · Zauberstab · Streithammer · Stab"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,13 @@ private static int every(MineRole role) {
private void work(MineRole role, Location at) {
Location spot = at.clone();
if (role == MineRole.FORGEMASTER) {
// Brann's anvil is the Deep Forge behind his counter: he turns to it to work
Location forge = MineWorld.point(isle.plugin(), isle.plugin().getConfig().getString("forge-prop.deep"));
if (forge != null && forge.getWorld() == at.getWorld() && forge.distanceSquared(at) < 64) {
spot.setYaw((float) Math.toDegrees(Math.atan2(-(forge.getX() - at.getX()), forge.getZ() - at.getZ())));
// Brann turns to his anvil to work: the one up top since he moved, the Deep Forge where he still stands below
for (String key : new String[] {"forge-prop.forgehand", "forge-prop.deep"}) {
Location forge = MineWorld.point(isle.plugin(), isle.plugin().getConfig().getString(key));
if (forge != null && forge.getWorld() == at.getWorld() && forge.distanceSquared(at) < 64) {
spot.setYaw((float) Math.toDegrees(Math.atan2(-(forge.getX() - at.getX()), forge.getZ() - at.getZ())));
break;
}
}
}
swing(role, spot);
Expand Down
Loading
Loading