Compare commits

...

2 Commits

Author SHA1 Message Date
0f77ed34c2
рецепты и тултип для энергетических кабелей
Konstantin Linev, [6:01]

Konstantin Linev, [6:02]
Но имеет смысл
2024-11-12 06:04:01 +03:00
fc76e0fbcb
рецепт ящикатора 2024-11-12 05:22:31 +03:00
3 changed files with 61 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.config.CablesConfig
import ru.dbotthepony.mc.otm.registry.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems
@ -460,4 +461,36 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.row(MItemTags.IRON_PLATES, MItemTags.CRAFTING_TABLES, MItemTags.IRON_PLATES)
.unlockedBy(Tags.Items.DYES)
.build(consumer)
MatteryRecipe(MItems.CHEST_UPGRADER, category = RecipeCategory.TOOLS)
.rowAC(Items.REDSTONE, Items.REDSTONE)
.row(MItemTags.TRITANIUM_PLATES, Items.ENDER_PEARL, MItemTags.TRITANIUM_PLATES)
.rowB(ItemTags.STONE_BUTTONS)
.unlockedBy(Tags.Items.CHESTS_WOODEN)
.unlockedBy(Tags.Items.BARRELS_WOODEN)
.unlockedBy(MItemTags.CARGO_CRATES)
.build(consumer)
MatteryRecipe(MItems.ENERGY_CABLES[CablesConfig.E.CRUDE]!!.asItem(), category = machinesCategory, count = 8)
.row(MItemTags.IRON_PLATES, Items.REDSTONE, MItemTags.IRON_PLATES)
.unlockedBy(Items.REDSTONE)
.build(consumer)
MatteryRecipe(MItems.ENERGY_CABLES[CablesConfig.E.REGULAR]!!.asItem(), category = machinesCategory, count = 16)
.row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
.row(MItemTags.COPPER_WIRES, Items.REDSTONE, MItemTags.COPPER_WIRES)
.row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
.build(consumer)
MatteryRecipe(MItems.ENERGY_CABLES[CablesConfig.E.ADVANCED]!!.asItem(), category = machinesCategory, count = 16)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.GOLD_WIRES, Items.REDSTONE, MItemTags.GOLD_WIRES)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.build(consumer)
MatteryRecipe(MItems.ENERGY_CABLES[CablesConfig.E.SUPERCONDUCTOR]!!.asItem(), category = machinesCategory)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItems.ELECTROMAGNET, MItemTags.REINFORCED_TRITANIUM_PLATES)
.row(Tags.Items.INGOTS_GOLD, Tags.Items.INGOTS_GOLD, Tags.Items.INGOTS_GOLD)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.BLUE_ICE, MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer)
}

View File

@ -0,0 +1,26 @@
package ru.dbotthepony.mc.otm.item.block
import net.minecraft.ChatFormatting
import net.minecraft.network.chat.Component
import net.minecraft.world.item.BlockItem
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.TooltipFlag
import ru.dbotthepony.mc.otm.config.CablesConfig
import ru.dbotthepony.mc.otm.core.util.formatPower
import ru.dbotthepony.mc.otm.registry.MBlocks
class EnergyCableItem(val conf: CablesConfig.E, properties: Properties) : BlockItem(MBlocks.ENERGY_CABLES[conf]!!, properties) {
override fun appendHoverText(
stack: ItemStack,
context: TooltipContext,
tooltip: MutableList<Component>,
flag: TooltipFlag
) {
super.appendHoverText(stack, context, tooltip, flag)
tooltip.add(
Component.translatable("otm.item.power.throughput_mono", conf.throughput.formatPower())
.withStyle(ChatFormatting.GRAY))
}
}

View File

@ -58,6 +58,7 @@ import ru.dbotthepony.mc.otm.item.ZPMItem
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.exopack.ExopackProbeItem
import ru.dbotthepony.mc.otm.item.exopack.ExopackSlotUpgradeItem
import ru.dbotthepony.mc.otm.item.exopack.ExopackUpgradeItem
@ -84,7 +85,7 @@ object MItems {
}
val ENERGY_CABLES: Map<CablesConfig.E, BlockItem> = SupplierMap(CablesConfig.E.entries.map { conf ->
conf to registry.register("${conf.name.lowercase()}_energy_cable") { BlockItem(MBlocks.ENERGY_CABLES[conf]!!, DEFAULT_PROPERTIES) }
conf to registry.register("${conf.name.lowercase()}_energy_cable") { EnergyCableItem(conf, DEFAULT_PROPERTIES) }
})
val ANDROID_STATION = register(MNames.ANDROID_STATION, MBlocks.ANDROID_STATION)