All checks were successful
continuous-integration/drone/push Build is passing
65 lines
1.9 KiB
JavaScript
65 lines
1.9 KiB
JavaScript
const drawerShapes = {
|
|
1: [
|
|
'///',
|
|
' X ',
|
|
'///'
|
|
],
|
|
2: [
|
|
'/X/',
|
|
'///',
|
|
'/X/'
|
|
],
|
|
4: [
|
|
'X/X',
|
|
'///',
|
|
'X/X'
|
|
],
|
|
}
|
|
|
|
if (Platform.isLoaded('storagedrawers')) {
|
|
ServerEvents.recipes((event) => {
|
|
global.drawerTypes.forEach((drawerType) => {
|
|
[1, 2, 4].forEach((drawerCount) => {
|
|
let slab_item = drawerType['planks'].replace('planks', 'slab')
|
|
let depthTypes = null
|
|
|
|
if (Item.exists(slab_item)) {
|
|
depthTypes = [true, false]
|
|
} else {
|
|
depthTypes = [false]
|
|
}
|
|
|
|
[true, false].forEach((halfDepth) => {
|
|
let drawer_id = 'storagedrawers:' + drawerType['name'] + '_' + (halfDepth ? 'half' : 'full') + '_drawers_' + drawerCount
|
|
event
|
|
.shaped(
|
|
Item.of(drawer_id, 1),
|
|
drawerShapes[drawerCount],
|
|
{
|
|
'/': { 'item': halfDepth ? drawerType['planks'].replace('planks', 'slab') : drawerType['planks'] },
|
|
'X': { 'tag': "forge:chests/wooden" }
|
|
}
|
|
)
|
|
.id(drawer_id)
|
|
})
|
|
})
|
|
|
|
let trim_id = 'storagedrawers:' + drawerType['name'] + '_trim'
|
|
|
|
event
|
|
.shaped(
|
|
Item.of(trim_id, 4),
|
|
[
|
|
'X/X',
|
|
'/X/',
|
|
'X/X'
|
|
],
|
|
{
|
|
'/': { 'tag': 'forge:rods/wooden' },
|
|
'X': { 'item': drawerType['planks'] }
|
|
}
|
|
)
|
|
.id(trim_id)
|
|
})
|
|
})
|
|
} |