skapa-season-3/kubejs/startup_scripts/quark.js
2024-07-18 05:02:21 +00:00

35 lines
1.0 KiB
JavaScript

global.quarkExistingVerticalPlanks = [
'oak',
'spruce',
'burch',
'jungle',
'acacia',
'dark_oak',
'mangrove',
'cherry',
'ancient',
'azalea',
'blossom'
]
global.verticalPlanks = {}
if (Platform.isLoaded('quark')) {
StartupEvents.registry('block', event => {
global.woodTypes.forEach((wood) => {
if (wood['id'] in global.quarkExistingVerticalPlanks) return;
let item_id = 'quark:vertical_' + wood['id'] + '_planks'
global.verticalPlanks[item_id] = event.createCustom(item_id, () => new $Block($Properties.copy($Blocks.OAK_PLANKS)))
})
})
StartupEvents.registry('item', event => {
global.woodTypes.forEach((wood) => {
if (wood['id'] in global.quarkExistingVerticalPlanks) return;
let item_id = 'quark:vertical_' + wood['id'] + '_planks'
event.createCustom(item_id, () => new $BlockItem(global.verticalPlanks[item_id].get(), new $IProperties()))
})
})
}