Merge branch '1.21' into worldgen-placement-providers

This commit is contained in:
DBotThePony 2025-03-02 11:25:40 +07:00
commit f9c8130e26
Signed by: DBot
GPG Key ID: DCC23B5715498507
17 changed files with 122 additions and 6 deletions

View File

@ -11,6 +11,8 @@ fun addBlockModels(provider: MatteryBlockModelProvider) {
resourceCubeAll(MBlocks.DEEPSLATE_TRITANIUM_ORE)
resourceCubeAll(MBlocks.TRITANIUM_INGOT_BLOCK)
resourceCubeAll(MBlocks.WITHERED_STEEL_BLOCK)
resourceCubeAll(MBlocks.DILITHIUM_ORE)
resourceCubeAll(MBlocks.DEEPSLATE_DILITHIUM_ORE)
resourceCubeAll(MBlocks.DILITHIUM_CRYSTAL_BLOCK)

View File

@ -32,6 +32,20 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
provider.ore(MBlocks.TRITANIUM_RAW_BLOCK)
provider.block(MBlocks.TRITANIUM_INGOT_BLOCK)
provider.block(MBlocks.WITHERED_STEEL_BLOCK)
provider.exec {
provider.getVariantBuilder(MBlocks.ROFLITE_ALLOY_BLOCK).forAllStates {
val side1 = modLocation("block/resource/roflite_alloy_1")
val side2 = modLocation("block/resource/roflite_alloy_2")
val top = modLocation("block/resource/roflite_alloy_top")
val a = provider.models().cube(MBlocks.ROFLITE_ALLOY_BLOCK.registryName!!.path, top, top, side1, side1, side2, side2).texture("particle", side1)
val b = provider.models().cube("${MBlocks.ROFLITE_ALLOY_BLOCK.registryName!!.path}_b", top, top, side2, side2, side1, side1).texture("particle", side2)
return@forAllStates arrayOf(ConfiguredModel.builder().modelFile(a).buildLast(), ConfiguredModel.builder().modelFile(b).buildLast())
}
}
provider.ore(MBlocks.DILITHIUM_ORE)
provider.ore(MBlocks.DEEPSLATE_DILITHIUM_ORE)
provider.block(MBlocks.DILITHIUM_CRYSTAL_BLOCK)

View File

@ -35,6 +35,9 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.block(MItems.TRITANIUM_RAW_BLOCK)
provider.block(MItems.TRITANIUM_INGOT_BLOCK)
provider.block(MItems.WITHERED_STEEL_BLOCK)
provider.block(MItems.ROFLITE_ALLOY_BLOCK)
provider.block(MItems.DILITHIUM_ORE)
provider.block(MItems.DEEPSLATE_DILITHIUM_ORE)
provider.block(MItems.DILITHIUM_CRYSTAL_BLOCK)
@ -68,6 +71,7 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.generated(MItems.PILL_HEAL)
provider.generated(MItems.PILL_NOT_NORMAL)
provider.generated(MItems.NUTRIENT_PASTE)
provider.generated(MItems.IMPERFECT_BREAD)
provider.generated(MItems.REDSTONE_INTERACTOR)
provider.generated(MItems.ESSENCE_DRIVE)
@ -100,6 +104,7 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.resource(MItems.DILITHIUM_CRYSTAL)
provider.resource(MItems.WITHERED_STEEL)
provider.resource(MItems.ROFLITE_ALLOY_INGOT)
provider.generated(MItems.EXOPACK_PROBE)

View File

@ -612,6 +612,8 @@ private fun blocks(provider: MatteryLanguageProvider) {
add(MBlocks.HOLO_SIGN, "desc", "Multi-line, colored and glowing, text sign")
add(MBlocks.TRITANIUM_INGOT_BLOCK, "Tritanium Plating Block")
add(MBlocks.WITHERED_STEEL_BLOCK, "Withered Steel Block")
add(MBlocks.ROFLITE_ALLOY_BLOCK, "Roflite Alloy Block")
addBlock(MBlocks.ENERGY_COUNTER.values, "Energy Counter")
addBlock(MBlocks.ENERGY_COUNTER.values, "desc", "Restricts energy flow direction;")
@ -741,6 +743,7 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.ESSENCE_SERVO, "desc2", "Can be used as a tool to pump essence manually")
add(MItems.NUTRIENT_PASTE, "Nutrient Paste")
add(MItems.IMPERFECT_BREAD, "Imperfect Bread")
add(MItems.FLUID_CAPSULE, "Fluid Capsule")
add(MItems.FLUID_CAPSULE, "named", "Fluid Capsule (%s)")
@ -788,6 +791,7 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.TRITANIUM_INGOT, "Tritanium Ingot")
add(MItems.DILITHIUM_CRYSTAL, "Dilithium Crystal")
add(MItems.WITHERED_STEEL, "Withered Steel Ingot")
add(MItems.ROFLITE_ALLOY_INGOT, "Roflite Alloy Ingot")
add(MItems.TRITANIUM_NUGGET, "Tritanium Nugget")
add(MItems.MATTER_IO_PORT, "Matter IO Port")
add(MItems.MATTER_TRANSFORM_MATRIX, "Matter Transformation Matrix")

