diff --git a/common/src/main/java/dev/dubhe/anvilcraft/api/power/IPowerStorage.java b/common/src/main/java/dev/dubhe/anvilcraft/api/power/IPowerStorage.java index e36973cf7..f98f64b35 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/api/power/IPowerStorage.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/api/power/IPowerStorage.java @@ -22,6 +22,21 @@ public interface IPowerStorage extends IPowerProducer, IPowerConsumer { */ int extract(int power); + + /** + * 获取已存储的电量 + * + * @return 电量值 + */ + int getPowerAmount(); + + /** + * 获取储电容量 + * + * @return 储电容量 + */ + int getCapacity(); + @Override default @NotNull PowerComponentType getComponentType() { return PowerComponentType.STORAGE; diff --git a/common/src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java b/common/src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java index 4c9f31aeb..d1f22349d 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java @@ -1,10 +1,20 @@ package dev.dubhe.anvilcraft.api.power; +import com.mojang.datafixers.util.Pair; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import com.mojang.serialization.codecs.PrimitiveCodec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import dev.dubhe.anvilcraft.AnvilCraft; +import dev.dubhe.anvilcraft.client.renderer.PowerGridRenderer; import dev.dubhe.anvilcraft.network.PowerGridRemovePack; import dev.dubhe.anvilcraft.network.PowerGridSyncPack; import lombok.Getter; +import net.minecraft.client.gui.components.tabs.Tab; import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtOps; +import net.minecraft.nbt.Tag; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; @@ -13,13 +23,18 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.NotNull; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; +import java.util.List; +import java.util.ListIterator; import java.util.Map; import java.util.Set; +import java.util.stream.IntStream; +import java.util.stream.Stream; /** * 电网 @@ -182,9 +197,9 @@ private void addRange(IPowerComponent component) { BlockPos center = this.pos; BlockPos vec3 = component.getPos(); VoxelShape range = component.getShape().move( - vec3.getX() - center.getX(), - vec3.getY() - center.getY(), - vec3.getZ() - center.getZ() + vec3.getX() - center.getX(), + vec3.getY() - center.getY(), + vec3.getZ() - center.getZ() ); this.shape = Shapes.join(this.shape, range, BooleanOp.OR); } @@ -255,9 +270,9 @@ public void merge(@NotNull PowerGrid grid) { public boolean isInRange(@NotNull IPowerComponent component) { BlockPos vec3 = component.getPos().subtract(this.getPos()); VoxelShape range = Shapes.join( - this.shape, - component.getShape().move(vec3.getX(), vec3.getY(), vec3.getZ()), - BooleanOp.AND + this.shape, + component.getShape().move(vec3.getX(), vec3.getY(), vec3.getZ()), + BooleanOp.AND ); return !range.isEmpty(); } @@ -314,29 +329,72 @@ public static void clear() { @Getter public static class SimplePowerGrid { + + public static final Codec CODEC = RecordCodecBuilder.create(ins -> ins.group( + Codec.INT.fieldOf("hash").forGetter(o -> o.hash), + Codec.STRING.fieldOf("level").forGetter(o -> o.level), + BlockPos.CODEC.fieldOf("pos").forGetter(o -> o.pos), + BlockPos.CODEC + .listOf() + .fieldOf("blocks") + .forGetter(o -> o.blocks), + Codec.INT + .listOf() + .fieldOf("rangeByIndex") + .forGetter(o -> o.rangeByIndex), + Codec.INT.fieldOf("generate").forGetter(o -> o.generate), + Codec.INT.fieldOf("consume").forGetter(o -> o.consume) + ).apply(ins, SimplePowerGrid::new)); + private final int hash; private final String level; private final BlockPos pos; - private final Map ranges = new HashMap<>(); + private Map ranges = new HashMap<>(); + private List blocks = new ArrayList<>(); + private List rangeByIndex = new ArrayList<>(); + private int generate = 0; // 发电功率 + private int consume = 0; // 耗电功率 + + public SimplePowerGrid( + int hash, + String level, + BlockPos pos, + List blocks, + List ranges, + int generate, + int consume + ) { + this.pos = pos; + this.level = level; + this.hash = hash; + this.blocks = blocks; + this.rangeByIndex = ranges; + for (int i = 0; i < blocks.size(); i++) { + this.ranges.put(blocks.get(i), ranges.get(i)); + } + this.generate = generate; + this.consume = consume; + } /** * @param buf 缓冲区 */ public void encode(@NotNull FriendlyByteBuf buf) { - buf.writeInt(this.hash); - buf.writeUtf(this.level); - buf.writeBlockPos(this.pos); - Set> set = this.ranges.entrySet(); - buf.writeVarInt(set.size()); - for (Map.Entry entry : set) { - buf.writeBlockPos(entry.getKey()); - buf.writeInt(entry.getValue()); - } + this.blocks = ranges.keySet().stream().toList(); + this.rangeByIndex = ranges.values().stream().toList(); + var tag1 = CODEC.encodeStart(NbtOps.INSTANCE, this); + Tag tag = CODEC.encodeStart(NbtOps.INSTANCE, this) + .getOrThrow(false, ignored -> { + }); + CompoundTag data = new CompoundTag(); + data.put("data", tag); + buf.writeNbt(data); } /** * @param buf 缓冲区 */ + @Deprecated public SimplePowerGrid(@NotNull FriendlyByteBuf buf) { this.hash = buf.readInt(); this.level = buf.readUtf(); @@ -358,6 +416,8 @@ public SimplePowerGrid(@NotNull PowerGrid grid) { grid.producers.forEach(this::addRange); grid.consumers.forEach(this::addRange); grid.transmitters.forEach(this::addRange); + this.consume = grid.consume; + this.generate = grid.generate; } public void addRange(@NotNull IPowerComponent component) { @@ -369,20 +429,27 @@ public void addRange(@NotNull IPowerComponent component) { */ public VoxelShape getShape() { return this.ranges.entrySet().stream().map(entry -> Shapes - .box( - -entry.getValue(), -entry.getValue(), -entry.getValue(), - entry.getValue() + 1, entry.getValue() + 1, entry.getValue() + 1 - ) - .move( - this.offset(entry.getKey()).getX(), - this.offset(entry.getKey()).getY(), - this.offset(entry.getKey()).getZ() - ) + .box( + -entry.getValue(), -entry.getValue(), -entry.getValue(), + entry.getValue() + 1, entry.getValue() + 1, entry.getValue() + 1 + ) + .move( + this.offset(entry.getKey()).getX(), + this.offset(entry.getKey()).getY(), + this.offset(entry.getKey()).getZ() + ) ).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).orElse(Shapes.block()); } private @NotNull BlockPos offset(@NotNull BlockPos pos) { return pos.subtract(this.pos); } + + public static List findPowerGrid(BlockPos pos) { + return PowerGridRenderer.getGrids() + .values().stream() + .filter(it -> it.blocks.stream().anyMatch(it1 -> it1.equals(pos))) + .toList(); + } } } diff --git a/common/src/main/java/dev/dubhe/anvilcraft/block/MagnetBlock.java b/common/src/main/java/dev/dubhe/anvilcraft/block/MagnetBlock.java index 52110d9da..1dc332c77 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/block/MagnetBlock.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/block/MagnetBlock.java @@ -11,6 +11,7 @@ import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; @@ -89,8 +90,9 @@ private void attract(BlockState state, @NotNull Level level, @NotNull BlockPos m BlockState state1 = level.getBlockState(currentPos); if (state1.is(BlockTags.ANVIL)) { - level.setBlock(currentPos, state1.getFluidState().createLegacyBlock(), 3); level.setBlockAndUpdate(magnetPos.below(), state1); + level.setBlockAndUpdate(currentPos, Blocks.AIR.defaultBlockState()); + AnimateAscendingBlockEntity.animate(level, currentPos, state1, magnetPos.below()); break; } diff --git a/common/src/main/java/dev/dubhe/anvilcraft/data/generator/lang/ScreenLang.java b/common/src/main/java/dev/dubhe/anvilcraft/data/generator/lang/ScreenLang.java index fb96903ca..ebc08a3b5 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/data/generator/lang/ScreenLang.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/data/generator/lang/ScreenLang.java @@ -40,5 +40,16 @@ public static void init(RegistrateLangProvider provider) { + ".base_slot_description", "Put " ); + provider.add("tooltip.anvilcraft.grid_information.title", "Power Grid Stats:"); + provider.add("tooltip.anvilcraft.grid_information.producer_stats", "Power Producer Stats:"); + provider.add("tooltip.anvilcraft.grid_information.consumer_stats", "Power Consumer Stats:"); + provider.add("tooltip.anvilcraft.grid_information.output_power", " Power Generation: %d"); + provider.add("tooltip.anvilcraft.grid_information.input_power", " Power Consumption: %d"); + provider.add("tooltip.anvilcraft.grid_information.total_consumed", " Total Consumption: %d"); + provider.add("tooltip.anvilcraft.grid_information.total_generated", " Total Generation: %d"); + provider.add("tooltip.anvilcraft.grid_information.utilization", " Power Utilization: %s"); + provider.add("tooltip.anvilcraft.grid_information.overloaded1", "It appears that this grid is overloaded."); + provider.add("tooltip.anvilcraft.grid_information.overloaded2", "Add more sources or remove the components"); + provider.add("tooltip.anvilcraft.grid_information.overloaded3", "with a high stress impact."); } } diff --git a/common/src/main/java/dev/dubhe/anvilcraft/mixin/AnvilBlockMixin.java b/common/src/main/java/dev/dubhe/anvilcraft/mixin/AnvilBlockMixin.java index 44dcdaee4..11cca613f 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/mixin/AnvilBlockMixin.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/mixin/AnvilBlockMixin.java @@ -92,7 +92,7 @@ public void onPlace( } if (!level.isEmptyBlock(magnet.below())) return; level.setBlockAndUpdate(magnet.below(), state); - level.setBlockAndUpdate(anvil, state.getFluidState().createLegacyBlock()); + level.setBlockAndUpdate(anvil, Blocks.AIR.defaultBlockState()); AnimateAscendingBlockEntity.animate(level, anvil, state, magnet.below()); } } diff --git a/common/src/main/java/dev/dubhe/anvilcraft/mixin/PowerGridInformationRenderMixin.java b/common/src/main/java/dev/dubhe/anvilcraft/mixin/PowerGridInformationRenderMixin.java new file mode 100644 index 000000000..40275385d --- /dev/null +++ b/common/src/main/java/dev/dubhe/anvilcraft/mixin/PowerGridInformationRenderMixin.java @@ -0,0 +1,212 @@ +package dev.dubhe.anvilcraft.mixin; + +import dev.dubhe.anvilcraft.api.power.IPowerComponent; +import dev.dubhe.anvilcraft.api.power.IPowerConsumer; +import dev.dubhe.anvilcraft.api.power.IPowerProducer; +import dev.dubhe.anvilcraft.api.power.PowerGrid; +import dev.dubhe.anvilcraft.init.ModItems; +import net.minecraft.ChatFormatting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner; +import net.minecraft.client.gui.screens.inventory.tooltip.DefaultTooltipPositioner; +import net.minecraft.client.gui.screens.inventory.tooltip.TooltipRenderUtil; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.Style; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.HitResult; +import org.joml.Vector2ic; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.ArrayList; +import java.util.List; + +@Mixin(Gui.class) +public abstract class PowerGridInformationRenderMixin { + + @Shadow + public abstract Font getFont(); + + @Shadow + protected int screenHeight; + + @Shadow + protected int screenWidth; + + @Shadow + @Final + protected Minecraft minecraft; + + @Inject( + method = "render", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/gui/Gui;renderCrosshair(Lnet/minecraft/client/gui/GuiGraphics;)V", + shift = At.Shift.AFTER + ) + ) + void onHudRender(GuiGraphics guiGraphics, float partialTick, CallbackInfo ci) { + if (minecraft.player == null || minecraft.isPaused()) return; + if (minecraft.screen != null) return; + if (!minecraft.player.getItemBySlot(EquipmentSlot.HEAD).is(ModItems.ANVIL_HAMMER.get()) + && !minecraft.player.getItemBySlot(EquipmentSlot.HEAD).is(ModItems.ROYAL_ANVIL_HAMMER.get()) + ) return; + + HitResult hit = minecraft.hitResult; + if (hit == null) return; + BlockPos pos = null; + boolean overloaded = false; + IPowerComponent powerComponent = null; + Block block; + BlockState state = null; + if (hit.getType() == HitResult.Type.BLOCK) { + BlockPos blockPos = ((BlockHitResult) hit).getBlockPos(); + if (minecraft.level == null) return; + BlockEntity e = minecraft.level.getBlockEntity(blockPos); + if (e == null) return; + if (e instanceof IPowerComponent ipc) { + if (e.getBlockState().hasProperty(IPowerComponent.OVERLOAD)) { + overloaded = e.getBlockState() + .getValues() + .getOrDefault(IPowerComponent.OVERLOAD, true) + .equals(Boolean.TRUE); + } + state = e.getBlockState(); + powerComponent = ipc; + pos = blockPos; + } + } + if (powerComponent == null) return; + List powerGrids = PowerGrid.SimplePowerGrid.findPowerGrid(pos); + if (powerGrids.isEmpty()) return; + PowerGrid.SimplePowerGrid grid = powerGrids.get(0); + if (grid == null) return; + final int tooltipPosX = screenWidth / 2 + 10; + final int tooltipPosY = screenHeight / 2 + 10; + overloaded |= grid.getConsume() > grid.getGenerate(); + List lines = new ArrayList<>(); + if (powerComponent instanceof IPowerProducer producer) { + lines.add(Component.translatable("tooltip.anvilcraft.grid_information.producer_stats") + .setStyle(Style.EMPTY.applyFormat(ChatFormatting.BLUE)) + ); + lines.add(Component.translatable( + "tooltip.anvilcraft.grid_information.output_power", + producer.getOutputPower() + ).setStyle(Style.EMPTY.applyFormat(ChatFormatting.GRAY))); + } else if (powerComponent instanceof IPowerConsumer consumer) { + lines.add(Component.translatable("tooltip.anvilcraft.grid_information.consumer_stats") + .setStyle(Style.EMPTY.applyFormat(ChatFormatting.BLUE)) + ); + lines.add(Component.translatable( + "tooltip.anvilcraft.grid_information.input_power", + consumer.getInputPower() + ).setStyle(Style.EMPTY.applyFormat(ChatFormatting.GRAY))); + } + List tooltipLines = List.of( + Component.translatable("tooltip.anvilcraft.grid_information.title") + .setStyle(Style.EMPTY.applyFormat(ChatFormatting.BLUE)), + Component.translatable( + "tooltip.anvilcraft.grid_information.total_consumed", + grid.getConsume() + ).setStyle(Style.EMPTY.applyFormat(ChatFormatting.GRAY)), + Component.translatable( + "tooltip.anvilcraft.grid_information.total_generated", + grid.getGenerate() + ).setStyle(Style.EMPTY.applyFormat(ChatFormatting.GRAY)) + ); + lines.addAll(tooltipLines); + if (overloaded) { + for (int i = 1; i <= 3; i++) { + lines.add(Component.translatable("tooltip.anvilcraft.grid_information.overloaded" + i)); + } + + } + anvilCraft$renderInfo( + guiGraphics, + this.getFont(), + state != null + ? state.getBlock().asItem().getDefaultInstance() + : ModItems.MAGNETOELECTRIC_CORE.asStack(), + lines, + tooltipPosX, + tooltipPosY + ); + } + + @Unique + private static void anvilCraft$renderInfo(GuiGraphics thiz, Font font, ItemStack itemStack, List lines, int x, int y) { + ClientTooltipPositioner tooltipPositioner = DefaultTooltipPositioner.INSTANCE; + List components = lines.stream() + .map(Component::getVisualOrderText) + .map(ClientTooltipComponent::create) + .toList(); + if (components.isEmpty()) return; + int width = 0; + int height = components.size() == 1 ? -2 : 0; + + for (ClientTooltipComponent component : components) { + width = Math.max(component.getWidth(font), width); + height += component.getHeight(); + } + + Vector2ic vector2ic = tooltipPositioner.positionTooltip( + thiz.guiWidth(), + thiz.guiHeight(), + x, + y, + width, + height + ); + int vx = vector2ic.x(); + int vy = vector2ic.y(); + thiz.pose().pushPose(); + + int finalVy = vy; + int finalWidth = width; + int finalHeight = height + 16; + TooltipRenderUtil.renderTooltipBackground( + thiz, + vx, + finalVy, + finalWidth, + finalHeight, + 400 + ); + + thiz.pose().translate(0.0F, 0.0F, 400.0F); + + thiz.renderFakeItem(itemStack, vx, vy); + + vy += 16; + + ClientTooltipComponent component; + for (int i = 0, q = vy; i < components.size(); ++i) { + component = components.get(i); + component.renderText(font, vx, q, thiz.pose().last().pose(), thiz.bufferSource()); + q += component.getHeight() + (i == 0 ? 2 : 0); + } + + for (int i = 0, q = vy; i < components.size(); ++i) { + component = components.get(i); + component.renderImage(font, vx, q, thiz); + q += component.getHeight() + (i == 0 ? 2 : 0); + } + + thiz.pose().popPose(); + } +} diff --git a/common/src/main/java/dev/dubhe/anvilcraft/network/PowerGridSyncPack.java b/common/src/main/java/dev/dubhe/anvilcraft/network/PowerGridSyncPack.java index f2d8112ec..2d41470d2 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/network/PowerGridSyncPack.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/network/PowerGridSyncPack.java @@ -8,6 +8,9 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtOps; +import net.minecraft.nbt.Tag; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.NotNull; @@ -27,7 +30,10 @@ public PowerGridSyncPack(PowerGrid grid) { * @param buf 缓冲区 */ public PowerGridSyncPack(@NotNull FriendlyByteBuf buf) { - this.grid = new PowerGrid.SimplePowerGrid(buf); + CompoundTag tag = buf.readNbt(); + Tag data = tag.get("data"); + this.grid = PowerGrid.SimplePowerGrid.CODEC.decode(NbtOps.INSTANCE, data) + .getOrThrow(false, ignored -> {}).getFirst(); } @Override diff --git a/common/src/main/resources/anvilcraft-common.mixins.json b/common/src/main/resources/anvilcraft-common.mixins.json index eed430b1a..0273d9ecb 100644 --- a/common/src/main/resources/anvilcraft-common.mixins.json +++ b/common/src/main/resources/anvilcraft-common.mixins.json @@ -25,6 +25,7 @@ ], "client": [ "LevelRendererMixin", + "PowerGridInformationRenderMixin", "accessor.ItemInHandRendererAccessor", "accessor.MinecraftAccessor" ], diff --git a/fabric/src/generated/resources/assets/anvilcraft/lang/en_ud.json b/fabric/src/generated/resources/assets/anvilcraft/lang/en_ud.json index 800f5172b..06a220fb2 100644 --- a/fabric/src/generated/resources/assets/anvilcraft/lang/en_ud.json +++ b/fabric/src/generated/resources/assets/anvilcraft/lang/en_ud.json @@ -159,5 +159,16 @@ "text.autoconfig.anvilcraft.option.redstoneEmpRadius": "ʞɔoןᗺ ɹǝԀ snıpɐᴚ ԀWƎ ǝuoʇspǝᴚ", "text.autoconfig.anvilcraft.option.redstoneEmpRadius.@Tooltip": "ןıʌuɐ ǝɥʇ ʎq pǝddoɹp ʞɔoןq ɹǝd pǝʇɐɹǝuǝb ǝɔuɐʇsıp ԀWƎ ǝuoʇspǝᴚ", "text.autoconfig.anvilcraft.title": "bıɟuoƆ ʇɟɐɹƆןıʌuⱯ", + "tooltip.anvilcraft.grid_information.consumer_stats": ":sʇɐʇS ɹǝɯnsuoƆ ɹǝʍoԀ", + "tooltip.anvilcraft.grid_information.input_power": "%d :uoıʇdɯnsuoƆ ɹǝʍoԀ ", + "tooltip.anvilcraft.grid_information.output_power": "%d :uoıʇɐɹǝuǝ⅁ ɹǝʍoԀ ", + "tooltip.anvilcraft.grid_information.overloaded1": "˙pǝpɐoןɹǝʌo sı pıɹb sıɥʇ ʇɐɥʇ sɹɐǝddɐ ʇI", + "tooltip.anvilcraft.grid_information.overloaded2": "sʇuǝuodɯoɔ ǝɥʇ ǝʌoɯǝɹ ɹo sǝɔɹnos ǝɹoɯ ppⱯ", + "tooltip.anvilcraft.grid_information.overloaded3": "˙ʇɔɐdɯı ssǝɹʇs ɥbıɥ ɐ ɥʇıʍ", + "tooltip.anvilcraft.grid_information.producer_stats": ":sʇɐʇS ɹǝɔnpoɹԀ ɹǝʍoԀ", + "tooltip.anvilcraft.grid_information.title": ":sʇɐʇS pıɹ⅁ ɹǝʍoԀ", + "tooltip.anvilcraft.grid_information.total_consumed": "%d :uoıʇdɯnsuoƆ ןɐʇo⟘ ", + "tooltip.anvilcraft.grid_information.total_generated": "%d :uoıʇɐɹǝuǝ⅁ ןɐʇo⟘ ", + "tooltip.anvilcraft.grid_information.utilization": "%s :uoıʇɐzıןıʇ∩ ɹǝʍoԀ ", "tooltip.anvilcraft.jade.power_information": "MW %d/%d :pıɹ⅁ ɹǝʍoԀ" } \ No newline at end of file diff --git a/fabric/src/generated/resources/assets/anvilcraft/lang/en_us.json b/fabric/src/generated/resources/assets/anvilcraft/lang/en_us.json index a505b3e9b..b32bbb078 100644 --- a/fabric/src/generated/resources/assets/anvilcraft/lang/en_us.json +++ b/fabric/src/generated/resources/assets/anvilcraft/lang/en_us.json @@ -159,5 +159,16 @@ "text.autoconfig.anvilcraft.option.redstoneEmpRadius": "Redstone EMP Radius Per Block", "text.autoconfig.anvilcraft.option.redstoneEmpRadius.@Tooltip": "Redstone EMP distance generated per block dropped by the anvil", "text.autoconfig.anvilcraft.title": "AnvilCraft Config", + "tooltip.anvilcraft.grid_information.consumer_stats": "Power Consumer Stats:", + "tooltip.anvilcraft.grid_information.input_power": " Power Consumption: %d", + "tooltip.anvilcraft.grid_information.output_power": " Power Generation: %d", + "tooltip.anvilcraft.grid_information.overloaded1": "It appears that this grid is overloaded.", + "tooltip.anvilcraft.grid_information.overloaded2": "Add more sources or remove the components", + "tooltip.anvilcraft.grid_information.overloaded3": "with a high stress impact.", + "tooltip.anvilcraft.grid_information.producer_stats": "Power Producer Stats:", + "tooltip.anvilcraft.grid_information.title": "Power Grid Stats:", + "tooltip.anvilcraft.grid_information.total_consumed": " Total Consumption: %d", + "tooltip.anvilcraft.grid_information.total_generated": " Total Generation: %d", + "tooltip.anvilcraft.grid_information.utilization": " Power Utilization: %s", "tooltip.anvilcraft.jade.power_information": "Power Grid: %d/%d MW" } \ No newline at end of file diff --git a/forge/src/generated/resources/assets/anvilcraft/lang/en_ud.json b/forge/src/generated/resources/assets/anvilcraft/lang/en_ud.json index 800f5172b..06a220fb2 100644 --- a/forge/src/generated/resources/assets/anvilcraft/lang/en_ud.json +++ b/forge/src/generated/resources/assets/anvilcraft/lang/en_ud.json @@ -159,5 +159,16 @@ "text.autoconfig.anvilcraft.option.redstoneEmpRadius": "ʞɔoןᗺ ɹǝԀ snıpɐᴚ ԀWƎ ǝuoʇspǝᴚ", "text.autoconfig.anvilcraft.option.redstoneEmpRadius.@Tooltip": "ןıʌuɐ ǝɥʇ ʎq pǝddoɹp ʞɔoןq ɹǝd pǝʇɐɹǝuǝb ǝɔuɐʇsıp ԀWƎ ǝuoʇspǝᴚ", "text.autoconfig.anvilcraft.title": "bıɟuoƆ ʇɟɐɹƆןıʌuⱯ", + "tooltip.anvilcraft.grid_information.consumer_stats": ":sʇɐʇS ɹǝɯnsuoƆ ɹǝʍoԀ", + "tooltip.anvilcraft.grid_information.input_power": "%d :uoıʇdɯnsuoƆ ɹǝʍoԀ ", + "tooltip.anvilcraft.grid_information.output_power": "%d :uoıʇɐɹǝuǝ⅁ ɹǝʍoԀ ", + "tooltip.anvilcraft.grid_information.overloaded1": "˙pǝpɐoןɹǝʌo sı pıɹb sıɥʇ ʇɐɥʇ sɹɐǝddɐ ʇI", + "tooltip.anvilcraft.grid_information.overloaded2": "sʇuǝuodɯoɔ ǝɥʇ ǝʌoɯǝɹ ɹo sǝɔɹnos ǝɹoɯ ppⱯ", + "tooltip.anvilcraft.grid_information.overloaded3": "˙ʇɔɐdɯı ssǝɹʇs ɥbıɥ ɐ ɥʇıʍ", + "tooltip.anvilcraft.grid_information.producer_stats": ":sʇɐʇS ɹǝɔnpoɹԀ ɹǝʍoԀ", + "tooltip.anvilcraft.grid_information.title": ":sʇɐʇS pıɹ⅁ ɹǝʍoԀ", + "tooltip.anvilcraft.grid_information.total_consumed": "%d :uoıʇdɯnsuoƆ ןɐʇo⟘ ", + "tooltip.anvilcraft.grid_information.total_generated": "%d :uoıʇɐɹǝuǝ⅁ ןɐʇo⟘ ", + "tooltip.anvilcraft.grid_information.utilization": "%s :uoıʇɐzıןıʇ∩ ɹǝʍoԀ ", "tooltip.anvilcraft.jade.power_information": "MW %d/%d :pıɹ⅁ ɹǝʍoԀ" } \ No newline at end of file diff --git a/forge/src/generated/resources/assets/anvilcraft/lang/en_us.json b/forge/src/generated/resources/assets/anvilcraft/lang/en_us.json index a505b3e9b..b32bbb078 100644 --- a/forge/src/generated/resources/assets/anvilcraft/lang/en_us.json +++ b/forge/src/generated/resources/assets/anvilcraft/lang/en_us.json @@ -159,5 +159,16 @@ "text.autoconfig.anvilcraft.option.redstoneEmpRadius": "Redstone EMP Radius Per Block", "text.autoconfig.anvilcraft.option.redstoneEmpRadius.@Tooltip": "Redstone EMP distance generated per block dropped by the anvil", "text.autoconfig.anvilcraft.title": "AnvilCraft Config", + "tooltip.anvilcraft.grid_information.consumer_stats": "Power Consumer Stats:", + "tooltip.anvilcraft.grid_information.input_power": " Power Consumption: %d", + "tooltip.anvilcraft.grid_information.output_power": " Power Generation: %d", + "tooltip.anvilcraft.grid_information.overloaded1": "It appears that this grid is overloaded.", + "tooltip.anvilcraft.grid_information.overloaded2": "Add more sources or remove the components", + "tooltip.anvilcraft.grid_information.overloaded3": "with a high stress impact.", + "tooltip.anvilcraft.grid_information.producer_stats": "Power Producer Stats:", + "tooltip.anvilcraft.grid_information.title": "Power Grid Stats:", + "tooltip.anvilcraft.grid_information.total_consumed": " Total Consumption: %d", + "tooltip.anvilcraft.grid_information.total_generated": " Total Generation: %d", + "tooltip.anvilcraft.grid_information.utilization": " Power Utilization: %s", "tooltip.anvilcraft.jade.power_information": "Power Grid: %d/%d MW" } \ No newline at end of file