All checks were successful
continuous-integration/drone/push Build is passing
108 lines
5.0 KiB
JavaScript
108 lines
5.0 KiB
JavaScript
if (Platform.isLoaded('storagedrawers')) {
|
|
ClientEvents.lang('en_us', (event) => {
|
|
// block.storagedrawers.acacia_full_drawers_1=Acacia Drawers 1x1
|
|
// block.storagedrawers.acacia_full_drawers_2=Acacia Drawers 1x2
|
|
// block.storagedrawers.acacia_full_drawers_4=Acacia Drawers 2x2
|
|
// block.storagedrawers.acacia_half_drawers_1=Acacia Half Drawers 1x1
|
|
// block.storagedrawers.acacia_half_drawers_2=Acacia Half Drawers 1x2
|
|
// block.storagedrawers.acacia_half_drawers_4=Acacia Half Drawers 2x2
|
|
|
|
global.storageDrawers.drawerTypes.forEach((drawerType) => {
|
|
let pretty_name = 'display_name' in drawerType ? drawerType['display_name'] : drawerType['name'].charAt(0).toUpperCase() + string.slice(1);
|
|
|
|
[1, 2, 4].forEach((drawerCount) => {
|
|
let countLabel = null;
|
|
|
|
if (count == 1) {
|
|
countLabel = '1x1'
|
|
} else if (count == 2) {
|
|
countLabel = '1x2'
|
|
} else if (count == 4) {
|
|
countLabel = '2x2'
|
|
}
|
|
|
|
[true, false].forEach((halfDepth) => {
|
|
let drawer_id = drawerType['name'] + '_' + (halfDepth ? 'half' : 'full') + '_drawers_' + drawerCount
|
|
|
|
event.add(
|
|
'block.storagedrawers.' + drawer_id,
|
|
pretty_name + (halfDepth ? ' Half' : '') + ' Drawers ' + countLabel
|
|
)
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
ClientEvents.highPriorityAssets((event) => {
|
|
global.storageDrawers.drawerTypes.forEach((drawerType) => {
|
|
[1, 2, 4].forEach((drawerCount) => {
|
|
[true, false].forEach((halfDepth) => {
|
|
let drawer_id = drawerType['name'] + '_' + (halfDepth ? 'half' : 'full') + '_drawers_' + drawerCount
|
|
|
|
event.addBlockState('storagedrawers:' + drawer_id, (gen) => {
|
|
gen.variant('facing=north', (variant) => {
|
|
variant
|
|
.model('storagedrawers:block/' + drawer_id)
|
|
})
|
|
|
|
gen.variant('facing=east', (variant) => {
|
|
variant
|
|
.model('storagedrawers:block/' + drawer_id)
|
|
.y(90)
|
|
})
|
|
|
|
gen.variant('facing=south', (variant) => {
|
|
variant
|
|
.model('storagedrawers:block/' + drawer_id)
|
|
.y(180)
|
|
})
|
|
|
|
gen.variant('facing=west', (variant) => {
|
|
variant
|
|
.model('storagedrawers:block/' + drawer_id)
|
|
.y(270)
|
|
})
|
|
})
|
|
|
|
event.addModel('block', 'storagedrawers:' + drawer_id, (gen) => {
|
|
gen.texture('front', 'storagedrawers:block/drawers_' + drawerType['name'] + '_front_' + drawerCount)
|
|
gen.texture('trim', 'storagedrawers:block/drawers_' + drawerType['name'] + '_trim')
|
|
|
|
if (halfDepth) {
|
|
gen.parent('storagedrawers:block/half_drawers_orientable')
|
|
gen.texture('back', 'storagedrawers:block/drawers_' + drawerType['name'] + '_side')
|
|
gen.texture('top', 'storagedrawers:block/drawers_' + drawerType['name'] + '_side_h')
|
|
gen.texture('side', 'storagedrawers:block/drawers_' + drawerType['name'] + '_side_v')
|
|
} else {
|
|
gen.parent('storagedrawers:block/full_drawers_orientable')
|
|
gen.texture('top', 'storagedrawers:block/drawers_' + drawerType['name'] + '_side')
|
|
gen.texture('side', 'storagedrawers:block/drawers_' + drawerType['name'] + '_side')
|
|
}
|
|
})
|
|
|
|
event.addModel('item', 'storagedrawers:' + drawer_id, (gen) => {
|
|
gen.parent('storagedrawers:block/' + drawer_id)
|
|
})
|
|
})
|
|
})
|
|
|
|
let trim_id = drawerType['name'] + '_trim'
|
|
|
|
event.addBlockState('storagedrawers:' + trim_id, (gen) => {
|
|
gen.variant('', (variant) => {
|
|
variant
|
|
.model('storagedrawers:block/' + trim_id)
|
|
})
|
|
})
|
|
|
|
event.addModel('block', 'storagedrawers:' + trim_id, (gen) => {
|
|
gen.parent('block/cube_all')
|
|
gen.texture('all', 'storagedrawers:block/drawers_' + drawerType['name'] + '_side')
|
|
})
|
|
|
|
event.addModel('item', 'storagedrawers:' + trim_id, (gen) => {
|
|
gen.parent('storagedrawers:block/' + trim_id)
|
|
})
|
|
})
|
|
})
|
|
} |