View File

@ -616,6 +616,8 @@ private fun blocks(provider: MatteryLanguageProvider) {
add(MBlocks.HOLO_SIGN, "desc", "Многострочная, крашеная и светящееся, табличка")
add(MBlocks.TRITANIUM_INGOT_BLOCK, "Блок слитков тритана")
add(MBlocks.WITHERED_STEEL_BLOCK, "Блок иссушенной стали")
add(MBlocks.ROFLITE_ALLOY_BLOCK, "Блок рофлитового сплава")
addBlock(MBlocks.ENERGY_COUNTER.values, "Счётчик энергии")
addBlock(MBlocks.ENERGY_COUNTER.values, "desc", "Ограничивает направление передачи энергии;")
@ -734,6 +736,7 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.ESSENCE_SERVO, "desc2", "Может использоваться как инструмент для ручной перекачки эссенции")
add(MItems.NUTRIENT_PASTE, "Питательная паста")
add(MItems.IMPERFECT_BREAD, "Несовершенный хлеб")
add(MItems.FLUID_CAPSULE, "Жидкостная капсула")
add(MItems.FLUID_CAPSULE, "named", "Жидкостная капсула (%s)")
@ -781,6 +784,7 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.TRITANIUM_INGOT, "Тритановый слиток")
add(MItems.DILITHIUM_CRYSTAL, "Дилитевый кристалл")
add(MItems.WITHERED_STEEL, "Слиток иссушенной стали")
add(MItems.ROFLITE_ALLOY_INGOT, "Слиток рофлитового сплава")
add(MItems.TRITANIUM_NUGGET, "Тритановый самородок")
add(MItems.MATTER_IO_PORT, "Порт ввода/вывода материи")
add(MItems.MATTER_TRANSFORM_MATRIX, "Матрица преобразования материи")

View File

@ -50,6 +50,8 @@ fun addDecorativeLoot(lootTables: LootTables) {
lootTables.dropsSelf(MBlocks.TRITANIUM_INGOT_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_BARS) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.WITHERED_STEEL_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_HULL) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.GENERATOR_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }

View File

@ -93,4 +93,24 @@ fun addShapelessRecipes(consumer: RecipeOutput) {
hammerRecipe(MItems.TRITANIUM_PLATE, MItemTags.TRITANIUM_INGOTS, consumer)
hammerRecipe(MItems.IRON_PLATE, Tags.Items.INGOTS_IRON, consumer)
hammerRecipe(MItems.GOLD_PLATE, Tags.Items.INGOTS_GOLD, consumer)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.WITHERED_STEEL_BLOCK, 1)
.requires(Ingredient.of(MItems.WITHERED_STEEL), 9)
.unlockedBy(MItems.WITHERED_STEEL)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.WITHERED_STEEL, 9)
.requires(Ingredient.of(MItems.WITHERED_STEEL_BLOCK))
.unlockedBy(MItems.WITHERED_STEEL_BLOCK)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.ROFLITE_ALLOY_BLOCK, 1)
.requires(Ingredient.of(MItems.ROFLITE_ALLOY_INGOT), 9)
.unlockedBy(MItems.ROFLITE_ALLOY_INGOT)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.ROFLITE_ALLOY_INGOT, 9)
.requires(Ingredient.of(MItems.ROFLITE_ALLOY_BLOCK))
.unlockedBy(MItems.ROFLITE_ALLOY_BLOCK)
.save(consumer)
}

View File

