Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions AetherionItems/src/main/java/de/aetherion/items/hud/PlaceChip.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package de.aetherion.items.hud;

import de.aetherion.items.combat.HudGlyphs;

import org.bukkit.entity.Player;

import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

/**
* One small line on the chip under the place plate, top right, for a place that has two numbers worth a glance
* (2026-12-03, Robb's playtest plan: "eine kleine Zeile oben rechts, nur in den Lullveins: Splitter und Fundstücke.
* Sonst nichts, das Feld bleibt leer"). The place's own plugin sets it while the player is there and clears it when
* they leave; the forage weather, which uses the same chip, wins where both would show.
*
* <p>The text is written in the HUD's pixel alphabet (capitals, digits, {@code .,:!'?/+-%()}); anything else is
* dropped by {@link HudGlyphs#label}.
*/
public final class PlaceChip {

private static final Map<UUID, String> LINES = new ConcurrentHashMap<>();

private PlaceChip() {
}

/** Shows {@code text} on the chip for this player until {@link #clear}; null or blank clears it. */
public static void set(Player player, String text) {
if (player == null) {
return;
}
String label = text == null ? "" : HudGlyphs.label(text);
if (label.isEmpty()) {
LINES.remove(player.getUniqueId());
} else {
LINES.put(player.getUniqueId(), label);
}
}

public static void clear(Player player) {
if (player != null) {
LINES.remove(player.getUniqueId());
}
}

public static void forget(UUID playerId) {
if (playerId != null) {
LINES.remove(playerId);
}
}

/** The line for this player, or "" when there is none. */
static String of(Player player) {
String line = player == null ? null : LINES.get(player.getUniqueId());
return line == null ? "" : line;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public void blank(Player player) {
@Override
public void forget(UUID playerId) {
carrier.forget(playerId);
PlaceChip.forget(playerId);
if (radar != null) {
radar.forget(playerId);
}
Expand Down Expand Up @@ -292,6 +293,19 @@ private int place(HudPen pen, Player player, int state) {
pen.at(x0 + HudPen.CHIP_CAP + HudPen.ICON_W + 2).small(weather, 0,
PanelPalette.radar(state, PanelPalette.PART_LABEL + 5, PanelPalette.WEATHER));
below = 96;
} else {
// A place's own two numbers (the Lullveins: splinters and finds) on the same chip.
String line = PlaceChip.of(player);
if (!line.isEmpty()) {
int width = HudPen.CHIP_CAP + HudPen.ICON_W + 2 + HudGlyphs.width(line) + 2 + HudPen.CHIP_CAP;
int x0 = right(width);
pen.at(x0).chip(width, PanelPalette.radar(state, PanelPalette.PART_LABEL + 4, PanelPalette.WHITE));
TextColor row = PanelPalette.radar(state, PanelPalette.PART_LABEL + 5, PanelPalette.WHITE);
pen.at(x0 + HudPen.CHIP_CAP).icon(HudPen.Icon.SHARD, 0, row);
pen.at(x0 + HudPen.CHIP_CAP + HudPen.ICON_W + 2).small(line, 0,
PanelPalette.radar(state, PanelPalette.PART_LABEL + 5, PanelPalette.WEATHER));
below = 96;
}
}
return below;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ private JournalDe() {
{"Back to the Capital, once you have been there.", "Zurück in die Hauptstadt, sobald du dort warst."},
{"Foraging Isle: journal, tour and wayfinder.", "Foraging-Insel: Buch, Führung und Wegweiser."},
{"Mining Isle: journal, compass and crew tour.", "Mining-Insel: Buch, Kompass und Führung."},
{"The Lullveins: what to do down there in three steps, your finds and your drill.",
"Die Lullveins: was du dort unten tust, in drei Schritten, deine Fundstücke und dein Bohrer."},
{"Origin Journal: districts, glowcaps, bells, skyways.", "Atlas der Hauptinsel: Bezirke, Glowcaps, Glocken, Skyways."},
{"Make or manage a party.", "Eine Party gründen oder verwalten."},
{"Friends list, visits and guild invites.", "Freundesliste, Besuche und Gildeneinladungen."},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,25 @@ ItemStack item(String name, List<String> lore) {
}
}

/** The Lullveins page shows once the player has been down there (AetherionMining marks them). */
private static final String LULLVEINS = "Lullveins";
private static final NamespacedKey LULL_SEEN = NamespacedKey.fromString("aetherionmining:lull_seen");

private static final List<Cmd> ATLAS_LINES = List.of(
new Cmd("Dungeons", "dhub", JournalIcon.DUNGEONS, "The dungeon hub, from anywhere."),
new Cmd("Exile", "exile", JournalIcon.EXILE, "Cross to the exile island, or come back."),
new Cmd("Capital", "capital", JournalIcon.CAPITAL, "Back to the Capital, once you have been there."));
private static final List<Cmd> ISLE_JOURNALS = List.of(
new Cmd("Grove", "grove", JournalIcon.GROVE, "Foraging Isle: journal, tour and wayfinder."),
new Cmd("Mine Isle", "mineisle", JournalIcon.MINE_ISLE, "Mining Isle: journal, compass and crew tour."),
new Cmd("Origin", "origin", JournalIcon.ORIGIN, "Origin Journal: districts, glowcaps, bells, skyways."));
new Cmd("Origin", "origin", JournalIcon.ORIGIN, "Origin Journal: districts, glowcaps, bells, skyways."),
new Cmd(LULLVEINS, "lullveins journal", null, Material.AMETHYST_SHARD,
"The Lullveins: what to do down there in three steps, your finds and your drill."));

private static boolean hidden(Player player, Cmd cmd) {
return LULLVEINS.equals(cmd.label()) && (LULL_SEEN == null
|| !player.getPersistentDataContainer().has(LULL_SEEN, PersistentDataType.BYTE));
}

/** The road tile from Quests (skill strands), or null before Ledger's stamp or without Quests. */
private static QuestProgressAccess.StrandTile strandTile(Player player) {
Expand Down Expand Up @@ -1027,7 +1038,7 @@ private void commands(Read read, List<Entry> out, boolean right, List<Cmd> cmds,
if (row > 4) {
return;
}
if (!available(player, cmd.command())) {
if (!available(player, cmd.command()) || hidden(player, cmd)) {
continue;
}
out.add(new Entry(row++, right, cmd.label(), Ink.INK,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package de.aetherion.mining.lullveins;

import de.aetherion.core.api.AetherServices;
import de.aetherion.core.api.BarChrome;
import de.aetherion.core.api.HudNotes;
import de.aetherion.core.api.TalkAccess;
import de.aetherion.core.npc.FancyBody;

Expand Down Expand Up @@ -113,6 +115,8 @@ Location at(World world) {

private final Lullveins lv;
private final NamespacedKey propKey;
/** Set once Kalle has told this player what to do down here. */
private final NamespacedKey introKey;
private final Map<Npc, Boolean> badges = new HashMap<>();
/** Prop groups by place ("ring", "heaven", "hell", "pillar0".."pillar5"), each respawned on its own. */
private final Map<String, List<Entity>> groups = new HashMap<>();
Expand All @@ -129,6 +133,7 @@ Location at(World world) {
LullCast(Lullveins lv) {
this.lv = lv;
this.propKey = new NamespacedKey(lv.plugin(), "lull_prop");
this.introKey = new NamespacedKey(lv.plugin(), "lull_intro");
}

// ── Upkeep ───────────────────────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -673,10 +678,59 @@ void gormBark(Player player, String line) {

// ── Kalle: the lift ──────────────────────────────────────────────────────────────────────────────────────

/**
* What to do in Lullveins, in three sentences (2026-12-03, Robb and David stood on the Core Ring and did not know
* where to start): pillars, Heart, splinters to Gorm. Kalle says it on the first arrival, and again when asked;
* the same three steps are the Lullveins page of the Journal ({@link LullJournal}).
*/
private static List<String> loop(boolean german, boolean first) {
return german
? List.of((first ? "Neues Gesicht! " : "") + "Kurzfassung: Bau Erz ab. Die Stimmen daraus bringen die sechs Säulen zum Klingen, drei oben im Himmel, drei unten in der Hölle.",
"Singen alle sechs, läutet Ysolde das Herz, und es wirft Lullsplitter ab.",
"Die Splitter bringst du zu Meister Gorm. Er baut dir einen Bohrer und macht ihn Stück für Stück stärker. Fang bei Ysolde an, im Osten auf dem Ring.")
: List.of((first ? "New face! " : "") + "Short version: mine ore. The voices in it make the six pillars sing, three up in Heaven, three down in Hell.",
"When all six sing, Ysolde rings the Heart, and it sheds Lull Splinters.",
"Take the splinters to Master Gorm. He builds you one drill and makes it stronger piece by piece. Start with Ysolde, east on the ring.");
}

/** The first arrival: Kalle, who stands right behind the landing, says the loop once. */
void welcome(Player player) {
if (player.getPersistentDataContainer().has(introKey, PersistentDataType.BYTE)) {
return;
}
if (lv.run().done(player) > 0) {
// Rang the Heart before this lesson existed: they know.
player.getPersistentDataContainer().set(introKey, PersistentDataType.BYTE, (byte) 1);
return;
}
Bukkit.getScheduler().runTaskLater(lv.plugin(), () -> {
if (player.isConnected() && lv.isLull(player.getWorld())
&& !player.getPersistentDataContainer().has(introKey, PersistentDataType.BYTE)) {
greet(player);
}
}, 70L);
}

/** Kalle's three sentences and the note that points at the Journal page (also the admin's "intro" test). */
void greet(Player player) {
player.getPersistentDataContainer().set(introKey, PersistentDataType.BYTE, (byte) 1);
boolean german = LullText.de(player);
sayAll(player, Npc.KALLE, loop(german, true));
try {
HudNotes.show(player, BarChrome.Icon.CRYSTAL, LullText.c("§dLullveins"), NamedTextColor.LIGHT_PURPLE,
List.of(LullText.c(german ? "§7Steht auch im Journal:" : "§7It is in your Journal too:"),
LullText.c("§fAtlas §8› §fLullveins")), 240);
} catch (RuntimeException | LinkageError ignored) {
// no note without the pack-drawn HUD: Kalle answers the question any time
}
}

private Menu kalle(Player player) {
boolean de = LullText.de(player);
String opener = de ? "Kalle, Kurbel, Kette. In der Reihenfolge." : "Kalle, crank, chain. In that order.";
List<Topic> topics = List.of(
new Topic("todo", "What do I do down here?", "Was mach ich hier unten?", NamedTextColor.YELLOW, true,
loop(false, false), loop(true, false)),
new Topic("ride", "How do I ride?", "Wie fahr ich?", NamedTextColor.YELLOW, false,
List.of("Click a board at the rail: up to Heaven, down to Hell. The crank does the rest. And me."),
List.of("Tafel am Geländer anklicken: hoch zum Himmel, runter zur Hölle. Den Rest macht die Kurbel. Und ich.")),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package de.aetherion.mining.lullveins;

import org.bukkit.entity.Player;

/**
* The one small line top right, only in Lullveins (2026-12-03, Robb's playtest plan): the Lull Splinters the player
* carries and how many of the sixteen finds they have. It sits on the chip under the place plate, drawn by
* AetherionItems' HUD ({@code PlaceChip}); with an older Items jar, or without the pack-drawn HUD, there is no line
* and nothing else breaks.
*/
final class LullChip {

private static boolean missing;

private LullChip() {
}

static void show(Lullveins lv, Player player) {
if (missing || lv.items() == null || lv.finds() == null) {
return;
}
int splinters = LullItems.count(player, lv.items()::isSplinter);
int found = Integer.bitCount(lv.finds().mask(player) & 0xffff);
String line = splinters + " " + (LullText.de(player) ? "FUNDE " : "FINDS ") + found + "/" + LullFinds.COUNT;
try {
de.aetherion.items.hud.PlaceChip.set(player, line);
} catch (LinkageError older) {
missing = true;
}
}

static void clear(Player player) {
if (missing) {
return;
}
try {
de.aetherion.items.hud.PlaceChip.clear(player);
} catch (LinkageError older) {
missing = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ private void find(Player player, int i) {
String where = heaven ? LullText.t(player, "Heaven", "Himmel") : LullText.t(player, "Hell", "Hölle");
ActionBarLane.show(player, LullText.c((german ? "§dFundstück" : "§dFind") + " §8· §f" + district + "/8 §7" + where
+ (each > 0 ? " §8· §d+" + each + (german ? " Lullsplitter" : " Lull Splinters") : "")), 80);
if (all == 1) {
// The first one says what finds are for; after that the line top right keeps count.
int bundle = Math.max(0, lv.cfg().getInt("finds.splinters-set", 12));
LullText.say(player,
"§d✦ §7A find. There are §f16 §7in the mines, eight in Heaven and eight in Hell. Each gives Lull Splinters, all eight of one half §d"
+ bundle + " §7more, all sixteen a §fdrill module§7. The count is top right.",
"§d✦ §7Ein Fundstück. In den Stollen liegen §f16§7, acht im Himmel und acht in der Hölle. Jedes gibt Lullsplitter, alle acht einer Hälfte §d"
+ bundle + " §7dazu, alle sechzehn ein §fBohrer-Modul§7. Der Zähler steht oben rechts.");
}
LullChip.show(lv, player);

if (district == 8) {
int bundle = Math.max(0, lv.cfg().getInt("finds.splinters-set", 12));
Expand Down
Loading
Loading