143 lines
6.4 KiB
JavaScript
143 lines
6.4 KiB
JavaScript
const createDD = {
|
|
'blocks': {},
|
|
'items': {},
|
|
'blockSetTypes': {},
|
|
'woodTypes': [
|
|
{ 'id': 'rose', 'name': 'Rose', 'mapColor': 'terracotta_red', 'woodType': $WoodType.MANGROVE, /* 'boatType': $Boat.Type.MANGROVE */ },
|
|
{ 'id': 'rubber', 'name': 'Rubber', 'mapColor': 'terracotta_cyan', 'woodType': $WoodType.ACACIA, /* 'boatType': $Boat.Type.ACACIA */ },
|
|
{ 'id': 'spirit', 'name': 'Spirit', 'mapColor': 'terracotta_purple', 'woodType': $WoodType.WARPED, /* 'boatType': $Boat.Type.WARPED */ },
|
|
{ 'id': 'smoked', 'name': 'Smoked', 'mapColor': 'terracotta_brown', 'woodType': $WoodType.SPRUCE, /* 'boatType': $Boat.Type.SPRUCE */ }
|
|
]
|
|
}
|
|
|
|
createDD.woodTypes.forEach((wood) => {
|
|
global.woodTypes.push({
|
|
'id': wood['id'],
|
|
'name': wood['name'],
|
|
'mod': 'create_dd',
|
|
'planks': {
|
|
'id': wood['id'] + '_planks'
|
|
}
|
|
})
|
|
|
|
// 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);
|
|
createDD.blockSetTypes[wood['id']] = new $BlockSetType(
|
|
wood['id'],
|
|
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
|
|
)
|
|
|
|
$Moonlight.BlockSetAPI.addBlockTypeFinder(
|
|
$Moonlight.WoodType.class,
|
|
$Moonlight.WoodType.Finder.simple('create_dd', wood['id'], wood['id'] + '_planks', wood['id'] + '_log')
|
|
)
|
|
})
|
|
|
|
// TODO: Make them flammable
|
|
// TODO: Map colors
|
|
StartupEvents.registry('block', (event) => {
|
|
createDdWoodTypes.forEach((wood) => {
|
|
let item_id = null
|
|
|
|
// Button
|
|
item_id = 'create_dd:' + wood['id'] + '_button'
|
|
createDdBlocks[item_id] = event.create(item_id, 'button')
|
|
.behavior(createDdBlockSetTypes[item_id])
|
|
// Door
|
|
item_id = 'create_dd:' + wood['id'] + '_door'
|
|
createDdBlocks[item_id] = event.createCustom(
|
|
item_id,
|
|
() => new $DoorBlock(
|
|
$Properties.copy($Blocks.OAK_DOOR),
|
|
createDdBlockSetTypes[wood['id']]
|
|
)
|
|
)
|
|
// Fence
|
|
item_id = 'create_dd:' + wood['id'] + '_fence'
|
|
createDdBlocks[item_id] = event.create(item_id, 'fence')
|
|
// Fence Gate
|
|
item_id = 'create_dd:' + wood['id'] + '_fence_gate'
|
|
createDdBlocks[item_id] = event.create(item_id, 'fence_gate')
|
|
.behavior(wood['woodType'])
|
|
// 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
|
|
item_id = 'create_dd:' + wood['id'] + '_pressure_plate'
|
|
createDdBlocks[item_id] = event.create(item_id, 'pressure_plate')
|
|
.behavior(createDdBlockSetTypes[item_id])
|
|
// Sign
|
|
item_id = 'create_dd:' + wood['id'] + '_sign'
|
|
createDdBlocks[item_id] = event.createCustom(item_id, () => new $SignBlock($Properties.copy($Blocks.OAK_SIGN), wood['woodType']))
|
|
// Slab
|
|
item_id = 'create_dd:' + wood['id'] + '_slab'
|
|
createDdBlocks[item_id] = event.create(item_id, 'slab')
|
|
// Stairs
|
|
item_id = 'create_dd:' + wood['id'] + '_stairs'
|
|
createDdBlocks[item_id] = event.create(item_id, '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)))
|
|
// Stripped Wood
|
|
item_id = 'create_dd:stripped_' + wood['id'] + '_wood'
|
|
createDdBlocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock($Properties.copy($Blocks.OAK_WOOD)))
|
|
// Trapdoor
|
|
item_id = 'create_dd:' + wood['id'] + '_door'
|
|
createDdBlocks[item_id] = event.createCustom(
|
|
item_id,
|
|
() => new $TrapDoorBlock(
|
|
$Properties.copy($Blocks.OAK_TRAPDOOR),
|
|
createDdBlockSetTypes[wood['id']]
|
|
)
|
|
)
|
|
// Wood
|
|
item_id = 'create_dd:' + wood['id'] + '_wood'
|
|
createDdBlocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock($Properties.copy($Blocks.OAK_WOOD)))
|
|
|
|
})
|
|
})
|
|
|
|
// StartupEvents.registry('entity_type', event => {
|
|
// createDdWoodTypes.forEach((wood) => {
|
|
// // Boat
|
|
// event.create('create_dd:' + wood['id'] + '_boat', 'minecraft:boat')
|
|
// })
|
|
// })
|
|
|
|
StartupEvents.registry('item', event => {
|
|
Object.keys(createDdBlocks).forEach((block_id) => {
|
|
createDdItems[block_id] = event.createCustom(block_id, () => new $BlockItem(createDdBlocks[block_id].get(), new $Properties()))
|
|
})
|
|
|
|
|
|
// createDdWoodTypes.forEach((wood) => {
|
|
// // Boat
|
|
// // public static final RegistryObject<Item> PEWEN_BOAT = DEF_REG.register(
|
|
// // "pewen_boat",
|
|
// // () -> new CaveBoatItem(false, AlexsCavesBoat.Type.PEWEN, new Item.Properties().stacksTo(1)));
|
|
// ['false', 'true'].forEach((hasChest) => {
|
|
// event.createCustom('create_dd:' + wood['id'] + (hasChest ? '_chest' : '') + '_boat', () => new $BoatItem(
|
|
// hasChest,
|
|
|
|
// ))
|
|
// })
|
|
// // public static final RegistryObject<Item> PEWEN_CHEST_BOAT = DEF_REG.register(
|
|
// // "pewen_chest_boat",
|
|
// // () -> new CaveBoatItem(true, AlexsCavesBoat.Type.PEWEN, new Item.Properties().stacksTo(1)));
|
|
// })
|
|
}) |