From 2a7331b1f31cf8587abcc28955165b28807fe5a4 Mon Sep 17 00:00:00 2001 From: C-H716 <1536152356@qq.com> Date: Mon, 24 Nov 2025 17:59:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=AE=9E=E4=BD=93=E5=8A=A0?= =?UTF-8?q?=E9=80=9F=E5=99=A8=E7=95=8C=E9=9D=A2=E4=BB=A3=E7=A0=81;=20?= =?UTF-8?q?=E8=A1=A5=E5=85=A8mod=E4=BF=A1=E6=81=AF;=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E5=8A=A0=E9=80=9F=E5=99=A8GUI;=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=AE=9E=E4=BD=93=E5=8A=A0=E9=80=9F=E5=99=A8=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 6 +- .../ae/menu/EntitySpeedTickerMenu.java | 99 ++++--- .../ae/parts/EntitySpeedTickerPart.java | 269 ++++++++++-------- .../ae/screen/EntitySpeedTickerScreen.java | 85 +++--- .../ae2/screens/entity_speed_ticker.json | 10 +- .../ae2/textures/guis/blank_background.png | Bin 2432 -> 2842 bytes .../models/item/entity_speed_ticker.json | 185 +++++++++++- .../models/part/entity_speed_ticker_part.json | 180 +++++++++++- .../templates/META-INF/neoforge.mods.toml | 92 +++--- 9 files changed, 662 insertions(+), 264 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7c01284..95445da 100644 --- a/gradle.properties +++ b/gradle.properties @@ -30,7 +30,7 @@ mod_id=extendedae_plus # The human-readable display name for the mod. mod_name=ExtendedAE-Plus # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. -mod_license=All Rights Reserved +mod_license=LGPL-3.0-or-later # The mod version. See https://semver.org/ mod_version=1.21.1-1.4.3 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. @@ -38,9 +38,9 @@ mod_version=1.21.1-1.4.3 # See https://maven.apache.org/guides/mini/guide-naming-conventions.html mod_group_id=com.extendedae_plus # The authors of the mod. This is a simple text string that is used for display purposes in the mod list. -mod_authors=YourNameHere, OtherNameHere +mod_authors=GaLi, C-H716 # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. -mod_description=Example mod description.\nNewline characters can be used and will be replaced properly. +mod_description=Add more practical features and auxiliary operations to the Applied Energistics 2 mod ## UI item explorer selection (emi | rei | jei) # Default to 'emi' per request; you can override by running with -Puse_Xei=rei or -Puse_Xei=jei diff --git a/src/main/java/com/extendedae_plus/ae/menu/EntitySpeedTickerMenu.java b/src/main/java/com/extendedae_plus/ae/menu/EntitySpeedTickerMenu.java index 1ec0691..1899796 100644 --- a/src/main/java/com/extendedae_plus/ae/menu/EntitySpeedTickerMenu.java +++ b/src/main/java/com/extendedae_plus/ae/menu/EntitySpeedTickerMenu.java @@ -9,12 +9,12 @@ import com.extendedae_plus.ae.parts.EntitySpeedTickerPart; import com.extendedae_plus.ae.screen.EntitySpeedTickerScreen; import com.extendedae_plus.api.config.EAPSettings; import com.extendedae_plus.config.ModConfigs; -import com.extendedae_plus.init.ModItems; import com.extendedae_plus.init.ModMenuTypes; import com.extendedae_plus.util.entitySpeed.ConfigParsingUtils; import com.extendedae_plus.util.entitySpeed.PowerUtils; import it.unimi.dsi.fastutil.shorts.ShortSet; import net.minecraft.client.Minecraft; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.Slot; import net.minecraft.world.level.block.entity.BlockEntity; @@ -23,25 +23,20 @@ import net.minecraft.world.level.block.entity.BlockEntity; * 实体加速器菜单,负责管理客户端与服务端的数据同步,处理加速卡、能量卡和目标方块的状态。 */ public class EntitySpeedTickerMenu extends UpgradeableMenu { - @GuiSync(716) public YesNo accelerate; // 是否启用加速 - @GuiSync(717) public YesNo redstoneControl; // 是否启用红石控制 - private int entitySpeedCardCount; // 已安装的实体加速卡数量 - @GuiSync(719) public int energyCardCount; // 已安装的能量卡数量 - @GuiSync(720) public int effectiveSpeed = 1; // 当前生效的加速倍率 - @GuiSync(721) public double multiplier = 1.0; // 目标方块的配置倍率 - @GuiSync(722) public boolean targetBlacklisted = false; // 目标方块是否在黑名单中 - @GuiSync(723) public YesNo networkEnergySufficient; // 网络能量是否充足 + private final EntitySpeedTickerPart logic; + @GuiSync(716) public int energyCardCount; // 已安装的能量卡数量 + @GuiSync(717) public int effectiveSpeed = 1; // 当前生效的加速倍率 + @GuiSync(718) public double multiplier = 1.0; // 目标方块的配置倍率 + @GuiSync(719) public boolean targetBlacklisted = false; // 目标方块是否在黑名单中 + @GuiSync(720) public YesNo networkEnergySufficient; // 网络能量是否充足 + @GuiSync(721) private YesNo accelerate; // 是否启用加速 + @GuiSync(722) private YesNo redstoneControl; // 是否启用红石控制 - protected final EntitySpeedTickerPart logic; - - @Override - protected void loadSettingsFromHost(IConfigManager cm) { - // 不需要模糊模式 - } /** * 构造函数,初始化菜单并绑定部件。 - * @param id 菜单ID - * @param ip 玩家背包 + * + * @param id 菜单ID + * @param ip 玩家背包 * @param host 关联的实体加速器部件 */ public EntitySpeedTickerMenu(int id, Inventory ip, EntitySpeedTickerPart host) { @@ -49,32 +44,34 @@ public class EntitySpeedTickerMenu extends UpgradeableMenuCrazy AE2 Addons启发 */ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTickable, MenuProvider, IUpgradeableObject { - public static final ResourceLocation MODEL_BASE = ResourceLocation.fromNamespaceAndPath( + private static final ResourceLocation MODEL_BASE = ResourceLocation.fromNamespaceAndPath( ExtendedAEPlus.MODID, "part/entity_speed_ticker_part"); @PartModels - public static final PartModel MODELS_OFF; + private static final PartModel MODELS_OFF; @PartModels - public static final PartModel MODELS_ON; + private static final PartModel MODELS_ON; @PartModels - public static final PartModel MODELS_HAS_CHANNEL; + private static final PartModel MODELS_HAS_CHANNEL; static { MODELS_OFF = new PartModel(MODEL_BASE, ResourceLocation.fromNamespaceAndPath(ExtendedAEPlus.MODID, "part/entity_speed_ticker_off")); @@ -70,10 +74,9 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka MODELS_HAS_CHANNEL = new PartModel(MODEL_BASE, ResourceLocation.fromNamespaceAndPath(ExtendedAEPlus.MODID, "part/entity_speed_ticker_has_channel")); } - private final IConfigManager configManager; public EntitySpeedTickerMenu menu; // 当前打开的菜单实例 - private YesNo networkEnergySufficient; // 网络能量是否充足 - private YesNo redstoneState = YesNo.UNDECIDED; + private YesNo networkEnergySufficient = YesNo.YES; // 网络能量是否充足 + /** * 构造函数,初始化部件并设置网络节点属性。 * @@ -85,40 +88,66 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka .setFlags(GridFlags.REQUIRE_CHANNEL) .setIdlePowerUsage(1) .addService(IGridTickable.class, this); - configManager = IConfigManager.builder(this::configChanged) - .registerSetting(EAPSettings.ACCELERATE, YesNo.NO) - .registerSetting(EAPSettings.REDSTONE_CONTROL, YesNo.YES) - .build(); } - private void configChanged(IConfigManager manager, Setting setting) { - this.saveChanges(); - } - - public void saveChanges() { - getHost().markForSave(); - } - - public boolean isAccelerate() { - return this.configManager.getSetting(EAPSettings.ACCELERATE) == YesNo.YES; - } - - public boolean isRedstoneControl() { - return this.configManager.getSetting(EAPSettings.REDSTONE_CONTROL) == YesNo.YES; - } - - public boolean isNetworkEnergySufficient() { - return this.networkEnergySufficient == YesNo.YES; + @Override + protected void registerSettings(IConfigManagerBuilder builder) { + super.registerSettings(builder); + builder.registerSetting(EAPSettings.ACCELERATE, YesNo.YES); // 默认开启加速 + builder.registerSetting(EAPSettings.REDSTONE_CONTROL, YesNo.NO); // 默认忽略红石信号 } /** - * 更新网络能量充足状态并通知菜单。 + * 获取可用的升级卡槽数量 * - * @param sufficient 是否能量充足 + * @return 升级卡槽数量 */ - private void setNetworkEnergySufficient(boolean sufficient) { - this.networkEnergySufficient = sufficient ? YesNo.YES : YesNo.NO; - saveChanges(); + @Override + protected int getUpgradeSlots() { + return 8; + } + + // 判断当前是否应该休眠 + @Override + protected boolean isSleeping() { + // 主开关没开 → 休眠 + if (this.getConfigManager().getSetting(EAPSettings.ACCELERATE) != YesNo.YES) { + return true; + } + + // 没开红石控制 → 一直工作 + if (this.getConfigManager().getSetting(EAPSettings.REDSTONE_CONTROL) != YesNo.YES) { + return false; + } + + // 开启了红石控制 → 必须有红石信号才工作 + return !this.getHost().hasRedstone(); // 没信号 → 休眠 + } + + @Override + protected void onSettingChanged(IConfigManager manager, Setting setting) { + // 每次玩家在 GUI 里点任何按钮(包括加速开关、红石控制开关)都会进来这里 + this.getMainNode().ifPresent((grid, node) -> { + if (this.isSleeping()) { + grid.getTickManager().sleepDevice(node); + } else { + grid.getTickManager().wakeDevice(node); + } + }); + } + + @Override + public void onNeighborChanged(BlockGetter level, BlockPos pos, BlockPos neighbor) { + // 只关心红石控制开启的情况下 + if (this.getConfigManager().getSetting(EAPSettings.REDSTONE_CONTROL) == YesNo.YES) { + this.getMainNode().ifPresent((grid, node) -> { + if (this.getHost().hasRedstone()) { + grid.getTickManager().wakeDevice(node); // 有信号 → 立刻唤醒 + } else { + grid.getTickManager().sleepDevice(node); // 没信号 → 立刻休眠 + } + }); + } } /** @@ -130,7 +159,7 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka */ @Override public final boolean onUseWithoutItem(Player player, Vec3 pos) { - if (!isClientSide()) { + if (!this.isClientSide()) { MenuOpener.open(ModMenuTypes.ENTITY_TICKER_MENU.get(), player, MenuLocators.forPart(this)); } return true; @@ -159,8 +188,30 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka */ @Override public void getBoxes(IPartCollisionHelper bch) { - bch.addBox(2, 2, 14, 14, 14, 16); - bch.addBox(5, 5, 12, 11, 11, 14); + bch.addBox(3, 3, 14, 13, 13, 16); + bch.addBox(5, 5, 11, 11, 11, 14); + } + + public void saveChanges() { + this.getHost().markForSave(); + } + + private boolean isAccelerate() { + return this.getConfigManager().getSetting(EAPSettings.ACCELERATE) == YesNo.YES; + } + + public boolean isNetworkEnergySufficient() { + return this.networkEnergySufficient == YesNo.YES; + } + + /** + * 更新网络能量充足状态并通知菜单。 + * + * @param sufficient 是否能量充足 + */ + private void setNetworkEnergySufficient(boolean sufficient) { + this.networkEnergySufficient = sufficient ? YesNo.YES : YesNo.NO; + this.saveChanges(); } /** @@ -172,7 +223,7 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka @Override public TickingRequest getTickingRequest(IGridNode iGridNode) { // 每 1 tick 执行一次 - return new TickingRequest(1, 1, false); + return new TickingRequest(1, 1, this.isSleeping()); } /** @@ -184,23 +235,24 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka */ @Override public TickRateModulation tickingRequest(IGridNode iGridNode, int ticksSinceLastCall) { - // 如果部件的加速开关被关闭,则不进行加速(提前返回) - if (!isAccelerate()) { + if (!this.isAccelerate()) { return TickRateModulation.IDLE; } - // 检查红石控制 - if (isRedstoneControl() && !getRedstoneState()) { - // 如果启用了红石控制且没有红石信号,则不执行加速 - return TickRateModulation.IDLE; + if (this.isSleeping()) { + return TickRateModulation.SLEEP; } // 获取目标方块实体(本部件朝向的方块) - BlockEntity target = getLevel().getBlockEntity(getBlockEntity().getBlockPos().relative(getSide())); + BlockEntity target = this.getLevel().getBlockEntity( + this.getBlockEntity().getBlockPos().relative(this.getSide()) + ); // 仅在目标存在且部件处于激活状态时执行加速 - if (target != null && isActive()) { - ticker(target); + if (target == null || !this.isActive()) { + return TickRateModulation.IDLE; } + + this.ticker(target); return TickRateModulation.IDLE; } @@ -211,7 +263,7 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka * @param 方块实体类型 */ private void ticker(@NotNull T blockEntity) { - if (!isValidForTicking()) { + if (!this.isValidForTicking()) { return; } @@ -220,22 +272,22 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka return; } - BlockEntityTicker ticker = getTicker(blockEntity); + BlockEntityTicker ticker = this.getTicker(blockEntity); if (ticker == null) { return; } - int speed = calculateSpeed(); + int speed = this.calculateSpeed(); if (speed <= 0) { return; } - double requiredPower = calculateRequiredPower(speed, blockId); - if (!extractPower(requiredPower)) { + double requiredPower = this.calculateRequiredPower(speed, blockId); + if (!this.extractPower(requiredPower)) { return; } - performTicks(blockEntity, ticker, speed); + this.performTicks(blockEntity, ticker, speed); } /** @@ -244,7 +296,7 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka * @return 是否可以执行 tick */ private boolean isValidForTicking() { - return getGridNode() != null && getMainNode() != null && getMainNode().getGrid() != null; + return this.getGridNode() != null && this.getMainNode() != null && this.getMainNode().getGrid() != null; } /** @@ -254,8 +306,8 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka * @return ticker 或 null */ private BlockEntityTicker getTicker(T blockEntity) { - return getLevel().getBlockState(blockEntity.getBlockPos()) - .getTicker(getLevel(), (BlockEntityType) blockEntity.getType()); + return this.getLevel().getBlockState(blockEntity.getBlockPos()) + .getTicker(this.getLevel(), (BlockEntityType) blockEntity.getType()); } /** @@ -264,9 +316,9 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka * @return 生效的加速倍率 */ private int calculateSpeed() { - int entitySpeedCardCount = getUpgrades().getInstalledUpgrades(ModItems.ENTITY_SPEED_CARD.get()); + int entitySpeedCardCount = this.getUpgrades().getInstalledUpgrades(ModItems.ENTITY_SPEED_CARD.get()); if (entitySpeedCardCount <= 0) return 0; - return (int) PowerUtils.computeProductWithCap(getUpgrades(), 8); + return (int) PowerUtils.computeProductWithCap(this.getUpgrades(), 8); } /** @@ -277,7 +329,7 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka * @return 所需能量 */ private double calculateRequiredPower(int speed, String blockId) { - int energyCardCount = getUpgrades().getInstalledUpgrades(AEItems.ENERGY_CARD); + int energyCardCount = this.getUpgrades().getInstalledUpgrades(AEItems.ENERGY_CARD); double multiplier = ConfigParsingUtils.getMultiplierForBlock(blockId, ModConfigs.ENTITY_TICKER_MULTIPLIERS.get()); return PowerUtils.computeFinalPowerForProduct(speed, energyCardCount) * multiplier; } @@ -289,15 +341,15 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka * @return 是否成功提取足够能量 */ private boolean extractPower(double requiredPower) { - IEnergyService energyService = getMainNode().getGrid().getEnergyService(); - MEStorage storage = getMainNode().getGrid().getStorageService().getInventory(); + IEnergyService energyService = this.getMainNode().getGrid().getEnergyService(); + MEStorage storage = this.getMainNode().getGrid().getStorageService().getInventory(); IActionSource source = IActionSource.ofMachine(this); boolean appFluxLoaded = ModList.get().isLoaded("appflux"); boolean preferDiskEnergy = appFluxLoaded && ModConfigs.PRIORITIZE_DISK_ENERGY.get(); // 如果 appflux 存在且优先磁盘能量,尝试提取 FE 能量 if (appFluxLoaded && preferDiskEnergy) { - if (tryExtractFE(energyService, storage, requiredPower, source)) { + if (this.tryExtractFE(energyService, storage, requiredPower, source)) { return true; } } @@ -307,14 +359,14 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka if (simulated >= requiredPower) { double extracted = energyService.extractAEPower(requiredPower, Actionable.MODULATE, PowerMultiplier.CONFIG); boolean sufficient = extracted >= requiredPower; - setNetworkEnergySufficient(sufficient); + this.setNetworkEnergySufficient(sufficient); return sufficient; } - setNetworkEnergySufficient(false); + this.setNetworkEnergySufficient(false); // 如果 appflux 存在且优先 AE 能量,尝试提取 FE 能量作为备用 if (appFluxLoaded && !preferDiskEnergy) { - return tryExtractFE(energyService, storage, requiredPower, source); + return this.tryExtractFE(energyService, storage, requiredPower, source); } return false; } @@ -332,13 +384,13 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka long feRequired = (long) requiredPower << 1; // 1 AE = 2 FE long feExtracted = (long) extractMethod.invoke(null, energyService, storage, feRequired, source); if (feExtracted >= feRequired) { - setNetworkEnergySufficient(true); + this.setNetworkEnergySufficient(true); return true; } } catch (Exception e) { // 如果反射失败,视为 FE 不可用 } - setNetworkEnergySufficient(false); + this.setNetworkEnergySufficient(false); return false; } @@ -354,12 +406,41 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka int speed) { // 执行 speed-1 次额外 tick(原生 tick 已包含 1 次) for (int i = 0; i < speed - 1; i++) { - ticker.tick( - blockEntity.getLevel(), - blockEntity.getBlockPos(), - blockEntity.getBlockState(), - blockEntity - ); + try { + ticker.tick( + blockEntity.getLevel(), + blockEntity.getBlockPos(), + blockEntity.getBlockState(), + blockEntity + ); + } catch (IllegalStateException e) { + // 捕获随机数生成器的多线程访问异常 + // 这通常发生在某些模组(如 Thermal)的机器使用随机数时 + // 由于加速导致在同一tick内多次访问随机数生成器而触发 ThreadingDetector + if (e.getMessage() != null && e.getMessage().contains("LegacyRandomSource")) { + // 记录警告并停止当前加速循环,避免崩溃 + ExtendedAELogger.LOGGER.warn( + "检测到方块实体 {} 在位置 {} 的随机数访问冲突,已停止本次加速以避免崩溃。" + + "建议将此方块类型添加到配置黑名单中。", + blockEntity.getType().toString(), + blockEntity.getBlockPos() + ); + break; // 停止后续的加速 tick + } else { + // 如果是其他类型的 IllegalStateException,继续抛出 + throw e; + } + } catch (Exception e) { + // 捕获其他可能的异常,防止崩溃 + ExtendedAELogger.LOGGER.error( + "在加速方块实体 {} 位置 {} 时发生错误: {}", + blockEntity.getType().toString(), + blockEntity.getBlockPos(), + e.getMessage(), + e + ); + break; // 停止后续的加速 tick + } } } @@ -397,46 +478,4 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka @NotNull Player player) { return new EntitySpeedTickerMenu(containerId, playerInventory, this); } - - /** - * 获取可用的升级卡槽数量 - * - * @return 升级卡槽数量 - */ - @Override - protected int getUpgradeSlots() { - return 8; - } - - /** - * 当升级卡数量发生变化时调用,通知菜单更新 - */ - @Override - public void upgradesChanged() { - if (this.menu != null) { - // 使用 AE2 风格:当升级发生变化时让菜单广播变化(槽/数据会被同步),客户端会基于槽内容重新计算并刷新界面 - this.menu.broadcastChanges(); - } - } - - public IConfigManager getConfigManager() { - return this.configManager; - } - - // 获取红石信号状态 - private boolean getRedstoneState() { - // 每次调用都更新红石状态,确保及时性 - updateRedstoneState(); - return redstoneState == YesNo.YES; - } - - // 更新红石信号状态 - private void updateRedstoneState() { - var be = this.getHost().getBlockEntity(); - if (be != null && be.getLevel() != null) { - redstoneState = be.getLevel().hasNeighborSignal(be.getBlockPos()) - ? YesNo.YES - : YesNo.NO; - } - } } \ No newline at end of file diff --git a/src/main/java/com/extendedae_plus/ae/screen/EntitySpeedTickerScreen.java b/src/main/java/com/extendedae_plus/ae/screen/EntitySpeedTickerScreen.java index 834b616..60ebc50 100644 --- a/src/main/java/com/extendedae_plus/ae/screen/EntitySpeedTickerScreen.java +++ b/src/main/java/com/extendedae_plus/ae/screen/EntitySpeedTickerScreen.java @@ -11,16 +11,13 @@ import com.extendedae_plus.api.config.EAPSettings; import com.extendedae_plus.client.gui.widgets.EAPServerSettingToggleButton; import com.extendedae_plus.client.gui.widgets.EAPSettingToggleButton; import com.extendedae_plus.util.entitySpeed.PowerUtils; -import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; -import java.util.HashMap; -import java.util.Map; - public class EntitySpeedTickerScreen extends UpgradeableScreen { private final EAPSettingToggleButton accelerateButton; // 加速开关按钮 private final EAPSettingToggleButton redstoneControlButton; // 加速开关按钮 + private final TextUpdater textUpdater = new TextUpdater(); /** * 构造函数,初始化界面和控件。 @@ -37,7 +34,7 @@ public class EntitySpeedTickerScreen extends UpgradeableScreen(EAPSettings.ACCELERATE, YesNo.NO); + this.accelerateButton = new EAPServerSettingToggleButton<>(EAPSettings.ACCELERATE, YesNo.YES); this.addToLeftToolbar(this.accelerateButton); this.redstoneControlButton = new EAPServerSettingToggleButton<>(EAPSettings.REDSTONE_CONTROL, YesNo.NO); @@ -54,47 +51,55 @@ public class EntitySpeedTickerScreen extends UpgradeableScreen textContents = new HashMap<>(); - if (this.getMenu().targetBlacklisted) { - // 黑名单禁用时的默认显示 - textContents.put("enable", Component.translatable("screen.extendedae_plus.entity_speed_ticker.enable")); - textContents.put("speed", Component.translatable("screen.extendedae_plus.entity_speed_ticker.speed", 0)); - textContents.put("energy", Component.translatable("screen.extendedae_plus.entity_speed_ticker.energy", Platform.formatPower(0.0, false))); - textContents.put("power_ratio", Component.translatable("screen.extendedae_plus.entity_speed_ticker.power_ratio", PowerUtils.formatPercentage(0.0))); - textContents.put("multiplier", Component.translatable("screen.extendedae_plus.entity_speed_ticker.multiplier", String.format("%.2fx", 0.0))); - } else { - // 正常状态下显示实际数据 - int energyCardCount = this.getMenu().energyCardCount; - double multiplier = this.getMenu().multiplier; - int effectiveSpeed = this.getMenu().effectiveSpeed; - double finalPower = PowerUtils.computeFinalPowerForProduct(effectiveSpeed, energyCardCount); - double remainingRatio = PowerUtils.getRemainingRatio(energyCardCount); - - textContents.put("enable", this.getMenu().networkEnergySufficient == YesNo.YES ? null : - Component.translatable("screen.extendedae_plus.entity_speed_ticker.warning_network_energy_insufficient")); - textContents.put("speed", Component.translatable("screen.extendedae_plus.entity_speed_ticker.speed", effectiveSpeed)); - textContents.put("energy", Component.translatable("screen.extendedae_plus.entity_speed_ticker.energy", Platform.formatPower(finalPower, false))); - textContents.put("power_ratio", Component.translatable("screen.extendedae_plus.entity_speed_ticker.power_ratio", PowerUtils.formatPercentage(remainingRatio))); - textContents.put("multiplier", Component.translatable("screen.extendedae_plus.entity_speed_ticker.multiplier", String.format("%.2fx", multiplier))); + private class TextUpdater { + void update() { + if (EntitySpeedTickerScreen.this.menu.targetBlacklisted) { + this.updateBlacklist(); + } else { + this.updateNormal(); + } + } + + private void updateBlacklist() { + this.set("enable", this.translatable("enable")); + this.set("speed", this.translatable("speed", 0)); + this.set("energy", this.translatable("energy", Platform.formatPower(0, false))); + this.set("power_ratio", this.translatable("power_ratio", PowerUtils.formatPercentage(0.0))); + this.set("multiplier", this.translatable("multiplier", "0.00x")); + } + + private void updateNormal() { + int energyCardCount = EntitySpeedTickerScreen.this.menu.energyCardCount; + double multiplier = EntitySpeedTickerScreen.this.menu.multiplier; + int effectiveSpeed = EntitySpeedTickerScreen.this.menu.effectiveSpeed; + double finalPower = PowerUtils.computeFinalPowerForProduct(effectiveSpeed, energyCardCount); + double powerRatio = PowerUtils.getRemainingRatio(energyCardCount); + + this.set("enable", EntitySpeedTickerScreen.this.menu.networkEnergySufficient == YesNo.YES + ? null + : this.translatable("warning_network_energy_insufficient")); + + this.set("speed", this.translatable("speed", effectiveSpeed)); + this.set("energy", this.translatable("energy", Platform.formatPower(finalPower, false))); + this.set("power_ratio", this.translatable("power_ratio", PowerUtils.formatPercentage(powerRatio))); + this.set("multiplier", this.translatable("multiplier", String.format("%.2fx", multiplier))); + } + + private Component translatable(String key, Object... args) { + return Component.translatable("screen.extendedae_plus.entity_speed_ticker." + key, args); + } + + private void set(String id, Component c) { + EntitySpeedTickerScreen.this.setTextContent(id, c); } - textContents.forEach(this::setTextContent); } } \ No newline at end of file diff --git a/src/main/resources/assets/ae2/screens/entity_speed_ticker.json b/src/main/resources/assets/ae2/screens/entity_speed_ticker.json index 352842a..255a364 100644 --- a/src/main/resources/assets/ae2/screens/entity_speed_ticker.json +++ b/src/main/resources/assets/ae2/screens/entity_speed_ticker.json @@ -11,7 +11,7 @@ 0, 0, 176, - 205 + 220 ] }, "text": { @@ -62,14 +62,14 @@ }, "widgets": { "toolbox": { - "right": 1, - "bottom": 55 + "right": 2, + "bottom": 66 } }, "slots": { "TOOLBOX": { - "right": 0, - "bottom": 50, + "right": 1, + "bottom": 60, "grid": "BREAK_AFTER_3COLS" } } diff --git a/src/main/resources/assets/ae2/textures/guis/blank_background.png b/src/main/resources/assets/ae2/textures/guis/blank_background.png index eee919cb8072bca5be8504f69325215c7e4e9a49..4eca0cfad8407e0083f8b789cfd461d7751ffb3a 100644 GIT binary patch delta 385 zcmZn=o+UQHf{CqTqg6W-pP`|ykx7W5iIt(5m9g36^Gx#SLVuV7RFW;sj4V>p%ylgc z3=(zI3{6aQEiDrbbS)DNjnfj1%}i2FlQtJHCo@VErKDNqWGWPwxR#YzB_@|-=I7Ze z6(^QWHeiu+H8W2#Gq5x>(@n87Pt{GdG)dC6G)YO+HA%6sut+m9Gc~tJQG)6%&qxL8 zG%_$U)rGpz$jTIm%qLG~vC)GnO3p~kOHWO)Rnk||w^OjeYdJA~z->7!fPj_@Vpu-; x97`NaLC(aW%?7NG7$-kq)!i(_uFWL&o7F{SzTTQMleHLtz|+;wWt~$(698~yZy^8x delta 106 zcmbOw)*w8=f{EqbMyqxvJ_Ac#L&Fe5b1Nf5D-+|%=b7Zuh5j%FO!i|@+g!w)$T&Hd wEt2J1Qp=Xjr`R4bZobK(%`|xfm#)}v*3xtH_3l?_EMNcvPgg&ebxsLQ0IkC!H~;_u diff --git a/src/main/resources/assets/extendedae_plus/models/item/entity_speed_ticker.json b/src/main/resources/assets/extendedae_plus/models/item/entity_speed_ticker.json index 51789c2..7b1d410 100644 --- a/src/main/resources/assets/extendedae_plus/models/item/entity_speed_ticker.json +++ b/src/main/resources/assets/extendedae_plus/models/item/entity_speed_ticker.json @@ -1,7 +1,190 @@ { "parent": "ae2:item/cable_interface", "textures": { + "sides": "extendedae_plus:part/entity_speed_ticker_sides", "front": "extendedae_plus:part/entity_speed_ticker_font", - "back": "extendedae_plus:part/entity_speed_ticker_back" + "back": "extendedae_plus:part/entity_speed_ticker_back", + "particle": "ae2:part/monitor_sides_status" + }, + "elements": [ + { + "from": [4, 4, 7], + "to": [12, 12, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "north": {"uv": [3, 3, 13, 13], "texture": "#front"}, + "south": {"uv": [3, 3, 13, 13], "texture": "#back"} + } + }, + { + "from": [5, 5, 10], + "to": [11, 11, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "east": {"uv": [12, 5, 13, 11], "texture": "#sides"}, + "south": {"uv": [5, 5, 11, 11], "texture": "#back"}, + "west": {"uv": [3, 5, 4, 11], "texture": "#sides"}, + "up": {"uv": [5, 3, 11, 4], "texture": "#sides"}, + "down": {"uv": [5, 12, 11, 13], "texture": "#sides"} + } + }, + { + "from": [5, 5, 9], + "to": [11, 11, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "east": {"uv": [13, 5, 14, 11], "texture": "#particle"}, + "south": {"uv": [11, 5, 5, 11], "texture": "#back"}, + "west": {"uv": [2, 5, 3, 11], "texture": "#particle"}, + "up": {"uv": [5, 2, 11, 3], "texture": "#particle"}, + "down": {"uv": [5, 13, 11, 14], "texture": "#particle"} + } + }, + { + "from": [5, 5, 11], + "to": [6, 7, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "east": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "south": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "west": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "up": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "down": {"uv": [1, 5, 2, 6], "texture": "#particle"} + } + }, + { + "from": [6, 10, 11], + "to": [7, 11, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "east": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "south": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "up": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "down": {"uv": [1, 5, 2, 6], "texture": "#particle"} + } + }, + { + "from": [9, 5, 11], + "to": [10, 6, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "south": {"uv": [14, 9, 15, 10], "texture": "#particle"}, + "west": {"uv": [14, 9, 15, 10], "texture": "#particle"}, + "up": {"uv": [14, 9, 15, 10], "texture": "#particle"}, + "down": {"uv": [14, 10, 15, 11], "texture": "#particle"} + } + }, + { + "from": [10, 5, 11], + "to": [11, 7, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "east": {"uv": [14, 9, 15, 11], "texture": "#particle"}, + "south": {"uv": [14, 9, 15, 11], "texture": "#particle"}, + "west": {"uv": [14, 9, 15, 11], "texture": "#particle"}, + "up": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "down": {"uv": [14, 6, 15, 7], "texture": "#particle"} + } + }, + { + "from": [10, 9, 11], + "to": [11, 11, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "east": {"uv": [14, 5, 15, 7], "texture": "#particle"}, + "south": {"uv": [14, 5, 15, 7], "texture": "#particle"}, + "west": {"uv": [14, 5, 15, 7], "texture": "#particle"}, + "up": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "down": {"uv": [14, 6, 15, 7], "texture": "#particle"} + } + }, + { + "from": [9, 10, 11], + "to": [10, 11, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "south": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "west": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "up": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "down": {"uv": [14, 6, 15, 7], "texture": "#particle"} + } + }, + { + "from": [5, 9, 11], + "to": [6, 11, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "east": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "south": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "west": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "up": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "down": {"uv": [1, 5, 2, 6], "texture": "#particle"} + } + }, + { + "from": [6, 5, 11], + "to": [7, 6, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "east": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "south": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "up": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "down": {"uv": [1, 5, 2, 6], "texture": "#particle"} + } + }, + { + "from": [3, 4, 7], + "to": [4, 12, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "north": {"uv": [2, 4, 3, 12], "texture": "#front"}, + "south": {"uv": [2, 4, 3, 12], "texture": "#back"}, + "west": {"uv": [0, 4, 2, 12], "texture": "#sides"}, + "up": {"uv": [2, 0, 3, 2], "texture": "#sides"}, + "down": {"uv": [13, 14, 14, 16], "texture": "#sides"} + } + }, + { + "from": [4, 12, 7], + "to": [12, 13, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "north": {"uv": [4, 2, 12, 3], "texture": "#front"}, + "east": {"uv": [14, 2, 16, 3], "texture": "#sides"}, + "south": {"uv": [4, 2, 12, 3], "texture": "#back"}, + "west": {"uv": [0, 2, 2, 3], "texture": "#sides"}, + "up": {"uv": [4, 0, 12, 2], "texture": "#sides"} + } + }, + { + "from": [4, 3, 7], + "to": [12, 4, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "north": {"uv": [4, 13, 12, 14], "texture": "#front"}, + "east": {"uv": [14, 2, 16, 3], "texture": "#sides"}, + "south": {"uv": [4, 13, 12, 14], "texture": "#back"}, + "west": {"uv": [0, 13, 2, 14], "texture": "#sides"}, + "down": {"uv": [4, 14, 12, 16], "texture": "#sides"} + } + }, + { + "from": [12, 4, 7], + "to": [13, 12, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 7]}, + "faces": { + "north": {"uv": [13, 4, 14, 12], "texture": "#front"}, + "east": {"uv": [14, 4, 16, 12], "texture": "#sides"}, + "south": {"uv": [13, 4, 14, 12], "texture": "#back"}, + "up": {"uv": [2, 0, 3, 2], "texture": "#sides"}, + "down": {"uv": [2, 14, 3, 16], "texture": "#sides"} + } + } + ], + "display": { + "gui": { + "rotation": [20, -130, 0], + "scale": [0.95, 0.95, 0.95] + } } } \ No newline at end of file diff --git a/src/main/resources/assets/extendedae_plus/models/part/entity_speed_ticker_part.json b/src/main/resources/assets/extendedae_plus/models/part/entity_speed_ticker_part.json index df7a2d4..7f90cf8 100644 --- a/src/main/resources/assets/extendedae_plus/models/part/entity_speed_ticker_part.json +++ b/src/main/resources/assets/extendedae_plus/models/part/entity_speed_ticker_part.json @@ -1,9 +1,181 @@ { - "parent": "ae2:part/interface_base", + "parent": "ae2:item/cable_interface", "textures": { - "front": "extendedae_plus:part/entity_speed_ticker_font", "sides": "extendedae_plus:part/entity_speed_ticker_sides", + "front": "extendedae_plus:part/entity_speed_ticker_font", "back": "extendedae_plus:part/entity_speed_ticker_back", - "particle": "extendedae_plus:part/entity_speed_ticker_back" - } + "particle": "ae2:part/monitor_sides_status" + }, + "elements": [ + { + "from": [4, 4, 0], + "to": [12, 12, 2], + "faces": { + "north": {"uv": [3, 3, 13, 13], "texture": "#front"}, + "south": {"uv": [3, 3, 13, 13], "texture": "#back"} + } + }, + { + "from": [5, 5, 3], + "to": [11, 11, 4], + "faces": { + "east": {"uv": [12, 5, 13, 11], "texture": "#sides"}, + "south": {"uv": [5, 5, 11, 11], "texture": "#back"}, + "west": {"uv": [3, 5, 4, 11], "texture": "#sides"}, + "up": {"uv": [5, 3, 11, 4], "texture": "#sides"}, + "down": {"uv": [5, 12, 11, 13], "texture": "#sides"} + } + }, + { + "from": [5, 5, 2], + "to": [11, 11, 3], + "faces": { + "east": {"uv": [13, 5, 14, 11], "texture": "#particle"}, + "south": {"uv": [11, 5, 5, 11], "texture": "#back"}, + "west": {"uv": [2, 5, 3, 11], "texture": "#particle"}, + "up": {"uv": [5, 2, 11, 3], "texture": "#particle"}, + "down": {"uv": [5, 13, 11, 14], "texture": "#particle"} + } + }, + { + "from": [5, 5, 4], + "to": [6, 7, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 5, 3]}, + "faces": { + "east": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "south": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "west": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "up": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "down": {"uv": [1, 5, 2, 6], "texture": "#particle"} + } + }, + { + "from": [6, 10, 4], + "to": [7, 11, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 10, 3]}, + "faces": { + "east": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "south": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "up": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "down": {"uv": [1, 5, 2, 6], "texture": "#particle"} + } + }, + { + "from": [9, 5, 4], + "to": [10, 6, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 5, 3]}, + "faces": { + "south": {"uv": [14, 9, 15, 10], "texture": "#particle"}, + "west": {"uv": [14, 9, 15, 10], "texture": "#particle"}, + "up": {"uv": [14, 9, 15, 10], "texture": "#particle"}, + "down": {"uv": [14, 10, 15, 11], "texture": "#particle"} + } + }, + { + "from": [10, 5, 4], + "to": [11, 7, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 5, 3]}, + "faces": { + "east": {"uv": [14, 9, 15, 11], "texture": "#particle"}, + "south": {"uv": [14, 9, 15, 11], "texture": "#particle"}, + "west": {"uv": [14, 9, 15, 11], "texture": "#particle"}, + "up": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "down": {"uv": [14, 6, 15, 7], "texture": "#particle"} + } + }, + { + "from": [10, 9, 4], + "to": [11, 11, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 9, 3]}, + "faces": { + "east": {"uv": [14, 5, 15, 7], "texture": "#particle"}, + "south": {"uv": [14, 5, 15, 7], "texture": "#particle"}, + "west": {"uv": [14, 5, 15, 7], "texture": "#particle"}, + "up": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "down": {"uv": [14, 6, 15, 7], "texture": "#particle"} + } + }, + { + "from": [9, 10, 4], + "to": [10, 11, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 10, 3]}, + "faces": { + "south": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "west": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "up": {"uv": [14, 5, 15, 6], "texture": "#particle"}, + "down": {"uv": [14, 6, 15, 7], "texture": "#particle"} + } + }, + { + "from": [5, 9, 4], + "to": [6, 11, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 9, 3]}, + "faces": { + "east": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "south": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "west": {"uv": [1, 5, 2, 7], "texture": "#particle"}, + "up": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "down": {"uv": [1, 5, 2, 6], "texture": "#particle"} + } + }, + { + "from": [6, 5, 4], + "to": [7, 6, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 5, 3]}, + "faces": { + "east": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "south": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "up": {"uv": [1, 5, 2, 6], "texture": "#particle"}, + "down": {"uv": [1, 5, 2, 6], "texture": "#particle"} + } + }, + { + "from": [3, 4, 0], + "to": [4, 12, 2], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 5, 0]}, + "faces": { + "north": {"uv": [2, 4, 3, 12], "texture": "#front"}, + "south": {"uv": [2, 4, 3, 12], "texture": "#back"}, + "west": {"uv": [0, 4, 2, 12], "texture": "#sides"}, + "up": {"uv": [2, 0, 3, 2], "texture": "#sides"}, + "down": {"uv": [13, 14, 14, 16], "texture": "#sides"} + } + }, + { + "from": [4, 12, 0], + "to": [12, 13, 2], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 12, 0]}, + "faces": { + "north": {"uv": [4, 2, 12, 3], "texture": "#front"}, + "east": {"uv": [14, 2, 16, 3], "texture": "#sides"}, + "south": {"uv": [4, 2, 12, 3], "texture": "#back"}, + "west": {"uv": [0, 2, 2, 3], "texture": "#sides"}, + "up": {"uv": [4, 0, 12, 2], "texture": "#sides"} + } + }, + { + "from": [4, 3, 0], + "to": [12, 4, 2], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 2, 0]}, + "faces": { + "north": {"uv": [4, 13, 12, 14], "texture": "#front"}, + "east": {"uv": [14, 2, 16, 3], "texture": "#sides"}, + "south": {"uv": [4, 13, 12, 14], "texture": "#back"}, + "west": {"uv": [0, 13, 2, 14], "texture": "#sides"}, + "down": {"uv": [4, 14, 12, 16], "texture": "#sides"} + } + }, + { + "from": [12, 4, 0], + "to": [13, 12, 2], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 4, 0]}, + "faces": { + "north": {"uv": [13, 4, 14, 12], "texture": "#front"}, + "east": {"uv": [14, 4, 16, 12], "texture": "#sides"}, + "south": {"uv": [13, 4, 14, 12], "texture": "#back"}, + "up": {"uv": [2, 0, 3, 2], "texture": "#sides"}, + "down": {"uv": [2, 14, 3, 16], "texture": "#sides"} + } + } + ] } \ No newline at end of file diff --git a/src/main/templates/META-INF/neoforge.mods.toml b/src/main/templates/META-INF/neoforge.mods.toml index e6de95f..b0f8b27 100644 --- a/src/main/templates/META-INF/neoforge.mods.toml +++ b/src/main/templates/META-INF/neoforge.mods.toml @@ -5,30 +5,24 @@ # Find more information on toml format here: https://github.com/toml-lang/toml # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml -modLoader="javafml" #mandatory +modLoader = "javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the FML version. This is currently 2. -loaderVersion="${loader_version_range}" #mandatory +loaderVersion = "${loader_version_range}" #mandatory # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. -license="${mod_license}" +license = "${mod_license}" # A URL to refer people to when problems occur with this mod -#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional # A list of mods - how many allowed here is determined by the individual mod loader -[[mods]] #mandatory - -# The modid of the mod -modId="${mod_id}" #mandatory - -# The version number of the mod -version="${mod_version}" #mandatory - -# A display name for the mod -displayName="${mod_name}" #mandatory - +[[mods]] +modId = "${mod_id}" +version = "${mod_version}" +displayName = "${mod_name}" +issueTrackerURL = "https://github.com/GaLicn/ExtendedAE_Plus/issues" +displayURL = "https://github.com/GaLicn/ExtendedAE_Plus" # A URL to query for updates for this mod. See the JSON update specification https://docs.neoforged.net/docs/misc/updatechecker/ #updateJSONURL="https://change.me.example.invalid/updates.json" #optional @@ -42,14 +36,14 @@ displayName="${mod_name}" #mandatory #credits="" #optional # A text field displayed in the mod UI -authors="${mod_authors}" #optional +authors = "${mod_authors}" #optional # The description text for the mod (multi line!) (#mandatory) -description='''${mod_description}''' +description = '''${mod_description}''' # The [[mixins]] block allows you to declare your mixin config to FML so that it gets loaded. [[mixins]] -config="${mod_id}.mixins.json" +config = "${mod_id}.mixins.json" # The [[accessTransformers]] block allows you to declare where your AT file is. # If this block is omitted, a fallback attempt will be made to load an AT from META-INF/accesstransformer.cfg @@ -59,41 +53,41 @@ config="${mod_id}.mixins.json" # The coremods config file path is not configurable and is always loaded from META-INF/coremods.json # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. -[[dependencies.${mod_id}]] #optional - # the modid of the dependency - modId="neoforge" #mandatory - # The type of the dependency. Can be one of "required", "optional", "incompatible" or "discouraged" (case insensitive). - # 'required' requires the mod to exist, 'optional' does not - # 'incompatible' will prevent the game from loading when the mod exists, and 'discouraged' will show a warning - type="required" #mandatory - # Optional field describing why the dependency is required or why it is incompatible - # reason="..." - # The version range of the dependency - versionRange="[21.1.1,)" #mandatory - # An ordering relationship for the dependency. - # BEFORE - This mod is loaded BEFORE the dependency - # AFTER - This mod is loaded AFTER the dependency - ordering="NONE" - # Side this dependency is applied on - BOTH, CLIENT, or SERVER - side="BOTH" +[[dependencies.${ mod_id }]] #optional +# the modid of the dependency +modId = "neoforge" #mandatory +# The type of the dependency. Can be one of "required", "optional", "incompatible" or "discouraged" (case insensitive). +# 'required' requires the mod to exist, 'optional' does not +# 'incompatible' will prevent the game from loading when the mod exists, and 'discouraged' will show a warning +type = "required" #mandatory +# Optional field describing why the dependency is required or why it is incompatible +# reason="..." +# The version range of the dependency +versionRange = "[21.1.1,)" #mandatory +# An ordering relationship for the dependency. +# BEFORE - This mod is loaded BEFORE the dependency +# AFTER - This mod is loaded AFTER the dependency +ordering = "NONE" +# Side this dependency is applied on - BOTH, CLIENT, or SERVER +side = "BOTH" # Here's another dependency -[[dependencies.${mod_id}]] - modId="minecraft" - type="required" - # This version range declares a minimum of the current minecraft version up to but not including the next major version - versionRange="${minecraft_version_range}" - ordering="NONE" - side="BOTH" +[[dependencies.${ mod_id }]] +modId = "minecraft" +type = "required" +# This version range declares a minimum of the current minecraft version up to but not including the next major version +versionRange = "${minecraft_version_range}" +ordering = "NONE" +side = "BOTH" # Require ExtendedAE (ExtendedAE-1.21-2.2.21-neoforge) to be present -[[dependencies.${mod_id}]] - modId="extendedae" - type="required" - # Use a permissive range to tolerate upstream version string variations (e.g. 1.21-2.2.21-neoforge) - versionRange="*" - ordering="AFTER" - side="BOTH" +[[dependencies.${ mod_id }]] +modId = "extendedae" +type = "required" +# Use a permissive range to tolerate upstream version string variations (e.g. 1.21-2.2.21-neoforge) +versionRange = "*" +ordering = "AFTER" +side = "BOTH" # Features are specific properties of the game environment, that you may want to declare you require. This example declares # that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't