diff --git a/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintForgeRitual.java b/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintForgeRitual.java index 2ac08474..9b78bf6f 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintForgeRitual.java +++ b/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintForgeRitual.java @@ -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(); @@ -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); @@ -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); @@ -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); } @@ -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) { diff --git a/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintForgeStation.java b/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintForgeStation.java index 718340d3..e40700a0 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintForgeStation.java +++ b/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintForgeStation.java @@ -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); @@ -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; } diff --git a/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintUpgrade.java b/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintUpgrade.java index 9fd055ab..1b615dd1 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintUpgrade.java +++ b/AetherionItems/src/main/java/de/aetherion/items/blueprint/BlueprintUpgrade.java @@ -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 { @@ -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); diff --git a/AetherionItems/src/main/java/de/aetherion/items/economy/ItemValueService.java b/AetherionItems/src/main/java/de/aetherion/items/economy/ItemValueService.java index 68bd61fb..daaa7c1d 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/economy/ItemValueService.java +++ b/AetherionItems/src/main/java/de/aetherion/items/economy/ItemValueService.java @@ -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; @@ -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) { @@ -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<from>.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; @@ -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()); } } diff --git a/AetherionItems/src/main/java/de/aetherion/items/recipe/RecipeRegistry.java b/AetherionItems/src/main/java/de/aetherion/items/recipe/RecipeRegistry.java index 1b628a69..ddc132db 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/recipe/RecipeRegistry.java +++ b/AetherionItems/src/main/java/de/aetherion/items/recipe/RecipeRegistry.java @@ -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( @@ -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 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 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 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. } diff --git a/AetherionItems/src/main/resources/economy.yml b/AetherionItems/src/main/resources/economy.yml index 2590d752..1dfc7415 100644 --- a/AetherionItems/src/main/resources/economy.yml +++ b/AetherionItems/src/main/resources/economy.yml @@ -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 @@ -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 diff --git a/AetherionItems/src/main/resources/lang/de.yml b/AetherionItems/src/main/resources/lang/de.yml index 5126dd6f..72a4afbb 100644 --- a/AetherionItems/src/main/resources/lang/de.yml +++ b/AetherionItems/src/main/resources/lang/de.yml @@ -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"} diff --git a/AetherionMining/src/main/java/de/aetherion/mining/isle/CastIdle.java b/AetherionMining/src/main/java/de/aetherion/mining/isle/CastIdle.java index 01110875..6725e799 100644 --- a/AetherionMining/src/main/java/de/aetherion/mining/isle/CastIdle.java +++ b/AetherionMining/src/main/java/de/aetherion/mining/isle/CastIdle.java @@ -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); diff --git a/AetherionMining/src/main/java/de/aetherion/mining/isle/ForgeWorks.java b/AetherionMining/src/main/java/de/aetherion/mining/isle/ForgeWorks.java index 699cd86b..b301a47f 100644 --- a/AetherionMining/src/main/java/de/aetherion/mining/isle/ForgeWorks.java +++ b/AetherionMining/src/main/java/de/aetherion/mining/isle/ForgeWorks.java @@ -1,5 +1,9 @@ package de.aetherion.mining.isle; +import de.aetherion.items.AetherionItems; +import de.aetherion.items.blueprint.BlueprintForgeRitual; +import de.aetherion.items.blueprint.BlueprintUpgrade; + import org.bukkit.Bukkit; import org.bukkit.Color; import org.bukkit.Location; @@ -45,8 +49,13 @@ * *

Every mark is paid in compressed ore, coins and, higher up, specimens. The top Assay Plate * wants a Heartstone, which only grows in the Amethyst Mine. There is no second currency. - * Forge Reputation is earned by forging here, by blueprint upgrades at the Forgehand upstairs, - * by contracts and by Stonejaw jaws. It gates the higher tiers. + * Forge Reputation is earned by forging here, by blueprint upgrades at his anvil, by contracts + * and by Stonejaw jaws. It gates the higher tiers. + * + *

