|
| 1 | +package io.github.cpearl0.ctnhcore.client.ponder.Mana; |
| 2 | + |
| 3 | +import io.github.cpearl0.ctnhcore.client.ponder.CTNHPonderSceneBuilder; |
| 4 | + |
| 5 | +import net.createmod.catnip.math.Pointing; |
| 6 | +import net.createmod.ponder.api.scene.SceneBuilder; |
| 7 | +import net.createmod.ponder.api.scene.SceneBuildingUtil; |
| 8 | +import net.minecraft.core.Direction; |
| 9 | +import net.minecraft.resources.ResourceLocation; |
| 10 | +import net.minecraft.world.item.Item; |
| 11 | +import net.minecraft.world.item.ItemStack; |
| 12 | +import net.minecraft.world.phys.Vec3; |
| 13 | +import net.minecraftforge.registries.ForgeRegistries; |
| 14 | + |
| 15 | +import com.ctnhlang.CN; |
| 16 | +import com.ctnhlang.EN; |
| 17 | +import com.ctnhlang.Key; |
| 18 | +import tech.vixhentx.mcmod.ctnhlib.langprovider.Lang; |
| 19 | +import vazkii.botania.common.entity.BotaniaEntities; |
| 20 | + |
| 21 | +public class ManaHatch { |
| 22 | + |
| 23 | + private ManaHatch() {} |
| 24 | + |
| 25 | + // ========== 魔力凝聚仓(合并场景) ========== |
| 26 | + @Key("ctnhcore.ponder.manahatch.title") |
| 27 | + @CN("魔力凝聚仓") |
| 28 | + @EN("Mana Hatch") |
| 29 | + static Lang Title; |
| 30 | + @Key("ctnhcore.ponder.manahatch.header") |
| 31 | + @CN("魔力凝聚仓") |
| 32 | + @EN("Mana Hatch") |
| 33 | + static Lang Header; |
| 34 | + @Key("ctnhcore.ponder.manahatch.text_1") |
| 35 | + @CN("魔力大机器运行所需的魔力能量由魔力凝聚仓提供") |
| 36 | + @EN("The mana energy required for large mana machines is provided by the Mana Hatch") |
| 37 | + static Lang Text1; |
| 38 | + @Key("ctnhcore.ponder.manahatch.text_2") |
| 39 | + @CN("凝聚仓可以将输入的植物魔法魔力自动转化为魔力能量") |
| 40 | + @EN("The hatch can automatically convert incoming Botania mana into mana energy") |
| 41 | + static Lang Text2; |
| 42 | + @Key("ctnhcore.ponder.manahatch.text_3") |
| 43 | + @CN("也可以将输入的LP魔力或液态魔力转化为魔力能量") |
| 44 | + @EN("It can also convert incoming LP or liquid mana into mana energy") |
| 45 | + static Lang Text3; |
| 46 | + @Key("ctnhcore.ponder.manahatch.text_4") |
| 47 | + @CN("转化得到的魔力能量将供给所属的魔力机器使用") |
| 48 | + @EN("The converted mana energy is supplied to adjacent mana machines") |
| 49 | + static Lang Text4; |
| 50 | + @Key("ctnhcore.ponder.manahatch.text_5") |
| 51 | + @CN("将魔力机器升级放入主方块UI中") |
| 52 | + @EN("Put the magic machine upgrade into the main block UI.") |
| 53 | + static Lang Text5; |
| 54 | + @Key("ctnhcore.ponder.manahatch.text_6") |
| 55 | + @CN("魔力机器升级会基于凝聚仓的容量提供增幅效果") |
| 56 | + @EN("Mana machine upgrades provide amplification effects based on the hatch's capacity") |
| 57 | + static Lang Text6; |
| 58 | + |
| 59 | + // ============================================================ |
| 60 | + // 合并场景:魔力凝聚仓 — 输入、供能与升级 |
| 61 | + // 对应 NBT: assets/ctnhcore/ponder/manahatch/scene.nbt (16x13x16) |
| 62 | + // 关键方块: |
| 63 | + // creative_pool (5, 1, 2) |
| 64 | + // giga_manahatch (7, 1, 4) ← 控制器 |
| 65 | + // mana_wiremill (8, 1, 4) ← 魔力机器示例 |
| 66 | + // hv_energy_input_hatch (9, 1, 4) |
| 67 | + // 魔力机器多方块 (5..11, 1..5, 5..10) |
| 68 | + // ============================================================ |
| 69 | + public static void Common(SceneBuilder builder, SceneBuildingUtil util) { |
| 70 | + CTNHPonderSceneBuilder scene = new CTNHPonderSceneBuilder(builder); |
| 71 | + scene.setSceneOffsetY(-1); |
| 72 | + scene.scaleSceneView(0.4F); |
| 73 | + scene.idle(10); |
| 74 | + |
| 75 | + // 关键观察点 |
| 76 | + Vec3 hatchVec = util.vector().blockSurface(util.grid().at(7, 1, 4), Direction.NORTH); |
| 77 | + Vec3 hatchTop = util.vector().blockSurface(util.grid().at(7, 1, 4), Direction.UP); |
| 78 | + Vec3 poolVec = util.vector().blockSurface(util.grid().at(5, 1, 2), Direction.UP); |
| 79 | + Vec3 wiremillVec = util.vector().blockSurface(util.grid().at(8, 1, 4), Direction.UP); |
| 80 | + |
| 81 | + // 1. 显示地面层 |
| 82 | + scene.world().showSection(util.select().layer(0), Direction.NORTH); |
| 83 | + scene.idle(10); |
| 84 | + |
| 85 | + // 2. 显示魔力凝聚仓 + 介绍 |
| 86 | + scene.world().showSection(util.select().position(7, 1, 4), Direction.DOWN); |
| 87 | + scene.title("manahatch"); |
| 88 | + scene.idle(20); |
| 89 | + scene.showText(60) |
| 90 | + .pointAt(hatchVec) |
| 91 | + .attachKeyFrame(); |
| 92 | + scene.idle(70); |
| 93 | + |
| 94 | + // 3. 展示 Botania 魔力输入:创造魔力池 + Spark + 流向凝聚仓的粒子 |
| 95 | + scene.world().showSection(util.select().position(5, 1, 2), Direction.DOWN); |
| 96 | + scene.idle(10); |
| 97 | + scene.world().createEntity(world -> { |
| 98 | + var spark = BotaniaEntities.SPARK.create(world); |
| 99 | + spark.setPos(5.5, 2.5, 2.5); |
| 100 | + spark.setYRot(0); |
| 101 | + return spark; |
| 102 | + }); |
| 103 | + scene.idle(10); |
| 104 | + PonderParticleUtil.sparkManaFlow(scene.effects(), poolVec, hatchVec, 160); |
| 105 | + scene.showText(60) |
| 106 | + .pointAt(poolVec) |
| 107 | + .attachKeyFrame(); |
| 108 | + scene.idle(80); |
| 109 | + |
| 110 | + // 4. 展示 LP/液态魔力转化(指向凝聚仓本体说明) |
| 111 | + scene.showText(60) |
| 112 | + .pointAt(hatchVec) |
| 113 | + .attachKeyFrame(); |
| 114 | + scene.idle(70); |
| 115 | + |
| 116 | + // 5. 展示魔力机器获取能量:魔力机器 + 能源仓 + 多方块结构 |
| 117 | + scene.world().showSection(util.select().position(8, 1, 4), Direction.DOWN); |
| 118 | + scene.idle(5); |
| 119 | + scene.world().showSection(util.select().position(9, 1, 4), Direction.DOWN); |
| 120 | + scene.idle(5); |
| 121 | + scene.world().showSection(util.select().fromTo(5, 1, 5, 11, 5, 10), Direction.DOWN); |
| 122 | + scene.idle(20); |
| 123 | + scene.showText(60) |
| 124 | + .pointAt(wiremillVec) |
| 125 | + .attachKeyFrame(); |
| 126 | + scene.idle(80); |
| 127 | + |
| 128 | + // 6. 展示升级符文放入主方块 UI |
| 129 | + Item upgradeRune = ForgeRegistries.ITEMS.getValue( |
| 130 | + ResourceLocation.fromNamespaceAndPath("ctnhmana", "clear_sky_flower_wish")); |
| 131 | + ItemStack upgradeStack = new ItemStack(upgradeRune); |
| 132 | + scene.overlay().showControls(wiremillVec, Pointing.DOWN, 60) |
| 133 | + .withItem(upgradeStack) |
| 134 | + .rightClick(); |
| 135 | + scene.showText(60) |
| 136 | + .pointAt(wiremillVec) |
| 137 | + .attachKeyFrame(); |
| 138 | + scene.idle(70); |
| 139 | + |
| 140 | + // 7. 升级基于容量提供增幅 |
| 141 | + scene.showText(60) |
| 142 | + .pointAt(hatchVec) |
| 143 | + .attachKeyFrame(); |
| 144 | + scene.idle(70); |
| 145 | + |
| 146 | + scene.markAsFinished(); |
| 147 | + } |
| 148 | +} |
0 commit comments