-
-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5435 from ZZZank/fluid-registry-rework
Fluid registry rework
- Loading branch information
Showing
3 changed files
with
69 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,147 +1,146 @@ | ||
onEvent('fluid.registry', (event) => { | ||
/** | ||
* @type {{type:string,id:string,color:number,display?:string,still?:string,flowing?:string}[]} | ||
* @param type Can be `thin`, `thick`, or `custom` | ||
* @param display Deprecated, DO NOT USE. Please switch to lang file. | ||
* Tips: For a targeted fluid, its language key is `"fluid.kubejs.{id}"`, | ||
* and the language key for its bucket item is `"item.kubejs.{id}_bucket"` | ||
* @param still Valid only when `type` is `custom` | ||
* @param flowing Valid only when `type` is `custom` | ||
*/ | ||
const generalFluids = [ | ||
{ | ||
type: 'thick', | ||
id: 'molten_cobalt_bee', | ||
texture: '0x209EBD', | ||
display: 'Molten Cobalt Bee' | ||
color: 0x209ebd | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_aluminum_bee', | ||
texture: '0xdce6f7', | ||
display: 'Molten Aluminum Bee' | ||
color: 0xdce6f7 | ||
}, | ||
{ | ||
type: 'thin', | ||
id: 'liquid_slimy_bee', | ||
texture: '0x73c262', | ||
display: 'Liquid Slimy Bee' | ||
color: 0x73c262 | ||
}, | ||
{ | ||
type: 'thin', | ||
id: 'liquid_skyslime_bee', | ||
texture: '0x72CFCB', | ||
display: 'Liquid Skyslime Bee' | ||
color: 0x72cfcb | ||
}, | ||
{ | ||
type: 'thin', | ||
id: 'liquid_ichor_bee', | ||
texture: '0xFDAB69', | ||
display: 'Liquid Ichor Bee' | ||
color: 0xfdab69 | ||
}, | ||
{ | ||
type: 'thin', | ||
id: 'liquid_enderslime_bee', | ||
texture: '0xC75EFF', | ||
display: 'Liquid Enderslime Bee' | ||
color: 0xc75eff | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_compressed_iron', | ||
texture: '0x868686', | ||
display: 'Molten Compressed Iron' | ||
color: 0x868686 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_infused_iron', | ||
texture: '0x2eb337', | ||
display: 'Molten Infused Iron' | ||
color: 0x2eb337 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_blazing', | ||
texture: '0xd79811', | ||
display: 'Molten Blazing Crystal' | ||
color: 0xd79811 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_energized_steel', | ||
texture: '0xb89365', | ||
display: 'Molten Energized Steel' | ||
color: 0xb89365 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_sky', | ||
texture: '0x88d7fc', | ||
display: 'Molten Sky Metal' | ||
color: 0x88d7fc | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_terminite', | ||
texture: '0x74f3e3', | ||
display: 'Molten Terminite' | ||
color: 0x74f3e3 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_aeternium', | ||
texture: '0x2e847c', | ||
display: 'Molten Aeternium' | ||
color: 0x2e847c | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_gaia_spirit', | ||
texture: '0x94a0bf', | ||
display: 'Molten Gaia Spirit' | ||
color: 0x94a0bf | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_niotic', | ||
texture: '0x54e5ea', | ||
display: 'Molten Niotic Crystal' | ||
color: 0x54e5ea | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_nitro', | ||
texture: '0xa42022', | ||
display: 'Molten Nitro Crystal' | ||
color: 0xa42022 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_spirited', | ||
texture: '0x86c52d', | ||
display: 'Molten Spirited Crystal' | ||
color: 0x86c52d | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'pink_ender_slime', | ||
texture: '0xa504d1', | ||
display: 'Molten Pink Enderslime' | ||
color: 0xa504d1 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_hardened_glass', | ||
texture: '0x535054', | ||
display: 'Molten Hardened Glass' | ||
color: 0x535054 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_signalum_glass', | ||
texture: '0x968274', | ||
display: 'Molten Signalum Glass' | ||
color: 0x968274 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_lumium_glass', | ||
texture: '0x959674', | ||
display: 'Molten Lumium Glass' | ||
color: 0x959674 | ||
}, | ||
{ | ||
type: 'thick', | ||
id: 'molten_enderium_glass', | ||
texture: '0x356e5b', | ||
display: 'Molten Enderium Glass' | ||
color: 0x356e5b | ||
} | ||
]; | ||
|
||
generalFluids.forEach((fluid) => { | ||
let /** @type {Internal.FluidBuilder} */ builder; | ||
if (fluid.type == 'thick') { | ||
event.create(fluid.id).textureThick(fluid.texture).bucketColor(fluid.texture).displayName(fluid.display); | ||
builder = event.create(fluid.id).textureThick(fluid.color).bucketColor(fluid.color); | ||
} else if (fluid.type == 'thin') { | ||
event.create(fluid.id).textureThin(fluid.texture).bucketColor(fluid.texture).displayName(fluid.display); | ||
} /* | ||
else if (fluid.type == 'custom') { | ||
event.create(fluid.id).displayName(fluid.display).textureStill(fluid.still).textureFlowing(fluid.flowing).bucketColor(fluid.color) | ||
}*/ | ||
builder = event.create(fluid.id).textureThin(fluid.color).bucketColor(fluid.color); | ||
} else if (fluid.type == 'custom') { | ||
builder = event | ||
.create(fluid.id) | ||
.textureStill(fluid.still) | ||
.textureFlowing(fluid.flowing) | ||
.bucketColor(fluid.color); | ||
} else { | ||
console.error('Invalid fluid registry type: ' + fluid.type); | ||
} | ||
if (fluid.display) { | ||
console.warn( | ||
'Deprecated param used: `display`, please switch to language file(kubejs/lang/en_us.json).' | ||
); | ||
builder.displayName(fluid.display); | ||
} | ||
}); | ||
}); |