diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt index 71e0d09db..dee93ed75 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt @@ -573,6 +573,10 @@ object DataGen { addItemModels(itemModelProvider) blockStateProvider.exec { addComplexBlockStates(blockStateProvider) } addLootTables(lootTableProvider) + addMachineLoot(lootTableProvider) + addDecorativeLoot(lootTableProvider) + addAdvancementLoot(lootTableProvider) + addVaultLoot(lootTableProvider) addChestLootTables(lootTableProvider) recipeProvider.exec { _, consumer -> diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/AdvancementLoot.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/AdvancementLoot.kt new file mode 100644 index 000000000..721eb28e7 --- /dev/null +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/AdvancementLoot.kt @@ -0,0 +1,53 @@ +package ru.dbotthepony.mc.otm.datagen.loot + +import net.minecraft.world.item.Items +import net.minecraft.world.level.storage.loot.entries.LootItem +import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets +import ru.dbotthepony.mc.otm.datagen.modLootTable +import ru.dbotthepony.mc.otm.registry.MItems + +fun addAdvancementLoot(lootTables: LootTables) { + lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("research_all_android")) { + lootPool { + add(LootItem.lootTableItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_HUGE)) + } + } + + lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("tritanium_block3")) { + lootPool { item(Items.WHITE_DYE) { setCount(8) } } + lootPool { item(Items.ORANGE_DYE) { setCount(8) } } + lootPool { item(Items.MAGENTA_DYE) { setCount(8) } } + lootPool { item(Items.LIGHT_BLUE_DYE) { setCount(8) } } + lootPool { item(Items.YELLOW_DYE) { setCount(8) } } + lootPool { item(Items.LIME_DYE) { setCount(8) } } + lootPool { item(Items.PINK_DYE) { setCount(8) } } + lootPool { item(Items.GRAY_DYE) { setCount(8) } } + lootPool { item(Items.LIGHT_GRAY_DYE) { setCount(8) } } + lootPool { item(Items.CYAN_DYE) { setCount(8) } } + lootPool { item(Items.PURPLE_DYE) { setCount(8) } } + lootPool { item(Items.BLUE_DYE) { setCount(8) } } + lootPool { item(Items.BROWN_DYE) { setCount(8) } } + lootPool { item(Items.GREEN_DYE) { setCount(8) } } + lootPool { item(Items.RED_DYE) { setCount(8) } } + lootPool { item(Items.BLACK_DYE) { setCount(8) } } + } + + lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("tritanium_block4")) { + lootPool { item(Items.WHITE_DYE) { setCount(64) } } + lootPool { item(Items.ORANGE_DYE) { setCount(64) } } + lootPool { item(Items.MAGENTA_DYE) { setCount(64) } } + lootPool { item(Items.LIGHT_BLUE_DYE) { setCount(64) } } + lootPool { item(Items.YELLOW_DYE) { setCount(64) } } + lootPool { item(Items.LIME_DYE) { setCount(64) } } + lootPool { item(Items.PINK_DYE) { setCount(64) } } + lootPool { item(Items.GRAY_DYE) { setCount(64) } } + lootPool { item(Items.LIGHT_GRAY_DYE) { setCount(64) } } + lootPool { item(Items.CYAN_DYE) { setCount(64) } } + lootPool { item(Items.PURPLE_DYE) { setCount(64) } } + lootPool { item(Items.BLUE_DYE) { setCount(64) } } + lootPool { item(Items.BROWN_DYE) { setCount(64) } } + lootPool { item(Items.GREEN_DYE) { setCount(64) } } + lootPool { item(Items.RED_DYE) { setCount(64) } } + lootPool { item(Items.BLACK_DYE) { setCount(64) } } + } +} diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt new file mode 100644 index 000000000..51a64178f --- /dev/null +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt @@ -0,0 +1,69 @@ +package ru.dbotthepony.mc.otm.datagen.loot + +import net.minecraft.world.level.block.state.properties.BlockStateProperties +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf +import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition +import ru.dbotthepony.mc.otm.registry.MBlocks +import ru.dbotthepony.mc.otm.registry.MRegistry + +fun addDecorativeLoot(lootTables: LootTables) { + lootTables.dropsSelf(MRegistry.DECORATIVE_CRATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + + lootTables.dropsSelf(MRegistry.COMPUTER_TERMINAL.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.STAR_CHAIR.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.CARGO_CRATES.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.TRITANIUM_BLOCK.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.TRITANIUM_WALL.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.TRITANIUM_STAIRS.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.createSlabItemTable(MRegistry.TRITANIUM_SLAB.allBlocks.values) + lootTables.dropsSelf(MRegistry.VENT.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.VENT_ALTERNATIVE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.FLOOR_TILES.blocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.UNREFINED_FLOOR_TILES.blocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_BLOCK.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.createSlabItemTable(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) } + + lootTables.dropsSelf(MRegistry.FLOOR_TILES_STAIRS.blocks.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.createSlabItemTable(MRegistry.FLOOR_TILES_SLAB.blocks.values) { condition(ExplosionCondition.survivesExplosion()) } + + lootTables.dropsSelf(MBlocks.CARBON_FIBRE_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.METAL_MESH) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.TRITANIUM_RAW_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_BLOCK.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_WALL.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_STAIRS.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.createSlabItemTable(MBlocks.TRITANIUM_STRIPED_SLAB.values) { condition(ExplosionCondition.survivesExplosion()) } + + lootTables.dropsSelf(MBlocks.LABORATORY_LAMP) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.LABORATORY_LAMP_INVERTED) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.DANGER_STRIPE_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.METAL_BEAM) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.TRITANIUM_INGOT_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.TRITANIUM_BARS) { condition(ExplosionCondition.survivesExplosion()) } + + lootTables.dropsSelf(MBlocks.ENGINE) { condition(ExplosionCondition.survivesExplosion()) } + + for (block in MBlocks.TRITANIUM_ANVIL) + lootTables.dropsSelf(block) { condition(ExplosionCondition.survivesExplosion()) } + + for (door in MBlocks.TRITANIUM_TRAPDOOR.values) + lootTables.dropsSelf(door) { condition(ExplosionCondition.survivesExplosion()) } + + lootTables.dropsSelf(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } + + for (door in MBlocks.TRITANIUM_DOOR.values) { + lootTables.block(door) { + item(door) { + blockStateCondition(door) { + this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER + } + } + + condition(ExplosionCondition.survivesExplosion()) + } + } +} diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesData.kt index 6f96dfbad..90492e0e4 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesData.kt @@ -58,230 +58,16 @@ private fun ore(lootTables: LootTables, ore: Block, clump: ItemLike, count: Int } fun addLootTables(lootTables: LootTables) { - lootTables.dropsSelf(MRegistry.DECORATIVE_CRATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - - lootTables.dropsSelf(MRegistry.COMPUTER_TERMINAL.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.STAR_CHAIR.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.CARGO_CRATES.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.TRITANIUM_BLOCK.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.TRITANIUM_WALL.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.TRITANIUM_STAIRS.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.createSlabItemTable(MRegistry.TRITANIUM_SLAB.allBlocks.values) - lootTables.dropsSelf(MRegistry.VENT.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.VENT_ALTERNATIVE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.FLOOR_TILES.blocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.UNREFINED_FLOOR_TILES.blocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_BLOCK.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.createSlabItemTable(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) } - - lootTables.dropsSelf(MRegistry.FLOOR_TILES_STAIRS.blocks.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.createSlabItemTable(MRegistry.FLOOR_TILES_SLAB.blocks.values) { condition(ExplosionCondition.survivesExplosion()) } - - lootTables.dropsSelf(MBlocks.CARBON_FIBRE_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.METAL_MESH) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.TRITANIUM_RAW_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_BLOCK.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_WALL.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_STAIRS.values) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.createSlabItemTable(MBlocks.TRITANIUM_STRIPED_SLAB.values) { condition(ExplosionCondition.survivesExplosion()) } lootTables.dropsSelf(MBlocks.MATTER_CABLE) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.ENERGY_CABLES.values) { condition(ExplosionCondition.survivesExplosion()) } + lootTables.dropsSelf(MBlocks.GRAVITATION_STABILIZER) lootTables.dropsOther(MBlocks.GRAVITATION_STABILIZER_LENS, MBlocks.GRAVITATION_STABILIZER) - lootTables.dropsSelf(MBlocks.LABORATORY_LAMP) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.LABORATORY_LAMP_INVERTED) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.DANGER_STRIPE_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.METAL_BEAM) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.TRITANIUM_INGOT_BLOCK) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.TRITANIUM_BARS) { condition(ExplosionCondition.survivesExplosion()) } - lootTables.dropsSelf(MBlocks.ENERGY_CABLES.values) { condition(ExplosionCondition.survivesExplosion()) } - ore(lootTables, MBlocks.TRITANIUM_ORE, MItems.TRITANIUM_ORE_CLUMP) ore(lootTables, MBlocks.DEEPSLATE_TRITANIUM_ORE, MItems.TRITANIUM_ORE_CLUMP) ore(lootTables, MBlocks.DILITHIUM_ORE, MItems.DILITHIUM_CRYSTAL, 2) ore(lootTables, MBlocks.DEEPSLATE_DILITHIUM_ORE, MItems.DILITHIUM_CRYSTAL, 2) - lootTables.dropsSelf(MBlocks.INFINITE_WATER_SOURCE) { condition(ExplosionCondition.survivesExplosion()) } - - lootTables.dropsSelf(MBlocks.ENGINE) { condition(ExplosionCondition.survivesExplosion()) } - - for (block in MBlocks.TRITANIUM_ANVIL) - lootTables.dropsSelf(block) { condition(ExplosionCondition.survivesExplosion()) } - - for (door in MBlocks.TRITANIUM_TRAPDOOR.values) - lootTables.dropsSelf(door) { condition(ExplosionCondition.survivesExplosion()) } - - lootTables.dropsSelf(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } - - lootTables.block(MBlocks.PHANTOM_ATTRACTOR) { - item(MBlocks.PHANTOM_ATTRACTOR) { - blockStateCondition(MBlocks.PHANTOM_ATTRACTOR) { - this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER - } - } - - condition(ExplosionCondition.survivesExplosion()) - } - - for (door in MBlocks.TRITANIUM_DOOR.values) { - lootTables.block(door) { - item(door) { - blockStateCondition(door) { - this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER - } - } - - condition(ExplosionCondition.survivesExplosion()) - } - } - - lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("research_all_android")) { - lootPool { - add(LootItem.lootTableItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_HUGE)) - } - } - - lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("tritanium_block3")) { - lootPool { item(Items.WHITE_DYE) { setCount(8) } } - lootPool { item(Items.ORANGE_DYE) { setCount(8) } } - lootPool { item(Items.MAGENTA_DYE) { setCount(8) } } - lootPool { item(Items.LIGHT_BLUE_DYE) { setCount(8) } } - lootPool { item(Items.YELLOW_DYE) { setCount(8) } } - lootPool { item(Items.LIME_DYE) { setCount(8) } } - lootPool { item(Items.PINK_DYE) { setCount(8) } } - lootPool { item(Items.GRAY_DYE) { setCount(8) } } - lootPool { item(Items.LIGHT_GRAY_DYE) { setCount(8) } } - lootPool { item(Items.CYAN_DYE) { setCount(8) } } - lootPool { item(Items.PURPLE_DYE) { setCount(8) } } - lootPool { item(Items.BLUE_DYE) { setCount(8) } } - lootPool { item(Items.BROWN_DYE) { setCount(8) } } - lootPool { item(Items.GREEN_DYE) { setCount(8) } } - lootPool { item(Items.RED_DYE) { setCount(8) } } - lootPool { item(Items.BLACK_DYE) { setCount(8) } } - } - - lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("tritanium_block4")) { - lootPool { item(Items.WHITE_DYE) { setCount(64) } } - lootPool { item(Items.ORANGE_DYE) { setCount(64) } } - lootPool { item(Items.MAGENTA_DYE) { setCount(64) } } - lootPool { item(Items.LIGHT_BLUE_DYE) { setCount(64) } } - lootPool { item(Items.YELLOW_DYE) { setCount(64) } } - lootPool { item(Items.LIME_DYE) { setCount(64) } } - lootPool { item(Items.PINK_DYE) { setCount(64) } } - lootPool { item(Items.GRAY_DYE) { setCount(64) } } - lootPool { item(Items.LIGHT_GRAY_DYE) { setCount(64) } } - lootPool { item(Items.CYAN_DYE) { setCount(64) } } - lootPool { item(Items.PURPLE_DYE) { setCount(64) } } - lootPool { item(Items.BLUE_DYE) { setCount(64) } } - lootPool { item(Items.BROWN_DYE) { setCount(64) } } - lootPool { item(Items.GREEN_DYE) { setCount(64) } } - lootPool { item(Items.RED_DYE) { setCount(64) } } - lootPool { item(Items.BLACK_DYE) { setCount(64) } } - } - - lootTables.tile(MBlocks.COBBLESTONE_GENERATOR.values) - lootTables.tile(MBlocks.ESSENCE_STORAGE.values) - lootTables.tile(MBlocks.MATTER_RECONSTRUCTOR.values) - lootTables.tile(MBlocks.FLUID_TANK) - lootTables.tile(MBlocks.PAINTER) - lootTables.tile(MBlocks.MATTER_ENTANGLER) - lootTables.tile(MBlocks.GRILL.values) - - lootTables.tile(MBlocks.ENERGY_SERVO.values) - lootTables.tile(MBlocks.ENERGY_COUNTER.values) - lootTables.tile(MBlocks.CHEMICAL_GENERATOR.values) - lootTables.tile(MBlocks.HOLO_SIGN, "isLocked") - lootTables.tile(MBlocks.STORAGE_CABLE) - lootTables.tile(MBlocks.ANDROID_STATION.values) - lootTables.tile(MBlocks.ANDROID_CHARGER.values) - lootTables.tile(MBlocks.BATTERY_BANK.values) - lootTables.tile(MBlocks.DRIVE_VIEWER.values) - - lootTables.tile(MBlocks.STORAGE_BUS) - lootTables.tile(MBlocks.STORAGE_IMPORTER) - lootTables.tile(MBlocks.STORAGE_EXPORTER) - lootTables.tile(MBlocks.STORAGE_POWER_SUPPLIER.values) - lootTables.tile(MBlocks.DRIVE_RACK) - - lootTables.tile(MBlocks.MATTER_DECOMPOSER.values) - lootTables.tile(MBlocks.MATTER_REPLICATOR.values) - lootTables.tile(MBlocks.MATTER_RECYCLER.values) - lootTables.tile(MBlocks.MATTER_SCANNER.values) - lootTables.tile(MBlocks.PLATE_PRESS.values) - lootTables.tile(MBlocks.TWIN_PLATE_PRESS.values) - - lootTables.tile(MBlocks.POWERED_FURNACE.values) - lootTables.tile(MBlocks.POWERED_SMOKER.values) - lootTables.tile(MBlocks.POWERED_BLAST_FURNACE.values) - - lootTables.tile(MBlocks.MATTER_PANEL.values) - lootTables.tile(MBlocks.PATTERN_STORAGE) - lootTables.tile(MBlocks.MATTER_CAPACITOR_BANK.values) - lootTables.tile(MBlocks.MATTER_BOTTLER.values) - - lootTables.tile(MBlocks.BLACK_HOLE_GENERATOR) - lootTables.tile(MBlocks.ITEM_INPUT_HATCH) - lootTables.tile(MBlocks.ITEM_OUTPUT_HATCH) - - lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/matter_dust")) { - lootPool { item(MItems.MATTER_DUST) { - chanceCondition(0.2) - setWeight(4) - apply(MatterDustItem.Randomizer(UniformDecimal(Decimal(100), Decimal(2_500)))) - } } - } - - lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/pill")) { - lootPool { item(MItems.PILL_ANDROID) { - chanceCondition(0.1) - setWeight(1) - } } - lootPool { item(MItems.PILL_HEAL) { - chanceCondition(0.5) - setWeight(2) - setCount(2, 5) - } } - } - - lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/exosuit")) { - lootPool { item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { - chanceCondition(0.2) - setWeight(2) - - apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(1, 9), UniformInt.of(0, 3))) - } } - - lootPool { item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { - chanceCondition(0.1) - setWeight(1) - - apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18), UniformInt.of(0, 3))) - } } - } - - lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/battery")) { - lootPool { item(MItems.PROCEDURAL_BATTERY) { - chanceCondition(0.05) - setWeight(1) - - apply( - ProceduralBatteryItem.Randomizer( - maxBatteryLevel = UniformDecimal(Decimal(10_000_000), Decimal(50_000_000)), - batteryLevel = UniformDecimal(Decimal(0), Decimal(25_000_000)), - maxInput = UniformDecimal(Decimal(1_000), Decimal(5_000)), - )) - } } - } - - lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/zpm_battery")) { - lootPool { item(MItems.ZPM_BATTERY) { - chanceCondition(0.001) - setWeight(1) - } } - } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/MachineLoot.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/MachineLoot.kt new file mode 100644 index 000000000..ee7841a3c --- /dev/null +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/MachineLoot.kt @@ -0,0 +1,64 @@ +package ru.dbotthepony.mc.otm.datagen.loot + +import net.minecraft.world.level.block.state.properties.BlockStateProperties +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf +import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition +import ru.dbotthepony.mc.otm.registry.MBlocks + +fun addMachineLoot(lootTables: LootTables) { + lootTables.block(MBlocks.PHANTOM_ATTRACTOR) { + item(MBlocks.PHANTOM_ATTRACTOR) { + blockStateCondition(MBlocks.PHANTOM_ATTRACTOR) { + this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER + } + } + + condition(ExplosionCondition.survivesExplosion()) + } + + lootTables.dropsSelf(MBlocks.INFINITE_WATER_SOURCE) { condition(ExplosionCondition.survivesExplosion()) } + + lootTables.tile(MBlocks.COBBLESTONE_GENERATOR.values) + lootTables.tile(MBlocks.ESSENCE_STORAGE.values) + lootTables.tile(MBlocks.MATTER_RECONSTRUCTOR.values) + lootTables.tile(MBlocks.FLUID_TANK) + lootTables.tile(MBlocks.PAINTER) + lootTables.tile(MBlocks.MATTER_ENTANGLER) + lootTables.tile(MBlocks.GRILL.values) + + lootTables.tile(MBlocks.ENERGY_SERVO.values) + lootTables.tile(MBlocks.ENERGY_COUNTER.values) + lootTables.tile(MBlocks.CHEMICAL_GENERATOR.values) + lootTables.tile(MBlocks.HOLO_SIGN, "isLocked") + lootTables.tile(MBlocks.STORAGE_CABLE) + lootTables.tile(MBlocks.ANDROID_STATION.values) + lootTables.tile(MBlocks.ANDROID_CHARGER.values) + lootTables.tile(MBlocks.BATTERY_BANK.values) + lootTables.tile(MBlocks.DRIVE_VIEWER.values) + + lootTables.tile(MBlocks.STORAGE_BUS) + lootTables.tile(MBlocks.STORAGE_IMPORTER) + lootTables.tile(MBlocks.STORAGE_EXPORTER) + lootTables.tile(MBlocks.STORAGE_POWER_SUPPLIER.values) + lootTables.tile(MBlocks.DRIVE_RACK) + + lootTables.tile(MBlocks.MATTER_DECOMPOSER.values) + lootTables.tile(MBlocks.MATTER_REPLICATOR.values) + lootTables.tile(MBlocks.MATTER_RECYCLER.values) + lootTables.tile(MBlocks.MATTER_SCANNER.values) + lootTables.tile(MBlocks.PLATE_PRESS.values) + lootTables.tile(MBlocks.TWIN_PLATE_PRESS.values) + + lootTables.tile(MBlocks.POWERED_FURNACE.values) + lootTables.tile(MBlocks.POWERED_SMOKER.values) + lootTables.tile(MBlocks.POWERED_BLAST_FURNACE.values) + + lootTables.tile(MBlocks.MATTER_PANEL.values) + lootTables.tile(MBlocks.PATTERN_STORAGE) + lootTables.tile(MBlocks.MATTER_CAPACITOR_BANK.values) + lootTables.tile(MBlocks.MATTER_BOTTLER.values) + + lootTables.tile(MBlocks.BLACK_HOLE_GENERATOR) + lootTables.tile(MBlocks.ITEM_INPUT_HATCH) + lootTables.tile(MBlocks.ITEM_OUTPUT_HATCH) +} diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/VaultLoot.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/VaultLoot.kt new file mode 100644 index 000000000..2930740ac --- /dev/null +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/VaultLoot.kt @@ -0,0 +1,70 @@ +package ru.dbotthepony.mc.otm.datagen.loot + +import net.minecraft.util.valueproviders.UniformInt +import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets +import ru.dbotthepony.mc.otm.core.math.Decimal +import ru.dbotthepony.mc.otm.data.world.UniformDecimal +import ru.dbotthepony.mc.otm.datagen.modLootTable +import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem +import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem +import ru.dbotthepony.mc.otm.item.matter.MatterDustItem +import ru.dbotthepony.mc.otm.registry.MItems + +fun addVaultLoot(lootTables: LootTables) { + lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/matter_dust")) { + lootPool { item(MItems.MATTER_DUST) { + chanceCondition(0.2) + setWeight(4) + apply(MatterDustItem.Randomizer(UniformDecimal(Decimal(100), Decimal(2_500)))) + } } + } + + lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/pill")) { + lootPool { item(MItems.PILL_ANDROID) { + chanceCondition(0.1) + setWeight(1) + } } + lootPool { item(MItems.PILL_HEAL) { + chanceCondition(0.5) + setWeight(2) + setCount(2, 5) + } } + } + + lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/exosuit")) { + lootPool { item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { + chanceCondition(0.2) + setWeight(2) + + apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(1, 9), UniformInt.of(0, 3))) + } } + + lootPool { item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { + chanceCondition(0.1) + setWeight(1) + + apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18), UniformInt.of(0, 3))) + } } + } + + lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/battery")) { + lootPool { item(MItems.PROCEDURAL_BATTERY) { + chanceCondition(0.05) + setWeight(1) + + apply( + ProceduralBatteryItem.Randomizer( + maxBatteryLevel = UniformDecimal(Decimal(10_000_000), Decimal(50_000_000)), + batteryLevel = UniformDecimal(Decimal(0), Decimal(25_000_000)), + maxInput = UniformDecimal(Decimal(1_000), Decimal(5_000)), + )) + } } + } + + lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/zpm_battery")) { + lootPool { item(MItems.ZPM_BATTERY) { + chanceCondition(0.001) + setWeight(1) + } } + } +}