diff --git a/AetherionItems/src/main/java/de/aetherion/items/blueprint/SurveyorGui.java b/AetherionItems/src/main/java/de/aetherion/items/blueprint/SurveyorGui.java index 389f2612..b0a4ea87 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/blueprint/SurveyorGui.java +++ b/AetherionItems/src/main/java/de/aetherion/items/blueprint/SurveyorGui.java @@ -244,26 +244,24 @@ private void stamp(Player player, Inventory top) { drawCollection(top, player); refreshPreview(top, player); player.playSound(player.getLocation(), Sound.UI_TOAST_CHALLENGE_COMPLETE, 0.8f, 1.25f); - player.sendMessage("§bSurveyor §8» §f" + kind.display() + " §7stamped. Tool's yours."); + player.sendMessage(de.aetherion.core.exile.Say.t(player, + "§bSurveyor §8» §f" + kind.display() + " §7stamped. Tool's yours.", + "§bSurveyor §8» §f" + kind.display() + " §7gestempelt. Das Werkzeug gehört dir.")); String[] best = bestPlace(kind); player.sendMessage(de.aetherion.core.exile.Say.t(player, "§bSurveyor §8» §7Its best place: §f" + best[0] + "§7.", "§bSurveyor §8» §7Sein bester Ort: §f" + best[1] + "§7.")); ActionBarLane.show(player, net.kyori.adventure.text.Component.text( - kind.display() + " crafted", + kind.display() + de.aetherion.core.exile.Say.t(player, " crafted", " hergestellt"), net.kyori.adventure.text.format.NamedTextColor.AQUA )); clearSurveyorHint(player); - if (first && mineBeforeBoss(player)) { - // strand 1 before its first boss: the pad opens, but the ore hall comes first (strand design, M1A) - player.sendMessage(de.aetherion.core.exile.Say.t(player, - "§bSurveyor §8» §7That's your first tool, and the §6Mining pad§7 is open whenever you like. First, though, the ore hall: copper armour, your own booster, and iron for Cinder's grappling hook.", - "§bSurveyor §8» §7Dein erstes Werkzeug, und das §6Mining-Pad§7 ist offen, wann du willst. Erst aber die Erzhalle: Kupfer-Rüstung, dein eigener Booster und Eisen für Cinders Enterhaken.")); - } else if (first) { - // the mining road's last step: the pad on Origin opens with this first tool + if (first) { + // the Shabby Mine's last step: the pad on Origin opens with this first tool (2026-12-03: straight away, + // steel comes after the isle) player.sendMessage(de.aetherion.core.exile.Say.t(player, - "§bSurveyor §8» §7That's your first tool. The §6Mining pad§7 is open now: §6Old Wick§7 waits on the isle.", - "§bSurveyor §8» §7Dein erstes Werkzeug. Das §6Mining-Pad§7 ist jetzt offen: §6Old Wick§7 wartet auf der Insel.")); + "§bSurveyor §8» §7That's your first tool, a tool of its own next to your pickaxe. The §6Mining pad§7 is open now: §6Old Wick§7 waits on the isle.", + "§bSurveyor §8» §7Dein erstes Werkzeug, ein eigenes neben deiner Spitzhacke. Das §6Mining-Pad§7 ist jetzt offen: §6Old Wick§7 wartet auf der Insel.")); pointMinePad(player); } } @@ -280,18 +278,6 @@ private static String[] bestPlace(BlueprintKind kind) { }; } - /** Strand 1 before its first boss (Quests Strands#mineBeforeBoss); false without Quests. */ - private static boolean mineBeforeBoss(Player player) { - try { - Object result = Class.forName("de.aetherion.quests.listener.Strands") - .getMethod("mineBeforeBoss", Player.class) - .invoke(null, player); - return Boolean.TRUE.equals(result); - } catch (ReflectiveOperationException | LinkageError | RuntimeException ignored) { - return false; - } - } - private static void pointMinePad(Player player) { try { Class.forName("de.aetherion.quests.ui.SkillRoads") diff --git a/AetherionItems/src/main/java/de/aetherion/items/item/CustomItem.java b/AetherionItems/src/main/java/de/aetherion/items/item/CustomItem.java index 91437e4c..01b16aee 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/item/CustomItem.java +++ b/AetherionItems/src/main/java/de/aetherion/items/item/CustomItem.java @@ -4955,6 +4955,38 @@ public ItemStack createMiningPickaxe2() { return item; } + /** + * Temper's own pick, lent for the six iron of the first horse (Quests {@code LoanPick} hands it out and takes it + * back). Breaks iron ore (Mining Power 24). It has no item profile on purpose: no recipe takes it and no + * booster goes into it. + */ + public ItemStack createTemperPickaxe() { + ItemStack item = new ItemStack(Material.IRON_PICKAXE); + ItemMeta meta = item.getItemMeta(); + if (meta != null) { + setItemId(meta, "temper_pickaxe"); + ItemStats stats = new ItemStats(); + stats.setMiningPower(26); + stats.setFortune(24); + stats.setSpread(2); + applyItemData(meta, Rarity.UNCOMMON, stats); + meta.setDisplayName("§aTemper's Pickaxe"); + meta.setLore(List.of( + "§7⛏ Mining Power: §f+26", + "§7💎 Fortune: §f+24", + "§7✦ Spread: §f+2.00", + "", + "§7On loan from Temper. It breaks iron ore.", + "§8Goes back to him with the six iron." + )); + meta.setCustomModelData(2221); + meta.setUnbreakable(true); + hideVanillaAttributes(meta); + item.setItemMeta(meta); + } + return item; + } + /* * ========================================================= * GOD ITEM HELPER diff --git a/AetherionItems/src/main/java/de/aetherion/items/mining/OreTrollListener.java b/AetherionItems/src/main/java/de/aetherion/items/mining/OreTrollListener.java index 97b3f198..9a0d7af6 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/mining/OreTrollListener.java +++ b/AetherionItems/src/main/java/de/aetherion/items/mining/OreTrollListener.java @@ -157,21 +157,74 @@ private static boolean firstPage(Player player) { } /** - * Trolls crawl for everyone from the Shaft Foreman on (R-24): First Shift handed out, running or done. - * Players the Surveyor already sent hunting stay open too. + * Trolls crawl once the player is kitted (Robb 2026-12-03: full gear and a few boosters first, then the trolls): + * Quests decides ({@code Strands#trollsReady}: on the Mining road the pick carries its first booster). Players the + * Surveyor already sent hunting stay open too. */ private boolean trollsOpen(Player player) { UUID id = player.getUniqueId(); if (trollsOpen.contains(id)) { return true; } - if (BlueprintHunt.unlocked(player) || foremanShiftStarted(player)) { + if (BlueprintHunt.unlocked(player) || questsSayReady(player)) { trollsOpen.add(id); return true; } return false; } + /** Quests' answer; an older Quests jar without it keeps the old rule (First Shift handed out, R-24). */ + private static boolean questsSayReady(Player player) { + try { + Object result = Class.forName("de.aetherion.quests.listener.Strands") + .getMethod("trollsReady", Player.class) + .invoke(null, player); + return Boolean.TRUE.equals(result); + } catch (ReflectiveOperationException | LinkageError | RuntimeException ex) { + return foremanShiftStarted(player); + } + } + + /** A living troll that crawled out for this player (the Mining road's arrow points at it), or null. */ + public Location trollOf(Player player) { + if (player == null) { + return null; + } + for (Map.Entry entry : liveTrolls.entrySet()) { + if (!player.getUniqueId().equals(entry.getValue())) { + continue; + } + Entity troll = plugin.getServer().getEntity(entry.getKey()); + if (troll != null && troll.isValid() && !troll.isDead() && troll.getWorld().equals(player.getWorld())) { + return troll.getLocation(); + } + } + return null; + } + + private static boolean german(Player player) { + try { + return de.aetherion.core.api.AetherServices.german(player); + } catch (LinkageError | RuntimeException ex) { + return false; + } + } + + /** The small popup under the compass; false where the pack-drawn HUD is off. */ + private static boolean note(Player player, String title, String... rows) { + try { + var legacy = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection(); + java.util.List lines = new java.util.ArrayList<>(); + for (String row : rows) { + lines.add(legacy.deserialize("§7" + row)); + } + return de.aetherion.core.api.HudNotes.show(player, de.aetherion.core.api.BarChrome.Icon.PICK, + legacy.deserialize(title), net.kyori.adventure.text.format.NamedTextColor.GOLD, lines, 200); + } catch (LinkageError | RuntimeException ex) { + return false; + } + } + /** First Shift is ACTIVE, READY or COMPLETED. Uses only long-standing Quests API, so old Quests jars still answer. */ private static boolean foremanShiftStarted(Player player) { try { @@ -246,11 +299,19 @@ public LivingEntity spawn(Location at, Player aggro) { world.playSound(spot, Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 0.55f, 1.6f); world.playSound(spot, Sound.BLOCK_STONE_BREAK, 0.45f, 0.7f); if (aggro != null) { - aggro.sendMessage("§6✦ §eTiny Ore Troll §7crawls out of the vein!"); + boolean de = german(aggro); + aggro.sendMessage(de ? "§6✦ §eEin kleiner Erz-Troll §7kriecht aus der Ader!" + : "§6✦ §eTiny Ore Troll §7crawls out of the vein!"); ActionBarLane.show(aggro, net.kyori.adventure.text.Component.text( - "Pickaxe only · rarity = damage", + de ? "Nur mit der Spitzhacke · Seltenheit = Schaden" : "Pickaxe only · rarity = damage", net.kyori.adventure.text.format.NamedTextColor.YELLOW )); + if (firstPage(aggro)) { + // the first one is announced (playtest 2026-12-03: "nichts reagiert darauf") + note(aggro, de ? "Erz-Troll!" : "Ore Troll!", + de ? "Er trägt eine Blaupausen-Seite." : "It carries a blueprint page.", + de ? "Schlag ihn mit der Spitzhacke." : "Strike it with your pickaxe."); + } } return troll; } @@ -454,8 +515,11 @@ public void onDeath(EntityDeathEvent event) { return; } killer.playSound(killer.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.7f, 0.8f); - if (!firstPage(killer) && ThreadLocalRandom.current().nextDouble() >= BLUEPRINT_CHANCE) { - killer.sendMessage("§6Tiny Ore Troll §7crumbles — no schematic this time."); + boolean de = german(killer); + boolean first = firstPage(killer); + if (!first && ThreadLocalRandom.current().nextDouble() >= BLUEPRINT_CHANCE) { + killer.sendMessage(de ? "§6Der Erz-Troll §7zerbröselt. Diesmal ohne Seite." + : "§6Tiny Ore Troll §7crumbles. No page this time."); return; } AetherionItems items = AetherionItems.getInstance(); @@ -475,7 +539,13 @@ public void onDeath(EntityDeathEvent event) { if (items.blueprintUnlocks() != null) { items.blueprintUnlocks().markCollected(killer, kind.id()); } - killer.sendMessage("§b✦ §fBlueprint: " + kind.display() + " §7— take it to the §eSurveyor§7."); + killer.sendMessage(de ? "§b✦ §fBlaupause: " + kind.display() + " §7· bring sie zum §eSurveyor§7." + : "§b✦ §fBlueprint: " + kind.display() + " §7· take it to the §eSurveyor§7."); + if (first) { + note(killer, de ? "Blaupausen-Seite" : "Blueprint page", + de ? "Der Surveyor stempelt sie," : "The Surveyor stamps it", + de ? "tiefer in der Shabby Mine." : "deeper in the Shabby Mine."); + } killer.playSound(killer.getLocation(), Sound.UI_TOAST_CHALLENGE_COMPLETE, 0.75f, 1.35f); } diff --git a/AetherionItems/src/main/java/de/aetherion/items/progress/PathLadder.java b/AetherionItems/src/main/java/de/aetherion/items/progress/PathLadder.java index b1b718a6..1e1092b1 100644 --- a/AetherionItems/src/main/java/de/aetherion/items/progress/PathLadder.java +++ b/AetherionItems/src/main/java/de/aetherion/items/progress/PathLadder.java @@ -99,6 +99,20 @@ private static QuestProgressAccess.JournalQuest lesson(QuestProgressAccess quest return null; } + /** The Mining pad is open for this player: a blueprint tool was stamped, or the Mining Isle is known. */ + private static boolean mineRoadOpen(Player player) { + try { + AetherionItems plugin = AetherionItems.getInstance(); + if (plugin != null && plugin.blueprintUnlocks() != null && plugin.blueprintUnlocks().hasStampedAny(player)) { + return true; + } + de.aetherion.core.api.MiningAccess mining = AetherServices.mining(); + return mining != null && mining.knowsIsle(player); + } catch (LinkageError | RuntimeException ex) { + return false; + } + } + private static boolean done(QuestProgressAccess quests, Player player, String quest) { try { return quests != null && quests.isQuestCompleted(player, quest); @@ -173,6 +187,11 @@ public static List nextGoals(Player player, boolean de) { out.add(de ? "Temper in der Schmiede will sechs Eisenbarren für Hufeisen. Dann gehört das Pferd dir." : "Temper at the forge wants six iron ingots for horseshoes. Then the horse is yours."); } + if (f.mounted() && !f.hooked() && !mineRoadOpen(player)) { + // 2026-12-03 (Robb): Mining comes first, steel (hook and boss) is the second chapter + out.add(de ? "Erst Mining: der Shaft Foreman in der Shabby Mine. Ausrüstung, dein erstes Blaupausen-Werkzeug, dann die Mining-Insel." + : "Mining first: the Shaft Foreman in the Shabby Mine. Your kit, your first blueprint tool, then the Mining Isle."); + } if (!f.hooked()) { out.add(de ? "Hol dir bei Cinder in den Borderlands deinen Enterhaken." : "Get your grappling hook from Cinder in the Borderlands."); diff --git a/AetherionItems/src/main/resources/lang/de.yml b/AetherionItems/src/main/resources/lang/de.yml index 7ea504d4..5126dd6f 100644 --- a/AetherionItems/src/main/resources/lang/de.yml +++ b/AetherionItems/src/main/resources/lang/de.yml @@ -460,6 +460,7 @@ names: - {en: "Tide Latch", de: "Gezeitenhaken"} - {en: "Mining Pickaxe", de: "Bergbau-Spitzhacke"} - {en: "Iron Mining Pickaxe", de: "Eisen-Bergbau-Spitzhacke"} + - {en: "Temper's Pickaxe", de: "Tempers Spitzhacke"} - {en: "GOD Pickaxe", de: "GOTT-Spitzhacke"} - {en: "GOD Axe", de: "GOTT-Axt"} - {en: "GOD Sword", de: "GOTT-Schwert"} @@ -1173,6 +1174,8 @@ text: - {en: "§7Cable never yanks you — gas is look-only.", de: "§7Das Seil reißt dich nie — Gas folgt nur deinem Blick."} - {en: "§8Hang · boost · swing · chain.", de: "§8Hängen · boosten · schwingen · verketten."} - {en: "§7It mines. That is the entire personality.", de: "§7Sie baut ab. Das ist die ganze Persönlichkeit."} + - {en: "§7On loan from Temper. It breaks iron ore.", de: "§7Von Temper geliehen. Sie bricht Eisenerz."} + - {en: "§8Goes back to him with the six iron.", de: "§8Geht mit den sechs Eisen an ihn zurück."} - {en: "§7The rocks are not impressed. Yet.", de: "§7Die Felsen sind unbeeindruckt. Noch."} - {en: "§7Trees have started taking it personally.", de: "§7Die Bäume nehmen es langsam persönlich."} - {en: "§7Farming, but make it an insult.", de: "§7Ackerbau, aber als Schimpfwort."} diff --git a/AetherionQuests/src/main/java/de/aetherion/quests/AetherionQuests.java b/AetherionQuests/src/main/java/de/aetherion/quests/AetherionQuests.java index b2e5120a..bc7092fe 100644 --- a/AetherionQuests/src/main/java/de/aetherion/quests/AetherionQuests.java +++ b/AetherionQuests/src/main/java/de/aetherion/quests/AetherionQuests.java @@ -368,6 +368,7 @@ public void onEnable() { ); de.aetherion.quests.tutorial.OrientationWatch.start(this, questManager); Bukkit.getPluginManager().registerEvents(new de.aetherion.quests.tutorial.BoosterPick(), this); + Bukkit.getPluginManager().registerEvents(new de.aetherion.quests.listener.LoanPick(), this); de.aetherion.quests.listener.SurveyorMineHintListener surveyorHint = new de.aetherion.quests.listener.SurveyorMineHintListener(this); Bukkit.getPluginManager().registerEvents(surveyorHint, this); diff --git a/AetherionQuests/src/main/java/de/aetherion/quests/listener/LoanPick.java b/AetherionQuests/src/main/java/de/aetherion/quests/listener/LoanPick.java new file mode 100644 index 00000000..6fbb768e --- /dev/null +++ b/AetherionQuests/src/main/java/de/aetherion/quests/listener/LoanPick.java @@ -0,0 +1,273 @@ +package de.aetherion.quests.listener; + +import de.aetherion.items.AetherionItems; +import de.aetherion.items.manager.ActiveEquipmentStats; +import de.aetherion.items.manager.ItemManager; +import de.aetherion.items.model.ItemCapability; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.ItemFrame; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryDragEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.event.player.PlayerArmorStandManipulateEvent; +import org.bukkit.event.player.PlayerDropItemEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerSwapHandItemsEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.PlayerInventory; + +import java.util.Iterator; + +/** + * Temper's Pickaxe, on loan for the six iron of the first horse (Robb 2026-12-03: first check whether the player + * already has the stats to mine it alone; only if not, lend something briefly, straight into the hotbar). Iron ore + * wants Mining Power 24; a graduate's own pick stops at 14. Before, the way to the iron led through the Shaft Foreman + * and the Recipe Book first, which was the back and forth of the first minutes. + *

+ * The pick is Temper's: it stays in the player's own inventory (no drop, no chest, no menu, no frame), it stays + * through a death, and it goes back when he takes the six iron. A player whose own gear breaks iron ore gets none. + */ +public final class LoanPick implements Listener { + + public static final String ITEM_ID = "temper_pickaxe"; + /** Items {@code HarvestRules.requiredPower(IRON_ORE)}. */ + private static final double IRON_POWER = 24.0; + + public enum Lend { GIVEN, HAS, FULL, FAILED } + + private static ItemManager items() { + try { + AetherionItems plugin = AetherionItems.getInstance(); + return plugin == null ? null : plugin.getItemManager(); + } catch (LinkageError ex) { + return null; + } + } + + public static boolean is(ItemStack item) { + if (item == null || item.getType().isAir() || !item.hasItemMeta()) { + return false; + } + ItemManager items = items(); + try { + return items != null && ITEM_ID.equalsIgnoreCase(items.getItemId(item)); + } catch (LinkageError | RuntimeException ex) { + return false; + } + } + + public static boolean has(Player player) { + if (player == null) { + return false; + } + for (ItemStack item : player.getInventory().getContents()) { + if (is(item)) { + return true; + } + } + return is(player.getItemOnCursor()); + } + + /** + * The player's own gear breaks iron ore: the best pickaxe in the bag together with everything else that counts + * (armour, token, pet). The loan itself never counts. + */ + public static boolean ownGearBreaksIron(Player player) { + ItemManager items = items(); + if (player == null || items == null) { + return false; + } + try { + PlayerInventory inv = player.getInventory(); + double total = new ActiveEquipmentStats(items).getStat(player, ItemCapability.MINING_POWER); + double rest = Math.max(0.0, total - power(items, inv.getItemInMainHand())); + double best = 0.0; + for (ItemStack item : inv.getStorageContents()) { + if (item != null && item.getType().name().endsWith("_PICKAXE") && !is(item)) { + best = Math.max(best, power(items, item)); + } + } + return rest + best + 0.001 >= IRON_POWER; + } catch (LinkageError | RuntimeException ex) { + return false; + } + } + + private static double power(ItemManager items, ItemStack item) { + if (item == null || item.getType().isAir() || !items.isAetherionItem(item)) { + return 0.0; + } + return Math.max(0.0, items.getStat(item, ItemCapability.MINING_POWER)); + } + + /** + * Into the first free hotbar slot and into the hand. Hotbar full: the item of the held slot moves into the bag. + * No room anywhere: {@link Lend#FULL}, nothing is touched. + */ + public static Lend lend(Player player) { + if (player == null) { + return Lend.FAILED; + } + if (has(player)) { + return Lend.HAS; + } + ItemStack pick; + try { + AetherionItems plugin = AetherionItems.getInstance(); + pick = plugin == null || plugin.getCustomItem() == null ? null : plugin.getCustomItem().createById(ITEM_ID); + } catch (LinkageError | RuntimeException ex) { + pick = null; + } + if (pick == null) { + return Lend.FAILED; + } + PlayerInventory inv = player.getInventory(); + int slot = -1; + for (int i = 0; i < 9 && slot < 0; i++) { + ItemStack at = inv.getItem(i); + if (at == null || at.getType().isAir()) { + slot = i; + } + } + if (slot < 0) { + int free = -1; + for (int i = 9; i < 36 && free < 0; i++) { + ItemStack at = inv.getItem(i); + if (at == null || at.getType().isAir()) { + free = i; + } + } + if (free < 0) { + return Lend.FULL; + } + slot = inv.getHeldItemSlot(); + inv.setItem(free, inv.getItem(slot)); + } + inv.setItem(slot, pick); + inv.setHeldItemSlot(slot); + return Lend.GIVEN; + } + + /** Temper takes his pick back (every copy, wherever it sits on the player). */ + public static void takeBack(Player player) { + if (player == null) { + return; + } + PlayerInventory inv = player.getInventory(); + ItemStack[] contents = inv.getContents(); + for (int i = 0; i < contents.length; i++) { + if (is(contents[i])) { + inv.setItem(i, null); + } + } + if (is(player.getItemOnCursor())) { + player.setItemOnCursor(null); + } + } + + // ------------------------------------------------------------------ it stays with the player + + @EventHandler + public void onJoin(PlayerJoinEvent event) { + Player player = event.getPlayer(); + // the horse is out (handed over on another day or another server): the loan is over + if (MountChain.flag(player, MountChain.MOUNT) && has(player)) { + takeBack(player); + } + } + + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onDrop(PlayerDropItemEvent event) { + if (is(event.getItemDrop().getItemStack())) { + event.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onSwap(PlayerSwapHandItemsEvent event) { + if (is(event.getMainHandItem()) || is(event.getOffHandItem())) { + event.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onClick(InventoryClickEvent event) { + if (!(event.getWhoClicked() instanceof Player player)) { + return; + } + boolean involved = is(event.getCurrentItem()) || is(event.getCursor()); + if (!involved && event.getClick() == ClickType.NUMBER_KEY && event.getHotbarButton() >= 0) { + involved = is(player.getInventory().getItem(event.getHotbarButton())); + } + if (!involved && event.getClick() == ClickType.SWAP_OFFHAND) { + involved = is(player.getInventory().getItemInOffHand()); + } + if (!involved) { + return; + } + // any open container or menu: the pick does not move at all + if (event.getView().getTopInventory().getType() != InventoryType.CRAFTING) { + event.setCancelled(true); + return; + } + // the player's own inventory: free to move, but not out of it and not into the crafting grid + InventoryType.SlotType slot = event.getSlotType(); + boolean out = slot == InventoryType.SlotType.OUTSIDE || event.getClick() == ClickType.DROP + || event.getClick() == ClickType.CONTROL_DROP || event.getClick() == ClickType.SWAP_OFFHAND; + if (out || slot == InventoryType.SlotType.CRAFTING || slot == InventoryType.SlotType.RESULT + || slot == InventoryType.SlotType.ARMOR) { + event.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onDrag(InventoryDragEvent event) { + if (!is(event.getOldCursor())) { + return; + } + int top = event.getView().getTopInventory().getSize(); + for (int raw : event.getRawSlots()) { + if (raw < top) { + event.setCancelled(true); + return; + } + } + } + + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onEntity(PlayerInteractEntityEvent event) { + if ((event.getRightClicked() instanceof ItemFrame || event.getRightClicked() instanceof ArmorStand) + && is(event.getPlayer().getInventory().getItem(event.getHand()))) { + event.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onStand(PlayerArmorStandManipulateEvent event) { + if (is(event.getPlayerItem())) { + event.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.HIGH) + public void onDeath(PlayerDeathEvent event) { + if (event.getKeepInventory()) { + return; + } + Iterator drops = event.getDrops().iterator(); + while (drops.hasNext()) { + ItemStack drop = drops.next(); + if (is(drop)) { + drops.remove(); + event.getItemsToKeep().add(drop); + } + } + } +} diff --git a/AetherionQuests/src/main/java/de/aetherion/quests/listener/MountChain.java b/AetherionQuests/src/main/java/de/aetherion/quests/listener/MountChain.java index f37d1108..3c30b983 100644 --- a/AetherionQuests/src/main/java/de/aetherion/quests/listener/MountChain.java +++ b/AetherionQuests/src/main/java/de/aetherion/quests/listener/MountChain.java @@ -31,8 +31,11 @@ /** * The first mount, earned in the world (2026-11-29, round "first fifteen minutes"): Miss Ledger sends a graduate to - * Temper; the Shaft Foreman pays the first shift in iron bars for the Mining Pickaxe 2; with it the player mines six - * iron, and Temper shoes the horse at his anvil (a short scene) and hands it over himself. The Craftsman's old part + * Temper; he wants six iron and says what it takes; the player mines them at the front of the Shabby Mine, and Temper + * shoes the horse at his anvil (a short scene) and hands it over himself. Since 2026-12-03 (Robb, after the playtest + * with David: one clean progression) nothing stands in between: a player whose own gear breaks iron ore goes + * straight to the ore, everybody else gets Temper's own pick on loan ({@link LoanPick}). The Shaft Foreman and the + * Mining Pickaxe 2 come after Miss Ledger's stamp, as the start of Mining ({@link Strands}). The Craftsman's old part * (the Mining Pickaxe check, {@code a_simple_craft}, his coins) is Temper's now: one smith in the forge. The mount * itself lives in AetherMobs ({@code /aemount grant}). *

@@ -47,6 +50,8 @@ public final class MountChain { public static final String MOUNT = "stable_first_mount"; private static final String PICK_GIFT = "craftsman_mining_pick_gift"; private static final String TEMPER_HELLO = "fs_temper_hello"; + /** Temper lent his pick once (a second time he asks where it went). */ + private static final String LOANED = "fs_temper_loaned"; private static final int IRON_NEEDED = 6; private static final List IRON_PICKS = List.of("mining_pickaxe_2", "mining_pickaxe_3", "mining_pickaxe_4", "mining_pickaxe_5"); @@ -112,40 +117,65 @@ public static boolean temper(Player player, QuestNPC npc) { forge(player, npc, plugin); return true; } - if (!ironPick) { - if (FirstSteps.once(player, TEMPER_HELLO)) { - // 2026-11-30 (Robb): Temper says in short what he wants (iron) and what helps to get it (pick, mining - // gear, boosters); the Journal shows the same as the thread's own line (QuestProgressAccessImpl) - say(player, npc, "booster_tutor.horse_hello_1", - "A horse? Gladly. Bring me six iron and I shoe her."); - say(player, npc, "booster_tutor.horse_hello_2", - "Iron ore wants the Mining Pickaxe 2. The Shaft Foreman in the mine pays your first shift in iron bars: six of those do for me too."); - say(player, npc, "booster_tutor.horse_hello_3", - "Mining armour from copper and a booster in your pick make the shaft quicker. It's all marked in your Journal."); - } else if (QuestStoryGate.questCompleted(player, quests, "first_shift")) { - say(player, npc, "booster_tutor.horse_bars", - "Your bars make a Mining Pickaxe 2 in the Recipe Book. Then six iron, and she's shod."); - } else { - say(player, npc, "booster_tutor.horse_pick", - "Mining Pickaxe 2 first. The Foreman in the mine pays you the iron for it."); + // 2026-12-03 (Robb): first see whether the player's own gear breaks iron ore; only if not, his pick on loan + boolean own = LoanPick.ownGearBreaksIron(player); + LoanPick.Lend lend = own ? LoanPick.Lend.FAILED : LoanPick.lend(player); + boolean first = FirstSteps.once(player, TEMPER_HELLO); + if (first) { + say(player, npc, "booster_tutor.horse_hello_1", "A horse? Gladly. Bring me six iron and I shoe her."); + } + switch (lend) { + case GIVEN -> { + if (FirstSteps.once(player, LOANED)) { + say(player, npc, "booster_tutor.horse_hello_loan", + "Your pick is too weak for iron ore. Take mine. It comes back to me with the six iron."); + } else { + say(player, npc, "booster_tutor.loan_again", + "Lost my pick? Here, once more. Six iron, then it comes back to me."); + } + loanNote(player); } - if (!QuestStoryGate.questCompleted(player, quests, "first_shift")) { - QuestHint.clearPending(player); - QuestHint.show(player, "foreman", LangPack.ui(player, "hint_label.foreman", "Shaft Foreman")); + case FULL -> say(player, npc, "booster_tutor.loan_full", + "Iron ore wants my pick, and your bag is full. Make room, then talk to me again."); + case HAS -> LivingNpcProfile.say(player, npc, LangPack.say(player, "booster_tutor.horse_iron_loan", + "Iron {n} of six. My pick breaks the iron ore at the front of the Shabby Mine.") + .replace("{n}", Integer.toString(iron))); + default -> { + if (first) { + say(player, npc, "booster_tutor.horse_hello_own", + "Your pick breaks iron ore already. It sits at the front of the Shabby Mine."); + } else { + LivingNpcProfile.say(player, npc, LangPack.say(player, "booster_tutor.horse_iron", + "Iron {n} of six. The iron ore in the mine is yours now.").replace("{n}", Integer.toString(iron))); + } } - return true; } - LivingNpcProfile.say(player, npc, LangPack.say(player, "booster_tutor.horse_iron", - "Iron {n} of six. The iron ore in the mine is yours now.").replace("{n}", Integer.toString(iron))); // the arrow goes to the ore, not to him (it pointed at Temper the whole time before) QuestHint.clearPending(player); return true; } + /** The small popup under the compass: what the pick in the hand is. */ + private static void loanNote(Player player) { + boolean german = LangPack.german(player); + try { + var legacy = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection(); + de.aetherion.core.api.HudNotes.show(player, de.aetherion.core.api.BarChrome.Icon.PICK, + legacy.deserialize(german ? "Tempers Spitzhacke" : "Temper's Pickaxe"), + net.kyori.adventure.text.format.NamedTextColor.GOLD, + List.of(legacy.deserialize(german ? "§7Geliehen. Sie bricht Eisenerz." : "§7On loan. It breaks iron ore."), + legacy.deserialize(german ? "§7Sechs Eisen, dann zurück zu Temper." : "§7Six iron, then back to Temper.")), + 200); + } catch (LinkageError | RuntimeException ignored) { + // his line already said it + } + } + /** Six iron off the player, then the shoes at the anvil (a short scene) and the horse. */ private static void forge(Player player, QuestNPC npc, AetherionQuests plugin) { UUID id = player.getUniqueId(); take(player, Material.IRON_INGOT, IRON_NEEDED); + LoanPick.takeBack(player); mark(player, SHOES); FORGING.add(id); say(player, npc, "booster_tutor.shoes_forge", "Hold still. Iron listens to the hammer, not to you."); @@ -172,6 +202,13 @@ private static boolean hasIronPick(Player player) { return false; } + /** The Mining Pickaxe 2 was made on the Mining road, after the horse: the pay for it, once ({@link Strands}). */ + static void pickMade(Player player, QuestManager quests) { + if (player != null && quests != null) { + pickPay(player, quests, true); + } + } + /** The Craftsman's old pay, now at Temper: the first pick closes {@code a_simple_craft}, the iron pick pays more. */ private static void pickPay(Player player, QuestManager quests, boolean ironPick) { AetherionQuests plugin = AetherionQuests.getInstance(); @@ -211,6 +248,7 @@ private static void pickPay(Player player, QuestManager quests, boolean ironPick */ private static void handOverHorse(Player player, QuestNPC npc) { mark(player, MOUNT); + LoanPick.takeBack(player); Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "aemount grant " + player.getName() + " steppe_horse"); player.playSound(player.getLocation(), Sound.ENTITY_HORSE_AMBIENT, SoundCategory.NEUTRAL, 0.9f, 1.0f); say(player, npc, "booster_tutor.horse_done", @@ -255,9 +293,9 @@ public static boolean ownsHint(String target) { /** * Where the thread stands while the first horse is next, as a soft arrow (2026-11-30, Robb: "der hint an der * seite, zeigt iwie fast die ganze zeit zu ihm. auch, wenn man eigentlich recourcen minen soll. das muss - * sauber sein"): Temper until he has spoken, the Foreman for the first shift, the Recipe Book for the iron - * pick, the ore in the mine until six iron are in the bag, then Temper again. Null while a quest owns the bar - * (the first shift itself) or when the horse is out. + * sauber sein"): Temper until he has spoken, the ore in the mine until six iron are in the bag, then Temper + * again. Back to Temper too when the ore is out of reach: the own gear does not break it and his pick is gone. + * Null when the horse is out. */ public static ThreadHint horseHint(Player player, QuestManager quests) { if (player == null || quests == null || flag(player, MOUNT) || !QuestStoryGate.tutorialDone(player, quests)) { @@ -273,53 +311,28 @@ public static ThreadHint horseHint(Player player, QuestManager quests) { LangPack.ui(player, "thread.horse_temper", "Talk to Temper at the forge down south"), LangPack.ui(player, "thread.place_temper", "Temper · the forge")); } - if (count(player, Material.IRON_INGOT) >= IRON_NEEDED) { - // six iron in the bag, from wherever (the Foreman's pay, the island): straight to Temper, no pick step + int iron = count(player, Material.IRON_INGOT); + if (iron >= IRON_NEEDED) { + // six iron in the bag, from wherever (the mine, the island): straight to Temper return new ThreadHint("booster_tutor", LangPack.ui(player, "hint_label.temper_iron", "Temper · six iron"), LangPack.ui(player, "thread.horse_bring", "Bring the six iron to Temper"), LangPack.ui(player, "thread.place_temper", "Temper · the forge")); } - if (!hasIronPick(player)) { - Quest shift = quests.getQuest("first_shift"); - QuestState state = shift == null ? null : quests.getQuestState(player, shift); - if (state == QuestState.ACTIVE || state == QuestState.READY) { - return null; - } - if (state != QuestState.COMPLETED) { - return new ThreadHint("foreman", LangPack.ui(player, "hint_label.foreman_shift", "Shaft Foreman · first shift"), - LangPack.ui(player, "thread.horse_foreman", "The Shaft Foreman pays your first shift in iron bars"), - LangPack.ui(player, "thread.place_foreman", "Shaft Foreman · the mine")); - } - return new ThreadHint(QuestHint.SPOT_PREFIX + "recipe_book", - LangPack.ui(player, "hint_label.craft_pick2", "Craft: Mining Pickaxe 2 · Recipe Book"), - LangPack.ui(player, "thread.horse_pick", "Craft the Mining Pickaxe 2 in the Recipe Book (Journal)"), - null); - } - int iron = count(player, Material.IRON_INGOT); - if (iron < IRON_NEEDED) { - String n = Math.min(iron, IRON_NEEDED) + "/" + IRON_NEEDED; - return new ThreadHint(QuestHint.SPOT_PREFIX + MineWay.ORE, - LangPack.ui(player, "hint_label.iron_ore", "Iron ore {n} · Shabby Mine").replace("{n}", n), - LangPack.ui(player, "thread.horse_iron", "Mine iron ore in the Shabby Mine: {n}").replace("{n}", n), - LangPack.ui(player, "thread.place_mine", "Shabby Mine")); + if (!LoanPick.has(player) && !LoanPick.ownGearBreaksIron(player)) { + return new ThreadHint("booster_tutor", LangPack.ui(player, "hint_label.temper_loan", "Temper · his pickaxe"), + LangPack.ui(player, "thread.horse_loan", "Temper lends you his pickaxe for the iron ore"), + LangPack.ui(player, "thread.place_temper", "Temper · the forge")); } - return new ThreadHint("booster_tutor", LangPack.ui(player, "hint_label.temper_iron", "Temper · six iron"), - LangPack.ui(player, "thread.horse_bring", "Bring the six iron to Temper"), - LangPack.ui(player, "thread.place_temper", "Temper · the forge")); + String n = Math.min(iron, IRON_NEEDED) + "/" + IRON_NEEDED; + return new ThreadHint(QuestHint.SPOT_PREFIX + MineWay.ORE, + LangPack.ui(player, "hint_label.iron_ore", "Iron ore {n} · Shabby Mine").replace("{n}", n), + LangPack.ui(player, "thread.horse_iron", "Mine iron ore in the Shabby Mine: {n}").replace("{n}", n), + LangPack.ui(player, "thread.place_mine", "Shabby Mine")); } - /** The Journal tile Temper's advice lives in while the iron is being got (the Recipe Book), with his tip. */ + /** The first horse has no Journal tile of its own any more (the Recipe Book step went with the Foreman's detour). */ public static de.aetherion.core.api.QuestProgressAccess.JournalCall journalCall(Player player, QuestManager quests) { - ThreadHint hint = horseHint(player, quests); - if (hint == null || hint.target().equals("foreman") || !flag(player, TEMPER_HELLO) || flag(player, SHOES) - || count(player, Material.IRON_INGOT) >= IRON_NEEDED) { - return null; - } - String tip = hasIronPick(player) - ? LangPack.ui(player, "thread.tip_gear", "Temper: mining armour from copper and a booster in your pick make the shaft quicker.") - : LangPack.ui(player, "thread.tip_pick", "Temper: the Mining Pickaxe 2 is your Mining Pickaxe with iron and coal. It breaks iron ore."); - return new de.aetherion.core.api.QuestProgressAccess.JournalCall("RECIPES", tip, - hasIronPick(player) ? null : "mining_pickaxe_2"); + return null; } /** The thread as one line in the Journal (Today): its step, where that is, Temper's advice. */ @@ -332,8 +345,8 @@ public static de.aetherion.core.api.QuestProgressAccess.JournalQuest journalLine boolean german = LangPack.german(player); Location target = QuestHint.locate(player, hint.target()); String detail = german - ? "Temper beschlägt dir ein Pferd aus sechs Eisen. Seine Tipps: die Mining Pickaxe 2 (Rezeptbuch), Bergbau-Rüstung aus Kupfer, ein Booster in der Spitzhacke (Amboss)." - : "Temper shoes you a horse from six iron. His tips: the Mining Pickaxe 2 (Recipe Book), mining armour from copper, a booster in your pick (anvil)."; + ? "Temper beschlägt dir ein Pferd aus sechs Eisen. Das Eisenerz liegt vorne in der Shabby Mine. Reicht deine Spitzhacke nicht, leiht er dir seine." + : "Temper shoes you a horse from six iron. The iron ore sits at the front of the Shabby Mine. If your pick is too weak, he lends you his."; return new de.aetherion.core.api.QuestProgressAccess.JournalQuest("first_horse", german ? "Ein Pferd von Temper" : "A horse from Temper", detail, false, tracked, hint.questLine(), target == null ? null : hint.place(), target); 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 f197ebea..070cc588 100644 --- a/AetherionQuests/src/main/java/de/aetherion/quests/listener/NpcListener.java +++ b/AetherionQuests/src/main/java/de/aetherion/quests/listener/NpcListener.java @@ -1063,6 +1063,16 @@ private void handleSurveyorVisit(Player player, QuestNPC npc) { return; } + if (!hasStampedAnyBlueprint(player) && !playerHasSurveyorBlueprint(player) && !blueprintHuntOpen(player) + && !de.aetherion.quests.listener.Strands.trollsReady(player)) { + // 2026-12-03 (Robb): trolls and pages only for a kitted miner; before that he says what is missing + LivingNpcProfile.say(player, npc, de.aetherion.quests.lang.LangPack.say(player, "surveyor.kit_first_1", + "No pages for you yet. Ore trolls only crawl out for a kitted miner.")); + LivingNpcProfile.say(player, npc, de.aetherion.quests.lang.LangPack.say(player, "surveyor.kit_first_2", + "Mining Pickaxe 2, copper armour, a booster in the pick. Then dig, and bring me the page.")); + return; + } + // Hunt unlocks on first talk. Desk stays quiet until the first blueprint is stamped. enableBlueprintHunt(player); @@ -1152,6 +1162,18 @@ private static void openBlueprintForge(Player player) { /** @return true if hunt was newly enabled this click. */ + /** The hunt was opened for this player before (an earlier talk with the Surveyor). */ + private static boolean blueprintHuntOpen(Player player) { + try { + Object result = Class.forName("de.aetherion.items.mining.BlueprintHunt") + .getMethod("unlocked", org.bukkit.entity.Player.class) + .invoke(null, player); + return result instanceof Boolean && (Boolean) result; + } catch (ReflectiveOperationException | NoClassDefFoundError ignored) { + return false; + } + } + private static boolean enableBlueprintHunt(Player player) { try { Object result = Class.forName("de.aetherion.items.mining.BlueprintHunt") @@ -1300,11 +1322,11 @@ private static void blinkHomesteadMarker(Player player) { private void briefIronPay(Player player, QuestNPC npc) { npcSay(player, npc, de.aetherion.quests.lang.LangPack.say(player, "foreman.iron_pay", "Good shift. In the Recipe Book coal turns your pick into a Mining Pickaxe, the bars make it a Mining Pickaxe 2.")); - npcSay(player, npc, de.aetherion.quests.lang.LangPack.say(player, "foreman.iron_next", - "With that you break the iron ore in here. Temper needs six, Cinder six more.")); + // 2026-12-03 (Robb): the Foreman is the start of Mining now, after the horse; what comes next is the kit + npcSay(player, npc, de.aetherion.quests.lang.LangPack.say(player, "foreman.kit_next", + "Then copper armour and a booster in it. Kitted like that, the ore trolls come out for you.")); + // the thread's own arrow takes over (the horse first if it is still open, then the Mining Pickaxe 2) de.aetherion.quests.ui.QuestHint.clearPending(player); - de.aetherion.quests.ui.QuestHint.show(player, "booster_tutor", - de.aetherion.quests.lang.LangPack.ui(player, "hint_label.temper_shoes", "Temper · horseshoes")); } private void briefSurveyorNext(Player player, QuestNPC npc) { diff --git a/AetherionQuests/src/main/java/de/aetherion/quests/listener/Strands.java b/AetherionQuests/src/main/java/de/aetherion/quests/listener/Strands.java index 2c4571db..11746e0a 100644 --- a/AetherionQuests/src/main/java/de/aetherion/quests/listener/Strands.java +++ b/AetherionQuests/src/main/java/de/aetherion/quests/listener/Strands.java @@ -45,13 +45,17 @@ * from the player's state, like the first horse ({@link MountChain}); it never holds the one quest slot. After Miss * Ledger's closing exactly one strand has the soft arrow: the one picked at her desk (default ★ Mining), or none. *

- * Strand 1, ★ Mining, in this order: M1 in the Shabby Mine (the Surveyor's stamp, the copper Mining Armour and Survey - * Token, the Mining Pickaxe 2 with an own core booster in it, 38 iron), then B1 Vex's steel lesson, B2 Cinder's hook, - * B3 the first rite boss, then M2 the Mining Isle (Old Wick's lesson), M3 the Diamond Mining Pickaxe, M4 the Assayer's - * coal, M5 his signature quest, M7 Mining 30. Strands 2 to 4 (Farming, Foraging, Fishing) run up to their isle lesson. - * A stage counts as done when its own condition holds or a later stage of the same strand is done (nobody is sent - * back), except: the crossing (M2) is never skipped, the boss stages do not skip the stamp (the Mining pad stays shut - * without it), and the four M1 steps go one by one. Items a stage needs are remembered once seen. + * Strand 1, ★ Mining, in this order (Robb 2026-12-03, after the playtest with David: "erst shaft foreman. dann + * blueprint bekommen. blueprint herstellen, dann mining island"; being well kitted comes first, combat is the second + * chapter): the Shaft Foreman's first shift (M1A), the Mining Pickaxe 2 from his iron (M1P), the copper Mining Armour + * and Survey Token (M1B), an own core booster in the pick (M1C), then the ore trolls, their first page and the + * Surveyor's stamp, which builds the first blueprint tool and opens the Mining pad (M1T), the Mining Isle with Old + * Wick's lesson (M2) and the Diamond Mining Pickaxe (M3). The second chapter is steel: 38 iron (M1D), Vex's lesson + * (B1), Cinder's hook (B2), the first rite boss (B3). After it the isle's long road: the Assayer's coal (M4), his + * signature quest (M5), Mining 30 (M7). Strands 2 to 4 (Farming, Foraging, Fishing) run up to their isle lesson. + * A stage counts as done when its own condition holds or a later stage of the same chapter is done (nobody is sent + * back), except: the stamp (M1T) and the crossing (M2) are never skipped, and the three kit steps go one by one and + * are not skipped by the stamp. Mining and steel never skip each other. Items a stage needs are remembered once seen. *

* The arrow rule: on a skill isle whose lesson runs, the strand is silent; a held quest keeps the arrow (and lends it * to the strand when it has no target of its own, {@code QuestCompass}); otherwise the strand points. @@ -66,6 +70,7 @@ public enum Pick { MINE, FARM, FORAGE, FISH, NONE } private static final String ALTAR_WARNED = "strand_altar_warned"; private static final String BONES_TOLD = "strand_bones_told"; private static final String FIRST_BOSS_CARD = "strand_first_boss_card"; + private static final String SEEN_M1P = "strand_seen_m1p"; private static final String SEEN_M1B = "strand_seen_m1b"; private static final String SEEN_M1C = "strand_seen_m1c"; private static final String SEEN_M1D = "strand_seen_m1d"; @@ -79,6 +84,8 @@ public enum Pick { MINE, FARM, FORAGE, FISH, NONE } static final String ANYWHERE = QuestHint.SPOT_PREFIX + "anywhere"; private static final String RECIPES = QuestHint.SPOT_PREFIX + "recipe_book"; private static final String ORE = QuestHint.SPOT_PREFIX + MineWay.ORE; + /** The ore troll that crawled out for this player (QuestHint resolves it to where the troll is). */ + public static final String TROLL = QuestHint.SPOT_PREFIX + "ore_troll"; private static final String FIELD = QuestHint.SPOT_PREFIX + "steel_field"; private static final String ALTAR = QuestHint.SPOT_PREFIX + "altar"; private static final String OTTO = QuestHint.SPOT_PREFIX + "mine_isle_otto"; @@ -95,7 +102,7 @@ public enum Pick { MINE, FARM, FORAGE, FISH, NONE } /** Arrows each strand takes over on its way (Vex's pin on Cinder, the Warden's, the pad pins, ...). */ private static final Set COMMON = Set.of("ledger", RECIPES, ANYWHERE); - private static final Set OWNED_MINE = Set.of("surveyor", "foreman", ORE, MINE_PAD, "vex", "ash_scout", + private static final Set OWNED_MINE = Set.of("surveyor", "foreman", ORE, TROLL, MINE_PAD, "vex", "ash_scout", "rite_keeper", FIELD, ALTAR, OTTO, "ore_ledger", "booster_tutor", "craftsman"); private static final Set OWNED_FARM = Set.of("farmer", "farm_isle_guide", FARM_PAD); private static final Set OWNED_FORAGE = Set.of("lumberjack", "forage_pad_guide", FORAGE_PAD); @@ -242,14 +249,43 @@ public static boolean isCurrent(Player player, QuestManager quests, String targe } /** - * Strand 1 before its first boss (B3). The Surveyor's first stamp then sends the player to the ore hall instead - * of straight onto the Mining Isle (called by reflection from Items SurveyorGui). + * Always false since 2026-12-03: the Surveyor's first stamp opens the Mining Isle straight away, steel comes + * after it. Kept for an older Items jar, whose SurveyorGui still asks by reflection. */ public static boolean mineBeforeBoss(Player player) { + return false; + } + + /** + * Ore trolls crawl out for this player (asked by Items {@code OreTrollListener}, by reflection). On the Mining + * road they wait until the player is kitted: the Foreman's shift, the Mining Pickaxe 2, the copper set and a + * booster in the pick are behind them (Robb 2026-12-03: full gear and a few boosters first, then the trolls). + * Not before Miss Ledger's closing. Off the Mining road the old rule holds: from the Foreman's first shift on. + */ + public static boolean trollsReady(Player player) { AetherionQuests plugin = AetherionQuests.getInstance(); QuestManager quests = plugin == null ? null : plugin.getQuestManager(); - return player != null && quests != null && active(player, quests) && pick(player) == Pick.MINE - && !riteBossKilled(player); + if (player == null || quests == null) { + return false; + } + try { + if (!enabled() || (active(player, quests) && pick(player) != Pick.MINE)) { + Quest shift = quests.getQuest("first_shift"); + QuestState state = shift == null ? null : quests.getQuestState(player, shift); + return state == QuestState.ACTIVE || state == QuestState.READY || state == QuestState.COMPLETED; + } + if (!active(player, quests)) { + return false; + } + Stage stage = currentMine(player, quests, Inv.of(player)); + return stage == null || !beforeTrolls(stage); + } catch (LinkageError | RuntimeException ex) { + return false; + } + } + + private static boolean beforeTrolls(Stage stage) { + return stage == Stage.M1A || kit(stage); } /** Layer 1: the player stands on a skill isle whose lesson has not reported back; the isle leads there. */ @@ -339,7 +375,7 @@ private static View compute(Player player, QuestManager quests) { // ------------------------------------------------------------------ strand 1: ★ Mining - private enum Stage { M1A, M1B, M1C, M1D, B1, B2, B3, M2, M3, M4, M5, M7 } + private enum Stage { M1A, M1P, M1B, M1C, M1T, M2, M3, M1D, B1, B2, B3, M4, M5, M7 } private static Stage currentMine(Player player, QuestManager quests, Inv inv) { Stage[] all = Stage.values(); @@ -370,29 +406,39 @@ private static Stage currentMine(Player player, QuestManager quests, Inv inv) { } private static boolean overtakes(Stage later, Stage earlier) { - if (earlier == Stage.M2) { + if (earlier == Stage.M2 || earlier == Stage.M1T) { return false; } - boolean boss = later == Stage.B1 || later == Stage.B2 || later == Stage.B3; - if (earlier == Stage.M1A && boss) { + if (steel(later) != steel(earlier)) { + // the second chapter and the mining road never skip each other return false; } - boolean m1 = earlier == Stage.M1B || earlier == Stage.M1C || earlier == Stage.M1D; - boolean m1Later = later == Stage.M1B || later == Stage.M1C || later == Stage.M1D; - return !(m1 && m1Later); + return !(kit(earlier) && (kit(later) || later == Stage.M1T)); + } + + /** The kit steps before the trolls: pick, armour, booster. */ + private static boolean kit(Stage stage) { + return stage == Stage.M1P || stage == Stage.M1B || stage == Stage.M1C; + } + + /** The second chapter: the iron for hook and blade, Vex, Cinder, the first boss. */ + private static boolean steel(Stage stage) { + return stage == Stage.M1D || stage == Stage.B1 || stage == Stage.B2 || stage == Stage.B3; } private static boolean achieved(Player player, QuestManager quests, Inv inv, Stage stage) { return switch (stage) { - case M1A -> SkillRoads.mineOpen(player); + case M1A -> QuestStoryGate.questCompleted(player, quests, "first_shift"); + case M1P -> pick2Seen(player, quests, inv); case M1B -> remember(player, SEEN_M1B, inv.armourPieces >= 4 && inv.charm); case M1C -> remember(player, SEEN_M1C, inv.pick2 && inv.coreBoosted); + case M1T -> SkillRoads.mineOpen(player); + case M2 -> SkillRoads.done(player, SkillRoads.Road.MINE) || knowsMineIsle(player); + case M3 -> remember(player, SEEN_M3, inv.pick3); case M1D -> remember(player, SEEN_M1D, inv.iron >= ironNeed(player, inv)); case B1 -> QuestStoryGate.questCompleted(player, quests, "lesson_steel") && swordSeen(player, inv); case B2 -> MountChain.flag(player, HookChain.DONE) || remember(player, SEEN_HOOK, inv.hook); case B3 -> riteBossKilled(player); - case M2 -> SkillRoads.done(player, SkillRoads.Road.MINE) || knowsMineIsle(player); - case M3 -> remember(player, SEEN_M3, inv.pick3); case M4 -> QuestStoryGate.questCompleted(player, quests, "coal_audit") && quests.getQuest("coal_audit") != null; case M5 -> QuestStoryGate.questCompleted(player, quests, "signature_crystal") && quests.getQuest("signature_crystal") != null; @@ -400,6 +446,16 @@ private static boolean achieved(Player player, QuestManager quests, Inv inv, Sta }; } + /** The Mining Pickaxe 2 (or better) was seen; the first time Temper's old pay for it goes out, once. */ + private static boolean pick2Seen(Player player, QuestManager quests, Inv inv) { + boolean before = flag(player, SEEN_M1P); + boolean now = remember(player, SEEN_M1P, inv.pick2); + if (now && !before) { + MountChain.pickMade(player, quests); + } + return now; + } + private static boolean remember(Player player, String key, boolean now) { if (flag(player, key)) { return true; @@ -480,24 +536,21 @@ private static View mine(Player player, QuestManager quests, Inv inv) { String mine = LangPack.ui(player, "strand.place.mine", "Shabby Mine"); String borderlands = LangPack.ui(player, "strand.place.borderlands", "Borderlands"); return switch (stage) { - case M1A -> { - boolean page = hasPage(player); - if (!page && !QuestStoryGate.questCompleted(player, quests, "first_shift")) { - yield view(stage, "foreman", LangPack.ui(player, "hint_label.foreman_shift", "Shaft Foreman · first shift"), - LangPack.ui(player, "strand.status.m1a_foreman", - "Next: the Shaft Foreman in the Shabby Mine. His first shift pays iron, and from then on ore trolls carry blueprint pages."), - LangPack.say(player, "strand.goal.foreman", "the Shaft Foreman in the Shabby Mine"), mine); - } - if (page) { - yield view(stage, "surveyor", LangPack.ui(player, "strand.label.surveyor", "Surveyor · stamp your page"), - LangPack.ui(player, "strand.status.m1a_page", - "Next: the Surveyor, deeper in the Shabby Mine. His stamp opens the Mining Isle, and the iron down there makes your grappling hook."), - LangPack.say(player, "strand.goal.surveyor", "the Surveyor, deeper in the Shabby Mine"), mine); + case M1A -> view(stage, "foreman", LangPack.ui(player, "hint_label.foreman_shift", "Shaft Foreman · first shift"), + LangPack.ui(player, "strand.status.m1a_shift", + "Next: the Shaft Foreman in the Shabby Mine. His first shift pays 32 iron, the iron for your Mining Pickaxe 2."), + LangPack.say(player, "strand.goal.foreman", "the Shaft Foreman in the Shabby Mine"), mine); + case M1P -> { + String status = LangPack.ui(player, "strand.status.m1c_pick", + "Next: the Mining Pickaxe 2, your pick with 32 iron and 32 coal, in the Recipe Book. Your own booster goes into it after."); + if (inv.iron >= 32 && inv.coal >= 32) { + yield craft(stage, LangPack.ui(player, "hint_label.craft_pick2", "Craft: Mining Pickaxe 2 · Recipe Book"), + status, LangPack.say(player, "strand.goal.ore_hall", "the ore hall of the Shabby Mine"), "mining_pickaxe_2"); } - yield view(stage, ORE, LangPack.ui(player, "strand.label.trolls", "Ore trolls · Shabby Mine"), - LangPack.ui(player, "strand.status.m1a_trolls", - "Next: ore trolls in the Shabby Mine. Their pages go to the Surveyor, and his stamp opens the Mining Isle."), - LangPack.say(player, "strand.goal.trolls", "the ore trolls in the Shabby Mine"), mine); + yield view(stage, ORE, LangPack.ui(player, "strand.label.m1c_pick", "Iron {i}/32 · Coal {c}/32 · ore hall") + .replace("{i}", Integer.toString(Math.min(32, inv.iron))) + .replace("{c}", Integer.toString(Math.min(32, inv.coal))), + status, LangPack.say(player, "strand.goal.ore_hall", "the ore hall of the Shabby Mine"), mine); } case M1B -> { String status = LangPack.ui(player, "strand.status.m1b", @@ -549,6 +602,25 @@ yield view(stage, ORE, LangPack.ui(player, "strand.label.m1c_coal", "Coal {c}/81 .replace("{c}", Integer.toString(Math.min(81, inv.coal))), status, LangPack.say(player, "strand.goal.ore_hall", "the ore hall of the Shabby Mine"), mine); } + case M1T -> { + String goal = LangPack.say(player, "strand.goal.trolls", "the ore trolls in the Shabby Mine"); + if (hasPage(player)) { + yield view(stage, "surveyor", LangPack.ui(player, "strand.label.surveyor", "Surveyor · stamp your page"), + LangPack.ui(player, "strand.status.m1t_page", + "Next: the Surveyor, deeper in the Shabby Mine. He stamps your page into a tool of its own, and that opens the Mining Isle."), + LangPack.say(player, "strand.goal.surveyor", "the Surveyor, deeper in the Shabby Mine"), mine); + } + if (trollOut(player)) { + yield view(stage, TROLL, LangPack.ui(player, "strand.label.troll", "Ore Troll · strike it"), + LangPack.ui(player, "strand.status.m1t_troll", + "An ore troll is out. Strike it with your pickaxe: it carries a blueprint page."), + goal, mine); + } + yield view(stage, ORE, LangPack.ui(player, "strand.label.trolls", "Ore trolls · Shabby Mine"), + LangPack.ui(player, "strand.status.m1t_trolls", + "Next: keep mining in the Shabby Mine. Ore trolls crawl out of the veins now, and the first one carries a blueprint page for the Surveyor."), + goal, mine); + } case M1D -> { int need = ironNeed(player, inv); String n = Math.min(need, inv.iron) + "/" + need; @@ -556,8 +628,8 @@ yield view(stage, ORE, LangPack.ui(player, "strand.label.m1c_coal", "Coal {c}/81 String status = inHall ? LangPack.ui(player, "strand.status.m1d_hall", "Iron for hook and blade: {n}, here in the ore hall.") .replace("{n}", n) - : LangPack.ui(player, "strand.status.m1d", - "Next: 38 iron in the ore hall, for Cinder's hook and your iron blade. Then Sergeant Vex, and after your first boss the Mining Isle."); + : LangPack.ui(player, "strand.status.m1d_steel", + "Next, the second chapter: steel. 38 iron for Cinder's hook and your iron blade, then Sergeant Vex at the Borderlands gate."); yield view(stage, ORE, LangPack.ui(player, "strand.label.iron", "Iron {n} · ore hall").replace("{n}", n), status, LangPack.say(player, "strand.goal.ore_hall", "the ore hall of the Shabby Mine"), mine); } @@ -783,6 +855,17 @@ private static boolean nearOreHall(Player player) { && hall.distanceSquared(player.getLocation()) < 40.0 * 40.0; } + /** A living ore troll crawled out for this player (Items {@code OreTrollListener}). */ + private static boolean trollOut(Player player) { + try { + AetherionItems items = AetherionItems.getInstance(); + return items != null && items.getOreTrollListener() != null + && items.getOreTrollListener().trollOf(player) != null; + } catch (LinkageError | RuntimeException ex) { + return false; + } + } + private static boolean hasPage(Player player) { try { AetherionItems items = AetherionItems.getInstance(); diff --git a/AetherionQuests/src/main/java/de/aetherion/quests/ui/QuestHint.java b/AetherionQuests/src/main/java/de/aetherion/quests/ui/QuestHint.java index c7fcc58d..1e461353 100644 --- a/AetherionQuests/src/main/java/de/aetherion/quests/ui/QuestHint.java +++ b/AetherionQuests/src/main/java/de/aetherion/quests/ui/QuestHint.java @@ -246,9 +246,23 @@ public static Location locate(Player player, String id) { if (id != null && id.equals(SPOT_PREFIX + "altar")) { return altarLocation(); } + if (id != null && id.equals(de.aetherion.quests.listener.Strands.TROLL)) { + return trollLocation(player); + } return npcLocation(id); } + /** The ore troll that crawled out for this player (Items {@code OreTrollListener}), or null. */ + private static Location trollLocation(Player player) { + try { + de.aetherion.items.AetherionItems items = de.aetherion.items.AetherionItems.getInstance(); + return items == null || items.getOreTrollListener() == null ? null + : items.getOreTrollListener().trollOf(player); + } catch (LinkageError | RuntimeException ex) { + return null; + } + } + /** The Borderlands powder altar (Items {@code BorderlandsRiteService}), or null. */ private static Location altarLocation() { try { diff --git a/AetherionQuests/src/main/resources/lang/de.yml b/AetherionQuests/src/main/resources/lang/de.yml index 55e3d2a0..6a82d6c7 100644 --- a/AetherionQuests/src/main/resources/lang/de.yml +++ b/AetherionQuests/src/main/resources/lang/de.yml @@ -222,6 +222,7 @@ ui: craft_pick2: "Herstellen: Mining Pickaxe 2 · Rezeptbuch" iron_ore: "Eisenerz {n} · Shabby Mine" temper_iron: "Temper · sechs Eisen" + temper_loan: "Temper · seine Spitzhacke" ledger_horse: "Miss Ledger · die Hauptstadt" hint_note: temper: "Booster Tutor" @@ -233,6 +234,7 @@ ui: horse_pick: "Stell die Mining Pickaxe 2 im Rezeptbuch her (Journal)" horse_iron: "Bau Eisenerz in der Shabby Mine ab: {n}" horse_bring: "Bring Temper die sechs Eisen" + horse_loan: "Temper leiht dir seine Spitzhacke für das Eisenerz" place_temper: "Temper · die Schmiede" place_foreman: "Shaft Foreman · die Mine" place_mine: "Shabby Mine" @@ -298,6 +300,7 @@ ui: ledger: "Miss Ledger · die Wege" surveyor: "Surveyor · Seite stempeln" trolls: "Erz-Trolle · Shabby Mine" + troll: "Erz-Troll · schlag ihn" m1b_craft: "Herstellen: Bergbau-Rüstung und Token · Rezeptbuch" m1b: "Bergbau-Rüstung {a}/4 · Survey Token {t}/1" m1c_pick: "Eisen {i}/32 · Kohle {c}/32 · Erzhalle" @@ -350,6 +353,11 @@ ui: m1c_blocks: "Als Nächstes: press deine Kohle zu Kohleblöcken. Neun Kohle ergeben im Crafting einen Block; neun Blöcke ergeben im Rezeptbuch den Coal Booster." b3_sword2: "Als Nächstes: das Iron Combat Sword vor deinem ersten Boss: dein Combat Sword, 32 Eisen und 16 Knochen, im Rezeptbuch." m1d: "Als Nächstes: 38 Eisen in der Erzhalle, für Cinders Haken und deine Eisenklinge. Dann Sergeant Vex, und nach deinem ersten Boss die Mining-Insel." + m1a_shift: "Als Nächstes: der Shaft Foreman in der Shabby Mine. Seine erste Schicht zahlt 32 Eisen, das Eisen für deine Mining Pickaxe 2." + m1t_trolls: "Als Nächstes: weiter abbauen in der Shabby Mine. Jetzt kriechen Erz-Trolle aus den Adern, und der erste trägt eine Blaupausen-Seite für den Surveyor." + m1t_troll: "Ein Erz-Troll ist draußen. Schlag ihn mit der Spitzhacke: Er trägt eine Blaupausen-Seite." + m1t_page: "Als Nächstes: der Surveyor, tiefer in der Shabby Mine. Er stempelt deine Seite zu einem eigenen Werkzeug, und das öffnet die Mining-Insel." + m1d_steel: "Als Nächstes, das zweite Kapitel: Stahl. 38 Eisen für Cinders Haken und deine Eisenklinge, dann Sergeant Vex am Tor zu den Borderlands." b1_sword: "Als Nächstes: dein Combat Sword, 2 Bruchstein und ein Stock im Rezeptbuch." b1: "Als Nächstes: Sergeant Vex am Tor zu den Borderlands, östlich von Tempers Schmiede." b1_recipe: "Combat Sword: 2 Bruchstein, 1 Stock." @@ -1488,6 +1496,7 @@ talk: troll_pages: "Erz-Trolle lassen seine Seiten fallen. Dein erstes Blaupausen-Werkzeug öffnet das §6Mining-Pad§f." iron_pay: "Gute Schicht. Im Rezeptbuch wird deine Hacke mit Kohle zur Mining Pickaxe und mit den Barren zur Mining Pickaxe 2." iron_next: "Damit brichst du das Eisenerz hier drin. Sechs braucht Temper, sechs Cinder." + kit_next: "Dann Kupfer-Rüstung und ein Booster hinein. So ausgerüstet kommen die Erz-Trolle zu dir heraus." amethyst_guide: hello: "Kristall-Guide. Die Amethyst Mine geht durch mich — Geoden, Resonance, Heartstones." send: "Bereit? Ich setz dich am violetten Hub ab. §e/amethyst§f macht dasselbe." @@ -1505,6 +1514,11 @@ talk: horse_bars: "Aus deinen Barren wird im Rezeptbuch die Mining Pickaxe 2. Dann sechs Eisen, und sie ist beschlagen." horse_pick: "Erst die Mining Pickaxe 2. Der Foreman im Schacht zahlt dir das Eisen dafür." horse_iron: "Eisen {n} von sechs. Das Eisenerz im Schacht gehört jetzt dir." + horse_iron_loan: "Eisen {n} von sechs. Meine Hacke bricht das Eisenerz vorne in der Shabby Mine." + horse_hello_loan: "Für Eisenerz ist deine Hacke zu schwach. Nimm meine. Mit den sechs Eisen kommt sie zurück." + horse_hello_own: "Deine Hacke bricht Eisenerz schon. Es liegt vorne in der Shabby Mine." + loan_again: "Meine Hacke verloren? Hier, noch mal. Sechs Eisen, dann kommt sie zurück zu mir." + loan_full: "Eisenerz braucht meine Hacke, und deine Tasche ist voll. Mach Platz, dann sprich mich an." horse_done: "So, beschlagen und deins. Rechtsklick auf den Sattel, dann kommt sie, Rechtsklick auf sie, dann sitzt du auf. Steigst du ab, läuft sie heim." horse_ledger: "Reite mit ihr hoch zu Miss Ledger in die Hauptstadt. Sie weiß, wohin die Wege führen." horse_next: "Reite nach Osten zu Cinder in die Borderlands. Sie knüpft Haken für Leute, die hoch hinaus wollen." @@ -1864,6 +1878,8 @@ talk: bring_page: "Bring mir eine Seite. Ich stemple sie dir hier in ein Tool." trolls_short: "Erz-Trolle kriechen jetzt aus den Adern. Hau einen um, er lässt eine Seite fallen." bring_page_pad: "Bring mir die Seite, ich stemple sie zu einem Werkzeug. Das öffnet das §6Mining-Pad§f." + kit_first_1: "Noch keine Seiten für dich. Erz-Trolle kriechen nur für gut ausgerüstete Kumpel heraus." + kit_first_2: "Mining Pickaxe 2, Kupfer-Rüstung, ein Booster in der Hacke. Dann grab, und bring mir die Seite." eldervale_upgrade: open: "Die Schmiede ist heiß, {player}. Blaupausen-Tool + Upgrade Stone. Ich mach den Tisch auf." root_cellar: diff --git a/docs/PROJECT_STATE.md b/docs/PROJECT_STATE.md index cd8951de..b83d4fb6 100644 --- a/docs/PROJECT_STATE.md +++ b/docs/PROJECT_STATE.md @@ -2444,3 +2444,30 @@ servers since 2026-12-03 22:59 CET, see the live builds on top). Nothing tested - **Open (plan before building)**: one clean mining progression (Ledger, Temper, horse, stamp; then Shaft Foreman, gear, boosters, trolls, blueprints, Mining Isle, Lullveins), the second forge on the Mining Isle, Lullveins look and progression, the jump pad between Mining Isle and mainland, combat feel. + +## Mining progression, one road front to back (2026-12-03 late evening, cloud session, branch `claude/mining-progression`, NOT live) + +Robb's order after the playtest with David: arrival (Miss Ledger, Temper's six iron, the horse, Ledger's stamp), then +Mining as one road, combat as the second chapter. Items + Quests, compiled, German overlay check green, nothing +tested in-game. + +- **Temper and the iron** (`MountChain`, new `LoanPick`): Temper first checks whether the player's own gear breaks + iron ore (Mining Power 24: best own pickaxe plus everything worn). If it does, straight to the ore. If not, he + lends `temper_pickaxe` (Items `CustomItem#createTemperPickaxe`, Mining Power 26, no profile, so no boosters and no + recipe): first free hotbar slot and into the hand, with a full hotbar the held item moves into the bag, with a full + bag he asks for room. The pick cannot be dropped, stored, framed or put into a menu, stays through a death, and + goes back when Temper takes the six iron. The Foreman and the Recipe Book are no longer part of the way to the horse. +- **Strand 1 order** (`Strands`): M1A the Foreman's first shift, M1P the Mining Pickaxe 2 from his iron, M1B copper + Mining Armour + Survey Token, M1C an own booster in the pick, M1T ore trolls, the first page and the Surveyor's + stamp (builds the blueprint tool, opens the Mining pad), M2 Old Wick on the Mining Isle, M3 the Diamond Mining + Pickaxe. Then steel: M1D 38 iron, B1 Vex, B2 Cinder's hook, B3 the first rite boss. Then M4, M5, M7. The stamp and + the crossing are never skipped, the three kit steps go one by one, mining and steel never skip each other. +- **Trolls only for a kitted miner**: Items `OreTrollListener` asks Quests `Strands#trollsReady` (reflection): on the + Mining road trolls start at M1T, never before Ledger's closing; off the road the old rule (from the first shift). + Players the Surveyor already sent hunting stay open. The Surveyor tells an unkitted miner what is missing instead of + opening the hunt. The first troll and the first page get a small popup, and the arrow points at the living troll + (`spot:ore_troll`). +- The Surveyor's first stamp now always opens the pad and points to it (`Strands#mineBeforeBoss` is false and only + kept for an older Items jar). Blueprint tools stay items of their own (Robb 2026-12-03); nothing is built from the + player's pickaxe. +- Deploy: Items + Quests on the six MMO backends, together, on Robb's go.