One forge since 2026-12-04 (Robb after the playtest: two forges on the isle are one too many): + * Brann works up top where the Forgehand stood and does all three jobs. He raises blueprint tools + * ({@link #upgrade}), forges marks and turns out the wares, the Upgrade Stones among them + * ({@link #craftStone}; before, the Recipe Book asked 131,072 iron for the first one). * *

The forge also turns out two consumables: the Prospector's Flare (every ore within 10 blocks * glows through the rock, only for you) and the Canary Cage (warnings, hazard shield, no dark). @@ -433,19 +442,20 @@ public void addRep(Player player, long amount, String reason) { Rank after = Rank.of(profile.forgeRep); MineText.bar(player, "§6⚒ +" + amount + " Forge Reputation §8· §7" + reason); if (after.ordinal() > before.ordinal()) { - player.sendMessage("§6⚒ Forge rank up: " + after.colored() + " §8· §7Brann has more for you at the Deep Forge."); + player.sendMessage("§6⚒ Forge rank up: " + after.colored() + " §8· §7" + MineLesson.t(player, + "Brann has more for you at the forge.", "Brann hat an der Schmiede mehr für dich.")); player.playSound(player.getLocation(), Sound.BLOCK_BELL_USE, SoundCategory.PLAYERS, 0.8f, 0.7f); player.playSound(player.getLocation(), Sound.UI_TOAST_CHALLENGE_COMPLETE, SoundCategory.PLAYERS, 0.6f, 0.9f); MineSkills.bonus(player, 100 * after.ordinal()); } } - /** A blueprint upgrade finished at the Forgehand (Items ritual). */ + /** A blueprint upgrade finished at Brann's anvil (Items ritual). */ void onForged(Player player, int tier) { MineProfiles.Profile profile = isle.profiles().of(player); profile.forged++; isle.profiles().markDirty(); - addRep(player, 40L * Math.max(1, tier), "Blueprint Tier " + MineText.roman(tier) + " at the Forgehand"); + addRep(player, 40L * Math.max(1, tier), "Blueprint Tier " + MineText.roman(tier) + " at Brann's anvil"); if (tier >= 4) { var line = MineText.legacy("§6⚒ " + player.getName() + " §7forged a §6Tier IV §7blueprint tool at the Eldervale forge." + " §8The whole mountain heard it."); @@ -455,6 +465,171 @@ void onForged(Player player, int tier) { } } + // ------------------------------------------------------------------ blueprint tools and their stones + + /** A blueprint tool in the bag: its inventory slot, a copy of the stack and its tier (1 to 4). */ + public record Blueprint(int slot, ItemStack stack, int tier) { + } + + /** Every blueprint tool the player carries (Vein Siphon and the five others), in bag order. */ + public List blueprints(Player player) { + List found = new ArrayList<>(); + if (player == null) { + return found; + } + try { + ItemStack[] contents = player.getInventory().getStorageContents(); + for (int slot = 0; slot < contents.length; slot++) { + ItemStack stack = contents[slot]; + if (stack != null && BlueprintUpgrade.isBlueprintTool(MineItems.itemId(stack))) { + found.add(new Blueprint(slot, stack.clone(), BlueprintUpgrade.tier(stack))); + } + } + } catch (LinkageError ignored) { + // an Items jar without the blueprint classes: no tools page + } + return found; + } + + /** Upgrade Stones in the bag that raise a tool to {@code tier} (2 to 4). */ + public int stones(Player player, int tier) { + int total = 0; + try { + for (ItemStack stack : player.getInventory().getStorageContents()) { + if (stack != null && BlueprintUpgrade.stoneTargetTier(stack) == tier) { + total += stack.getAmount(); + } + } + } catch (LinkageError ignored) { + return 0; + } + return total; + } + + public enum Upgrade { STARTED, NO_TOOL, FINISHED, NO_STONE, BUSY, FAILED } + + /** + * Raise the blueprint tool in {@code slot} by one tier: one matching Upgrade Stone goes, the tool goes onto the + * anvil and comes back when the hammer is done (Items ritual, 10 to 30 seconds). Boosters stay on the tool. + */ + public Upgrade upgrade(Player player, int slot) { + try { + AetherionItems items = AetherionItems.getInstance(); + PlayerInventory inventory = player.getInventory(); + ItemStack tool = slot < 0 || slot >= 36 ? null : inventory.getItem(slot); + if (items == null || items.getItemManager() == null) { + return Upgrade.FAILED; + } + if (tool == null || !BlueprintUpgrade.isBlueprintTool(MineItems.itemId(tool))) { + return Upgrade.NO_TOOL; + } + int tier = BlueprintUpgrade.tier(tool); + if (tier >= BlueprintUpgrade.MAX_TIER) { + return Upgrade.FINISHED; + } + int stoneSlot = -1; + for (int i = 0; i < 36 && stoneSlot < 0; i++) { + ItemStack stack = inventory.getItem(i); + if (stack != null && BlueprintUpgrade.stoneTargetTier(stack) == tier + 1) { + stoneSlot = i; + } + } + if (stoneSlot < 0) { + return Upgrade.NO_STONE; + } + BlueprintForgeRitual ritual = items.getBlueprintForgeRitual(); + if (ritual != null && (ritual.isBusy() || ritual.isForging(player.getUniqueId()))) { + return Upgrade.BUSY; + } + ItemStack stone = inventory.getItem(stoneSlot); + ItemStack result = BlueprintUpgrade.apply(items.getItemManager(), tool, stone); + if (result == null) { + return Upgrade.FAILED; + } + inventory.setItem(slot, null); + stone.setAmount(stone.getAmount() - 1); + inventory.setItem(stoneSlot, stone.getAmount() <= 0 ? null : stone); + player.closeInventory(); + if (ritual == null || !ritual.start(player, result)) { + // no anvil scene on this server: the raised tool comes straight back, nothing is lost + MineSkills.give(player, result); + player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_USE, SoundCategory.PLAYERS, 0.8f, 1.1f); + onForged(player, tier + 1); + } + return Upgrade.STARTED; + } catch (LinkageError | RuntimeException failure) { + isle.plugin().getLogger().warning("Blueprint upgrade at the forge failed: " + failure); + return Upgrade.FAILED; + } + } + + /** + * What an Upgrade Stone costs at the forge. Ore the isle itself gives, on the scale of the marks: the first stone + * is an evening's ore with no rank asked, the last one stands beside the top marks. + */ + public Cost stoneCost(int tier) { + Map items = new LinkedHashMap<>(); + return switch (Math.max(2, Math.min(4, tier))) { + case 2 -> { + items.put("compressed_raw_iron", 8); + items.put("compressed_raw_copper", 4); + items.put("compressed_redstone", 4); + yield new Cost(items, Map.of(), 5_000L, null, 0, Rank.VISITOR); + } + case 3 -> { + items.put("compressed_raw_iron", 24); + items.put("compressed_raw_gold", 12); + items.put("compressed_lapis", 8); + yield new Cost(items, Map.of(), 25_000L, Grade.FLAWLESS, 1, Rank.JOURNEYMAN); + } + default -> { + items.put("compacted_raw_iron", 2); + items.put("compacted_raw_gold", 1); + items.put("compressed_emerald", 16); + yield new Cost(items, Map.of(), 100_000L, Grade.PERFECT, 1, Rank.SMITH); + } + }; + } + + /** The stone itself, as Items makes it (null when Items is not there). */ + public ItemStack stone(int tier) { + try { + return BlueprintUpgrade.createStone(Math.max(2, Math.min(4, tier))); + } catch (LinkageError | RuntimeException failure) { + return null; + } + } + + /** Forge one Upgrade Stone. Returns false with the reason on the action bar. */ + public boolean craftStone(Player player, int tier) { + ItemStack stone = stone(tier); + Cost cost = stoneCost(tier); + if (stone == null) { + MineText.bar(player, MineLesson.t(player, "§cThe forge is cold right now.", "§cDie Schmiede ist gerade kalt.")); + return false; + } + if (!affordable(player, cost)) { + player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, SoundCategory.PLAYERS, 0.6f, 0.7f); + MineText.bar(player, MineLesson.t(player, "§cBrann shakes his head §8· §7check the list, something's short.", + "§cBrann schüttelt den Kopf §8· §7schau auf die Liste, es fehlt etwas.")); + return false; + } + if (!MineSkills.takeCoins(player, cost.coins())) { + MineText.bar(player, MineLesson.t(player, "§cCoins didn't clear.", "§cDie Münzen gingen nicht durch.")); + return false; + } + PlayerInventory inventory = player.getInventory(); + cost.items().forEach((id, amount) -> MineItems.takeById(inventory, id, amount)); + if (cost.specimen() != null) { + MineItems.takeSpecimensAtLeast(inventory, isle.crystals(), cost.specimen(), cost.specimens()); + } + MineSkills.give(player, stone); + player.playSound(player.getLocation(), Sound.BLOCK_SMITHING_TABLE_USE, SoundCategory.PLAYERS, 0.8f, 0.9f); + player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_USE, SoundCategory.PLAYERS, 0.6f, 1.2f); + addRep(player, 10L * tier, "Upgrade Stone " + MineText.roman(tier)); + return true; + } + // ------------------------------------------------------------------ effects read by the router double oreFortune(Player player) { @@ -499,7 +674,7 @@ public ItemStack tool(Tool tool, int amount) { List lore = new ArrayList<>(tool.lore); lore.add(""); lore.add("§eRight-click to use."); - lore.add("§8The Deep Forge · Mining Isle"); + lore.add("§8Brann's Forge · Mining Isle"); meta.setLore(lore); meta.setEnchantmentGlintOverride(true); meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS); diff --git a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineCast.java b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineCast.java index 48b6b971..3821dcce 100644 --- a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineCast.java +++ b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineCast.java @@ -75,6 +75,8 @@ private record Spawned(String body, UUID hologram, boolean badge) { private final Map barked = new ConcurrentHashMap<>(); private final Map clickCool = new ConcurrentHashMap<>(); private boolean seeded; + /** Brann already moved up to the one forge (see {@link #moveBrannUp()}). */ + private boolean forgeUp; private boolean routed; private boolean warnedNoFancy; private BukkitTask task; @@ -119,10 +121,10 @@ private TalkDesk wickDesk() { TalkDesk.Topic.of("Who's who?", net.kyori.adventure.text.format.NamedTextColor.AQUA, "Who runs this rock?", "§6Otto§f hands out contracts. §6Nan§f at the Hearth feeds you — in ore.", - "§dIlse§f buys specimens up at the Assay Office. §6Brann§f runs the Deep Forge on the pit floor.") + "§dIlse§f buys specimens up at the Assay Office. §6Brann§f runs the forge up here: tools, marks, wares.") .de("Wer ist wer?", "Wer hat hier das Sagen?", "§6Otto§f verteilt Aufträge. §6Nan§f am Herd füttert dich — mit Erz.", - "§dIlse§f kauft Fundstücke oben im Assay Office. §6Brann§f führt die Deep Forge in der Grube."), + "§dIlse§f kauft Fundstücke oben im Assay Office. §6Brann§f führt die Schmiede hier oben: Werkzeuge, Marken, Waren."), TalkDesk.Topic.of("Anything bite?", net.kyori.adventure.text.format.NamedTextColor.RED, "What should I watch for?", "Strain the rock and it caves in. You'll hear it first — move.", @@ -176,10 +178,60 @@ void start() { seeded = true; save(); } + moveBrannUp(); + if (!forgeUp) { + // Quests may write the Forgehand's spot a moment after us + Bukkit.getScheduler().runTaskLater(isle.plugin(), this::moveBrannUp, 200L); + } ensureAll(); task = Bukkit.getScheduler().runTaskTimer(isle.plugin(), this::tick, 40L, 10L); } + /** + * One forge on the isle (Robb 2026-12-03): Brann leaves the pit floor and works at the anvil up top, on the spot + * where the Forgehand stood. Once per server. The spot comes from Quests: its hand-over file, or the Forgehand's + * row while it is still there. A server that never had a Forgehand keeps Brann where he is. + */ + private void moveBrannUp() { + if (forgeUp) { + return; + } + Location site = forgehandSpot(); + if (site == null || site.getWorld() == null) { + return; + } + forgeUp = true; + isle.plugin().getLogger().info("One forge: Brann moves up to the anvil at " + + site.getBlockX() + " " + site.getBlockY() + " " + site.getBlockZ() + "."); + place(MineRole.FORGEMASTER, site); + } + + private static Location forgehandSpot() { + File quests = new File(Bukkit.getPluginsFolder(), "AetherionQuests"); + Location handed = spot(new File(quests, "forge-site.yml"), "site"); + return handed != null ? handed : spot(new File(quests, "npcs.yml"), "npcs.eldervale_upgrade"); + } + + private static Location spot(File file, String path) { + try { + if (!file.isFile()) { + return null; + } + YamlConfiguration config = YamlConfiguration.loadConfiguration(file); + if (!config.contains(path + ".x")) { + return null; + } + org.bukkit.World world = Bukkit.getWorld(config.getString(path + ".world", "world")); + if (world == null) { + return null; + } + return new Location(world, config.getDouble(path + ".x"), config.getDouble(path + ".y"), config.getDouble(path + ".z"), + (float) config.getDouble(path + ".yaw", 0.0d), 0.0f); + } catch (RuntimeException unreadable) { + return null; + } + } + void shutdown() { if (task != null) { task.cancel(); @@ -578,6 +630,7 @@ private void load() { } YamlConfiguration config = YamlConfiguration.loadConfiguration(file); seeded = config.getBoolean("seeded", false); + forgeUp = config.getBoolean("forge-up", false); ConfigurationSection roles = config.getConfigurationSection("roles"); if (roles == null) { return; @@ -600,6 +653,7 @@ private void load() { private void save() { YamlConfiguration config = new YamlConfiguration(); config.set("seeded", seeded); + config.set("forge-up", forgeUp); pending.forEach((role, section) -> { if (!placed.containsKey(role)) { config.createSection("roles." + role.id(), section.getValues(false)); diff --git a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineDistricts.java b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineDistricts.java index 86ff21ee..6f16538d 100644 --- a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineDistricts.java +++ b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineDistricts.java @@ -120,6 +120,15 @@ boolean contains(double px, double pz) { */ static final Set MAJOR_PLACES = Set.of("landing", "north_pit", "great_works", "rootdeep"); + /** + * A live config keeps the line it was written with. The Deep Forge's old line named it Brann's forge; he works + * up top since the isle has one forge (2026-12-04), so that one line is read as the new one. + */ + private static String blurb(String configured) { + return "Brann's forge at the bottom of the North Pit.".equals(configured) + ? "The old fires at the bottom of the North Pit. Brann forges up top now." : configured; + } + public record District(String id, String name, Kind kind, String blurb, List circles, double minY, double maxY, Location anchor, boolean major) { @@ -236,7 +245,7 @@ static List parse(ConfigurationSection root, java.util.logging.Logger key, section.getString("name", id), kind, - section.getString("blurb", ""), + blurb(section.getString("blurb", "")), List.copyOf(circles), section.getDouble("min-y", -64.0d), section.getDouble("max-y", 320.0d), diff --git a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineLesson.java b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineLesson.java index 58523f5c..38a8838a 100644 --- a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineLesson.java +++ b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineLesson.java @@ -321,8 +321,8 @@ private void close(Player player) { List lines = List.of( t(player, "That's mining here, {player}: read the rock, keep the beat. Power opens the rock — rhythm empties it.", "So geht Bergbau hier, {player}: Fels lesen, Takt halten. Kraft öffnet den Fels — Rhythmus leert ihn."), - t(player, "Otto hands out contracts — that's the steady money. Brann's Deep Forge turns ore into marks for keeps. The pad home's by my lamp.", - "Otto vergibt Aufträge — das ist das sichere Geld. Branns Tiefe Schmiede macht aus Erz bleibende Marken. Das Pad nach Hause ist an meiner Lampe."), + t(player, "Otto hands out contracts — that's the steady money. Brann at the forge raises your blueprint tool and stamps marks for keeps. The pad home's by my lamp.", + "Otto vergibt Aufträge — das ist das sichere Geld. Brann an der Schmiede hebt dein Bauplan-Werkzeug eine Stufe und schlägt bleibende Marken. Das Pad nach Hause ist an meiner Lampe."), t(player, "Keep this one, whatever Ilse or Otto offer: at Mining twenty the Assayer on Ore Ridge asks for exactly this find.", "Den hier behältst du, egal was Ilse oder Otto bieten: Bei Mining 20 will der Assayer auf dem Ore Ridge genau diesen Fund."), t(player, "Otto Brassbuckle's contracts pay for ore; copper and iron make your next pick. Back on the mainland, the Assayer on Ore Ridge takes Compressed Coal from Mining 8.", @@ -330,6 +330,8 @@ private void close(Player player) { List chips = new ArrayList<>(); chips.add(new TalkAccess.Reply(t(player, "Otto's contracts", "Ottos Aufträge"), NamedTextColor.GOLD, () -> pointRole(player, MineRole.CLERK), t(player, "Where's Otto?", "Wo ist Otto?"))); + chips.add(new TalkAccess.Reply(t(player, "Brann's forge", "Branns Schmiede"), NamedTextColor.YELLOW, + () -> pointRole(player, MineRole.FORGEMASTER), t(player, "Where's the forge?", "Wo ist die Schmiede?"))); chips.add(new TalkAccess.Reply(t(player, "Way home?", "Weg nach Hause?"), NamedTextColor.AQUA, () -> pointHome(player), t(player, "How do I get home?", "Wie komm ich heim?"))); chips.add(new TalkAccess.Reply(t(player, "Bye.", "Tschüss."), NamedTextColor.DARK_GRAY, @@ -340,6 +342,32 @@ private void close(Player player) { } pointRole(player, MineRole.CLERK); } + forgeNote(player); + } + + /** + * Once, for a miner who carries a blueprint tool (Robb 2026-12-03: whoever gets such a tool must be pointed to the + * smith who raises it): a small note under the compass that Brann's forge does that. + */ + void forgeNote(Player player) { + if (isle.forge().blueprints(player).isEmpty() || !isle.cast().isPlaced(MineRole.FORGEMASTER)) { + return; + } + MineProfiles.Profile profile = isle.profiles().of(player); + if (!profile.claimMark("note_forge_tools")) { + return; + } + isle.profiles().markDirty(); + try { + de.aetherion.core.api.HudNotes.show(player, de.aetherion.core.api.BarChrome.Icon.ANVIL, + MineText.legacy(t(player, "§6Brann's forge", "§6Branns Schmiede")), NamedTextColor.GOLD, + List.of(MineText.legacy(t(player, "§7He raises your blueprint tool,", "§7Er hebt dein Bauplan-Werkzeug,")), + MineText.legacy(t(player, "§7Tier I to IV. Boosters stay on it.", "§7Stufe I bis IV. Booster bleiben drauf."))), + 240); + } catch (LinkageError | RuntimeException older) { + chat(player, t(player, "Brann's forge raises your blueprint tool, Tier I to IV.", + "Branns Schmiede hebt dein Bauplan-Werkzeug, Stufe I bis IV.")); + } } private void pointRole(Player player, MineRole role) { diff --git a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineMenus.java b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineMenus.java index 554cd9e4..be7a5686 100644 --- a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineMenus.java +++ b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineMenus.java @@ -154,7 +154,7 @@ private void crewRow(Holder holder, int slot) { "§6Otto §8· §7Contract Office", "§cNan §8· §7The Hearth · rations", "§dIlse §8· §7Assay Office · collections & cabinet", - "§6Brann §8· §7The Deep Forge · marks", + "§6Brann §8· §7The Forge · tools, marks, wares", "§3Hollis §8· §7Last Lamp · the deep", "", "§eLeft-click §7cycles the compass through them."), (viewer, click) -> { @@ -376,25 +376,143 @@ public void openAssay(Player player, int page) { // ------------------------------------------------------------------ The Deep Forge + /** The three pages of the one forge on the isle (Robb 2026-12-03: two forges are one too many). */ + public enum ForgePage { + TOOLS("Tools", Material.SMITHING_TABLE, "§b", "Raise your blueprint tools, Tier I to IV."), + MARKS("Marks", Material.ANVIL, "§6", "Forge Marks: they stay on you, not on a tool."), + WARES("Wares", Material.BLAST_FURNACE, "§e", "Upgrade Stones, flares and the canary."); + + final String label; + final Material icon; + final String color; + final String blurb; + + ForgePage(String label, Material icon, String color, String blurb) { + this.label = label; + this.icon = icon; + this.color = color; + this.blurb = blurb; + } + } + + /** Opens on the tools when the miner carries a blueprint tool, else on the marks. */ public void openForge(Player player) { + openForge(player, isle.forge().blueprints(player).isEmpty() ? ForgePage.MARKS : ForgePage.TOOLS); + } + + public void openForge(Player player, ForgePage page) { ForgeWorks forge = isle.forge(); Holder holder = new Holder(); - Inventory inventory = create(holder, 54, "§8The Deep Forge §7· Brann Emberlock"); + Inventory inventory = create(holder, 54, "§8Brann's Forge §7· " + page.label); + int[] tabSlots = {2, 4, 6}; + ForgePage[] pages = ForgePage.values(); + for (int i = 0; i < pages.length; i++) { + ForgePage tab = pages[i]; + boolean here = tab == page; + ItemStack icon = set(holder, tabSlots[i], tab.icon, tab.color + "§l" + tab.label, lines( + "§7" + tab.blurb, + "", + here ? "§a▸ You are here" : "§e▶ Click to open"), here ? null : (viewer, click) -> openForge(viewer, tab)); + if (here) { + glow(icon); + holder.inventory.setItem(tabSlots[i], icon); + } + } + switch (page) { + case TOOLS -> forgeTools(player, holder, forge); + case MARKS -> forgeMarks(player, holder, forge); + case WARES -> forgeWares(player, holder, forge); + } MineProfiles.Profile profile = isle.profiles().of(player); ForgeWorks.Rank rank = forge.rank(player); ForgeWorks.Rank next = rank.ordinal() + 1 < ForgeWorks.Rank.values().length ? ForgeWorks.Rank.values()[rank.ordinal() + 1] : null; long rep = forge.rep(player); double fill = next == null ? 1.0d : (rep - rank.from()) / (double) Math.max(1L, next.from() - rank.from()); - set(holder, 4, Material.ANVIL, "§6Forge Reputation §8· " + rank.colored(), lines( + set(holder, 49, Material.NETHER_STAR, "§6Forge Reputation §8· " + rank.colored(), lines( MineText.cells(fill, "§6") + " §7" + MineText.coins(rep) + (next == null ? " §6MAX" : " §8/ " + MineText.coins(next.from()) + " for " + next.colored()), "", "§7Earn it by forging Marks, stamping contracts,", - "§7breaking Stonejaws and upgrading blueprint", - "§7tools at the §6Forgehand §7upstairs.", + "§7breaking Stonejaws and raising blueprint", + "§7tools on this anvil.", "", "§7Blueprint upgrades here: §f" + profile.forged()), null); - int[] slots = {19, 20, 21, 22, 23}; + set(holder, 45, Material.LANTERN, "§8« Old Wick", lines("§7Map, depth and the crew."), (viewer, click) -> openWick(viewer)); + ChromePage.open(player, inventory, ChromePage.Theme.MINE); + } + + /** Page one: every blueprint tool in the bag, one click raises it with the matching Upgrade Stone. */ + private void forgeTools(Player player, Holder holder, ForgeWorks forge) { + List tools = forge.blueprints(player); + if (tools.isEmpty()) { + set(holder, 22, Material.PAPER, "§bNo blueprint tool on you", lines( + "§7Blueprint tools are tools of their own", + "§7next to your pickaxe: the §fVein Siphon", + "§7and its five cousins.", + "", + "§7Ore trolls drop the pages, the §bSurveyor", + "§7on the mainland stamps a page into a tool.", + "§7Bring it here and I raise it, Tier I to IV."), null); + return; + } + int[] slots = {19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34}; + for (int i = 0; i < tools.size() && i < slots.length; i++) { + ForgeWorks.Blueprint tool = tools.get(i); + ItemStack icon = tool.stack().clone(); + icon.setAmount(1); + ItemMeta meta = icon.getItemMeta(); + List lore = new ArrayList<>(meta == null || meta.getLore() == null ? List.of() : meta.getLore()); + lore.add(""); + int nextTier = tool.tier() + 1; + if (tool.tier() >= 4) { + lore.add("§6✦ Tier IV. Nothing left to raise."); + } else { + int have = forge.stones(player, nextTier); + int seconds = nextTier == 3 ? 20 : nextTier == 4 ? 30 : 10; + lore.add("§7Raise to §fTier " + MineText.roman(nextTier) + " §8· §7on the anvil for §f" + seconds + "s"); + lore.add("§7Boosters stay on the tool."); + lore.add((have > 0 ? "§a✔ " : "§c✘ ") + "§f1× Upgrade Stone " + MineText.roman(nextTier) + " §8(" + have + ")"); + lore.add(""); + lore.add(have > 0 ? "§e▶ Click to put it on the anvil" : "§e▶ Click: I make the stone, see Wares"); + } + if (meta != null) { + meta.setLore(lore); + icon.setItemMeta(meta); + } + holder.inventory.setItem(slots[i], icon); + int bagSlot = tool.slot(); + holder.actions.put(slots[i], (viewer, click) -> { + switch (forge.upgrade(viewer, bagSlot)) { + case STARTED -> { + } + case NO_STONE -> { + viewer.playSound(viewer.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, SoundCategory.PLAYERS, 0.6f, 0.7f); + isle.cast().say(viewer, MineRole.FORGEMASTER, MineLesson.t(viewer, + "No stone, no tier. I make them, here's the list.", + "Ohne Stein keine Stufe. Ich mache sie, hier ist die Liste.")); + openForge(viewer, ForgePage.WARES); + } + case BUSY -> isle.cast().say(viewer, MineRole.FORGEMASTER, MineLesson.t(viewer, + "Anvil's busy. Give the hammer a moment.", + "Der Amboss ist besetzt. Gib dem Hammer einen Moment.")); + case FINISHED -> isle.cast().say(viewer, MineRole.FORGEMASTER, MineLesson.t(viewer, + "That one's finished. Tier IV is as far as steel goes.", + "Das ist fertig. Stufe IV, weiter geht Stahl nicht.")); + default -> openForge(viewer, ForgePage.TOOLS); + } + }); + } + set(holder, 40, Material.BOOK, "§bTiers", lines( + "§7Every blueprint tool starts at Tier I.", + "§7Each step up needs one §fUpgrade Stone", + "§7(II, III, IV) and a turn on the anvil.", + "", + "§7Each finished tier: §6+40 Forge Reputation§7 per tier."), null); + } + + /** Page two: the five lines of Forge Marks. */ + private void forgeMarks(Player player, Holder holder, ForgeWorks forge) { + int[] slots = {20, 21, 22, 23, 24}; ForgeWorks.Mark[] marks = ForgeWorks.Mark.values(); for (int i = 0; i < marks.length; i++) { ForgeWorks.Mark mark = marks[i]; @@ -415,14 +533,45 @@ public void openForge(Player player) { ItemStack icon = set(holder, slots[i], mark.icon(), mark.colored() + " " + MineText.roman(Math.max(level, 0)), lore, (viewer, click) -> { if (forge.forge(viewer, mark)) { - openForge(viewer); + openForge(viewer, ForgePage.MARKS); } }); if (level > 0) { glow(icon); + holder.inventory.setItem(slots[i], icon); } } - int[] toolSlots = {30, 32}; + } + + /** Page three: Upgrade Stones for the blueprint tools, the flare and the canary. */ + private void forgeWares(Player player, Holder holder, ForgeWorks forge) { + long rep = forge.rep(player); + int[] stoneSlots = {20, 21, 22}; + for (int tier = 2; tier <= 4; tier++) { + int stoneTier = tier; + ItemStack stone = forge.stone(tier); + if (stone == null) { + continue; + } + ItemMeta meta = stone.getItemMeta(); + List lore = new ArrayList<>(meta == null || meta.getLore() == null ? List.of() : meta.getLore()); + lore.add(""); + lore.add("§7Brann needs:"); + lore.addAll(forge.costLines(player, forge.stoneCost(tier))); + lore.add(""); + lore.add("§e▶ Click to forge one"); + if (meta != null) { + meta.setLore(lore); + stone.setItemMeta(meta); + } + holder.inventory.setItem(stoneSlots[tier - 2], stone); + holder.actions.put(stoneSlots[tier - 2], (viewer, click) -> { + if (forge.craftStone(viewer, stoneTier)) { + openForge(viewer, ForgePage.WARES); + } + }); + } + int[] toolSlots = {24, 25}; ForgeWorks.Tool[] tools = ForgeWorks.Tool.values(); for (int i = 0; i < tools.length; i++) { ForgeWorks.Tool tool = tools[i]; @@ -441,25 +590,10 @@ public void openForge(Player player) { lore.add("§e▶ Click to forge one"); set(holder, toolSlots[i], tool.material(), tool.colored(), lore, (viewer, click) -> { if (forge.craft(viewer, tool)) { - openForge(viewer); + openForge(viewer, ForgePage.WARES); } }); } - set(holder, 40, Material.SMITHING_TABLE, "§6The Forgehand §8(upstairs)", lines( - "§7Blueprint tools (Vein Siphon and friends)", - "§7climb Tier I → IV at the Eldervale Forgehand", - "§7with Upgrade Stones II, III and IV.", - "", - "§7Each finished ritual: §6+40 rep per tier§7.", - "§eClick §7to point your compass at the Landing."), (viewer, click) -> { - viewer.closeInventory(); - MineDistricts.District landing = isle.districts().byId("landing"); - if (landing != null) { - isle.compass().guide(viewer, landing); - } - }); - set(holder, 45, Material.LANTERN, "§8« Old Wick", lines("§7Map, depth and the crew."), (viewer, click) -> openWick(viewer)); - ChromePage.open(player, inventory, ChromePage.Theme.MINE); } // ------------------------------------------------------------------ The Last Lamp @@ -620,8 +754,9 @@ public void openJournal(Player player) { "§cEmber Hour §8· §7Crystal Finds ×4", "§fTremor §8· §7rubble to clear, shore it up", "§aTroll Run §8· §7Ore Trolls crawl out"), null); - set(holder, 23, Material.ANVIL, "§6The Deep Forge", lines( - "§7Forge Marks: permanent upgrades on you.", + set(holder, 23, Material.ANVIL, "§6Brann's Forge", lines( + "§7Blueprint tools up a tier, Forge Marks", + "§7that stay on you, Upgrade Stones and flares.", "§7Rank: " + isle.forge().rank(player).colored(), "", "§eClick §7to open Brann's board."), (viewer, click) -> openForge(viewer)); diff --git a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineProps.java b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineProps.java index 82388506..74161c98 100644 --- a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineProps.java +++ b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineProps.java @@ -42,8 +42,9 @@ *

  • The Deep Forge at the bottom of the North Pit: a molten crucible that breathes, a * leather bellows that pumps, a six-block chimney that smokes, a quench trough, a rack of * picks from iron to netherite, and a banner. It roars when anyone forges a Mark here or - * upgrades a blueprint at the Forgehand upstairs.
  • - *
  • The Forgehand's anvil: four braziers and a name plate around the Items forge frame. + * upgrades a blueprint at the anvil up top. Scenery since Brann moved up (2026-12-04).
  • + *
  • Brann's anvil (piece {@code FORGEHAND}, the Forgehand stood here before): four braziers and a name + * plate around the Items forge frame. * They flare for the whole length of a blueprint ritual.
  • *
  • The Record Board at the Assay Office: the heaviest specimen per ore family, live.
  • * @@ -224,7 +225,8 @@ private void buildDeepForge(Location base, List ids) { } // Banner plate. TextDisplay plate = world.spawn(base.clone().add(0.0, 5.0, -3.2), TextDisplay.class, text -> { - text.text(MineText.legacy("§6§l⚒ THE DEEP FORGE ⚒\n§7Brann Emberlock §8· §eForge Works\n§8Marks · Reputation · Flares")); + // the old fires keep burning as scenery; Brann works the one forge up top since 2026-12-04 + text.text(MineText.legacy("§6§l⚒ THE DEEP FORGE ⚒\n§7The old fires of the North Pit\n§8Brann forges up top now")); text.setBillboard(Display.Billboard.VERTICAL); text.setAlignment(TextDisplay.TextAlignment.CENTER); text.setShadowed(true); @@ -248,7 +250,7 @@ private void buildForgehand(Location anvil, List ids) { braziers.add(lamp); } TextDisplay plate = world.spawn(anvil.clone().add(0, 2.6, 0), TextDisplay.class, text -> { - text.text(MineText.legacy("§6⚒ The Eldervale Forge\n§7Blueprint upgrades §8· §fUpgrade Stones II–IV")); + text.text(MineText.legacy("§6⚒ The Eldervale Forge\n§7Brann Emberlock §8· §fTools · Marks · Wares")); text.setBillboard(Display.Billboard.CENTER); text.setAlignment(TextDisplay.TextAlignment.CENTER); text.setShadowed(true); diff --git a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineRole.java b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineRole.java index c6d4f0aa..84518950 100644 --- a/AetherionMining/src/main/java/de/aetherion/mining/isle/MineRole.java +++ b/AetherionMining/src/main/java/de/aetherion/mining/isle/MineRole.java @@ -10,8 +10,9 @@ * so learning the isle means walking it top to bottom. Preset spots were measured from the schematic * (config {@code mine-cast.presets}). Each NPC can also be moved with its DEV anchor. * - *

    None of them replace the Quests NPCs already on the isle (Forgehand, Surveyor, Ore Ledger, - * the Eldervale welcome). Those keep their dialogue. This cast only runs the Mining loops. + *

    None of them replace the Quests NPCs already on the isle (Surveyor, Ore Ledger, the Eldervale + * welcome). Those keep their dialogue. This cast only runs the Mining loops. The one exception since + * 2026-12-04: Brann took over the Forgehand's anvil up top, so the isle has one forge. */ public enum MineRole { @@ -52,11 +53,11 @@ public enum MineRole { "Fill a row and the whole seam starts paying you respect.", "The record board's up there. Your name isn't. Yet." )), - FORGEMASTER("Brann Emberlock", "The Deep Forge", "§6", "mine_brann", false, Material.ANVIL, - "Forge Works · marks · reputation", + FORGEMASTER("Brann Emberlock", "The Forge", "§6", "mine_brann", false, Material.ANVIL, + "Blueprint tools · marks · wares", List.of( "Ore's just rock that hasn't met me yet.", - "Temper the head, trust the swing. The Forgehand upstairs does the fancy tools, I do the honest ones.", + "Temper the head, trust the swing. Blueprint tool or plain pick, it all crosses this anvil.", "Reputation here isn't bought. It's hammered.", "Every Forge Mark stays with you. The steel forgets, the smith doesn't.", "Heat Ward before the Emberseam. I'm not scraping you off the walls again." diff --git a/AetherionMining/src/main/resources/config.yml b/AetherionMining/src/main/resources/config.yml index 8daa2092..f6202308 100644 --- a/AetherionMining/src/main/resources/config.yml +++ b/AetherionMining/src/main/resources/config.yml @@ -189,7 +189,7 @@ mine-isle-districts: deep_forge: name: The Deep Forge kind: hall - blurb: "Brann's forge at the bottom of the North Pit." + blurb: "The old fires at the bottom of the North Pit. Brann forges up top now." circles: ["38 476 9"] min-y: 30 max-y: 62 @@ -321,7 +321,9 @@ mine-cast: clerk: "-53.5 99 519.5 0" cook: "-56.5 98 614.5 180" assayer: "15.5 122 660.5 0" - forgemaster: "37.5 39 475.5 180" + # One forge since 2026-12-04: Brann stands at the anvil up top (the Forgehand's old spot), not on the pit floor. + # A live server moves him once by itself (MineCast#moveBrannUp, flag forge-up in mine-cast.yml). + forgemaster: "53.5 90 500.5 180" hermit: "105.5 -5 566.5 0" strike-rhythm: diff --git a/AetherionQuests/src/main/java/de/aetherion/quests/AetherionQuests.java b/AetherionQuests/src/main/java/de/aetherion/quests/AetherionQuests.java index bc7092fe..b979fc07 100644 --- a/AetherionQuests/src/main/java/de/aetherion/quests/AetherionQuests.java +++ b/AetherionQuests/src/main/java/de/aetherion/quests/AetherionQuests.java @@ -436,6 +436,8 @@ public void onEnable() { getLogger().info("Dungeon backend detected — skipping quest NPC restore."); return; } + // one forge on the Mining Isle: the Forgehand's row goes before the cast is restored + de.aetherion.quests.npc.ForgeMerge.retireForgehand(this); restoreQuestNpcs(); if (npcEditor != null) { npcEditor.restore(); @@ -450,6 +452,8 @@ public void onEnable() { markerManager.refreshAll(); } }, 200L); + // again a little later: Mining moves Brann up in its own first seconds + Bukkit.getScheduler().runTaskLater(this, () -> de.aetherion.quests.npc.ForgeMerge.retireForgehand(this), 400L); // Origin island cast: seed the unplaced registry NPCs once, after restore + uniqueness sweep. islandCast = new de.aetherion.quests.isle.IsleCast(this); Bukkit.getScheduler().runTaskLater(this, () -> { diff --git a/AetherionQuests/src/main/java/de/aetherion/quests/listener/NpcListener.java b/AetherionQuests/src/main/java/de/aetherion/quests/listener/NpcListener.java index 070cc588..c11c6fdb 100644 --- a/AetherionQuests/src/main/java/de/aetherion/quests/listener/NpcListener.java +++ b/AetherionQuests/src/main/java/de/aetherion/quests/listener/NpcListener.java @@ -1156,7 +1156,7 @@ private static void openBlueprintForge(Player player) { Class.forName("de.aetherion.items.manager.ItemManager")) .invoke(null, player, itemManager); } catch (Throwable ignored) { - player.sendMessage("§cForge unavailable — talk to Forgehand with tool + Upgrade Stone."); + player.sendMessage("§cForge unavailable. Brann on the Mining Isle raises blueprint tools."); } } @@ -2841,12 +2841,12 @@ private boolean openEldervaleDesk(Player player, QuestNPC npc) { "Galleries, Deep Works, then the Undercroft. Deeper rock, more Fortune.", "First time in a band you get a card and some XP. Mind the heat in the Emberseam." })) - .topic(de.aetherion.quests.lang.LangPack.say(player, "eldervale_welcome.desk.forge.label", "The forges?"), + .topic(de.aetherion.quests.lang.LangPack.say(player, "eldervale_welcome.desk.forge.label", "The forge?"), net.kyori.adventure.text.format.NamedTextColor.GOLD, - de.aetherion.quests.lang.LangPack.say(player, "eldervale_welcome.desk.forge.echo", "Tell me about the forges."), + de.aetherion.quests.lang.LangPack.say(player, "eldervale_welcome.desk.forge.echo", "Tell me about the forge."), de.aetherion.quests.lang.LangPack.sayLines(player, "eldervale_welcome.desk.forge.lines", new String[] { - "§6Brann§f runs the Deep Forge on the North Pit floor. Ore in, Forge Marks out — for keeps.", - "The §6Forgehand§f up here stamps blueprints into tools. Bring an Upgrade Stone." + "§6Brann§f runs the forge up here. One anvil for everything.", + "He raises blueprint tools with an Upgrade Stone, and his Forge Marks stay on you for keeps." })) .topic(de.aetherion.quests.lang.LangPack.say(player, "eldervale_welcome.desk.warn.label", "Anything bite?"), net.kyori.adventure.text.format.NamedTextColor.RED, diff --git a/AetherionQuests/src/main/java/de/aetherion/quests/npc/ForgeMerge.java b/AetherionQuests/src/main/java/de/aetherion/quests/npc/ForgeMerge.java new file mode 100644 index 00000000..a1cd3f2a --- /dev/null +++ b/AetherionQuests/src/main/java/de/aetherion/quests/npc/ForgeMerge.java @@ -0,0 +1,82 @@ +package de.aetherion.quests.npc; + +import de.aetherion.quests.AetherionQuests; +import de.aetherion.quests.data.NPCDataStorage; +import de.aetherion.quests.service.QuestNPCSpawnService; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; + +import java.io.File; +import java.io.IOException; + +/** + * One forge on the Mining Isle (Robb 2026-12-03 after the playtest: two forges are one too many, "zusammenführen"). + * The Forgehand ({@code eldervale_upgrade}) goes; Brann of the Mining cast takes his spot and his anvil and does + * blueprint upgrades, marks and wares in one menu. + *

    + * Here: once Brann stands at the anvil, the Forgehand's saved spot is kept in {@code forge-site.yml} (Items finds + * the anvil by it) and his row and his body are removed. Never before, so no server is left without a forge. + */ +public final class ForgeMerge { + + public static final String FORGEHAND = "eldervale_upgrade"; + private static final String SITE_FILE = "forge-site.yml"; + + private ForgeMerge() { + } + + /** + * Brann already stands at the Forgehand's anvil on this server: Mining wrote {@code forge-up: true} into its + * {@code mine-cast.yml} when it moved him (MineCast#moveBrannUp). An older Mining jar, a server without the isle + * or without Mining never writes it. + */ + public static boolean brannTookOver() { + Plugin mining = Bukkit.getPluginManager().getPlugin("AetherionMining"); + if (mining == null || !mining.isEnabled()) { + return false; + } + try { + File cast = new File(mining.getDataFolder(), "mine-cast.yml"); + return cast.isFile() && YamlConfiguration.loadConfiguration(cast).getBoolean("forge-up", false); + } catch (RuntimeException unreadable) { + return false; + } + } + + /** Hand the spot over and let the Forgehand go. Safe to call again: a second call finds nothing to do. */ + public static void retireForgehand(AetherionQuests plugin) { + NPCDataStorage storage = plugin == null ? null : plugin.getNpcDataStorage(); + if (storage == null || !brannTookOver()) { + return; + } + boolean saved = storage.hasSavedNPC(FORGEHAND); + if (saved) { + Location at = storage.getSavedLocation(FORGEHAND); + File site = new File(plugin.getDataFolder(), SITE_FILE); + if (!site.exists() && (at == null || at.getWorld() == null)) { + // his world is not loaded: without the spot Brann would not know where to stand, so the Forgehand stays + return; + } + if (!site.exists()) { + YamlConfiguration out = new YamlConfiguration(); + out.set("site.world", at.getWorld().getName()); + out.set("site.x", at.getX()); + out.set("site.y", at.getY()); + out.set("site.z", at.getZ()); + out.set("site.yaw", at.getYaw()); + try { + de.aetherion.core.persist.AtomicYaml.save(out, site); + } catch (IOException | RuntimeException failure) { + // without the hand-over Brann would not know where to stand: keep the Forgehand for now + plugin.getLogger().warning("One forge: could not write " + SITE_FILE + ", the Forgehand stays: " + failure); + return; + } + } + } + if (new QuestNPCSpawnService().forget(FORGEHAND) && saved) { + plugin.getLogger().info("One forge: the Forgehand is gone, Brann works at his anvil now."); + } + } +} diff --git a/AetherionQuests/src/main/resources/lang/de.yml b/AetherionQuests/src/main/resources/lang/de.yml index 6a82d6c7..35a4d757 100644 --- a/AetherionQuests/src/main/resources/lang/de.yml +++ b/AetherionQuests/src/main/resources/lang/de.yml @@ -1748,11 +1748,11 @@ talk: - "Galerien, Deep Works, dann das Undercroft. Tieferer Fels, mehr Fortune." - "Beim ersten Mal in einer Tiefe gibt's eine Karte und etwas XP. Pass auf die Hitze im Emberseam auf." forge: - label: "Die Schmieden?" - echo: "Erzähl mir von den Schmieden." + label: "Die Schmiede?" + echo: "Erzähl mir von der Schmiede." lines: - - "§6Brann§f führt die Deep Forge unten im North Pit. Erz rein, Forge Marks raus — für immer." - - "Der §6Forgehand§f hier oben stempelt Blaupausen in Tools. Bring einen Upgrade Stone mit." + - "§6Brann§f führt die Schmiede hier oben. Ein Amboss für alles." + - "Er hebt Bauplan-Werkzeuge mit einem Upgrade Stone, und seine Forge Marks bleiben für immer bei dir." warn: label: "Was beißt hier?" echo: "Worauf muss ich aufpassen?" diff --git a/docs/MINING_ELDERVALE.md b/docs/MINING_ELDERVALE.md index e6c9c1ff..681059b0 100644 --- a/docs/MINING_ELDERVALE.md +++ b/docs/MINING_ELDERVALE.md @@ -78,7 +78,7 @@ Depth Gauge scales all of it. Reaching a band for the first time pays a title ca | FORGEMASTER | Brann Emberlock | 37.5 39 475.5 | Forge Works (marks, reputation, flares and canaries) | | HERMIT | Hollis Underhill | 105.5 -5 566.5 | Last Lamp (depth board, Stonejaw bounty, deep trade) | -The cast is auto-placed on first start (`mine-cast.auto-place`). None of them replace the Quests NPCs already on the isle (Forgehand, Surveyor, Ore Ledger, the Eldervale welcome). +The cast is auto-placed on first start (`mine-cast.auto-place`). None of them replace the Quests NPCs already on the isle (Surveyor, Ore Ledger, the Eldervale welcome). **One forge since 2026-12-04:** Brann stands at the anvil up top (the Forgehand's old spot, moved once per server by `MineCast#moveBrannUp`), the Forgehand is gone, and Brann's menu has three pages (blueprint tools, marks, wares with the Upgrade Stones). The Deep Forge in the pit is scenery. Lines below that still name the Forgehand describe the time before. --- diff --git a/docs/PROJECT_STATE.md b/docs/PROJECT_STATE.md index 23da70c8..92da42a7 100644 --- a/docs/PROJECT_STATE.md +++ b/docs/PROJECT_STATE.md @@ -2485,3 +2485,32 @@ Mining as one road, combat as the second chapter. Items + Quests on the six MMO - Leftover found the same evening: the Recipe Book still holds a September recipe `vein_siphon` (4 iron, 4 redstone, a Mining Pickaxe in the middle) that shows after the stamp. It contradicts the rule above and goes with the next Items round. + +## One forge on the Mining Isle (2026-12-04 night, cloud session, branch `claude/isle-forge`, NOT live) + +Robb after the playtest: two forges on the isle are one too many, merge them, and whoever gets a blueprint tool must +be pointed to the smith. Items + Quests + Mining, compiled, German overlay check green, nothing tested in-game. The +forge house as a building is not in this round (it needs a look at the isle map first). + +- **Brann does all three jobs** (Mining `MineMenus#openForge`, `ForgeWorks`): one menu, three pages. Tools: every + blueprint tool in the bag, one click puts it on the anvil with the matching Upgrade Stone (Items ritual, 10 to 30 + seconds, boosters stay). Marks: the five lines as before. Wares: Upgrade Stones II to IV, flare, canary. Opens on + Tools when the miner carries a blueprint tool. +- **Brann moves up, the Forgehand goes** (Mining `MineCast#moveBrannUp`, Quests `ForgeMerge`): once per server Brann + is placed on the Forgehand's saved spot (flag `forge-up` in `mine-cast.yml`). Only after that Quests keeps the spot + in `plugins/AetherionQuests/forge-site.yml` (Items finds the anvil by it) and removes the Forgehand's row and body. + A server without the isle or with an older Mining jar keeps its Forgehand. The Deep Forge in the pit stays as + scenery (props and district), its plate and district line say so. +- **Upgrade Stones are forged, not crafted** (Items `RecipeRegistry`, Mining `ForgeWorks#stoneCost`): the three + Recipe Book recipes are gone (Stone II asked 131,072 iron and 128 diamond; the isle has no diamond ore). New prices, + isle ore only: II = 8 Compressed Iron, 4 Compressed Copper, 4 Compressed Redstone, 5,000 coins, no rank. III = 24 + Compressed Iron, 12 Compressed Gold, 8 Compressed Lapis, one Flawless specimen, 25,000 coins, Journeyman. IV = 2 + Compacted Iron, 1 Compacted Gold, 16 Compressed Emerald, one Perfect specimen, 100,000 coins, Smith. +- **Listed values follow** (Items `economy.yml` version 5, `ItemValueService`): the stones list at 16,641 / 76,539 / + 715,257 instead of 1.28 to 3.18 million (a cheap stone with the old value would print coins at the buyback). A live + file gets only these three values patched in, the old file is kept as `economy.yml.v4.bak`. +- **Pointed to the smith**: Old Wick's closing lines name Brann's forge and offer an arrow to him, a miner with a + blueprint tool gets one small note under the compass (`MineLesson#forgeNote`), Maren and Wick's desk speak of one + forge. The Vein Siphon's old recipe (built from a Mining Pickaxe) is gone as well (PR #271, same deploy). +- Open, noted for Robb: several Forge Marks still ask Compressed Diamond although the isle has no diamond ore. +- Deploy: Items + Quests on the six MMO backends and Mining on mmo-t, mmo-r, mmo-c, mmo-m, together, on Robb's go.