All checks were successful
Build & Release Pack / build (push) Successful in 1m47s
- Worldgen (both packs): Terralith 2.6.2, Tectonic 3.0.26, Continents 1.1.12 (realistic continent-based overworld; applies to NEW worlds) - Client: bundle MakeUp Ultra Fast shaderpack (LGPL) + Vanilla Live resource pack (CC-BY-SA), force-enabled via Resource Pack Overrides - FTB Quests: add Protocol Tome starter item (given on first login) that opens the quest book via KubeJS network -> FTBQuestsClient.openGui(); + lang keys - Optimize: add Lithium 0.15.4 (NeoForge 1.21.1) to both packs - Docs: mods.md updated with worldgen/shader/resource/quest notes
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
// SCICRAFT — The Dark Photon Protocol
|
|
// Protocol Tome: starter item that makes the FTB Quests guidance unmissable.
|
|
// - Given to each player once on first login.
|
|
// - Right-clicking it opens the FTB Quests book on the client.
|
|
|
|
const TOME_SC = {
|
|
item: 'scicraft:protocol_tome',
|
|
channel: 'scicraft:open_quests',
|
|
give_flag: 'scicraft_got_tome'
|
|
}
|
|
|
|
// Give the Tome once per player on first login.
|
|
PlayerEvents.loggedIn(event => {
|
|
const player = event.player
|
|
if (player.persistentData.contains(TOME_SC.give_flag)) return
|
|
player.persistentData.putBoolean(TOME_SC.give_flag, true)
|
|
// Give on the next tick so the player is fully in-world first.
|
|
event.server.scheduleInTicks(10, () => {
|
|
if (!player.isOnline()) return
|
|
player.give(Item.of(TOME_SC.item))
|
|
player.tell(Text.translate('scicraft.phrases.tome_given'))
|
|
})
|
|
})
|
|
|
|
// Right-clicking the Tome asks the client to open the FTB Quests book.
|
|
ItemEvents.rightClicked(event => {
|
|
if (event.item.id !== TOME_SC.item) return
|
|
if (event.player.crouching) return
|
|
event.player.sendData(TOME_SC.channel, {})
|
|
event.cancel()
|
|
})
|