skapa-season-3/kubejs/startup_scripts/create_dd.js
Steve McMaster da0b26d1a2
All checks were successful
continuous-integration/drone/push Build is passing
Prepare for season 3 reset. Update required!
2024-07-17 05:32:07 +00:00

100 lines
5.1 KiB
JavaScript

const createDdWoodTypes = [
{ 'id': 'rose', 'name': 'Rose', 'mapColor': 'terracotta_red' },
{ 'id': 'rubber', 'name': 'Rubber', 'mapColor': 'terracotta_cyan' },
{ 'id': 'spirit', 'name': 'Spirit', 'mapColor': 'terracotta_purple' },
{ 'id': 'smoked', 'name': 'Smoked', 'mapColor': 'terracotta_brown' }
]
createDdWoodTypes.forEach((wood) => {
global.woodTypes.push({
'id': wood['id'],
'name': wood['name'],
'mod': 'create_dd',
'planks': {
'id': wood['id'] + '_planks'
}
})
})
// const createDdWoodItems = [
// // { 'id': 'boat', 'name': 'Boat', 'cls': '' },
// { 'id': 'button', 'name': 'Button', 'cls': 'ButtonBlock' , 'base': () => { return $Blocks.OAK_BUTTON } },
// { 'id': 'door', 'name': 'Door', 'cls': 'DoorBlock' , 'base': () => { return $Blocks.OAK_DOOR } },
// { 'id': 'fence', 'name': 'Fence', 'cls': 'FenceBlock' , 'base': () => { return $Blocks.OAK_FENCE } },
// { 'id': 'fence_gate', 'name': 'Fence Gate', 'cls': 'FenceGateBlock' , 'base': () => { return $Blocks.OAK_FENCE_GATE } },
// { 'id': 'log', 'name': 'Log', 'cls': 'RotatedPillarBlock' , 'base': () => { return $Blocks.OAK_LOG } },
// { 'id': 'planks', 'name': 'Planks', 'cls': 'Block' , 'base': () => { return $Blocks.OAK_PLANKS } },
// { 'id': 'pressure_plate', 'name': 'Pressure Plate', 'cls': 'PressurePlateBlock' , 'base': () => { return $Blocks.OAK_PRESSURE_PLATE } },
// { 'id': 'sign', 'name': 'Sign', 'cls': 'SignBlock' , 'base': () => { return $Blocks.OAK_SIGN } },
// { 'id': 'slab', 'name': 'Slab', 'cls': 'SlabBlock' , 'base': () => { return $Blocks.OAK_SLAB } },
// { 'id': 'stairs', 'name': 'Stairs', 'cls': 'StairBlock' , 'base': () => { return $Blocks.OAK_STAIRS } },
// { 'id': 'trapdoor', 'name': 'Trapdoor', 'cls': 'TrapDoorBlock' , 'base': () => { return $Blocks.OAK_TRAPDOOR } },
// { 'id': 'wood', 'name': 'Wood', 'cls': 'RotatedPillarBlock' , 'base': () => { return $Blocks.OAK_WOOD } }
// ]
let createDdBlocks = {}
let createDdItems = {}
let createDdWoodsets = {}
// createDdWoodTypes.forEach((wood) => {
// // public static final Supplier<BlockSetType> SPIRIT_SET_TYPE =
// // () -> new BlockSetType("spirit", true, SoundType.WOOD, SoundEvents.WOODEN_DOOR_CLOSE,
// // SoundEvents.WOODEN_DOOR_OPEN, SoundEvents.WOODEN_TRAPDOOR_CLOSE, SoundEvents.WOODEN_TRAPDOOR_OPEN,
// // SoundEvents.WOODEN_PRESSURE_PLATE_CLICK_OFF, SoundEvents.WOODEN_PRESSURE_PLATE_CLICK_ON,
// // SoundEvents.WOODEN_BUTTON_CLICK_OFF, SoundEvents.WOODEN_BUTTON_CLICK_ON);
// createDdWoodsets = new $BlockSetType(wood['id'], $SoundType.WOOD, $SoundEvents.WOODEN_DOOR_CLOSE,
// $SoundEvents.WOODEN_DOOR_OPEN, $SoundEvents.WOODEN_TRAPDOOR_CLOSE, $SoundEvents.WOODEN_TRAPDOOR_OPEN,
// $SoundEvents.WOODEN_PRESSURE_PLATE_CLICK_OFF, $SoundEvents.WOODEN_PRESSURE_PLATE_CLICK_ON,
// $SoundEvents.WOODEN_BUTTON_CLICK_OFF, $SoundEvents.WOODEN_BUTTON_CLICK_ON)
// })
// TODO: Make them flammable
// TODO: Map colors
StartupEvents.registry('block', (event) => {
createDdWoodTypes.forEach((wood) => {
let item_id = null
// Boat
// Button
// Door
// Fence
// Fence Gate
// Log
item_id = 'create_dd:' + wood['id'] + '_log'
createDdBlocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock($Properties.copy($Blocks.OAK_LOG)))
// Planks
item_id = 'create_dd:' + wood['id'] + '_planks'
createDdBlocks[item_id] = event.createCustom(item_id, () => new $Block($Properties.copy($Blocks.OAK_PLANKS)))
// Pressure Plate
// Sign
// Slab
item_id = 'create_dd:' + wood['id'] + '_slab'
createDdBlocks[item_id] = event.create(item_id, 'slab')
// Stairs
// Stripped Log
item_id = 'create_dd:stripped_' + wood['id'] + '_log'
createDdBlocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock($Properties.copy($Blocks.OAK_LOG)))
// StrippedWood
item_id = 'create_dd:stripped_' + wood['id'] + '_wood'
createDdBlocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock($Properties.copy($Blocks.OAK_WOOD)))
// Trapdoor
// Wood
item_id = 'create_dd:' + wood['id'] + '_wood'
createDdBlocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock($Properties.copy($Blocks.OAK_WOOD)))
})
})
StartupEvents.registry('item', event => {
createDdWoodTypes.forEach((wood) => {
['log', 'planks', 'wood'].forEach((type) => {
let item_id = 'create_dd:' + wood['id'] + '_' + type
if (item_id in createDdBlocks) {
createDdItems[item_id] = event.createCustom(item_id, () => new $BlockItem(createDdBlocks[item_id].get(), new $IProperties()))
} else {
console.log('Not creating item for ' + item_id + ' as block doesn\'t exist')
}
})
})
})