All checks were successful
continuous-integration/drone/push Build is passing
127 lines
5.5 KiB
JavaScript
127 lines
5.5 KiB
JavaScript
global.storageDrawers = {
|
|
'blocks': [],
|
|
'items': [],
|
|
'drawerTypes': [
|
|
{ '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 (global.semverCompare(Platform.getInfo('storagedrawers').getVersion(), '12.4.0') < 0) {
|
|
// Workaround until we update, and then handle it automatically
|
|
[
|
|
{ 'name': 'bamboo', 'planks': 'minecraft:bamboo_planks' },
|
|
{ 'name': 'cherry', 'planks': 'minecraft:cherry_planks' },
|
|
{ 'name': 'mangrove', 'planks': 'minecraft:mangrove_planks' }
|
|
].forEach((drawerType) => global.storageDrawers.drawerTypes.push(drawerType))
|
|
}
|
|
|
|
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.storageDrawers.drawerTypes.push(drawerType))
|
|
}
|
|
|
|
if (Platform.isLoaded('ribbits')) {
|
|
[
|
|
{ 'name': 'mossy_oak', 'planks': 'ribbits:mossy_oak_planks', 'slab': 'ribbits:mossy_oak_planks_slab' }
|
|
].forEach((drawerType) => global.storageDrawers.drawerTypes.push(drawerType))
|
|
}
|
|
|
|
if (Platform.isLoaded('twilightforest')) {
|
|
[
|
|
{ 'name': 'canopy', 'planks': 'twilightforest:canopy_planks' },
|
|
{ 'name': 'darkwood', 'planks': 'twilightforest:dark_planks' },
|
|
{ 'name': 'minewood', 'planks': 'twilightforest:mining_planks' },
|
|
{ 'name': 'sortingwood', 'planks': 'twilightforest:sorting_planks' },
|
|
{ 'name': 'timewood', 'planks': 'twilightforest:time_planks' },
|
|
{ 'name': 'transwood', 'planks': 'twilightforest:transformation_planks' },
|
|
{ 'name': 'twilight_mangrove', 'planks': 'twilightforest:mangrove_planks' },
|
|
{ 'name': 'twilight_oak', 'planks': 'twilightforest:twilight_oak_planks' }
|
|
].forEach((drawerType) => global.storageDrawers.drawerTypes.push(drawerType))
|
|
}
|
|
|
|
if (Platform.isLoaded('alexscaves')) {
|
|
[
|
|
{ 'name': 'pewen', 'planks': 'alexscaves:pewen_planks' },
|
|
{ 'name': 'thornwood', 'planks': 'alexscaves:thornwood_planks' }
|
|
].forEach((drawerType) => global.storageDrawers.drawerTypes.push(drawerType))
|
|
}
|
|
if (Platform.isLoaded('deeperdarker')) {
|
|
[
|
|
{ 'name': 'echo', 'planks': 'deeperdarker:echo_planks' }
|
|
].forEach((drawerType) => global.storageDrawers.drawerTypes.push(drawerType))
|
|
}
|
|
if (Platform.isLoaded('quark')) {
|
|
[
|
|
{ 'name': 'ancient', 'display_name': 'Ashen', 'planks': 'quark:ancient_planks', 'slab': 'quark:ancient_planks_slab' },
|
|
{ 'name': 'azalea', 'display_name': 'Azalea', 'planks': 'quark:azalea_planks', 'slab': 'quark:azalea_planks_slab' },
|
|
{ 'name': 'blossom', 'display_name': 'Trumpet', 'planks': 'quark:blossom_planks', 'slab': 'quark:blossom_planks_slab' },
|
|
].forEach((drawerType) => global.storageDrawers.drawerTypes.push(drawerType))
|
|
}
|
|
if (Platform.isLoaded('vinery')) {
|
|
[
|
|
{ 'name': 'dark_cherry', 'planks': 'vinery:dark_cherry_planks' },
|
|
].forEach((drawerType) => global.storageDrawers.drawerTypes.push(drawerType))
|
|
}
|
|
|
|
if (Platform.isLoaded('storagedrawers')) {
|
|
StartupEvents.registry('block', event => {
|
|
var props = $Properties.of()
|
|
.sound(SoundType.WOOD)
|
|
.strength(3, 4)
|
|
|
|
global.storageDrawers.drawerTypes.forEach((wood) => {
|
|
[1, 2, 4].forEach((drawerCount) => {
|
|
[true, false].forEach((halfDepth) => {
|
|
let id = wood['name'] + '_' + (halfDepth ? 'half' : 'full') + '_drawers_' + drawerCount
|
|
|
|
global.storageDrawers.blocks.push({
|
|
'id': id,
|
|
'block': event
|
|
.createCustom('storagedrawers:' + id, () => new $BlockStandardDrawers(drawerCount, halfDepth, props))
|
|
.tag('storagedrawers:drawers')
|
|
.tag('minecraft:mineable/axe'),
|
|
'trim': false
|
|
})
|
|
})
|
|
})
|
|
|
|
let id = wood['name'] + '_trim'
|
|
global.storageDrawers.blocks.push({
|
|
'id': id,
|
|
'block': event
|
|
.createCustom('storagedrawers:' + id, () => new $BlockTrim(props))
|
|
.tag('minecraft:mineable/axe'),
|
|
'trim': true
|
|
})
|
|
})
|
|
})
|
|
|
|
StartupEvents.registry('item', event => {
|
|
global.storageDrawers.blocks.forEach((block) => {
|
|
let item = event
|
|
.createCustom('storagedrawers:' + block['id'], () => new $ItemDrawers(block['block'].get(), new $IProperties()))
|
|
|
|
if (!(block['trim'])) {
|
|
item = item.tag('storagedrawers:drawers')
|
|
}
|
|
|
|
global.storageDrawers.items.push({
|
|
'id': block['id'],
|
|
'item': item
|
|
})
|
|
})
|
|
})
|
|
} |