@ -11,7 +11,11 @@ import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry
fun addConstructionTags(tagsProvider: TagsProvider) {
tagsProvider.blocks.Appender(BlockTags.BEACON_BASE_BLOCKS).add(MBlocks.TRITANIUM_INGOT_BLOCK)
tagsProvider.blocks.Appender(BlockTags.BEACON_BASE_BLOCKS)
.add(MBlocks.TRITANIUM_INGOT_BLOCK)
.add(MBlocks.DILITHIUM_CRYSTAL_BLOCK)
.add(MBlocks.WITHERED_STEEL_BLOCK)
.add(MBlocks.ROFLITE_ALLOY_BLOCK)
tagsProvider.blocks.Appender(MBlockTags.MULTIBLOCK_STRUCTURE)
.add(MBlockTags.MULTIBLOCK_HARD_STRUCTURE, MBlockTags.MULTIBLOCK_SOFT_STRUCTURE)

View File

@ -51,6 +51,8 @@ fun addMineableTags(tagsProvider: TagsProvider) {
*MBlocks.ENERGY_SERVO.values.toTypedArray(),
MBlocks.TRITANIUM_INGOT_BLOCK,
MBlocks.WITHERED_STEEL_BLOCK,
MBlocks.METAL_JUNK,
MBlocks.METAL_MESH,
MBlocks.TRITANIUM_BARS,
@ -96,6 +98,7 @@ fun addMineableTags(tagsProvider: TagsProvider) {
MBlocks.DILITHIUM_ORE,
MBlocks.DEEPSLATE_DILITHIUM_ORE,
MBlocks.DILITHIUM_CRYSTAL_BLOCK,
MBlocks.ROFLITE_ALLOY_BLOCK,
MBlocks.GRAVITATION_STABILIZER,
MBlocks.GRAVITATION_STABILIZER_LENS,

View File

@ -21,6 +21,8 @@ fun addResourceTags(tagsProvider: TagsProvider) {
tagsProvider.dusts.add("tritanium", MItems.TRITANIUM_DUST)
tagsProvider.ingots.add("tritanium", MItems.TRITANIUM_INGOT)
tagsProvider.ingots.add("withered_steel", MItems.WITHERED_STEEL)
tagsProvider.ingots.add("roflite_alloy", MItems.ROFLITE_ALLOY_INGOT)
tagsProvider.wires.add("copper", MItems.COPPER_WIRING)
tagsProvider.wires.add("gold", MItems.GOLD_WIRING)
@ -32,6 +34,10 @@ fun addResourceTags(tagsProvider: TagsProvider) {
tagsProvider.storageBlocksAsItem.add("tritanium", MItems.TRITANIUM_INGOT_BLOCK)
tagsProvider.storageBlocksAsBlock.add("tritanium", MBlocks.TRITANIUM_INGOT_BLOCK)
tagsProvider.storageBlocksAsItem.add("withered_steel", MItems.WITHERED_STEEL_BLOCK)
tagsProvider.storageBlocksAsBlock.add("withered_steel", MBlocks.WITHERED_STEEL_BLOCK)
tagsProvider.storageBlocksAsItem.add("roflite_alloy", MItems.ROFLITE_ALLOY_BLOCK)
tagsProvider.storageBlocksAsBlock.add("roflite_alloy", MBlocks.ROFLITE_ALLOY_BLOCK)
tagsProvider.singleDropOre(
MBlocks.TRITANIUM_ORE,

View File

@ -20,6 +20,8 @@ fun addTags(tagsProvider: TagsProvider) {
tagsProvider.items.Appender(ItemTags.BEACON_PAYMENT_ITEMS)
.add(MItems.TRITANIUM_INGOT)
.add(MItems.DILITHIUM_CRYSTAL)
.add(MItems.WITHERED_STEEL)
.add(MItems.ROFLITE_ALLOY_INGOT)
tagsProvider.items.Appender(ItemTags.MEAT).add(MItems.NUTRIENT_PASTE)

View File

@ -0,0 +1,25 @@
package ru.dbotthepony.mc.otm.item.consumables
import net.minecraft.world.effect.MobEffectInstance
import net.minecraft.world.effect.MobEffects
import net.minecraft.world.level.Level
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player
import net.minecraft.world.food.FoodProperties
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
class ImperfectBread(properties: Item.Properties) : Item(properties) {
override fun finishUsingItem(stack: ItemStack, level: Level, entity: LivingEntity): ItemStack {
if (entity is Player) {
entity.addEffect(MobEffectInstance(MobEffects.POISON, 80, 0))
}
return super.finishUsingItem(stack, level, entity)
}
}
val IMPERFECT_BREAD_FOOD: FoodProperties = FoodProperties.Builder()
.nutrition(5)
.saturationModifier(0.6f)
.build()

View File

@ -93,10 +93,12 @@ object MNames {
// building blocks
const val TRITANIUM_BLOCK = "tritanium_block"
const val TRITANIUM_BLOCK_YELLOW_CLASSIC = "tritanium_block_yellow_classic"
const val TRITANIUM_STAIRS = "tritanium_stairs"
const val TRITANIUM_SLAB = "tritanium_slab"
const val TRITANIUM_WALL = "tritanium_wall"
const val TRITANIUM_STRIPED_BLOCK = "tritanium_striped_block"
const val TRITANIUM_CLASSIC_STRIPED_BLOCK = "tritanium_classic_striped_block"
const val TRITANIUM_STRIPED_STAIRS = "tritanium_striped_stairs"
const val TRITANIUM_STRIPED_SLAB = "tritanium_striped_slab"
const val TRITANIUM_STRIPED_WALL = "tritanium_striped_wall"
@ -128,6 +130,8 @@ object MNames {
const val PILL_HEAL = "pill_heal"
const val PILL_NOT_NORMAL = "pill_not_normal"
const val IMPERFECT_BREAD = "imperfect_bread"
const val BATTERY_CRUDE = "battery_crude"
const val BATTERY_BASIC = "battery_basic"
const val BATTERY_NORMAL = "battery_normal"
@ -205,8 +209,12 @@ object MNames {
const val TRITANIUM_INGOT = "tritanium_ingot"
const val TRITANIUM_INGOT_BLOCK = "tritanium_ingot_block"
const val WITHERED_STEEL_BLOCK = "withered_steel_block"
const val WITHERED_STEEL = "withered_steel"
const val ROFLITE_ALLOY_INGOT = "roflite_alloy_ingot"
const val ROFLITE_ALLOY_BLOCK = "roflite_alloy_block"
const val MATTER_IO_PORT = "matter_io_port"
const val CARBON_MESH = "carbon_mesh"

View File

@ -252,6 +252,14 @@ object MBlocks {
Block(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLUE).sound(SoundType.METAL).explosionResistance(400f).destroyTime(3f).requiresCorrectToolForDrops())
}
val WITHERED_STEEL_BLOCK: Block by registry.register(MNames.WITHERED_STEEL_BLOCK) {
Block(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_GREEN).sound(SoundType.NETHERITE_BLOCK).explosionResistance(400f).destroyTime(3f).requiresCorrectToolForDrops())
}
val ROFLITE_ALLOY_BLOCK: Block by registry.register(MNames.ROFLITE_ALLOY_BLOCK) {
Block(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BROWN).sound(SoundType.NETHERITE_BLOCK).explosionResistance(400f).destroyTime(3f).requiresCorrectToolForDrops())
}
val METAL_JUNK: MatteryBlock by registry.register(MNames.METAL_JUNK) {
MatteryBlock(BlockBehaviour.Properties.of().sound(SoundType.NETHERITE_BLOCK).mapColor(MapColor.COLOR_GRAY).explosionResistance(45f).destroyTime(3f).requiresCorrectToolForDrops())
.addSimpleDescription()

View File

@ -237,6 +237,10 @@ private fun addMainCreativeTabItems(consumer: CreativeModeTab.Output) {
accept(MItems.DILITHIUM_CRYSTAL_BLOCK)
accept(MItems.WITHERED_STEEL)
accept(MItems.WITHERED_STEEL_BLOCK)
accept(MItems.ROFLITE_ALLOY_INGOT)
accept(MItems.ROFLITE_ALLOY_BLOCK)
accept(MItems.TRITANIUM_TOOLS)
accept(MItems.TRITANIUM_SHIELD)
@ -281,6 +285,7 @@ private fun addMainCreativeTabItems(consumer: CreativeModeTab.Output) {
base(MItems.CARGO_CRATE_MINECARTS)
accept(MItems.NUTRIENT_PASTE)
accept(MItems.IMPERFECT_BREAD)
// exo
accept(MItems.EXOPACK_PROBE)

View File

@ -43,16 +43,12 @@ import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.item.BatteryItem
import ru.dbotthepony.mc.otm.item.ChestUpgraderItem
import ru.dbotthepony.mc.otm.item.CrudeBatteryItem
import ru.dbotthepony.mc.otm.item.consumables.EssenceCapsuleItem
import ru.dbotthepony.mc.otm.item.EssenceServoItem
import ru.dbotthepony.mc.otm.item.FluidCapsuleItem
import ru.dbotthepony.mc.otm.item.block.FluidTankItem
import ru.dbotthepony.mc.otm.item.GravitationalDisruptorItem
import ru.dbotthepony.mc.otm.item.consumables.HealPillItem
import ru.dbotthepony.mc.otm.item.MatteryItem
import ru.dbotthepony.mc.otm.item.MinecartCargoCrateItem
import ru.dbotthepony.mc.otm.item.consumables.PillItem
import ru.dbotthepony.mc.otm.item.consumables.PillType
import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem
import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem
import ru.dbotthepony.mc.otm.item.QuantumBatteryItem
@ -62,7 +58,7 @@ import ru.dbotthepony.mc.otm.item.addSimpleDescription
import ru.dbotthepony.mc.otm.item.armor.PortableGravitationStabilizerItem
import ru.dbotthepony.mc.otm.item.armor.TritaniumArmorItem
import ru.dbotthepony.mc.otm.item.block.EnergyCableItem
import ru.dbotthepony.mc.otm.item.consumables.NotNormalPill
import ru.dbotthepony.mc.otm.item.consumables.*
import ru.dbotthepony.mc.otm.item.exopack.ExopackProbeItem
import ru.dbotthepony.mc.otm.item.exopack.ExopackSlotUpgradeItem
import ru.dbotthepony.mc.otm.item.exopack.ExopackUpgradeItem
@ -301,6 +297,9 @@ object MItems {
val TRITANIUM_NUGGET: Item by registry.register(MNames.TRITANIUM_NUGGET) { Item(DEFAULT_PROPERTIES) }
val TRITANIUM_INGOT: Item by registry.register(MNames.TRITANIUM_INGOT) { Item(DEFAULT_PROPERTIES) }
val TRITANIUM_INGOT_BLOCK: BlockItem by registry.register(MNames.TRITANIUM_INGOT_BLOCK) { BlockItem(MBlocks.TRITANIUM_INGOT_BLOCK, DEFAULT_PROPERTIES) }
val WITHERED_STEEL_BLOCK: BlockItem by registry.register(MNames.WITHERED_STEEL_BLOCK) { BlockItem(MBlocks.WITHERED_STEEL_BLOCK, DEFAULT_PROPERTIES) }
val TRITANIUM_BARS: BlockItem by registry.register(MNames.TRITANIUM_BARS) { BlockItem(MBlocks.TRITANIUM_BARS, DEFAULT_PROPERTIES) }
val METAL_RAILING: BlockItem by registry.register(MNames.METAL_RAILING) { BlockItem(MBlocks.METAL_RAILING, DEFAULT_PROPERTIES) }
@ -426,6 +425,8 @@ object MItems {
val PILL_HEAL: Item by registry.register(MNames.PILL_HEAL) { HealPillItem() }
val PILL_NOT_NORMAL: Item by registry.register(MNames.PILL_NOT_NORMAL) { NotNormalPill() }
val IMPERFECT_BREAD: Item by registry.register(MNames.IMPERFECT_BREAD) { ImperfectBread(Item.Properties().food(IMPERFECT_BREAD_FOOD)) }
val PILLS = SupplierList(
MItems::PILL_ANDROID,
MItems::PILL_HUMANE,
@ -665,6 +666,9 @@ object MItems {
val BREAD_MONSTER_SPAWN_EGG: Item by registry.register(MNames.BREAD_MONSTER_SPAWN_EGG){ SpawnEggItem(MEntityTypes.BREAD_MONSTER, 0xFFFFFF, 0xFFFFFF, Item.Properties())}
val ROFLITE_ALLOY_INGOT: Item by registry.register(MNames.ROFLITE_ALLOY_INGOT) { Item(DEFAULT_PROPERTIES) }
val ROFLITE_ALLOY_BLOCK: BlockItem by registry.register(MNames.ROFLITE_ALLOY_BLOCK) { BlockItem(MBlocks.ROFLITE_ALLOY_BLOCK, DEFAULT_PROPERTIES) }
init {
MRegistry.registerItems(registry)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B