From b38ebfaa3b5bf616e0929f81aa95e03be0961efb Mon Sep 17 00:00:00 2001 From: GearShocky Date: Tue, 4 Mar 2025 00:13:32 +0500 Subject: [PATCH 1/6] I want this --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 19847cef5..abaa278cd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -190,7 +190,7 @@ dependencies { compileOnly("curse.maven:resourceful-config-714059:${resourceful_config_id}") compileOnly("curse.maven:botarium-704113:${botarium_id}") compileOnly("curse.maven:ad-astra-635042:${ad_astra_id}") - //runtimeOnly("curse.maven:worldedit-225608:${worldedit_id}") + runtimeOnly("curse.maven:worldedit-225608:${worldedit_id}") runtimeOnly("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}") implementation("io.wispforest:condensed_creative-neoforge:${condensed_creative_version}") From 440b7fff2bab5c40d3627c5613a1873d61845652 Mon Sep 17 00:00:00 2001 From: GearShocky Date: Tue, 4 Mar 2025 06:18:01 +0500 Subject: [PATCH 2/6] Falling sun --- .../mc/otm/datagen/lang/English.kt | 6 + .../mc/otm/datagen/lang/Russian.kt | 6 + .../dbotthepony/mc/otm/config/ToolsConfig.kt | 2 + .../mc/otm/item/weapon/FallingSunItem.kt | 232 +++++++++++++++++ .../ru/dbotthepony/mc/otm/registry/MNames.kt | 1 + .../dbotthepony/mc/otm/registry/MRegistry.kt | 9 + .../mc/otm/registry/game/MItems.kt | 2 + .../models/item/falling_sun.json | 22 ++ .../models/item/falling_sun_inventory.json | 6 + .../models/item/falling_sun_powered.json | 241 ++++++++++++++++++ .../models/item/falling_sun_unpowered.json | 200 +++++++++++++++ .../textures/item/falling_sun.png | Bin 0 -> 691 bytes .../textures/item/falling_sun_charge.png | Bin 0 -> 2546 bytes .../item/falling_sun_charge.png.mcmeta | 1 + .../textures/item/falling_sun_icon.png | Bin 0 -> 547 bytes .../weapon_attributes/falling_sun.json | 40 +++ 16 files changed, 768 insertions(+) create mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/FallingSunItem.kt create mode 100644 src/main/resources/assets/overdrive_that_matters/models/item/falling_sun.json create mode 100644 src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_inventory.json create mode 100644 src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_powered.json create mode 100644 src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_unpowered.json create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun.png create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png.mcmeta create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_icon.png create mode 100644 src/main/resources/data/overdrive_that_matters/weapon_attributes/falling_sun.json diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index 47a522393..35455c300 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -859,6 +859,12 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.ENERGY_SWORD, "desc3", "Always strikes surrounding enemies with full damage if empowered") add(MItems.ENERGY_SWORD, "desc4", "Does not benefit from Sweeping Edge enchantment") + add(MItems.FALLING_SUN, "◄ Falling Sun ►") + add(MItems.FALLING_SUN, "desc", "Prototype weapon, needs power to operate") + add(MItems.FALLING_SUN, "desc2", "Deals extra damage to androids when empowered") + add(MItems.FALLING_SUN, "desc3", "Always strikes surrounding enemies with full damage if empowered") + add(MItems.FALLING_SUN, "desc4", "Does not benefit from Sweeping Edge enchantment") + add(MItems.PORTABLE_CONDENSATION_DRIVE, "Portable Condensation Drive") add(MItems.PORTABLE_DENSE_CONDENSATION_DRIVE, "Portable Dense Condensation Drive") add(MItems.TRITANIUM_ORE_CLUMP, "Raw Tritanium") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt index fd30292c9..f0bb29256 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt @@ -852,6 +852,12 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.ENERGY_SWORD, "desc3", "Всегда наносит полный урон по площади если имеет заряд") add(MItems.ENERGY_SWORD, "desc4", "Зачарование 'Разящий клинок' не имеет никакого эффекта на данном оружии") + add(MItems.FALLING_SUN, "◄ Падающее Солнце ►") + add(MItems.FALLING_SUN, "desc", "Прототип,требует энергию для работы") + add(MItems.FALLING_SUN, "desc2", "Наносит дополнительный урон андроидам если имеет заряд") + add(MItems.FALLING_SUN, "desc3", "Всегда наносит полный урон по площади если имеет заряд") + add(MItems.FALLING_SUN, "desc4", "Зачарование 'Разящий клинок' не имеет никакого эффекта на данном оружии") + add(MItems.PORTABLE_CONDENSATION_DRIVE, "Portable Condensation Drive") add(MItems.PORTABLE_DENSE_CONDENSATION_DRIVE, "Portable Dense Condensation Drive") add(MItems.TRITANIUM_ORE_CLUMP, "Рудный тритан") diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/config/ToolsConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/config/ToolsConfig.kt index f6aadb631..81039877d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/config/ToolsConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/config/ToolsConfig.kt @@ -1,12 +1,14 @@ package ru.dbotthepony.mc.otm.config import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem +import ru.dbotthepony.mc.otm.item.weapon.FallingSunItem object ToolsConfig : AbstractConfig("tools") { val AXES_BREAK_LEAVES_INSTANTLY: Boolean by builder.define("AXES_BREAK_LEAVES_INSTANTLY", true) init { EnergySwordItem.registerConfig(builder) + FallingSunItem.registerConfig(builder) } object ExplosiveHammer { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/FallingSunItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/FallingSunItem.kt new file mode 100644 index 000000000..b9275fdff --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/FallingSunItem.kt @@ -0,0 +1,232 @@ +package ru.dbotthepony.mc.otm.item.weapon + +import net.minecraft.core.BlockPos +import net.minecraft.core.component.DataComponents +import net.minecraft.tags.BlockTags +import net.minecraft.world.entity.EquipmentSlotGroup +import net.minecraft.world.entity.LivingEntity +import net.minecraft.world.entity.ai.attributes.AttributeModifier +import net.minecraft.world.entity.ai.attributes.Attributes +import net.minecraft.world.entity.player.Player +import net.minecraft.world.item.ItemStack +import net.minecraft.world.item.Rarity +import net.minecraft.world.item.component.ItemAttributeModifiers +import net.minecraft.world.level.Level +import net.minecraft.world.level.block.Blocks +import net.minecraft.world.level.block.state.BlockState +import net.neoforged.neoforge.capabilities.Capabilities +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent +import net.neoforged.neoforge.common.ItemAbilities +import net.neoforged.neoforge.common.ItemAbility +import net.neoforged.neoforge.common.ModConfigSpec +import ru.dbotthepony.mc.otm.OverdriveThatMatters +import ru.dbotthepony.mc.otm.capability.MatteryCapability +import ru.dbotthepony.mc.otm.capability.energy.EnergyConsumerItem +import ru.dbotthepony.mc.otm.capability.energy.extractEnergyExact +import ru.dbotthepony.mc.otm.capability.energy.getBarColor +import ru.dbotthepony.mc.otm.capability.energy.getBarWidth +import ru.dbotthepony.mc.otm.capability.matteryEnergy +import ru.dbotthepony.mc.otm.capability.matteryPlayer +import ru.dbotthepony.mc.otm.core.ResourceLocation +import ru.dbotthepony.mc.otm.core.damageType +import ru.dbotthepony.mc.otm.core.math.Decimal +import ru.dbotthepony.mc.otm.core.math.DecimalConfigValue +import ru.dbotthepony.mc.otm.core.math.defineDecimal +import ru.dbotthepony.mc.otm.core.math.nextVariance +import ru.dbotthepony.mc.otm.core.otmRandom +import ru.dbotthepony.mc.otm.core.util.WriteOnce +import ru.dbotthepony.mc.otm.item.MatteryItem +import ru.dbotthepony.mc.otm.item.addSimpleDescription +import ru.dbotthepony.mc.otm.registry.CapabilitiesRegisterListener +import ru.dbotthepony.mc.otm.registry.MDamageTypes +import ru.dbotthepony.mc.otm.registry.MatteryDamageSource + +class FallingSunItem : MatteryItem(Properties().stacksTo(1).rarity(Rarity.EPIC)), CapabilitiesRegisterListener { + private val chargedAttributes: ItemAttributeModifiers + private val dischargedAttributes: ItemAttributeModifiers + + init { + var builder = ItemAttributeModifiers.builder() + + builder.add(Attributes.ATTACK_DAMAGE, AttributeModifier(BASE_ATTACK_DAMAGE_ID, 13.0, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + builder.add(Attributes.ATTACK_SPEED, AttributeModifier(BASE_ATTACK_SPEED_ID, -3.2, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + builder.add(Attributes.SWEEPING_DAMAGE_RATIO, AttributeModifier(ResourceLocation(OverdriveThatMatters.MOD_ID, "energy_sword_sweeping_edge"), 1.0, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + + chargedAttributes = builder.build() + builder = ItemAttributeModifiers.builder() + + builder.add(Attributes.ATTACK_DAMAGE, AttributeModifier(BASE_ATTACK_DAMAGE_ID, 5.5, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + builder.add(Attributes.ATTACK_SPEED, AttributeModifier(BASE_ATTACK_SPEED_ID, -3.2, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + dischargedAttributes = builder.build() + } + + override fun isEnchantable(p_41456_: ItemStack): Boolean { + return p_41456_.count == 1 + } + + override fun getEnchantmentValue(stack: ItemStack): Int { + return 12 + } + + override fun getDestroySpeed(itemStack: ItemStack, blockState: BlockState): Float { + val energy = itemStack.getCapability(MatteryCapability.ITEM_ENERGY) ?: return 1f + + if (blockState.`is`(Blocks.COBWEB)) { + return if (energy.batteryLevel < COBWEB_POWER_COST) 2f else 25f + } else if (blockState.`is`(BlockTags.SWORD_EFFICIENT)) { + return if (energy.batteryLevel < PLANT_POWER_COST) 1.5f else 8f + } else { + return 1f + } + } + + override fun canAttackBlock(p_41441_: BlockState, p_41442_: Level, p_41443_: BlockPos, p_41444_: Player): Boolean { + return !p_41444_.isCreative + } + + override fun hurtEnemy(itemStack: ItemStack, victim: LivingEntity, attacker: LivingEntity): Boolean { + if (attacker is Player && attacker.isCreative) { + victim.matteryPlayer?.let { + if (it.isAndroid) { + victim.invulnerableTime = 0 + victim.hurt(MatteryDamageSource(attacker.level().registryAccess().damageType(MDamageTypes.EMP), attacker, itemStack), 8f) + } + } + + return true + } + + itemStack.getCapability(MatteryCapability.ITEM_ENERGY)?.let { + if (it.extractEnergyExact(ENERGY_PER_SWING, false)) { + it.extractEnergy(attacker.level().otmRandom.nextVariance(ENERGY_PER_SWING_VARIANCE), false) + victim.matteryPlayer?.let { + if (it.isAndroid && it.androidEnergy.extractEnergyExact(ENERGY_ZAP, false)) { + it.androidEnergy.extractEnergy(attacker.level().otmRandom.nextVariance(ENERGY_ZAP_VARIANCE), false) + victim.hurt(MatteryDamageSource(attacker.level().registryAccess().damageType(MDamageTypes.EMP), attacker, itemStack), 8f) + } + } + } + } + + return true + } + + override fun isBarVisible(p_150899_: ItemStack): Boolean { + return p_150899_.matteryEnergy != null + } + + override fun getBarWidth(p_150900_: ItemStack): Int { + return p_150900_.matteryEnergy?.getBarWidth() ?: super.getBarWidth(p_150900_) + } + + override fun getBarColor(p_150901_: ItemStack): Int { + return p_150901_.matteryEnergy?.getBarColor() ?: super.getBarColor(p_150901_) + } + + init { + tooltips.itemEnergy() + + addSimpleDescription() + addSimpleDescription("2") + addSimpleDescription("3") + addSimpleDescription("4") + } + + override fun mineBlock( + itemStack: ItemStack, + p_41417_: Level, + blockState: BlockState, + p_41419_: BlockPos, + user: LivingEntity + ): Boolean { + if (blockState.getDestroySpeed(p_41417_, p_41419_) > 0f && (user !is Player || !user.isCreative)) { + val energy = itemStack.matteryEnergy + + if (blockState.`is`(BlockTags.SWORD_EFFICIENT)) { + if (energy?.extractEnergyExact(PLANT_POWER_COST, false) == true) + energy.extractEnergyExact(user.level().otmRandom.nextVariance(PLANT_POWER_COST_VARIANCE), false) + } + + if (blockState.`is`(Blocks.COBWEB)) { + if (energy?.extractEnergyExact(COBWEB_POWER_COST, false) == true) + energy.extractEnergyExact(user.level().otmRandom.nextVariance(COBWEB_POWER_COST_VARIANCE), false) + } + } + + return true + } + + override fun isCorrectToolForDrops(stack: ItemStack, state: BlockState): Boolean { + val energy = stack.matteryEnergy ?: return super.isCorrectToolForDrops(stack, state) + + if (state.`is`(BlockTags.SWORD_EFFICIENT) && energy.batteryLevel >= PLANT_POWER_COST) + return true + else if (state.`is`(Blocks.COBWEB) && energy.batteryLevel >= COBWEB_POWER_COST) + return true + + return super.isCorrectToolForDrops(stack, state) + } + + private fun cap(stack: ItemStack) = EnergyConsumerItem(stack, MAX_ENERGY) + + override fun registerCapabilities(event: RegisterCapabilitiesEvent) { + event.registerItem(MatteryCapability.ITEM_ENERGY, { o, _ -> cap(o) }, this) + event.registerItem(Capabilities.EnergyStorage.ITEM, { o, _ -> cap(o) }, this) + } + + override fun getDefaultAttributeModifiers(stack: ItemStack): ItemAttributeModifiers { + val energy = cap(stack) + + if (energy.batteryLevel >= ENERGY_PER_SWING) { + return chargedAttributes + } + + return dischargedAttributes + } + + override fun canPerformAction(stack: ItemStack, toolAction: ItemAbility): Boolean { + if (cap(stack).extractEnergyExact(ENERGY_PER_SWING, true)) { + return ItemAbilities.DEFAULT_SWORD_ACTIONS.contains(toolAction) + } + + return false + } + + companion object { + val MAX_ENERGY get() = _MAX_ENERGY.get() + val ENERGY_ZAP get() = _ENERGY_ZAP.get() + val ENERGY_ZAP_VARIANCE get() = _ENERGY_ZAP_VARIANCE.get() + val ENERGY_PER_SWING get() = _ENERGY_PER_SWING.get() + val ENERGY_PER_SWING_VARIANCE get() = _ENERGY_PER_SWING_VARIANCE.get() + val COBWEB_POWER_COST get() = _COBWEB_POWER_COST.get() + val COBWEB_POWER_COST_VARIANCE get() = _COBWEB_POWER_COST_VARIANCE.get() + val PLANT_POWER_COST get() = _PLANT_POWER_COST.get() + val PLANT_POWER_COST_VARIANCE get() = _PLANT_POWER_COST_VARIANCE.get() + + private var _MAX_ENERGY: DecimalConfigValue by WriteOnce() + private var _ENERGY_ZAP: DecimalConfigValue by WriteOnce() + private var _ENERGY_ZAP_VARIANCE: DecimalConfigValue by WriteOnce() + private var _ENERGY_PER_SWING: DecimalConfigValue by WriteOnce() + private var _ENERGY_PER_SWING_VARIANCE: DecimalConfigValue by WriteOnce() + private var _COBWEB_POWER_COST: DecimalConfigValue by WriteOnce() + private var _COBWEB_POWER_COST_VARIANCE: DecimalConfigValue by WriteOnce() + private var _PLANT_POWER_COST: DecimalConfigValue by WriteOnce() + private var _PLANT_POWER_COST_VARIANCE: DecimalConfigValue by WriteOnce() + + fun registerConfig(builder: ModConfigSpec.Builder) { + builder.comment("Falling Sun values").push("FallingSun") + + _MAX_ENERGY = builder.defineDecimal("MAX_ENERGY", Decimal(3_500_000), Decimal.ZERO) + _ENERGY_ZAP = builder.comment("Extra energy required when hitting androids").defineDecimal("ENERGY_ZAP", Decimal(4_000), Decimal.ZERO) + _ENERGY_ZAP_VARIANCE = builder.comment("Random deviation from ENERGY_ZAP").defineDecimal("ENERGY_ZAP_VARIANCE", Decimal(1200), Decimal.ZERO) + _ENERGY_PER_SWING = builder.defineDecimal("ENERGY_PER_SWING", Decimal(3_000), Decimal.ZERO) + _ENERGY_PER_SWING_VARIANCE = builder.comment("Random deviation from ENERGY_PER_SWING").defineDecimal("ENERGY_PER_SWING_VARIANCE", Decimal(600), Decimal.ZERO) + _COBWEB_POWER_COST = builder.defineDecimal("COBWEB_POWER_COST", Decimal(2_500), Decimal.ZERO) + _COBWEB_POWER_COST_VARIANCE = builder.comment("Random deviation from COBWEB_POWER_COST").defineDecimal("COBWEB_POWER_COST_VARIANCE", Decimal(500), Decimal.ZERO) + _PLANT_POWER_COST = builder.defineDecimal("PLANT_POWER_COST", Decimal(500), Decimal.ZERO) + _PLANT_POWER_COST_VARIANCE = builder.comment("Random deviation from PLANT_POWER_COST").defineDecimal("PLANT_POWER_COST_VARIANCE", Decimal(100), Decimal.ZERO) + + builder.pop() + } + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt index a3612f1f0..a283cc490 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt @@ -194,6 +194,7 @@ object MNames { const val TRITANIUM_SHIELD = "tritanium_shield" const val ENERGY_SWORD = "energy_sword" + const val FALLING_SUN = "falling_sun" const val PLASMA_RIFLE = "plasma_rifle" diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt index cd58f1a2d..b0a70f9d3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt @@ -42,6 +42,7 @@ import ru.dbotthepony.mc.otm.core.math.Decimal import ru.dbotthepony.mc.otm.isClient import ru.dbotthepony.mc.otm.item.armor.TritaniumArmorItem import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem +import ru.dbotthepony.mc.otm.item.weapon.FallingSunItem import ru.dbotthepony.mc.otm.registry.game.MItems import ru.dbotthepony.mc.otm.registry.game.MStats import ru.dbotthepony.mc.otm.registry.objects.ColoredDecorativeBlock @@ -284,6 +285,14 @@ object MRegistry : IBlockItemRegistryAcceptor { } } + ItemProperties.register(MItems.FALLING_SUN, ResourceLocation(OverdriveThatMatters.MOD_ID, "is_powered")) { stack, _, _, _ -> + if ((stack.matteryEnergy?.batteryLevel ?: Decimal.ZERO) >= FallingSunItem.ENERGY_PER_SWING) { + 1f + } else { + 0f + } + } + ItemProperties.register(MItems.EXPLOSIVE_HAMMER, ResourceLocation(OverdriveThatMatters.MOD_ID, "is_primed")) { stack, level, entity, _ -> if (MItems.EXPLOSIVE_HAMMER.isPrimed(stack) || entity == null) { 1f diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt index 82de7fba6..fd87871a6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt @@ -72,6 +72,7 @@ import ru.dbotthepony.mc.otm.item.tool.ExplosiveHammerItem import ru.dbotthepony.mc.otm.item.tool.MatteryAxeItem import ru.dbotthepony.mc.otm.item.tool.RedstoneInteractorItem import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem +import ru.dbotthepony.mc.otm.item.weapon.FallingSunItem import ru.dbotthepony.mc.otm.item.weapon.WitheredSteelSwordItem import ru.dbotthepony.mc.otm.registry.MDeferredRegister import ru.dbotthepony.mc.otm.registry.MItemTags @@ -407,6 +408,7 @@ object MItems { val EXPLOSIVE_HAMMER: ExplosiveHammerItem by registry.register("explosive_hammer") { ExplosiveHammerItem() } val ENERGY_SWORD: Item by registry.register(MNames.ENERGY_SWORD) { EnergySwordItem() } + val FALLING_SUN: Item by registry.register(MNames.FALLING_SUN) { FallingSunItem() } val WITHERED_STEEL_SWORD: Item by registry.register(MNames.WITHERED_STEEL_SWORD) { WitheredSteelSwordItem(Item.Properties().durability(420)) } diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun.json b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun.json new file mode 100644 index 000000000..cf79584ea --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun.json @@ -0,0 +1,22 @@ +{ + "loader": "neoforge:separate_transforms", + "gui_light": "front", + "base": + { + "parent": "overdrive_that_matters:item/falling_sun_unpowered" + }, + "perspectives": { + "gui": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + }, + "fixed": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + }, + "ground": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + } + }, + "overrides": [ + { "predicate": { "overdrive_that_matters:is_powered": 1.0 }, "model": "overdrive_that_matters:item/falling_sun_powered" } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_inventory.json b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_inventory.json new file mode 100644 index 000000000..4a768a3b1 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "overdrive_that_matters:item/falling_sun_icon" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_powered.json b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_powered.json new file mode 100644 index 000000000..58eb91a45 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_powered.json @@ -0,0 +1,241 @@ +{ + "loader": "neoforge:separate_transforms", + "gui_light": "front", + "base": + { + "texture_size": [32, 32], + "textures": { + "0": "overdrive_that_matters:item/falling_sun", + "1": "overdrive_that_matters:item/falling_sun_charge", + "particle": "overdrive_that_matters:item/falling_sun" + }, + "elements": [ + { + "name": "frame", + "from": [7.999, 8, 9.6], + "to": [8.002, 22, 11.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 11, 10.6]}, + "faces": { + "east": {"uv": [11.5, 0, 10.5, 7], "texture": "#0"}, + "west": {"uv": [10.5, 0, 11.5, 7], "texture": "#0"} + } + }, + { + "name": "frame", + "from": [8, 22, 9.6], + "to": [8, 29, 11.6], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 22, 9.6]}, + "faces": { + "east": {"uv": [12.5, 0, 11.5, 3.5], "texture": "#0"}, + "west": {"uv": [11.5, 0, 12.5, 3.5], "texture": "#0"} + } + }, + { + "name": "cap", + "from": [7.4, 6, 7.6], + "to": [8.6, 11, 9.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 7, 7.6]}, + "faces": { + "north": {"uv": [7.5, 4, 8, 6.5], "texture": "#0"}, + "east": {"uv": [9, 4, 8, 6.5], "texture": "#0"}, + "south": {"uv": [9, 4, 9.5, 6.5], "texture": "#0"}, + "west": {"uv": [8, 4, 9, 6.5], "texture": "#0"}, + "up": {"uv": [8, 3.5, 9, 4], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "handle", + "from": [7, -5, 4], + "to": [9, -4, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -5, 7]}, + "faces": { + "north": {"uv": [8, 10, 9, 10.5], "texture": "#0"}, + "east": {"uv": [7.5, 7, 8, 10], "rotation": 270, "texture": "#0"}, + "south": {"uv": [8, 6.5, 9, 7], "texture": "#0"}, + "west": {"uv": [7.5, 7, 8, 10], "rotation": 90, "texture": "#0"}, + "up": {"uv": [8, 7, 9, 10], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 7, 10, 10], "texture": "#0"} + } + }, + { + "name": "handle", + "from": [8, -4, 4.6], + "to": [8, 3, 7.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, -3, 5.6]}, + "faces": { + "east": {"uv": [9, 0, 10.5, 3.5], "texture": "#0"}, + "west": {"uv": [10.5, 0, 9, 3.5], "texture": "#0"} + } + }, + { + "name": "handle", + "from": [7.5, -4, 7.2], + "to": [8.5, 3, 9.2], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, -3, 7.2]}, + "faces": { + "north": {"uv": [7, 0, 7.5, 3.5], "texture": "#0"}, + "east": {"uv": [8.5, 0, 7.5, 3.5], "texture": "#0"}, + "south": {"uv": [8.5, 0, 9, 3.5], "texture": "#0"}, + "west": {"uv": [7.5, 0, 8.5, 3.5], "texture": "#0"} + } + }, + { + "name": "guard", + "from": [6.5, 5, 4], + "to": [9.5, 6, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 5, 7]}, + "faces": { + "north": {"uv": [4, 8, 5.5, 8.5], "texture": "#0"}, + "east": {"uv": [3.5, 5, 4, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [4, 4.5, 5.5, 5], "rotation": 180, "texture": "#0"}, + "west": {"uv": [5.5, 5, 6, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [4, 5, 5.5, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 5, 7.5, 8], "texture": "#0"} + } + }, + { + "name": "guard", + "from": [6.5, 3, 4], + "to": [9.5, 4, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 3, 7]}, + "faces": { + "north": {"uv": [4, 8, 5.5, 8.5], "texture": "#0"}, + "east": {"uv": [3.5, 5, 4, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [4, 4.5, 5.5, 5], "rotation": 180, "texture": "#0"}, + "west": {"uv": [5.5, 5, 6, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [4, 5, 5.5, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 5, 7.5, 8], "texture": "#0"} + } + }, + { + "name": "blade", + "from": [7.5, 4, 4.5], + "to": [8.5, 22, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 6, 5.5]}, + "faces": { + "north": {"uv": [0, 0.5, 0.5, 9.5], "texture": "#0"}, + "east": {"uv": [3, 0.5, 0.5, 9.5], "texture": "#0"}, + "south": {"uv": [3, 0.5, 3.5, 9.5], "texture": "#0"}, + "west": {"uv": [0.5, 0.5, 3, 9.5], "texture": "#0"}, + "up": {"uv": [0.5, 0, 3, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "blade", + "from": [7.501, 22.001, 4.501], + "to": [8.499, 29.999, 9.499], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7.5, 22, 4.5]}, + "faces": { + "north": {"uv": [3.5, 0.5, 4, 4.5], "texture": "#0"}, + "east": {"uv": [6.5, 0.5, 4, 4.5], "texture": "#0"}, + "south": {"uv": [6.5, 0.5, 7, 4.5], "texture": "#0"}, + "west": {"uv": [4, 0.5, 6.5, 4.5], "texture": "#0"}, + "up": {"uv": [4, 0, 6.5, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7.501, 26.801, 8.601], + "to": [8.499, 25.799, 9.699], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7.5, 26.8, 8.6]}, + "faces": { + "north": {"uv": [4.5, 1.5, 5, 2], "texture": "#0"}, + "south": {"uv": [5.5, 1.5, 6, 2], "texture": "#0"}, + "up": {"uv": [5, 2, 5.5, 2.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [5, 1, 5.5, 1.5], "texture": "#0"} + } + }, + { + "name": "charge", + "from": [7.6, 6, 3.8], + "to": [8.4, 22, 10.2], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 12, 4]}, + "faces": { + "north": {"uv": [4, 4, 4.5, 12], "texture": "#1"}, + "east": {"uv": [1, 4, 4, 12], "texture": "#1"}, + "south": {"uv": [7.5, 4, 8, 12], "texture": "#1"}, + "west": {"uv": [4.5, 4, 7.5, 12], "texture": "#1"} + } + }, + { + "name": "charge", + "from": [7.6, 21.9, 3.8], + "to": [8.4, 30.8, 10.2], + "rotation": {"angle": 22.5, "axis": "x", "origin": [6.5, 22, 4]}, + "faces": { + "north": {"uv": [4, 2.5, 4.5, 5], "texture": "#1"}, + "east": {"uv": [1, 2.5, 4, 5], "texture": "#1"}, + "south": {"uv": [7.5, 2.5, 8, 5], "texture": "#1"}, + "west": {"uv": [4.5, 2.5, 7.5, 5], "texture": "#1"}, + "up": {"uv": [3.5, 0.5, 6, 1], "rotation": 90, "texture": "#1"} + } + }, + { + "name": "battery", + "from": [7.5, 7, 9.6], + "to": [8.5, 8, 11.6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [7.5, 7, 9.6]}, + "faces": { + "east": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 0.5], "texture": "#0"}, + "west": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.5, 13, 1.5], "texture": "#0"} + } + }, + { + "name": "battery", + "from": [7.5, 9, 9.6], + "to": [8.5, 10, 11.6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [7.5, 9, 9.6]}, + "faces": { + "east": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 0.5], "texture": "#0"}, + "west": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.5, 13, 1.5], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, 5.75, 1.25] + }, + "thirdperson_lefthand": { + "translation": [0, 5.75, 1.25] + }, + "firstperson_righthand": { + "rotation": [-35, 0, 0], + "translation": [1.5, 1.5, -3.5] + }, + "firstperson_lefthand": { + "rotation": [-35, 0, 0], + "translation": [1.5, 0, -3.5] + }, + "ground": { + "rotation": [-60, 0, 0], + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [0, 90, 0], + "translation": [0, -1.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "head": { + "rotation": [-127, 0, 0], + "translation": [0, 12.25, 0] + } + } + }, + "perspectives": { + "gui": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + }, + "fixed": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + }, + "ground": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_unpowered.json b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_unpowered.json new file mode 100644 index 000000000..e31c94612 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_unpowered.json @@ -0,0 +1,200 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "overdrive_that_matters:item/falling_sun", + "particle": "overdrive_that_matters:item/falling_sun" + }, + "elements": [ + { + "name": "frame", + "from": [7.999, 8, 9.6], + "to": [8.002, 22, 11.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 11, 10.6]}, + "faces": { + "east": {"uv": [11.5, 0, 10.5, 7], "texture": "#0"}, + "west": {"uv": [10.5, 0, 11.5, 7], "texture": "#0"} + } + }, + { + "name": "frame", + "from": [8, 22, 9.6], + "to": [8, 29, 11.6], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 22, 9.6]}, + "faces": { + "east": {"uv": [12.5, 0, 11.5, 3.5], "texture": "#0"}, + "west": {"uv": [11.5, 0, 12.5, 3.5], "texture": "#0"} + } + }, + { + "name": "cap", + "from": [7.4, 6, 7.6], + "to": [8.6, 11, 9.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 7, 7.6]}, + "faces": { + "north": {"uv": [7.5, 4, 8, 6.5], "texture": "#0"}, + "east": {"uv": [9, 4, 8, 6.5], "texture": "#0"}, + "south": {"uv": [9, 4, 9.5, 6.5], "texture": "#0"}, + "west": {"uv": [8, 4, 9, 6.5], "texture": "#0"}, + "up": {"uv": [8, 3.5, 9, 4], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "handle", + "from": [7, -5, 4], + "to": [9, -4, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -5, 7]}, + "faces": { + "north": {"uv": [8, 10, 9, 10.5], "texture": "#0"}, + "east": {"uv": [7.5, 7, 8, 10], "rotation": 270, "texture": "#0"}, + "south": {"uv": [8, 6.5, 9, 7], "texture": "#0"}, + "west": {"uv": [7.5, 7, 8, 10], "rotation": 90, "texture": "#0"}, + "up": {"uv": [8, 7, 9, 10], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 7, 10, 10], "texture": "#0"} + } + }, + { + "name": "handle", + "from": [8, -4, 4.6], + "to": [8, 3, 7.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, -3, 5.6]}, + "faces": { + "east": {"uv": [9, 0, 10.5, 3.5], "texture": "#0"}, + "west": {"uv": [10.5, 0, 9, 3.5], "texture": "#0"} + } + }, + { + "name": "handle", + "from": [7.5, -4, 7.2], + "to": [8.5, 3, 9.2], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, -3, 7.2]}, + "faces": { + "north": {"uv": [7, 0, 7.5, 3.5], "texture": "#0"}, + "east": {"uv": [8.5, 0, 7.5, 3.5], "texture": "#0"}, + "south": {"uv": [8.5, 0, 9, 3.5], "texture": "#0"}, + "west": {"uv": [7.5, 0, 8.5, 3.5], "texture": "#0"} + } + }, + { + "name": "guard", + "from": [6.5, 5, 4], + "to": [9.5, 6, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 5, 7]}, + "faces": { + "north": {"uv": [4, 8, 5.5, 8.5], "texture": "#0"}, + "east": {"uv": [3.5, 5, 4, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [4, 4.5, 5.5, 5], "rotation": 180, "texture": "#0"}, + "west": {"uv": [5.5, 5, 6, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [4, 5, 5.5, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 5, 7.5, 8], "texture": "#0"} + } + }, + { + "name": "guard", + "from": [6.5, 3, 4], + "to": [9.5, 4, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 3, 7]}, + "faces": { + "north": {"uv": [4, 8, 5.5, 8.5], "texture": "#0"}, + "east": {"uv": [3.5, 5, 4, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [4, 4.5, 5.5, 5], "rotation": 180, "texture": "#0"}, + "west": {"uv": [5.5, 5, 6, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [4, 5, 5.5, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 5, 7.5, 8], "texture": "#0"} + } + }, + { + "name": "blade", + "from": [7.5, 4, 4.5], + "to": [8.5, 22, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 6, 5.5]}, + "faces": { + "north": {"uv": [0, 0.5, 0.5, 9.5], "texture": "#0"}, + "east": {"uv": [3, 0.5, 0.5, 9.5], "texture": "#0"}, + "south": {"uv": [3, 0.5, 3.5, 9.5], "texture": "#0"}, + "west": {"uv": [0.5, 0.5, 3, 9.5], "texture": "#0"}, + "up": {"uv": [0.5, 0, 3, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "blade", + "from": [7.501, 22.001, 4.501], + "to": [8.499, 29.999, 9.499], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7.5, 22, 4.5]}, + "faces": { + "north": {"uv": [3.5, 0.5, 4, 4.5], "texture": "#0"}, + "east": {"uv": [6.5, 0.5, 4, 4.5], "texture": "#0"}, + "south": {"uv": [6.5, 0.5, 7, 4.5], "texture": "#0"}, + "west": {"uv": [4, 0.5, 6.5, 4.5], "texture": "#0"}, + "up": {"uv": [4, 0, 6.5, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7.501, 26.801, 8.601], + "to": [8.499, 25.799, 9.699], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7.5, 26.8, 8.6]}, + "faces": { + "north": {"uv": [4.5, 1.5, 5, 2], "texture": "#0"}, + "south": {"uv": [5.5, 1.5, 6, 2], "texture": "#0"}, + "up": {"uv": [5, 2, 5.5, 2.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [5, 1, 5.5, 1.5], "texture": "#0"} + } + }, + { + "name": "battery", + "from": [7.5, 6.5, 8.6], + "to": [8.5, 7.5, 10.6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [7.5, 6.5, 8.6]}, + "faces": { + "east": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 0.5], "texture": "#0"}, + "west": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.5, 13, 1.5], "texture": "#0"} + } + }, + { + "name": "battery", + "from": [7.5, 8.5, 8.6], + "to": [8.5, 9.5, 10.6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [7.5, 8.5, 8.6]}, + "faces": { + "east": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 0.5], "texture": "#0"}, + "west": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.5, 13, 1.5], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, 5.75, 1.25] + }, + "thirdperson_lefthand": { + "translation": [0, 5.75, 1.25] + }, + "firstperson_righthand": { + "rotation": [-35, 0, 0], + "translation": [1.5, 1.5, -3.5] + }, + "firstperson_lefthand": { + "rotation": [-35, 0, 0], + "translation": [1.5, 0, -3.5] + }, + "ground": { + "rotation": [-60, 0, 0], + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [0, 90, 0], + "translation": [0, -1.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "head": { + "rotation": [-127, 0, 0], + "translation": [0, 12.25, 0] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun.png b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun.png new file mode 100644 index 0000000000000000000000000000000000000000..5b17b37440da093130b53fd53bc3a40b2c2511ef GIT binary patch literal 691 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCikV0(?ST|NsAA6dIE3+AZW+?+uY63e03s9wjk+A{e0*I*~8(9}XOqv2@g8&oITqdx}AWI7%3#!Y|zyKt> zTw~w5-=YWK0GYo$T^vI!{NGOSEIVw#<80dgF+l6#-}g}y7D<`Es*Wv**3mirgGrH{ z({P!JP?4T%R`%L!TILhAmI?4INMN}7d)vzG@r^RUi~$@6w#l}8STF1spD^)&k5g-( zv#^xg8*zn4D^yif?%Za$ki-<&ZX7MZm1O2t!@h=jUTXoTO2$cj2KTFlek|<^Gx-zl zC}oNMaEoEEn58f`@_YaB&z-FQ54N)WS>Yth@crI(mbVSRHZaWjyS!yihscG`#)+&m z+?&4it$(bg#(IiD=irlhp5A;8+Pm%;`#LbZxaUwD^U&t|?SHd&s_kLSZdxC_pGo1* k(X9;cf3dgyt=kkPkEHTwydOzp2ty;Xo{JO{t1#o53|WRvCM$** zk3_ah8jq%tvUx{T>_(dqdE^!8y5F?@?!CYLf4}oPkN^43`Of*B$CpNRu~$S9PyhfZ zIy%_UAWQ@R7=V<8sHep-=OF}(rrBEoH9b3~Ax0+H@|Yz6)McSJ{XvMAk8+?#1Hd+k z6kw_(Cl(~c$JlzsxSa`#iS<7h2vGe)BV))ew(dk@vH{ufQ!}Cg(rF0vatv~G+zTKf z1_TH&5ONCuP7tVnrKMj(f+4=h;Sg;Ag98`{dqWVKD)U7i2GP><;XDkOLi`W^%_#s~ z@#Fv*NK@a?NFOHn%c|5PDEQ0L6^ND|IAj<8MU!^uAVhtA%RpaWdYftbz;giC>;eGD zVn-WG_c-78*N^6m9#FVcZfdf4;D_2rx$18S^zyLg1?6T3&k6Fq?l__w(<9^^_fU{xilY*)}&ABy^Ig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zx=8&4Rr`6A60ohleX%m*fyAvLHz!FM$qvQ4HYQ#La2?Lml~io7!cIh zL{yFZ$^CWP`>kN=BT6uXf?!^ibQv$*oSweJm;Zcc%<=zc{DT#CUS1NcE=;6n9;@9i P{c&-$b+M_j@=N{?umegr literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png.mcmeta b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png.mcmeta new file mode 100644 index 000000000..b14454b15 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png.mcmeta @@ -0,0 +1 @@ +{ "animation": { "frametime": 1 } } \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_icon.png b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b9e3bc6e77ed7cfdbdd47bf9578368f73e2926b1 GIT binary patch literal 547 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}Z0G|-oI5*e-|Nq~-c{9+~wkkR**~>G`!9iD7wJFdr?l_PVE(!7r2AY5d7&g`3;Q&f=7I;J!GcfQS1YyP< z6SLm}1tm&cBT9nv(@M${i&7Z^5;OBk^!!{y6ioFD^^AV+VcrH*vn@5kGtJXeiveT` zD}xjxD+42tjH>LQ-Ev`U;>)U1XdYjX#r$Gbr~8MfMl0z>|6I+ z^xzvHGtbk-F+?Lc_G~m?g94As#UO9puXq3IUvun`c-~!nnWgLgzQ%c_2~&hVn=q-K zoaNr&nqJGiv9nfBV`j?i4PqTjcTKspul4MM=dus4M$HnObJr(5=DPs5^&Ye98{W3> ocf0ZJv(-937K Date: Tue, 4 Mar 2025 14:15:04 +0300 Subject: [PATCH 3/6] =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83?= =?UTF-8?q?=D1=80=D0=B0=D1=82=D0=BE=D1=80=20=D0=B4=D0=BB=D1=8F=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BF=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BA=20#341?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/otm/datagen/items/ItemModels.kt | 11 ++ .../mc/otm/datagen/lang/English.kt | 11 ++ .../mc/otm/datagen/lang/Russian.kt | 11 ++ .../mc/otm/block/entity/MatteryBlockEntity.kt | 15 +++ .../block/entity/MatteryDeviceBlockEntity.kt | 20 ++-- .../block/entity/MatteryWorkerBlockEntity.kt | 2 +- .../BlackHoleGeneratorBlockEntity.kt | 6 +- .../entity/decorative/HoloSignBlockEntity.kt | 14 +-- .../entity/decorative/PainterBlockEntity.kt | 2 +- .../entity/matter/MatterBottlerBlockEntity.kt | 4 +- .../entity/matter/MatterPanelBlockEntity.kt | 2 +- .../entity/storage/DriveRackBlockEntity.kt | 6 +- .../entity/storage/StorageBusBlockEntity.kt | 2 +- .../block/entity/storage/StorageInterfaces.kt | 2 +- .../entity/tech/EnergyCounterBlockEntity.kt | 2 +- .../mc/otm/item/ConfiguratorItem.kt | 111 ++++++++++++++++++ .../ru/dbotthepony/mc/otm/registry/MNames.kt | 1 + .../dbotthepony/mc/otm/registry/MRegistry.kt | 7 ++ .../mc/otm/registry/game/MCreativeTabs.kt | 1 + .../otm/registry/game/MDataComponentTypes.kt | 33 ++++++ .../mc/otm/registry/game/MItems.kt | 3 + .../ru/dbotthepony/mc/otm/server/Ext.kt | 9 ++ .../textures/item/configurator.png | Bin 0 -> 2677 bytes .../textures/item/configurator_ready.png | Bin 0 -> 2679 bytes 24 files changed, 244 insertions(+), 31 deletions(-) create mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/item/ConfiguratorItem.kt create mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/server/Ext.kt create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/configurator.png create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/configurator_ready.png diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt index f071a31a6..1c4bc7248 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt @@ -114,6 +114,17 @@ fun addItemModels(provider: MatteryItemModelProvider) { provider.handheld(MItems.CHEST_UPGRADER) + provider.exec { + val path = MItems.CONFIGURATOR.registryName!!.path + + val ready = provider.withExistingParent("${path}_ready", MatteryItemModelProvider.HANDHELD) + .texture("layer0", modLocation("item/${path}_ready")) + + provider.withExistingParent(path, MatteryItemModelProvider.HANDHELD) + .texture("layer0", modLocation("item/$path")) + .override().predicate(modLocation("has_configuration_saved"), 1f).model(ready).end() + } + provider.generated(MItems.BREAD_MONSTER_SPAWN_EGG, modLocation("item/egg/bread_monster")) provider.generated(MItems.LOADER_SPAWN_EGG, modLocation("item/egg/loader")) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index 35455c300..77f5db3cb 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -924,6 +924,12 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.CHEST_UPGRADER, "desc", "Replaces placed chests and barrels with cargo crates while keeping storage contents") add(MItems.CHEST_UPGRADER, "desc2", "Hold desired crates in the opposite hand") + add(MItems.CONFIGURATOR, "Configurator") + add(MItems.CONFIGURATOR, "desc", "Copies configuration from one block to another") + add(MItems.CONFIGURATOR, "desc2", "Sneak-use on block to copy, use to paste") + add(MItems.CONFIGURATOR, "desc3", "Use on air while sneaking to clear saved configuration") + add(MItems.CONFIGURATOR, "desc_saved", "Saved configuration for: %s") + add(MItems.BREAD_MONSTER_SPAWN_EGG, "Bread Monster Spawn Egg") add(MEntityTypes.BREAD_MONSTER, "Bread Monster") @@ -981,6 +987,11 @@ private fun gui(provider: MatteryLanguageProvider) { gui("flow_direction_set", "Flow direction set to %s") gui("tick_timer_set", "Timer set to %s ticks") + gui("config_copied", "Copied configuration for %s") + gui("config_pasted", "Applied saved configuration") + gui("config_cleared", "Configuration cleared") + gui("config_missing", "No configuration to apply") + gui("black_hole_generator.help0", "Generates energy using angular momentum of Singularities") gui("black_hole_generator.help1", "The stronger gravity Singularity has, the more power is generated!") gui("black_hole_generator.help2", "Using Spacetime Normalizers will reduce gravitation strength of Singularity, which will reduce power output.") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt index f0bb29256..48235c695 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt @@ -917,6 +917,12 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.CHEST_UPGRADER, "desc", "Заменяет установленные сундуки и бочки грузовыми ящиками с сохранением содержимого") add(MItems.CHEST_UPGRADER, "desc2", "Удерживайте необходимые ящики в противоположной руке") + add(MItems.CONFIGURATOR, "Конфигуратор") + add(MItems.CONFIGURATOR, "desc", "Копирует настройки между блоками") + add(MItems.CONFIGURATOR, "desc2", "Использование крадясь на блоке копирует настройки, простое использование применяет") + add(MItems.CONFIGURATOR, "desc3", "Используйте крадясь на воздухе для очистки") + add(MItems.CONFIGURATOR, "desc_saved", "Сохранены настройки для: %s") + add(MItems.BREAD_MONSTER_SPAWN_EGG, "Яйцо призыва хлебного монстра") add(MEntityTypes.BREAD_MONSTER, "Хлебный монстр") @@ -974,6 +980,11 @@ private fun gui(provider: MatteryLanguageProvider) { gui("flow_direction_set", "Направление потока установлено на %s") gui("tick_timer_set", "Таймер установлен на %s тиков") + gui("config_copied", "Скопированы настройки для %s") + gui("config_pasted", "Настройки применены") + gui("config_cleared", "Настройки очищены") + gui("config_missing", "Нет настроек для применения") + gui("black_hole_generator.help0", "Генерирует электричество используя угловое ускорение сингулярностей") gui("black_hole_generator.help1", "Чем сильнее гравитационное поле сингулярности, тем больше генерация!") gui("black_hole_generator.help2", "Использование стабилизаторов пространства-времени ослабляет гравитационное поле, снижая генерацию") diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt index 40941bf09..ab8ad4363 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt @@ -96,6 +96,11 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc */ protected val savetablesLevel = Savetables() + /** + * Savetables for things configured from user input + */ + protected val savetablesConfig = Savetables() + /** * "shortcut" for getting [BlockRotation] * @@ -269,6 +274,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc */ open fun saveShared(nbt: CompoundTag, registry: Provider) { savetables.serializeNBT(nbt, registry) + saveConfiguration(nbt, registry) } /** @@ -282,6 +288,15 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc super.loadAdditional(nbt, registry) savetables.deserializeNBT(registry, nbt) savetablesLevel.deserializeNBT(registry, nbt) + loadConfiguration(nbt, registry) + } + + fun saveConfiguration(nbt: CompoundTag, registry: Provider) { + savetablesConfig.serializeNBT(nbt, registry) + } + + fun loadConfiguration(nbt: CompoundTag, registry: Provider) { + savetablesConfig.deserializeNBT(registry, nbt) } @Suppress("OVERRIDE_DEPRECATION") diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryDeviceBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryDeviceBlockEntity.kt index 71085dd64..4580fcefe 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryDeviceBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryDeviceBlockEntity.kt @@ -56,7 +56,7 @@ abstract class MatteryDeviceBlockEntity(blockEntityType: BlockEntityType<*>, blo } init { - savetables.stateful(::redstoneControl, REDSTONE_CONTROL_KEY) + savetablesConfig.stateful(::redstoneControl, REDSTONE_CONTROL_KEY) } protected open val defaultDisplayName: Component @@ -146,9 +146,9 @@ abstract class MatteryDeviceBlockEntity(blockEntityType: BlockEntityType<*>, blo init { // https://tenor.com/view/simp-metal-gear-liquid-snake-running-gif-16717852 - savetables.enum(::flow, "fluid_${side}_flow", FlowDirection::valueOf) - savetables.bool(::automatePull, "fluid_${side}_pull") - savetables.bool(::automatePush, "fluid_${side}_push") + savetablesConfig.enum(::flow, "fluid_${side}_flow", FlowDirection::valueOf) + savetablesConfig.bool(::automatePull, "fluid_${side}_pull") + savetablesConfig.bool(::automatePush, "fluid_${side}_push") } var flow by syncher.enum(possibleModes, setter = { access, value -> @@ -375,9 +375,9 @@ abstract class MatteryDeviceBlockEntity(blockEntityType: BlockEntityType<*>, blo } init { - savetables.enum(::energyFlow, "energy_${side}_flow", FlowDirection::valueOf) - savetables.bool(::automatePull, "energy_${side}_pull") - savetables.bool(::automatePush, "energy_${side}_push") + savetablesConfig.enum(::energyFlow, "energy_${side}_flow", FlowDirection::valueOf) + savetablesConfig.bool(::automatePull, "energy_${side}_pull") + savetablesConfig.bool(::automatePush, "energy_${side}_push") dirtyListeners.addListener(Runnable { updateTickerState() @@ -626,9 +626,9 @@ abstract class MatteryDeviceBlockEntity(blockEntityType: BlockEntityType<*>, blo } init { - savetables.bool(::automatePull, "itemhandler_${side}_automatePull") - savetables.bool(::automatePush, "itemhandler_${side}_automatePush") - savetables.enum(::mode, "itemhandler_${side}_mode", ItemHandlerMode::valueOf) + savetablesConfig.bool(::automatePull, "itemhandler_${side}_automatePull") + savetablesConfig.bool(::automatePush, "itemhandler_${side}_automatePush") + savetablesConfig.enum(::mode, "itemhandler_${side}_mode", ItemHandlerMode::valueOf) waitForServerLevel { redstoneControl.addListener(::updateTickerState) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryWorkerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryWorkerBlockEntity.kt index 7b207ba54..4df7cc662 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryWorkerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryWorkerBlockEntity.kt @@ -73,7 +73,7 @@ abstract class MatteryWorkerBlockEntity( var balanceInputs = false init { - savetables.bool(::balanceInputs) + savetablesConfig.bool(::balanceInputs) } protected open fun jobUpdated(new: JobType?, old: JobType?, id: Int) {} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleGeneratorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleGeneratorBlockEntity.kt index 2c3ab16f5..84c9bba76 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleGeneratorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleGeneratorBlockEntity.kt @@ -118,9 +118,9 @@ class BlackHoleGeneratorBlockEntity(blockPos: BlockPos, blockState: BlockState) exposeSideless(MatteryCapability.BLOCK_ENERGY, energy) exposeSideless(Capabilities.EnergyStorage.BLOCK, energy) - savetables.enum(::mode, map = Mode::valueOf) - savetables.decimal(::injectionRate) - savetables.decimal(::targetMass) + savetablesConfig.enum(::mode, map = Mode::valueOf) + savetablesConfig.decimal(::injectionRate) + savetablesConfig.decimal(::targetMass) } private fun findBlackHoleRange(): Int { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/HoloSignBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/HoloSignBlockEntity.kt index e6125efa4..02062bea9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/HoloSignBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/HoloSignBlockEntity.kt @@ -64,16 +64,16 @@ class HoloSignBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryB var isLocked = false init { - savetables.string(::signText) + savetablesConfig.string(::signText) savetablesLevel.bool(::isLocked) - savetables.stateful(::redstoneControl) + savetablesConfig.stateful(::redstoneControl) - savetables.float(::textRed) - savetables.float(::textGreen) - savetables.float(::textBlue) - savetables.float(::textAlpha) + savetablesConfig.float(::textRed) + savetablesConfig.float(::textGreen) + savetablesConfig.float(::textBlue) + savetablesConfig.float(::textAlpha) - savetables.bool(::textAutoScale) + savetablesConfig.bool(::textAutoScale) } override fun createMenu(p_39954_: Int, p_39955_: Inventory, p_39956_: Player): AbstractContainerMenu { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/PainterBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/PainterBlockEntity.kt index 94311cead..59733f0ed 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/PainterBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/PainterBlockEntity.kt @@ -82,7 +82,7 @@ class PainterBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryDe init { addDroppableContainer(dyeInput) savetables.stateful(dyeInput, INVENTORY_KEY) - savetables.bool(::isBulk) + savetablesConfig.bool(::isBulk) exposeGlobally(Capabilities.FluidHandler.BLOCK, this) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt index 17aae98fe..dd474603b 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt @@ -112,8 +112,8 @@ class MatterBottlerBlockEntity(blockPos: BlockPos, blockState: BlockState) : exposeGlobally(MatteryCapability.MATTER_BLOCK, matter) exposeGlobally(MatteryCapability.MATTER_NODE, matterNode) - savetables.bool(::isBottling) - savetables.bool(::spitItemsWhenCantWork) + savetablesConfig.bool(::isBottling) + savetablesConfig.bool(::spitItemsWhenCantWork) savetables.stateful(::energy, ENERGY_KEY) savetables.stateful(::matter, MATTER_STORAGE_KEY) savetables.stateful(::bottling) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterPanelBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterPanelBlockEntity.kt index 41490ae5b..8a5dc7ad7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterPanelBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterPanelBlockEntity.kt @@ -84,7 +84,7 @@ class MatterPanelBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matte exposeGlobally(MatteryCapability.MATTER_NODE, matterNode) exposeGlobally(MatteryCapability.REPLICATION_TASK, this) - savetables.bool(::isProvidingTasks) + savetablesConfig.bool(::isProvidingTasks) } override fun setLevel(level: Level) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveRackBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveRackBlockEntity.kt index 66b0ca54a..877a2d08a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveRackBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveRackBlockEntity.kt @@ -63,9 +63,9 @@ class DriveRackBlockEntity(blockPos: BlockPos, blockState: BlockState) : Mattery savetables.stateful(::energy, ENERGY_KEY) savetables.stateful(::container, INVENTORY_KEY) exposeGlobally(MatteryCapability.STORAGE_NODE, cell) - savetables.int(::insertPriority) - savetables.int(::extractPriority) - savetables.enum(::mode, map = FlowDirection::valueOf) + savetablesConfig.int(::insertPriority) + savetablesConfig.int(::extractPriority) + savetablesConfig.enum(::mode, map = FlowDirection::valueOf) redstoneControl.addListener(Consumer { cell.isDetached = it diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageBusBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageBusBlockEntity.kt index b5afdb850..9430419f0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageBusBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageBusBlockEntity.kt @@ -131,7 +131,7 @@ class StorageBusBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matter } init { - savetables.codec(::filter, ItemFilter.CODEC, FILTER_KEY, Supplier { ItemFilter(MAX_FILTERS) }) + savetablesConfig.codec(::filter, ItemFilter.CODEC, FILTER_KEY, Supplier { ItemFilter(MAX_FILTERS) }) } override fun setLevel(level: Level) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt index 1a66a0424..17aa2e953 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt @@ -112,7 +112,7 @@ abstract class AbstractStorageImportExport( } init { - savetables.codec(::filter, ItemFilter.CODEC, FILTER_KEY, Supplier { ItemFilter(MAX_FILTERS) }) + savetablesConfig.codec(::filter, ItemFilter.CODEC, FILTER_KEY, Supplier { ItemFilter(MAX_FILTERS) }) } companion object { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/EnergyCounterBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/EnergyCounterBlockEntity.kt index dbe0da7a2..80b12d46f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/EnergyCounterBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/EnergyCounterBlockEntity.kt @@ -78,7 +78,7 @@ class EnergyCounterBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Mat } init { - savetables.int(::displayChartOnBlock) + savetablesConfig.int(::displayChartOnBlock) savetables.stateful(::history5s) savetables.stateful(::history15s) savetables.stateful(::history1m) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ConfiguratorItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/ConfiguratorItem.kt new file mode 100644 index 000000000..b7799e9df --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/ConfiguratorItem.kt @@ -0,0 +1,111 @@ +package ru.dbotthepony.mc.otm.item + +import net.minecraft.nbt.CompoundTag +import net.minecraft.network.chat.Component +import net.minecraft.server.level.ServerPlayer +import net.minecraft.world.InteractionHand +import net.minecraft.world.InteractionResult +import net.minecraft.world.InteractionResultHolder +import net.minecraft.world.entity.player.Player +import net.minecraft.world.item.ItemStack +import net.minecraft.world.item.TooltipFlag +import net.minecraft.world.item.context.UseOnContext +import net.minecraft.world.level.Level +import net.minecraft.world.level.block.Blocks +import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity +import ru.dbotthepony.mc.otm.core.TextComponent +import ru.dbotthepony.mc.otm.core.TranslatableComponent +import ru.dbotthepony.mc.otm.registry.game.MDataComponentTypes +import ru.dbotthepony.mc.otm.server.sendActionBarMessage + +class ConfiguratorItem : MatteryItem(Properties().stacksTo(1)) { + init { + addSimpleDescription() + addSimpleDescription("2") + addSimpleDescription("3") + } + + override fun appendHoverText( + stack: ItemStack, + context: TooltipContext, + components: MutableList, + tooltipType: TooltipFlag + ) { + super.appendHoverText(stack, context, components, tooltipType) + + val tag = getConfiguration(stack) + val block = stack.getOrDefault(MDataComponentTypes.Configurator.BLOCK, Blocks.AIR.defaultBlockState()) + if (!tag.isEmpty && !block.isAir) { + components.add(TranslatableComponent("$descriptionId.desc_saved", block.block.name)) + } + } + + override fun use(level: Level, player: Player, hand: InteractionHand): InteractionResultHolder { + if (player is ServerPlayer && player.isCrouching) { + val stack = player.getItemInHand(hand) + + setConfiguration(stack, CompoundTag()) + stack.set(MDataComponentTypes.Configurator.BLOCK, Blocks.AIR.defaultBlockState()) + + player.sendActionBarMessage(TranslatableComponent("otm.gui.config_cleared")) + + return InteractionResultHolder.success(stack) + } + + return super.use(level, player, hand) + } + + override fun onItemUseFirst(stack: ItemStack, context: UseOnContext): InteractionResult { + val player = context.player + if (player == null) return super.useOn(context) + + val level = context.level + + val tile = level.getBlockEntity(context.clickedPos) + if (tile == null || tile !is MatteryBlockEntity) return super.useOn(context) + + if (player.isCrouching == true) { + if (player is ServerPlayer) { + val tag = CompoundTag() + tile.saveConfiguration(tag, level.registryAccess()) + + if (tag.isEmpty) return super.onItemUseFirst(stack, context) + + setConfiguration(stack, tag) + + val block = level.getBlockState(context.clickedPos) + stack.set(MDataComponentTypes.Configurator.BLOCK, block) + + player.sendActionBarMessage(TranslatableComponent("otm.gui.config_copied", block.block.name)) + } + + return InteractionResult.SUCCESS + } + + val tag = getConfiguration(stack) + if (!tag.isEmpty) { + if (player is ServerPlayer) { + tile.loadConfiguration(tag, level.registryAccess()) + player.sendActionBarMessage(TranslatableComponent("otm.gui.config_pasted")) + } + + return InteractionResult.SUCCESS + } else { + if (player is ServerPlayer) { + player.sendActionBarMessage(TranslatableComponent("otm.gui.config_missing")) + } + + return InteractionResult.FAIL + } + + return super.useOn(context) + } + + fun getConfiguration(stack: ItemStack): CompoundTag { + return stack.getOrDefault(MDataComponentTypes.Configurator.CONFIGURATION, CompoundTag()) + } + + fun setConfiguration(stack: ItemStack, tag: CompoundTag) { + stack.set(MDataComponentTypes.Configurator.CONFIGURATION, tag) + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt index a283cc490..6967c5d02 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt @@ -199,6 +199,7 @@ object MNames { const val PLASMA_RIFLE = "plasma_rifle" const val CHEST_UPGRADER = "chest_upgrader" + const val CONFIGURATOR = "configurator" const val WITHERED_STEEL_SWORD = "withered_steel_sword" diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt index b0a70f9d3..0cf69e5f3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt @@ -6,6 +6,7 @@ import net.minecraft.core.BlockPos import net.minecraft.core.cauldron.CauldronInteraction import net.minecraft.core.component.DataComponents import net.minecraft.core.registries.BuiltInRegistries +import net.minecraft.nbt.CompoundTag import net.minecraft.world.entity.EntityType import net.minecraft.world.item.DyeColor import net.minecraft.world.item.Item @@ -43,6 +44,7 @@ import ru.dbotthepony.mc.otm.isClient import ru.dbotthepony.mc.otm.item.armor.TritaniumArmorItem import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem import ru.dbotthepony.mc.otm.item.weapon.FallingSunItem +import ru.dbotthepony.mc.otm.registry.game.MDataComponentTypes import ru.dbotthepony.mc.otm.registry.game.MItems import ru.dbotthepony.mc.otm.registry.game.MStats import ru.dbotthepony.mc.otm.registry.objects.ColoredDecorativeBlock @@ -316,6 +318,11 @@ object MRegistry : IBlockItemRegistryAcceptor { } } } + + ItemProperties.register(MItems.CONFIGURATOR, ResourceLocation(OverdriveThatMatters.MOD_ID, "has_configuration_saved")) { stack, _, _, _ -> + val tag = stack.getOrDefault(MDataComponentTypes.Configurator.CONFIGURATION, CompoundTag()) + if (tag.isEmpty) 0f else 1f + } } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MCreativeTabs.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MCreativeTabs.kt index 3bea5d150..0d13a7607 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MCreativeTabs.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MCreativeTabs.kt @@ -263,6 +263,7 @@ private fun addMainCreativeTabItems(consumer: CreativeModeTab.Output) { accept(MItems.GRAVITATIONAL_DISRUPTOR) accept(MItems.CHEST_UPGRADER) + accept(MItems.CONFIGURATOR) accept(MItems.ESSENCE_SERVO) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MDataComponentTypes.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MDataComponentTypes.kt index 21d568866..1817fed3a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MDataComponentTypes.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MDataComponentTypes.kt @@ -5,9 +5,11 @@ import com.mojang.serialization.Codec import net.minecraft.core.UUIDUtil import net.minecraft.core.component.DataComponentType import net.minecraft.core.registries.BuiltInRegistries +import net.minecraft.nbt.CompoundTag import net.minecraft.network.RegistryFriendlyByteBuf import net.minecraft.network.codec.StreamCodec import net.minecraft.util.StringRepresentable +import net.minecraft.world.level.block.state.BlockState import net.neoforged.bus.api.IEventBus import net.neoforged.neoforge.fluids.SimpleFluidContent import ru.dbotthepony.mc.otm.capability.FlowDirection @@ -17,6 +19,7 @@ import ru.dbotthepony.mc.otm.core.math.Decimal import ru.dbotthepony.mc.otm.data.codec.DecimalCodec import ru.dbotthepony.mc.otm.item.tool.RedstoneInteractorItem import ru.dbotthepony.mc.otm.network.StreamCodecs +import ru.dbotthepony.mc.otm.network.streamCodec import ru.dbotthepony.mc.otm.registry.MDeferredRegister import java.util.UUID @@ -34,6 +37,16 @@ object MDataComponentTypes { } } + private class CompoundTagComponent : DataComponentType { + override fun codec(): Codec { + return CompoundTag.CODEC + } + + override fun streamCodec(): StreamCodec { + return CompoundTag.CODEC.streamCodec() + } + } + val FLUID_STACK by registry.register("fluid_stack") { object : DataComponentType { override fun codec(): Codec { @@ -81,6 +94,26 @@ object MDataComponentTypes { } } + object Configurator { + val BLOCK: DataComponentType by registry.register("configurator_block") { + object : DataComponentType { + override fun codec(): Codec? { + return BlockState.CODEC + } + + override fun streamCodec(): StreamCodec { + return BlockState.CODEC.streamCodec() + } + + } + } + val CONFIGURATION: DataComponentType by registry.register("configurator_configuration") { CompoundTagComponent() } + } + + init { + Configurator + } + fun register(bus: IEventBus) { registry.register(bus) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt index fd87871a6..d9b809861 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt @@ -43,6 +43,7 @@ import ru.dbotthepony.mc.otm.core.collect.SupplierMap 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.ConfiguratorItem import ru.dbotthepony.mc.otm.item.CrudeBatteryItem import ru.dbotthepony.mc.otm.item.EssenceServoItem import ru.dbotthepony.mc.otm.item.FluidCapsuleItem @@ -674,6 +675,8 @@ object MItems { 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) } + val CONFIGURATOR: Item by registry.register(MNames.CONFIGURATOR) { ConfiguratorItem() } + init { MRegistry.registerItems(registry) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/server/Ext.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/server/Ext.kt new file mode 100644 index 000000000..31f82fd91 --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/server/Ext.kt @@ -0,0 +1,9 @@ +package ru.dbotthepony.mc.otm.server + +import net.minecraft.network.chat.Component +import net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket +import net.minecraft.server.level.ServerPlayer + +fun ServerPlayer.sendActionBarMessage(component: Component) { + this.connection.send(ClientboundSetActionBarTextPacket(component)) +} diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/configurator.png b/src/main/resources/assets/overdrive_that_matters/textures/item/configurator.png new file mode 100644 index 0000000000000000000000000000000000000000..e9147615fb9f42120951dbb01165878e6f488f3f GIT binary patch literal 2677 zcmZ8jc{Cg77Ed%JikaxBYEcrYqH5pQ(x`oz5L;1dr_nx3Q%l7XgI0$|thJ4;YO9to zMT)AlXrrOFs??w*4HNqwdC{43-Z}4{bHDq$%Xjbn?)m<>=?-@0LdVY>2LJ#|K$G_1#n$i zU;v04siLN?0xbI{>rqACvVSrWx%h~9xOsVgM51(cxai+oswyf+-ZF{uc4tt}Gw#a~ zmPivP3v0tM%gn04DDaB9L9aeNy5?D3$KbS%7)Z2iCgIG-gc}HicQ238rOG%ELIj3@ z`{$jM)@lN1AqL9 z>nxqFaZz14ZxG3--8AN~ICooXO#S4mps(CRdlIqGr5^g>D#NXu6l_bspcgttp+HO_ zuqfp}rq6z%pXIe7I&4s`aay|cJucccOxB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KhS_f6WVOY`Z zqn~v-PfFwb0x&&5KxNE{q!S15xroh~2l(&46*pypUG{1u1fD1hq>W{Q1Et}{a<3 Date: Tue, 4 Mar 2025 15:00:12 +0300 Subject: [PATCH 4/6] =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD=20+=20=D0=BA?= =?UTF-8?q?=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=80=D0=B5=D1=86=D0=B5=D0=BF=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GearShocky — Сегодня, в 14:35 сканер сингулярностей его кстати переделать нужно --- .../dbotthepony/mc/otm/datagen/lang/English.kt | 1 + .../dbotthepony/mc/otm/datagen/lang/Russian.kt | 1 + .../mc/otm/datagen/recipes/ComponentRecipes.kt | 6 ++++++ .../otm/datagen/recipes/CraftingTableRecipes.kt | 14 +++++++------- .../mc/otm/datagen/recipes/DecorativesRecipes.kt | 4 ++-- .../ru/dbotthepony/mc/otm/registry/MNames.kt | 1 + .../dbotthepony/mc/otm/registry/game/MItems.kt | 3 +++ .../textures/item/component/display_screen.png | Bin 0 -> 2437 bytes 8 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 src/main/resources/assets/overdrive_that_matters/textures/item/component/display_screen.png diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index 77f5db3cb..d06fb62f0 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -826,6 +826,7 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.REINFORCED_IRON_PLATE, "desc", "A sturdier and more durable Iron Plate") add(MItems.ARMOR_ASSEMBLY, "Armor assembly") add(MItems.CARBON_MESH, "Carbon Mesh") + add(MItems.DISPLAY_SCREEN, "Display Screen") add(MItems.GRAVITATIONAL_DISRUPTOR, "Spacetime Equalizer") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt index 48235c695..77d971421 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt @@ -819,6 +819,7 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.REINFORCED_IRON_PLATE, "desc", "Более надёжная и прочная железная пластина") add(MItems.ARMOR_ASSEMBLY, "Стройка брони") add(MItems.CARBON_MESH, "Углеродная сетка") + add(MItems.DISPLAY_SCREEN, "Экран дисплея") add(MItems.GRAVITATIONAL_DISRUPTOR, "Маяк уравнения пространства-времени") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/ComponentRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/ComponentRecipes.kt index f243ef97d..fc4822754 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/ComponentRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/ComponentRecipes.kt @@ -100,4 +100,10 @@ fun addComponentRecipes(consumer: RecipeOutput) { .row(MItemTags.COPPER_WIRES, MItems.MECHANICAL_PARTS, MItemTags.COPPER_WIRES) .unlockedBy(MItems.ELECTROMAGNET) .build(consumer) + + MatteryRecipe(MItems.DISPLAY_SCREEN, 3) + .row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_GLOWSTONE, Tags.Items.GLASS_PANES_COLORLESS) + .row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_REDSTONE, Tags.Items.GLASS_PANES_COLORLESS) + .row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_GLOWSTONE, Tags.Items.GLASS_PANES_COLORLESS) + .build(consumer) } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt index 2389b6cb9..c14fb79b1 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt @@ -52,8 +52,8 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) { .save(consumer, modLocation("holo_sign_reset")) MatteryRecipe(MBlocks.DRIVE_VIEWER[null]!!, category = machinesCategory) - .rowAC(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES) - .row(Tags.Items.DUSTS_GLOWSTONE, MItems.MACHINE_FRAME, Tags.Items.GLASS_BLOCKS) + .rowBC(MItems.DISPLAY_SCREEN, Tags.Items.GLASS_PANES) + .row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES) .row(MItemTags.BASIC_CIRCUIT, MItems.MATTER_IO_PORT, MItemTags.BASIC_CIRCUIT) .unlockedBy(MItems.MATTER_IO_PORT) .build(consumer) @@ -75,9 +75,9 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) { .build(consumer) MatteryRecipe(MBlocks.MATTER_PANEL[null]!!, category = machinesCategory) - .row(MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES, Tags.Items.GLASS_BLOCKS) - .row(MItems.MATTER_CABLE, Tags.Items.DUSTS_GLOWSTONE, Tags.Items.GLASS_BLOCKS) - .row(MItemTags.ADVANCED_CIRCUIT, MItemTags.TRITANIUM_PLATES, Tags.Items.GLASS_BLOCKS) + .row(MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES, Tags.Items.GLASS_PANES) + .row(MItems.MATTER_CABLE, MItems.DISPLAY_SCREEN, Tags.Items.GLASS_PANES) + .row(MItemTags.ADVANCED_CIRCUIT, MItemTags.TRITANIUM_PLATES, Tags.Items.GLASS_PANES) .unlockedBy(Tags.Items.GLASS_BLOCKS) .build(consumer) @@ -99,7 +99,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) { MatteryRecipe(MBlocks.ENERGY_COUNTER[null]!!, category = machinesCategory) .row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES) - .row(MItemTags.BASIC_CIRCUIT, Tags.Items.DUSTS_GLOWSTONE, MItemTags.HARDENED_GLASS_PANES_COLORLESS) + .row(MItemTags.BASIC_CIRCUIT, MItems.DISPLAY_SCREEN, MItemTags.HARDENED_GLASS_PANES) .row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES) .unlockedBy(MItems.ENERGY_BUS) .build(consumer) @@ -223,7 +223,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) { .build(consumer) MatteryRecipe(MItems.BLACK_HOLE_SCANNER, category = RecipeCategory.TOOLS) - .row(MItemTags.IRON_PLATES, Tags.Items.GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES) + .row(MItemTags.IRON_PLATES, MItems.DISPLAY_SCREEN, MItemTags.IRON_PLATES) .row(MItemTags.GOLD_WIRES, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.ADVANCED_CIRCUIT) .rowAC(Tags.Items.DUSTS_GLOWSTONE, MItemTags.TRITANIUM_PLATES) .unlockedBy(MItems.GRAVITATION_FIELD_SENSOR) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/DecorativesRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/DecorativesRecipes.kt index eb70427c6..f4bf0eb48 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/DecorativesRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/DecorativesRecipes.kt @@ -433,11 +433,11 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu for ((color, item) in MRegistry.COMPUTER_TERMINAL.allItems) { val builder = MatteryRecipe(item, category = RecipeCategory.DECORATIONS) - builder.row(MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS) - if (color != null) { builder.rowB(color.tag) } + builder.row(MItemTags.TRITANIUM_PLATES, MItems.DISPLAY_SCREEN, MItemTags.HARDENED_GLASS_PANES_COLORLESS) + builder.rowB(MItemTags.BASIC_CIRCUIT) builder.build(consumer) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt index 6967c5d02..8d701847e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt @@ -232,6 +232,7 @@ object MNames { const val MIRROR_COMPOUND = "mirror_compound" const val MIRROR = "mirror" const val BLANK_MACHINE_UPGRADE = "blank_machine_upgrade" + const val DISPLAY_SCREEN = "display_screen" const val ENERGY_BUS = "energy_bus" diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt index d9b809861..cbd83e673 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt @@ -560,6 +560,7 @@ object MItems { val ELECTROMOTOR: Item by registry.register(MNames.ELECTROMOTOR) { Item(DEFAULT_PROPERTIES) } val MIRROR_COMPOUND: Item by registry.register(MNames.MIRROR_COMPOUND) { Item(DEFAULT_PROPERTIES) } val MIRROR: Item by registry.register(MNames.MIRROR) { MatteryItem(DEFAULT_PROPERTIES).addSimpleDescription() } + val DISPLAY_SCREEN: Item by registry.register(MNames.DISPLAY_SCREEN) { Item(DEFAULT_PROPERTIES) } /** * List of components for everything else @@ -589,6 +590,7 @@ object MItems { MItems::ELECTROMOTOR, MItems::MIRROR_COMPOUND, MItems::MIRROR, + MItems::DISPLAY_SCREEN, MItems::CARBON_MESH, MItems::ARMOR_ASSEMBLY, @@ -624,6 +626,7 @@ object MItems { MItems::ELECTROMOTOR, MItems::MIRROR_COMPOUND, MItems::MIRROR, + MItems::DISPLAY_SCREEN, MItems::CARBON_MESH, MItems::ARMOR_ASSEMBLY, diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/component/display_screen.png b/src/main/resources/assets/overdrive_that_matters/textures/item/component/display_screen.png new file mode 100644 index 0000000000000000000000000000000000000000..d36635b4d3d72a5dd2644f4bd55341d6da866d5b GIT binary patch literal 2437 zcmV;033~R4P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizyJUazyWI3i3tDz2^vX6K~zXfC00vs zB-ItZ&w5u^_1o=s`!Sv|69|G4pg@8KG$8_{NP$K2WB3W#Wt~+vStU{yStQB^wh=-M z5Qc#Za?}}@2Yz%Upb|=-M)42x#xW6JKs6zYd`g%BkkQV~@VUGD8nrn9+annhN)EiW(2EG_GrV4IL;%VOge-yd}} zwG3gfM_+$F8MoJqSy@Dz&1SMQ$;)DXd3CXlV4X2m*L9xfTI;%0jFO%qkM?#rso;&@ zaP_B99&}1txdV{{Q12<@|Q^k6nph&VO-yL_tHqK;OD!6<$JynX}QA)ve z{Kie3Qs3hDUc9@yoKs5tRtsAyrE5(o8mBM@BST?Twv<+sO=GpoAcxSKM>Bn&lC_erC;cPZ1gx0$84G&PlV@rMa_I{q1Cl}|sCWdKH zgjrXDQ&)De+fcU0*AhM08RNhJ657s%p7GJ_uHSJiD}fmjbxMp?CY}C!X6r zzqo*#|NPe{i**7#di~zz^#aI%MNKvcX$QgS+1czGnG>pJwrK(%%dv|hkD`>(8UWQb z18$3D#0_J5a{A@h|6#X|?#yPhaL_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(q@eu4&+joPiPG><8YU`ILD$O?O)*)=j_qK{5CZ=edBQ0lPbL%`w=KtDtIG@c zJ|47pCnKhE%ano>$7+hfuo~lp5oTKgWx@`gS&4lmzL8sk@IRjOOHm6BxT4q@kjB3@iKZXGhfneCd zc#y;y3e8ZN21LL8@Et_g1k-@iyoYtjA=)LX%WQdu1;&Xuf*KO!NofV%TBg%93v6Z* z4U-8e3=?OYMO}l&P%bKMX}C;PSjTWCkm{RkH;svabHMUuDDp5;+F{V^5KB;i2@R`@ zyi6)xz!eN1*wf?>)^8r1!W2Sivk2vHOx&zvFl(l0+;FplF-!)G;tRSardmH7gkFeR ztBL~Y!BKo*9o{tiDTO(-bfgW_YzFDh(03zjVSoWUun>6D)!-O~><4V*mu8 Date: Tue, 4 Mar 2025 15:20:01 +0300 Subject: [PATCH 5/6] =?UTF-8?q?=D1=80=D0=B5=D1=86=D0=B5=D0=BF=D1=82=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/otm/datagen/recipes/CraftingTableRecipes.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt index c14fb79b1..85a152684 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt @@ -585,4 +585,12 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) { .unlockedBy(MItems.DILITHIUM_CRYSTAL) .unlockedBy(MItems.DILITHIUM_CRYSTAL_BLOCK) .save(consumer, modLocation("dilithium_crystal/from_block")) + + MatteryRecipe(MItems.CONFIGURATOR, category = RecipeCategory.TOOLS) + .rowA(MItemTags.IRON_PLATES) + .row(Tags.Items.GLASS_PANES, Tags.Items.DUSTS_REDSTONE, MItems.DISPLAY_SCREEN) + .row(MItemTags.IRON_PLATES, MItemTags.BASIC_CIRCUIT, MItems.DILITHIUM_CRYSTAL) + .unlockedBy(MItems.DILITHIUM_CRYSTAL) + .unlockedBy(MItems.DISPLAY_SCREEN) + .build(consumer) } From 4eb7971717b869839ce0d9fbc075137d2193637f Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 4 Mar 2025 21:06:22 +0700 Subject: [PATCH 6/6] Further reduce internal state of CMWC (from 1024 octets / 8192 bits to just 128 octets / 1024 bits) because we don't need these insane periods --- src/main/kotlin/ru/dbotthepony/mc/otm/core/util/CMWCRandom.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/CMWCRandom.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/CMWCRandom.kt index ae291f2d1..7ec103ac8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/CMWCRandom.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/CMWCRandom.kt @@ -109,7 +109,7 @@ class CMWCRandom(seed: Long = System.nanoTime()) : RandomGenerator, RandomSource } companion object { - const val CMWC_STATE_SIZE = 256 // 4096 + const val CMWC_STATE_SIZE = 32 // 4096 const val CMWC_CARRY_MAX = 809430660 } }