fix: KubeJS redeclaration of const SC across server scripts
All checks were successful
Build & Release Pack / build (push) Successful in 1m46s
All checks were successful
Build & Release Pack / build (push) Successful in 1m46s
Three server scripts each declared 'const SC' at top level, but KubeJS 2101 shares a single global scope across all server scripts → 'redeclaration of const SC' TypeError. Rename per-file to unique consts: - 01_corruption_tide.js → const TIDE_SC - 02_events.js → const EVENTS_SC - 03_recipes_tags.js → const RECIPES_SC (The IP warnings in the log — Iris portal artifacts + HAR 1010 wrong-mods — are informational from the IPSable fork, not errors.)
This commit is contained in:
parent
2fdd487786
commit
26a9fe775d
6 changed files with 38 additions and 38 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
// GLOBAL CORRUPTION TIDE. Shared by all players via server persistent data.
|
// GLOBAL CORRUPTION TIDE. Shared by all players via server persistent data.
|
||||||
// Rises while the Doors stay unsealed. Re-seal them at the Lattice to push it back.
|
// Rises while the Doors stay unsealed. Re-seal them at the Lattice to push it back.
|
||||||
|
|
||||||
const SC = {
|
const TIDE_SC = {
|
||||||
items: { quantum_lattice: 'scicraft:quantum_lattice' },
|
items: { quantum_lattice: 'scicraft:quantum_lattice' },
|
||||||
tide: {
|
tide: {
|
||||||
key: 'scicraft_corruption',
|
key: 'scicraft_corruption',
|
||||||
|
|
@ -18,7 +18,7 @@ const SC = {
|
||||||
darker_dim: 'deeperdarker:otherside'
|
darker_dim: 'deeperdarker:otherside'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const T = SC.tide
|
const T = TIDE_SC.tide
|
||||||
|
|
||||||
function getTide(server) {
|
function getTide(server) {
|
||||||
const data = server.persistentData
|
const data = server.persistentData
|
||||||
|
|
@ -38,7 +38,7 @@ ServerEvents.tick(event => {
|
||||||
|
|
||||||
// Every sealed Lattice pushes the tide back, once per stabilizer use.
|
// Every sealed Lattice pushes the tide back, once per stabilizer use.
|
||||||
BlockEvents.rightClicked(event => {
|
BlockEvents.rightClicked(event => {
|
||||||
if (event.block.id !== SC.items.quantum_lattice) return
|
if (event.block.id !== TIDE_SC.items.quantum_lattice) return
|
||||||
const held = event.player.mainHandItem
|
const held = event.player.mainHandItem
|
||||||
if (!held.hasTag('scicraft:stabilizer')) return
|
if (!held.hasTag('scicraft:stabilizer')) return
|
||||||
if (event.player.crouching) return
|
if (event.player.crouching) return
|
||||||
|
|
@ -62,7 +62,7 @@ PlayerEvents.tick(event => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inside the wound itself, the dark is absolute.
|
// Inside the wound itself, the dark is absolute.
|
||||||
if (dim === SC.dimensions.void_dim || dim === SC.dimensions.darker_dim) {
|
if (dim === TIDE_SC.dimensions.void_dim || dim === TIDE_SC.dimensions.darker_dim) {
|
||||||
event.player.potionEffects.add('minecraft:darkness', 120, 1, true, false)
|
event.player.potionEffects.add('minecraft:darkness', 120, 1, true, false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// SCICRAFT — The Dark Photon Protocol
|
// SCICRAFT — The Dark Photon Protocol
|
||||||
// Player-side lore events: the Resonance, void exposure, and held-item powers.
|
// Player-side lore events: the Resonance, void exposure, and held-item powers.
|
||||||
|
|
||||||
const SC = {
|
const EVENTS_SC = {
|
||||||
items: {
|
items: {
|
||||||
photon_core: 'scicraft:photon_core',
|
photon_core: 'scicraft:photon_core',
|
||||||
void_stabilizer: 'scicraft:void_stabilizer'
|
void_stabilizer: 'scicraft:void_stabilizer'
|
||||||
|
|
@ -17,10 +17,10 @@ PlayerEvents.tick(event => {
|
||||||
if (event.player.server.ticks % 40 !== 0) return
|
if (event.player.server.ticks % 40 !== 0) return
|
||||||
const held = event.player.mainHandItem
|
const held = event.player.mainHandItem
|
||||||
|
|
||||||
if (held.id === SC.items.photon_core) {
|
if (held.id === EVENTS_SC.items.photon_core) {
|
||||||
event.player.potionEffects.add('minecraft:night_vision', 140, 0, true, false)
|
event.player.potionEffects.add('minecraft:night_vision', 140, 0, true, false)
|
||||||
}
|
}
|
||||||
if (held.id === SC.items.void_stabilizer) {
|
if (held.id === EVENTS_SC.items.void_stabilizer) {
|
||||||
event.player.potionEffects.add('minecraft:speed', 120, 0, true, false)
|
event.player.potionEffects.add('minecraft:speed', 120, 0, true, false)
|
||||||
event.player.potionEffects.add('minecraft:regeneration', 120, 0, true, false)
|
event.player.potionEffects.add('minecraft:regeneration', 120, 0, true, false)
|
||||||
}
|
}
|
||||||
|
|
@ -29,11 +29,11 @@ PlayerEvents.tick(event => {
|
||||||
// The wound is physically hostile. Being inside it costs you.
|
// The wound is physically hostile. Being inside it costs you.
|
||||||
PlayerEvents.tick(event => {
|
PlayerEvents.tick(event => {
|
||||||
const dim = String(event.player.level.dimension)
|
const dim = String(event.player.level.dimension)
|
||||||
if (dim === SC.dimensions.void_dim) {
|
if (dim === EVENTS_SC.dimensions.void_dim) {
|
||||||
if (event.player.server.ticks % 100 === 0) {
|
if (event.player.server.ticks % 100 === 0) {
|
||||||
event.player.hurt('minecraft:generic', 1.0)
|
event.player.hurt('minecraft:generic', 1.0)
|
||||||
}
|
}
|
||||||
} else if (dim === SC.dimensions.darker_dim) {
|
} else if (dim === EVENTS_SC.dimensions.darker_dim) {
|
||||||
if (event.player.server.ticks % 200 === 0) {
|
if (event.player.server.ticks % 200 === 0) {
|
||||||
event.player.potionEffects.add('minecraft:wither', 80, 0, true, false)
|
event.player.potionEffects.add('minecraft:wither', 80, 0, true, false)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// SCICRAFT — The Dark Photon Protocol
|
// SCICRAFT — The Dark Photon Protocol
|
||||||
// The Protocol's crafting chain. Soft-gates the story items behind mod content.
|
// The Protocol's crafting chain. Soft-gates the story items behind mod content.
|
||||||
|
|
||||||
const SC = {
|
const RECIPES_SC = {
|
||||||
items: {
|
items: {
|
||||||
photon_fragment: 'scicraft:photon_fragment',
|
photon_fragment: 'scicraft:photon_fragment',
|
||||||
photon_core: 'scicraft:photon_core',
|
photon_core: 'scicraft:photon_core',
|
||||||
|
|
@ -14,44 +14,44 @@ const SC = {
|
||||||
ServerEvents.recipes(event => {
|
ServerEvents.recipes(event => {
|
||||||
// --- Photon Fragment: harvested from the Darker's own remains.
|
// --- Photon Fragment: harvested from the Darker's own remains.
|
||||||
// (LootJS also adds these; this gives a deterministic in-world path.)
|
// (LootJS also adds these; this gives a deterministic in-world path.)
|
||||||
event.shapeless(SC.items.photon_fragment, ['minecraft:echo_shard', 'minecraft:glowstone_dust'])
|
event.shapeless(RECIPES_SC.items.photon_fragment, ['minecraft:echo_shard', 'minecraft:glowstone_dust'])
|
||||||
.id('scicraft:photon_fragment_from_echo')
|
.id('scicraft:photon_fragment_from_echo')
|
||||||
|
|
||||||
// --- Photon Core: compress fragments in a Mekanism-grade press.
|
// --- Photon Core: compress fragments in a Mekanism-grade press.
|
||||||
event.recipes.create.pressing(SC.items.photon_core, '3x ' + SC.items.photon_fragment)
|
event.recipes.create.pressing(RECIPES_SC.items.photon_core, '3x ' + RECIPES_SC.items.photon_fragment)
|
||||||
.id('scicraft:photon_core_pressing')
|
.id('scicraft:photon_core_pressing')
|
||||||
event.smelting(SC.items.photon_core, 'minecraft:ender_pearl', 0.5)
|
event.smelting(RECIPES_SC.items.photon_core, 'minecraft:ender_pearl', 0.5)
|
||||||
.id('scicraft:photon_core_smelting')
|
.id('scicraft:photon_core_smelting')
|
||||||
|
|
||||||
// --- Void Stabilizer: the tool of the Flight — needs a door's key, not ore.
|
// --- Void Stabilizer: the tool of the Flight — needs a door's key, not ore.
|
||||||
event.shaped(SC.items.void_stabilizer, [
|
event.shaped(RECIPES_SC.items.void_stabilizer, [
|
||||||
' P ',
|
' P ',
|
||||||
'PEP',
|
'PEP',
|
||||||
' P '
|
' P '
|
||||||
], {
|
], {
|
||||||
P: SC.items.photon_core,
|
P: RECIPES_SC.items.photon_core,
|
||||||
E: 'minecraft:ender_eye'
|
E: 'minecraft:ender_eye'
|
||||||
}).id('scicraft:void_stabilizer')
|
}).id('scicraft:void_stabilizer')
|
||||||
|
|
||||||
// --- Quantum Lattice: the emitter. Dense, expensive, ongoing.
|
// --- Quantum Lattice: the emitter. Dense, expensive, ongoing.
|
||||||
event.shaped(SC.items.quantum_lattice, [
|
event.shaped(RECIPES_SC.items.quantum_lattice, [
|
||||||
'SCS',
|
'SCS',
|
||||||
'CPC',
|
'CPC',
|
||||||
'SCS'
|
'SCS'
|
||||||
], {
|
], {
|
||||||
S: 'c:ingots/steel',
|
S: 'c:ingots/steel',
|
||||||
C: 'c:circuits',
|
C: 'c:circuits',
|
||||||
P: SC.items.photon_core
|
P: RECIPES_SC.items.photon_core
|
||||||
}).id('scicraft:quantum_lattice')
|
}).id('scicraft:quantum_lattice')
|
||||||
|
|
||||||
// --- Renegade Glass: the Flight's TARDIS-blue pane. Purely decorative.
|
// --- Renegade Glass: the Flight's TARDIS-blue pane. Purely decorative.
|
||||||
event.shaped('8x ' + SC.items.renegade_glass, [
|
event.shaped('8x ' + RECIPES_SC.items.renegade_glass, [
|
||||||
'GGG',
|
'GGG',
|
||||||
'GPG',
|
'GPG',
|
||||||
'GGG'
|
'GGG'
|
||||||
], {
|
], {
|
||||||
G: 'c:glass_blocks',
|
G: 'c:glass_blocks',
|
||||||
P: SC.items.photon_fragment
|
P: RECIPES_SC.items.photon_fragment
|
||||||
}).id('scicraft:renegade_glass')
|
}).id('scicraft:renegade_glass')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// GLOBAL CORRUPTION TIDE. Shared by all players via server persistent data.
|
// GLOBAL CORRUPTION TIDE. Shared by all players via server persistent data.
|
||||||
// Rises while the Doors stay unsealed. Re-seal them at the Lattice to push it back.
|
// Rises while the Doors stay unsealed. Re-seal them at the Lattice to push it back.
|
||||||
|
|
||||||
const SC = {
|
const TIDE_SC = {
|
||||||
items: { quantum_lattice: 'scicraft:quantum_lattice' },
|
items: { quantum_lattice: 'scicraft:quantum_lattice' },
|
||||||
tide: {
|
tide: {
|
||||||
key: 'scicraft_corruption',
|
key: 'scicraft_corruption',
|
||||||
|
|
@ -18,7 +18,7 @@ const SC = {
|
||||||
darker_dim: 'deeperdarker:otherside'
|
darker_dim: 'deeperdarker:otherside'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const T = SC.tide
|
const T = TIDE_SC.tide
|
||||||
|
|
||||||
function getTide(server) {
|
function getTide(server) {
|
||||||
const data = server.persistentData
|
const data = server.persistentData
|
||||||
|
|
@ -38,7 +38,7 @@ ServerEvents.tick(event => {
|
||||||
|
|
||||||
// Every sealed Lattice pushes the tide back, once per stabilizer use.
|
// Every sealed Lattice pushes the tide back, once per stabilizer use.
|
||||||
BlockEvents.rightClicked(event => {
|
BlockEvents.rightClicked(event => {
|
||||||
if (event.block.id !== SC.items.quantum_lattice) return
|
if (event.block.id !== TIDE_SC.items.quantum_lattice) return
|
||||||
const held = event.player.mainHandItem
|
const held = event.player.mainHandItem
|
||||||
if (!held.hasTag('scicraft:stabilizer')) return
|
if (!held.hasTag('scicraft:stabilizer')) return
|
||||||
if (event.player.crouching) return
|
if (event.player.crouching) return
|
||||||
|
|
@ -62,7 +62,7 @@ PlayerEvents.tick(event => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inside the wound itself, the dark is absolute.
|
// Inside the wound itself, the dark is absolute.
|
||||||
if (dim === SC.dimensions.void_dim || dim === SC.dimensions.darker_dim) {
|
if (dim === TIDE_SC.dimensions.void_dim || dim === TIDE_SC.dimensions.darker_dim) {
|
||||||
event.player.potionEffects.add('minecraft:darkness', 120, 1, true, false)
|
event.player.potionEffects.add('minecraft:darkness', 120, 1, true, false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// SCICRAFT — The Dark Photon Protocol
|
// SCICRAFT — The Dark Photon Protocol
|
||||||
// Player-side lore events: the Resonance, void exposure, and held-item powers.
|
// Player-side lore events: the Resonance, void exposure, and held-item powers.
|
||||||
|
|
||||||
const SC = {
|
const EVENTS_SC = {
|
||||||
items: {
|
items: {
|
||||||
photon_core: 'scicraft:photon_core',
|
photon_core: 'scicraft:photon_core',
|
||||||
void_stabilizer: 'scicraft:void_stabilizer'
|
void_stabilizer: 'scicraft:void_stabilizer'
|
||||||
|
|
@ -17,10 +17,10 @@ PlayerEvents.tick(event => {
|
||||||
if (event.player.server.ticks % 40 !== 0) return
|
if (event.player.server.ticks % 40 !== 0) return
|
||||||
const held = event.player.mainHandItem
|
const held = event.player.mainHandItem
|
||||||
|
|
||||||
if (held.id === SC.items.photon_core) {
|
if (held.id === EVENTS_SC.items.photon_core) {
|
||||||
event.player.potionEffects.add('minecraft:night_vision', 140, 0, true, false)
|
event.player.potionEffects.add('minecraft:night_vision', 140, 0, true, false)
|
||||||
}
|
}
|
||||||
if (held.id === SC.items.void_stabilizer) {
|
if (held.id === EVENTS_SC.items.void_stabilizer) {
|
||||||
event.player.potionEffects.add('minecraft:speed', 120, 0, true, false)
|
event.player.potionEffects.add('minecraft:speed', 120, 0, true, false)
|
||||||
event.player.potionEffects.add('minecraft:regeneration', 120, 0, true, false)
|
event.player.potionEffects.add('minecraft:regeneration', 120, 0, true, false)
|
||||||
}
|
}
|
||||||
|
|
@ -29,11 +29,11 @@ PlayerEvents.tick(event => {
|
||||||
// The wound is physically hostile. Being inside it costs you.
|
// The wound is physically hostile. Being inside it costs you.
|
||||||
PlayerEvents.tick(event => {
|
PlayerEvents.tick(event => {
|
||||||
const dim = String(event.player.level.dimension)
|
const dim = String(event.player.level.dimension)
|
||||||
if (dim === SC.dimensions.void_dim) {
|
if (dim === EVENTS_SC.dimensions.void_dim) {
|
||||||
if (event.player.server.ticks % 100 === 0) {
|
if (event.player.server.ticks % 100 === 0) {
|
||||||
event.player.hurt('minecraft:generic', 1.0)
|
event.player.hurt('minecraft:generic', 1.0)
|
||||||
}
|
}
|
||||||
} else if (dim === SC.dimensions.darker_dim) {
|
} else if (dim === EVENTS_SC.dimensions.darker_dim) {
|
||||||
if (event.player.server.ticks % 200 === 0) {
|
if (event.player.server.ticks % 200 === 0) {
|
||||||
event.player.potionEffects.add('minecraft:wither', 80, 0, true, false)
|
event.player.potionEffects.add('minecraft:wither', 80, 0, true, false)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// SCICRAFT — The Dark Photon Protocol
|
// SCICRAFT — The Dark Photon Protocol
|
||||||
// The Protocol's crafting chain. Soft-gates the story items behind mod content.
|
// The Protocol's crafting chain. Soft-gates the story items behind mod content.
|
||||||
|
|
||||||
const SC = {
|
const RECIPES_SC = {
|
||||||
items: {
|
items: {
|
||||||
photon_fragment: 'scicraft:photon_fragment',
|
photon_fragment: 'scicraft:photon_fragment',
|
||||||
photon_core: 'scicraft:photon_core',
|
photon_core: 'scicraft:photon_core',
|
||||||
|
|
@ -14,44 +14,44 @@ const SC = {
|
||||||
ServerEvents.recipes(event => {
|
ServerEvents.recipes(event => {
|
||||||
// --- Photon Fragment: harvested from the Darker's own remains.
|
// --- Photon Fragment: harvested from the Darker's own remains.
|
||||||
// (LootJS also adds these; this gives a deterministic in-world path.)
|
// (LootJS also adds these; this gives a deterministic in-world path.)
|
||||||
event.shapeless(SC.items.photon_fragment, ['minecraft:echo_shard', 'minecraft:glowstone_dust'])
|
event.shapeless(RECIPES_SC.items.photon_fragment, ['minecraft:echo_shard', 'minecraft:glowstone_dust'])
|
||||||
.id('scicraft:photon_fragment_from_echo')
|
.id('scicraft:photon_fragment_from_echo')
|
||||||
|
|
||||||
// --- Photon Core: compress fragments in a Mekanism-grade press.
|
// --- Photon Core: compress fragments in a Mekanism-grade press.
|
||||||
event.recipes.create.pressing(SC.items.photon_core, '3x ' + SC.items.photon_fragment)
|
event.recipes.create.pressing(RECIPES_SC.items.photon_core, '3x ' + RECIPES_SC.items.photon_fragment)
|
||||||
.id('scicraft:photon_core_pressing')
|
.id('scicraft:photon_core_pressing')
|
||||||
event.smelting(SC.items.photon_core, 'minecraft:ender_pearl', 0.5)
|
event.smelting(RECIPES_SC.items.photon_core, 'minecraft:ender_pearl', 0.5)
|
||||||
.id('scicraft:photon_core_smelting')
|
.id('scicraft:photon_core_smelting')
|
||||||
|
|
||||||
// --- Void Stabilizer: the tool of the Flight — needs a door's key, not ore.
|
// --- Void Stabilizer: the tool of the Flight — needs a door's key, not ore.
|
||||||
event.shaped(SC.items.void_stabilizer, [
|
event.shaped(RECIPES_SC.items.void_stabilizer, [
|
||||||
' P ',
|
' P ',
|
||||||
'PEP',
|
'PEP',
|
||||||
' P '
|
' P '
|
||||||
], {
|
], {
|
||||||
P: SC.items.photon_core,
|
P: RECIPES_SC.items.photon_core,
|
||||||
E: 'minecraft:ender_eye'
|
E: 'minecraft:ender_eye'
|
||||||
}).id('scicraft:void_stabilizer')
|
}).id('scicraft:void_stabilizer')
|
||||||
|
|
||||||
// --- Quantum Lattice: the emitter. Dense, expensive, ongoing.
|
// --- Quantum Lattice: the emitter. Dense, expensive, ongoing.
|
||||||
event.shaped(SC.items.quantum_lattice, [
|
event.shaped(RECIPES_SC.items.quantum_lattice, [
|
||||||
'SCS',
|
'SCS',
|
||||||
'CPC',
|
'CPC',
|
||||||
'SCS'
|
'SCS'
|
||||||
], {
|
], {
|
||||||
S: 'c:ingots/steel',
|
S: 'c:ingots/steel',
|
||||||
C: 'c:circuits',
|
C: 'c:circuits',
|
||||||
P: SC.items.photon_core
|
P: RECIPES_SC.items.photon_core
|
||||||
}).id('scicraft:quantum_lattice')
|
}).id('scicraft:quantum_lattice')
|
||||||
|
|
||||||
// --- Renegade Glass: the Flight's TARDIS-blue pane. Purely decorative.
|
// --- Renegade Glass: the Flight's TARDIS-blue pane. Purely decorative.
|
||||||
event.shaped('8x ' + SC.items.renegade_glass, [
|
event.shaped('8x ' + RECIPES_SC.items.renegade_glass, [
|
||||||
'GGG',
|
'GGG',
|
||||||
'GPG',
|
'GPG',
|
||||||
'GGG'
|
'GGG'
|
||||||
], {
|
], {
|
||||||
G: 'c:glass_blocks',
|
G: 'c:glass_blocks',
|
||||||
P: SC.items.photon_fragment
|
P: RECIPES_SC.items.photon_fragment
|
||||||
}).id('scicraft:renegade_glass')
|
}).id('scicraft:renegade_glass')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue