From 5956b5d76f092872d693737d5808ff582dc87fc4 Mon Sep 17 00:00:00 2001 From: GearShocky Date: Wed, 5 Mar 2025 05:59:10 +0500 Subject: [PATCH] a --- .../ru/dbotthepony/mc/otm/datagen/DataGen.kt | 1 + .../mc/otm/datagen/loot/EntityLoot.kt | 21 +++++ .../mc/otm/datagen/loot/LootTablesChests.kt | 73 ++++++++++++++++-- .../datagen/models/MatteryModelProvider.kt | 2 +- .../ru/dbotthepony/mc/otm/entity/Loader.kt | 10 +++ .../mc/otm/registry/game/MBlocks.kt | 3 +- .../textures/item/component/rogue_ai_core.png | Bin 0 -> 571 bytes 7 files changed, 103 insertions(+), 7 deletions(-) create mode 100644 src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/EntityLoot.kt create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/component/rogue_ai_core.png 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 da93af5c8..206133507 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt @@ -585,6 +585,7 @@ object DataGen { addDecorativeLoot(lootTableProvider) addAdvancementLoot(lootTableProvider) addVaultLoot(lootTableProvider) + addEntityLoot(lootTableProvider) addChestLootTables(lootTableProvider) recipeProvider.exec { _, consumer -> diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/EntityLoot.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/EntityLoot.kt new file mode 100644 index 000000000..16ce1b445 --- /dev/null +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/EntityLoot.kt @@ -0,0 +1,21 @@ +package ru.dbotthepony.mc.otm.datagen.loot + +import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets +import ru.dbotthepony.mc.otm.datagen.modLootTable +import ru.dbotthepony.mc.otm.registry.game.MItems + +fun addEntityLoot(loot: LootTables) { + loot.builder(LootContextParamSets.ENTITY, modLootTable("entities/loader")) { + lootPool { + item(MItems.MECHANICAL_PARTS) { + setCount(1, 3) + setWeight(7) + } + item(MItems.ELECTRIC_PARTS) { + setCount(1, 1) + setWeight(1) + } + setRolls(1) + } + } +} diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt index 6be0eaff0..29b378bf5 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt @@ -1,8 +1,14 @@ package ru.dbotthepony.mc.otm.datagen.loot +import net.minecraft.util.valueproviders.UniformInt import net.minecraft.world.item.Items 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.game.MItems fun addChestLootTables(loot: LootTables) { @@ -28,24 +34,72 @@ fun addChestLootTables(loot: LootTables) { item(Items.COPPER_INGOT) { setCount(minimal = 1, maximal = 3) } item(Items.EXPOSED_COPPER) { setCount(minimal = 1, maximal = 2) } - setRolls(3) + item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { + chanceCondition(0.1) + setWeight(1) + apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(1, 9), UniformInt.of(0, 3))) + } + + setRolls(7) } } loot.builder(LootContextParamSets.CHEST, modLootTable("frigate_cargo")) { lootPool { - item(Items.IRON_INGOT) { setCount(minimal = 1, maximal = 3) } + item(Items.IRON_INGOT) { + setCount(minimal = 1, maximal = 3) + setWeight(3) + } item(Items.GOLD_INGOT) { setCount(minimal = 1, maximal = 3) } item(Items.EMERALD) { setCount(minimal = 1, maximal = 3) } item(MItems.TRITANIUM_INGOT) { setCount(minimal = 1, maximal = 3) } - item(MItems.MECHANICAL_PARTS) { setCount(minimal = 2, maximal = 3) } + item(MItems.MECHANICAL_PARTS) { + setCount(minimal = 2, maximal = 3) + setWeight(2) + } item(MItems.CIRCUIT_PLATING) { setCount(minimal = 2, maximal = 3) } + item(MItems.ENERGY_BUS) { setCount(minimal = 0, maximal = 2) } + item(MItems.ROFLITE_ALLOY_INGOT) { setCount(minimal = 0, maximal = 3) } + item(MItems.WITHERED_STEEL) { setCount(minimal = 0, maximal = 3) } item(Items.SADDLE) { setCount(minimal = 0, maximal = 1) } item(Items.DIAMOND) { setCount(minimal = 0, maximal = 3) } - setRolls(3) + item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { + chanceCondition(0.2) + setWeight(3) + apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(1, 9), UniformInt.of(0, 3))) + } + item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { + chanceCondition(0.1) + setWeight(2) + apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18), UniformInt.of(0, 3))) + } + + 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)), + )) + } + + item(MItems.ZPM_BATTERY) { + chanceCondition(0.001) + setWeight(1) + } + + item(MItems.MATTER_DUST) { + chanceCondition(0.1) + setWeight(4) + apply(MatterDustItem.Randomizer(UniformDecimal(Decimal(100), Decimal(2_500)))) + } + + setRolls(12) } } @@ -57,7 +111,16 @@ fun addChestLootTables(loot: LootTables) { item(Items.SNOWBALL) { setCount(minimal = 1, maximal = 5) } item(Items.PACKED_ICE) { setCount(minimal = 2, maximal = 3) } - setRolls(3) + setRolls(7) + } + } + + loot.builder(LootContextParamSets.CHEST, modLootTable("laboratory/reward")) { + lootPool { + item(MItems.NUTRIENT_PASTE) { setCount(minimal = 2, maximal = 3) } + + + setRolls(5) } } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt index 29d81d18d..c86b884e0 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt @@ -2,6 +2,7 @@ package ru.dbotthepony.mc.otm.datagen.models import net.minecraft.world.item.DyeColor import net.minecraft.world.level.block.Block +import net.minecraft.world.level.block.WaterloggedTransparentBlock import net.neoforged.neoforge.client.model.generators.BlockModelProvider import net.neoforged.neoforge.data.event.GatherDataEvent import ru.dbotthepony.mc.otm.datagen.DataGen @@ -81,7 +82,6 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve } } } - fun decorativeCubeAll(subdir: String, vararg blocks: Block) { for (block in blocks) { exec { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/Loader.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/Loader.kt index 0a6418b46..38ecf9013 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/Loader.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/Loader.kt @@ -3,6 +3,10 @@ package ru.dbotthepony.mc.otm.entity import net.minecraft.network.syncher.EntityDataAccessor import net.minecraft.network.syncher.EntityDataSerializers import net.minecraft.network.syncher.SynchedEntityData +import net.minecraft.resources.ResourceKey +import net.minecraft.core.registries.Registries +import ru.dbotthepony.mc.otm.core.ResourceLocation +import net.minecraft.world.level.storage.loot.LootTable import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvents import net.minecraft.world.entity.AnimationState @@ -21,6 +25,7 @@ import net.minecraft.world.entity.ai.navigation.PathNavigation import net.minecraft.world.entity.monster.Monster import net.minecraft.world.entity.player.Player import net.minecraft.world.level.Level +import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.registry.game.MSoundEvents @@ -100,6 +105,11 @@ class Loader(type: EntityType, level: Level) : Monster(type, level) { return success } + override fun getDefaultLootTable(): ResourceKey { + return ResourceKey.create(Registries.LOOT_TABLE, + ResourceLocation(OverdriveThatMatters.MOD_ID, "entities/loader")) + } + override fun aiStep() { super.aiStep() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt index a3f6b5689..9e4399b47 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt @@ -18,6 +18,7 @@ import net.minecraft.world.level.block.SoundType import net.minecraft.world.level.block.StairBlock import net.minecraft.world.level.block.TransparentBlock import net.minecraft.world.level.block.WallBlock +import net.minecraft.world.level.block.WaterloggedTransparentBlock import net.minecraft.world.level.block.state.BlockBehaviour import net.minecraft.world.level.block.state.properties.BlockStateProperties import net.minecraft.world.level.block.state.properties.NoteBlockInstrument @@ -266,7 +267,7 @@ object MBlocks { } val METAL_MESH: Block by registry.register(MNames.METAL_MESH) { - TransparentBlock(BlockBehaviour.Properties.of() + WaterloggedTransparentBlock(BlockBehaviour.Properties.of() .mapColor(MapColor.COLOR_GRAY) .noOcclusion() .sound(SoundType.COPPER_GRATE) diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/component/rogue_ai_core.png b/src/main/resources/assets/overdrive_that_matters/textures/item/component/rogue_ai_core.png new file mode 100644 index 0000000000000000000000000000000000000000..71eb0d3f6eb3ab3869298b51ec7d5e330929c433 GIT binary patch literal 571 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}}0G|+7F)^{YxVW1)Z?0IeqN%A#TU)zbS9iOeU0v1f)bug8YL2V*w1>H)~%36>t`KL>4nJ z@a+d-Mhn(p6`-I*iEBhjaDG}zd16s2LqK9?UWuNcYlwoWo}r%6?>)@hfNHj-MtG)q zdTKFn06DA-QjDw&j6jwb5KBYZAfIb6GK0mLfNVoXCU8hZ0oj@DEMW00AR7dF%NQA6 z00Rg{qgl!Tl$yZKzyefhU}S8-xBy}*$VS!$5R;|=*&x6KG?xjiGRV>b$b#xJG%x_k zcJkkKu4CIH3}n`Mx;Tbt1jn9x%Xe6TgEc_#!n(C9*1rG0=5g}bX&(<4_%ltq7GJBV z`re))OpkGbvC#BICmD^BLT|<~HcTr|vMXag@jO$q;qpR;D=tz(6C6V`F14GS=L_Pc&sV<