All checks were successful
continuous-integration/drone/push Build is passing
260 lines
10 KiB
JavaScript
260 lines
10 KiB
JavaScript
const SpiritSoundType = new $ForgeSoundType(
|
|
1,
|
|
.7,
|
|
() => $SoundEvents.WOOD_BREAK,
|
|
() => $SoundEvents.STEM_STEP,
|
|
() => $SoundEvents.WOOD_PLACE,
|
|
() => $SoundEvents.STEM_HIT,
|
|
() => $SoundEvents.STEM_FALL
|
|
);
|
|
|
|
const createDD = {
|
|
'blocks': {},
|
|
'items': {},
|
|
'blockSetTypes': {},
|
|
'woodTypes': [
|
|
{
|
|
'id': 'rose',
|
|
'name': 'Rose',
|
|
'mapColor': $MapColor.TERRACOTTA_RED,
|
|
'woodType': $WoodType.MANGROVE,
|
|
'soundType': $SoundType.WOOD,
|
|
'baseLog': $Blocks.OAK_LOG,
|
|
'baseWood': $Blocks.OAK_WOOD,
|
|
'baseStrippedLog': $Blocks.STRIPPED_OAK_LOG,
|
|
'baseStrippedWood': $Blocks.OAK_WOOD,
|
|
'basePlanks': $Blocks.OAK_PLANKS,
|
|
'baseDoor': $Blocks.OAK_DOOR,
|
|
'baseTrapDoor': $Blocks.OAK_TRAPDOOR,
|
|
/* 'boatType': $Boat.Type.MANGROVE */
|
|
},
|
|
{
|
|
'id': 'rubber',
|
|
'name': 'Rubber',
|
|
'mapColor': $MapColor.TERRACOTTA_CYAN,
|
|
'woodType': $WoodType.ACACIA,
|
|
'soundType': $SoundType.WOOD,
|
|
'baseLog': $Blocks.OAK_LOG,
|
|
'baseWood': $Blocks.OAK_WOOD,
|
|
'baseStrippedLog': $Blocks.STRIPPED_OAK_LOG,
|
|
'baseStrippedWood': $Blocks.STRIPPED_OAK_WOOD,
|
|
'basePlanks': $Blocks.OAK_PLANKS,
|
|
'baseDoor': $Blocks.OAK_DOOR,
|
|
'baseTrapDoor': $Blocks.OAK_TRAPDOOR,
|
|
/* 'boatType': $Boat.Type.ACACIA */
|
|
},
|
|
{
|
|
'id': 'spirit',
|
|
'name': 'Spirit',
|
|
'mapColor': $MapColor.TERRACOTTA_PURPLE,
|
|
'woodType': $WoodType.WARPED,
|
|
'soundType': SpiritSoundType,
|
|
'baseLog': $Blocks.WARPED_STEM,
|
|
'baseWood': $Blocks.WARPED_HYPHAE,
|
|
'baseStrippedLog': $Blocks.STRIPPED_WARPED_STEM,
|
|
'baseStrippedWood': $Blocks.STRIPPED_WARPED_HYPHAE,
|
|
'basePlanks': $Blocks.WARPED_PLANKS,
|
|
'baseDoor': $Blocks.WARPED_DOOR,
|
|
'baseTrapDoor': $Blocks.WARPED_TRAPDOOR,
|
|
/* 'boatType': $Boat.Type.WARPED */
|
|
},
|
|
{
|
|
'id': 'smoked',
|
|
'name': 'Smoked',
|
|
'mapColor': $MapColor.TERRACOTTA_BROWN,
|
|
'woodType': $WoodType.SPRUCE,
|
|
'soundType': $SoundType.WOOD,
|
|
'baseLog': $Blocks.OAK_LOG,
|
|
'baseWood': $Blocks.OAK_WOOD,
|
|
'baseStrippedLog': $Blocks.STRIPPED_OAK_LOG,
|
|
'baseStrippedWood': $Blocks.STRIPPED_OAK_WOOD,
|
|
'basePlanks': $Blocks.OAK_PLANKS,
|
|
'baseDoor': $Blocks.OAK_DOOR,
|
|
'baseTrapDoor': $Blocks.OAK_TRAPDOOR,
|
|
/* '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,
|
|
$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) => {
|
|
createDD.woodTypes.forEach((wood) => {
|
|
let item_id = null
|
|
|
|
// Button
|
|
item_id = 'create_dd:' + wood['id'] + '_button'
|
|
createDD.blocks[item_id] = event.create(item_id, 'button')
|
|
['behaviour(net.minecraft.world.level.block.state.properties.BlockSetType)'](createDD.blockSetTypes[wood['id']])
|
|
.noItem()
|
|
.soundType(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
// Door
|
|
item_id = 'create_dd:' + wood['id'] + '_door'
|
|
createDD.blocks[item_id] = event.createCustom(
|
|
item_id,
|
|
() => new $DoorBlock(
|
|
$Properties
|
|
.copy(wood['baseDoor'])
|
|
.sound(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
.noOcclusion(),
|
|
createDD.blockSetTypes[wood['id']]
|
|
)
|
|
)
|
|
// Fence
|
|
item_id = 'create_dd:' + wood['id'] + '_fence'
|
|
createDD.blocks[item_id] = event.create(item_id, 'fence')
|
|
.noItem()
|
|
.soundType(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
// Fence Gate
|
|
item_id = 'create_dd:' + wood['id'] + '_fence_gate'
|
|
createDD.blocks[item_id] = event.create(item_id, 'fence_gate')
|
|
['behaviour(net.minecraft.world.level.block.state.properties.WoodType)'](wood['woodType'])
|
|
.noItem()
|
|
.soundType(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
// Log
|
|
item_id = 'create_dd:' + wood['id'] + '_log'
|
|
createDD.blocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock(
|
|
$Properties
|
|
.copy(wood['baseLog'])
|
|
.sound(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
))
|
|
// Planks
|
|
item_id = 'create_dd:' + wood['id'] + '_planks'
|
|
createDD.blocks[item_id] = event.createCustom(item_id, () => new $Block(
|
|
$Properties
|
|
.copy(wood['basePlanks'])
|
|
.sound(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
))
|
|
// Pressure Plate
|
|
item_id = 'create_dd:' + wood['id'] + '_pressure_plate'
|
|
createDD.blocks[item_id] = event.create(item_id, 'pressure_plate')
|
|
['behaviour(net.minecraft.world.level.block.state.properties.BlockSetType)'](createDD.blockSetTypes[wood['id']])
|
|
.noItem()
|
|
.soundType(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
// Sign
|
|
// item_id = 'create_dd:' + wood['id'] + '_sign'
|
|
// createDD.blocks[item_id] = event.createCustom(item_id, () => new $SignBlock($Properties.copy($Blocks.OAK_SIGN), wood['woodType']))
|
|
// Slab
|
|
item_id = 'create_dd:' + wood['id'] + '_slab'
|
|
createDD.blocks[item_id] = event.create(item_id, 'slab')
|
|
.noItem()
|
|
.soundType(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
// Stairs
|
|
item_id = 'create_dd:' + wood['id'] + '_stairs'
|
|
createDD.blocks[item_id] = event.create(item_id, 'stairs')
|
|
.noItem()
|
|
.soundType(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
// Stripped Log
|
|
item_id = 'create_dd:stripped_' + wood['id'] + '_log'
|
|
createDD.blocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock(
|
|
$Properties
|
|
.copy(wood['baseStrippedLog'])
|
|
.sound(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
))
|
|
// Stripped Wood
|
|
item_id = 'create_dd:stripped_' + wood['id'] + '_wood'
|
|
createDD.blocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock(
|
|
$Properties
|
|
.copy(wood['baseStrippedWood'])
|
|
.sound(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
))
|
|
// Trapdoor
|
|
item_id = 'create_dd:' + wood['id'] + '_trapdoor'
|
|
createDD.blocks[item_id] = event.createCustom(
|
|
item_id,
|
|
() => new $TrapDoorBlock(
|
|
$Properties
|
|
.copy(wood['baseTrapDoor'])
|
|
.sound(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
.noOcclusion(),
|
|
createDD.blockSetTypes[wood['id']]
|
|
)
|
|
)
|
|
// Wood
|
|
item_id = 'create_dd:' + wood['id'] + '_wood'
|
|
createDD.blocks[item_id] = event.createCustom(item_id, () => new $RotatedPillarBlock(
|
|
$Properties
|
|
.copy(wood['baseWood'])
|
|
.sound(wood['soundType'])
|
|
// .mapColor(wood['mapColor'])
|
|
))
|
|
|
|
})
|
|
})
|
|
|
|
// StartupEvents.registry('entity_type', event => {
|
|
// createDdWoodTypes.forEach((wood) => {
|
|
// // Boat
|
|
// event.create('create_dd:' + wood['id'] + '_boat', 'minecraft:boat')
|
|
// })
|
|
// })
|
|
|
|
StartupEvents.registry('item', event => {
|
|
Object.keys(createDD.blocks).forEach((block_id) => {
|
|
createDD.items[block_id] = event.createCustom(block_id, () => new $BlockItem(createDD.blocks[block_id].get(), new $IProperties()))
|
|
})
|
|
|
|
|
|
// 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)));
|
|
// })
|
|
}) |