skapa-season-3/kubejs/startup_scripts/storagedrawers.js
Steve McMaster aa14e989ce
All checks were successful
continuous-integration/drone/push Build is passing
Prepare for season 3 reset. Update required! You MUST re-download
setup.exe
2024-07-17 05:42:11 +00:00

88 lines
3.8 KiB
JavaScript

global.drawerTypes = [
{ 'name': 'bamboo', 'planks': 'minecraft:bamboo_planks' },
{ 'name': 'cherry', 'planks': 'minecraft:cherry_planks' },
{ 'name': 'mangrove', 'planks': 'minecraft:mangrove_planks' },
{ 'name': 'rose', 'planks': 'create_dd:rose_planks' },
{ 'name': 'rubber', 'planks': 'create_dd:rubber_planks' },
{ 'name': 'smoked', 'planks': 'create_dd:smoked_planks' },
{ 'name': 'spirit', 'planks': 'create_dd:spirit_planks' }
]
if (Platform.isLoaded('biomesoplenty')) {
[
{ 'name': 'dead', 'planks': 'biomesoplenty:dead_planks' },
{ 'name': 'fir', 'planks': 'biomesoplenty:fir_planks' },
{ 'name': 'hellbark', 'planks': 'biomesoplenty:hellbark_planks' },
{ 'name': 'jacaranda', 'planks': 'biomesoplenty:jacaranda_planks' },
{ 'name': 'magic', 'planks': 'biomesoplenty:magic_planks' },
{ 'name': 'mahogany', 'planks': 'biomesoplenty:mahogany_planks' },
{ 'name': 'palm', 'planks': 'biomesoplenty:palm_planks' },
{ 'name': 'redwood', 'planks': 'biomesoplenty:redwood_planks' },
{ 'name': 'umbran', 'planks': 'biomesoplenty:umbran_planks' },
{ 'name': 'willow', 'planks': 'biomesoplenty:willow_planks' }
].forEach((drawerType) => global.drawerTypes.push(drawerType))
}
if (Platform.isLoaded('ribbits')) {
[
{ 'name': 'mossy_oak', 'planks': 'ribbits:mossy_oak_planks' }
].forEach((drawerType) => global.drawerTypes.push(drawerType))
}
if (Platform.isLoaded('twilightforest')) {
[
{ 'name': 'canopy', 'planks': 'twilightforest:canopy_planks' },
{ 'name': 'darkwood', 'planks': 'twilightforest:darkwood_planks' },
{ 'name': 'minewood', 'planks': 'twilightforest:minewood_planks' },
{ 'name': 'sortingwood', 'planks': 'twilightforest:sortingwood_planks' },
{ 'name': 'timewood', 'planks': 'twilightforest:timewood_planks' },
{ 'name': 'transwood', 'planks': 'twilightforest:transwood_planks' },
{ 'name': 'twilight_mangrove', 'planks': 'twilightforest:mangrove_planks' },
{ 'name': 'twilight_oak', 'planks': 'twilightforest:twilight_oak_planks' }
].forEach((drawerType) => global.drawerTypes.push(drawerType))
}
let drawerBlocks = {}
if (Platform.isLoaded('storagedrawers')) {
StartupEvents.registry('block', event => {
var props = $Properties.of()
.sound(SoundType.WOOD)
.strength(3, 4)
global.drawerTypes.forEach((wood) => {
[1, 2, 4].forEach((drawerCount) => {
[true, false].forEach((halfDepth) => {
let id = wood['name'] + '_' + (halfDepth ? 'half' : 'full') + '_drawers_' + drawerCount
drawerBlocks[id] = event
.createCustom('storagedrawers:' + id, () => new $BlockStandardDrawers(drawerCount, halfDepth, props))
.tag('storagedrawers:drawers')
})
})
let id = wood['name'] + '_trim'
drawerBlocks[id] = event
.createCustom('storagedrawers:' + id, () => new $BlockTrim(props))
})
})
StartupEvents.registry('item', event => {
global.drawerTypes.forEach((wood) => {
[1, 2, 4].forEach((drawerCount) => {
[true, false].forEach((halfDepth) => {
let id = wood['name'] + '_' + (halfDepth ? 'half' : 'full') + '_drawers_' + drawerCount
event
.createCustom('storagedrawers:' + id, () => new $ItemDrawers(drawerBlocks[id].get(), new $IProperties()))
.tag('storagedrawers:drawers')
})
})
let id = wood['name'] + '_trim'
event
.createCustom('storagedrawers:' + id, () => new $BlockItem(drawerBlocks[id].get(), new $IProperties()))
})
})
}