feat: 调整lang文件
This commit is contained in:
parent
9966205aa2
commit
9c7d49bb7e
|
|
@ -54,7 +54,9 @@ public class ExtendedAEPlus {
|
|||
NeoForge.EVENT_BUS.register(this);
|
||||
|
||||
// 注册配置:接入自定义的 ModConfigs
|
||||
modContainer.registerConfig(ModConfig.Type.COMMON, ModConfigs.COMMON_SPEC);
|
||||
modContainer.registerConfig(ModConfig.Type.COMMON, ModConfigs.COMMON_SPEC, "extendedae_plus-common.toml");
|
||||
modContainer.registerConfig(ModConfig.Type.CLIENT, ModConfigs.CLIENT_SPEC, "extendedae_plus-client.toml");
|
||||
modContainer.registerConfig(ModConfig.Type.SERVER, ModConfigs.SERVER_SPEC, "extendedae_plus-server.toml");
|
||||
}
|
||||
|
||||
// 便捷 ResourceLocation 工具
|
||||
|
|
|
|||
|
|
@ -5,61 +5,62 @@ import net.neoforged.neoforge.common.ModConfigSpec;
|
|||
import java.util.List;
|
||||
|
||||
public final class ModConfigs {
|
||||
// Common 配置
|
||||
public static final ModConfigSpec COMMON_SPEC;
|
||||
public static final ModConfigSpec.IntValue PAGE_MULTIPLIER;
|
||||
public static final ModConfigSpec.DoubleValue WIRELESS_MAX_RANGE;
|
||||
public static final ModConfigSpec.BooleanValue WIRELESS_CROSS_DIM_ENABLE;
|
||||
public static final ModConfigSpec.BooleanValue SHOW_ENCOD_PATTERN_PLAYER;
|
||||
public static final ModConfigSpec.BooleanValue PROVIDER_ROUND_ROBIN_ENABLE;
|
||||
|
||||
// Client 配置
|
||||
public static final ModConfigSpec CLIENT_SPEC;
|
||||
public static final ModConfigSpec.BooleanValue SHOW_ENCODER_PATTERN_PLAYER;
|
||||
public static final ModConfigSpec.BooleanValue PATTERN_TERMINAL_SHOW_SLOTS_DEFAULT;
|
||||
|
||||
// Server 配置
|
||||
public static final ModConfigSpec SERVER_SPEC;
|
||||
public static final ModConfigSpec.BooleanValue PROVIDER_ROUND_ROBIN_ENABLE;
|
||||
public static final ModConfigSpec.IntValue SMART_SCALING_MAX_MULTIPLIER;
|
||||
public static final ModConfigSpec.IntValue CRAFTING_PAUSE_THRESHOLD;
|
||||
public static final ModConfigSpec.DoubleValue WIRELESS_MAX_RANGE;
|
||||
public static final ModConfigSpec.BooleanValue WIRELESS_CROSS_DIM_ENABLE;
|
||||
public static final ModConfigSpec.IntValue ENTITY_TICKER_COST;
|
||||
public static final ModConfigSpec.ConfigValue<List<? extends String>> ENTITY_TICKER_BLACK_LIST;
|
||||
public static final ModConfigSpec.ConfigValue<List<? extends String>> ENTITY_TICKER_MULTIPLIERS;
|
||||
static {
|
||||
ModConfigSpec.Builder builder = new ModConfigSpec.Builder();
|
||||
|
||||
// General settings
|
||||
builder.push("general");
|
||||
PAGE_MULTIPLIER = builder
|
||||
static {
|
||||
// Common 配置
|
||||
ModConfigSpec.Builder commonBuilder = new ModConfigSpec.Builder();
|
||||
commonBuilder.push("common");
|
||||
PAGE_MULTIPLIER = commonBuilder
|
||||
.comment(
|
||||
"扩展样板供应器总槽位容量的倍率",
|
||||
"基础为36,每页仍显示36格,倍率会增加总页数/总容量",
|
||||
"建议范围 1-16"
|
||||
)
|
||||
.defineInRange("pageMultiplier", 1, 1, 64);
|
||||
commonBuilder.pop();
|
||||
COMMON_SPEC = commonBuilder.build();
|
||||
|
||||
// 是否显示样板编码玩家(通用)
|
||||
SHOW_ENCOD_PATTERN_PLAYER = builder
|
||||
// Client 配置
|
||||
ModConfigSpec.Builder clientBuilder = new ModConfigSpec.Builder();
|
||||
clientBuilder.push("client");
|
||||
SHOW_ENCODER_PATTERN_PLAYER = clientBuilder
|
||||
.comment(
|
||||
"是否显示样板编码玩家",
|
||||
"开启后将在样板 HoverText 上添加样板的编码玩家"
|
||||
)
|
||||
.define("showEncoderPatternPlayer", true);
|
||||
|
||||
// 模式访问终端(ExtendedAE 图样终端)默认是否显示槽位渲染(SlotsRow)。
|
||||
// true: 默认显示(可通过界面按钮临时隐藏);false: 默认隐藏(可通过按钮显示)
|
||||
PATTERN_TERMINAL_SHOW_SLOTS_DEFAULT = builder
|
||||
PATTERN_TERMINAL_SHOW_SLOTS_DEFAULT = clientBuilder
|
||||
.comment(
|
||||
"样板终端默认是否显示槽位",
|
||||
"影响进入界面时SlotsRow的默认可见性,仅影响客户端显示"
|
||||
)
|
||||
.define("patternTerminalShowSlotsDefault", true);
|
||||
clientBuilder.pop();
|
||||
CLIENT_SPEC = clientBuilder.build();
|
||||
|
||||
CRAFTING_PAUSE_THRESHOLD = builder
|
||||
.comment(
|
||||
"值越大将减少AE构建合成计划过程中的 wait/notify 次数,提升吞吐但会降低调度响应性"
|
||||
)
|
||||
.defineInRange("craftingPauseThreshold", 100000, 100, Integer.MAX_VALUE);
|
||||
|
||||
// end general
|
||||
builder.pop();
|
||||
|
||||
// Smart-scaling group
|
||||
builder.push("smartScaling");
|
||||
// 智能倍增:是否在样板供应器间轮询分配请求量(开启:按 provider 均分;关闭:不拆分)
|
||||
PROVIDER_ROUND_ROBIN_ENABLE = builder
|
||||
// Server 配置
|
||||
ModConfigSpec.Builder serverBuilder = new ModConfigSpec.Builder();
|
||||
serverBuilder.push("ae");
|
||||
PROVIDER_ROUND_ROBIN_ENABLE = serverBuilder
|
||||
.comment(
|
||||
"智能倍增时是否对样板供应器轮询分配",
|
||||
"仅多个供应器有相同样板时生效,开启后请求会均分到所有可用供应器,关闭则全部分配给单一供应器",
|
||||
|
|
@ -67,75 +68,64 @@ public final class ModConfigs {
|
|||
"默认: true"
|
||||
)
|
||||
.define("providerRoundRobinEnable", true);
|
||||
|
||||
// 智能倍增的最大倍数(以单次样板产出为单位)。
|
||||
// 0 表示不限制;>0 表示最大倍增倍数上限,例如 64 表示最多放大到 64 倍。
|
||||
SMART_SCALING_MAX_MULTIPLIER = builder
|
||||
SMART_SCALING_MAX_MULTIPLIER = serverBuilder
|
||||
.comment(
|
||||
"智能倍增的最大倍数(0 表示不限制)",
|
||||
"此倍数是针对单次样板产出的放大倍数上限,用于限制一次推送中按倍增缩放的规模"
|
||||
)
|
||||
.defineInRange("smartScalingMaxMultiplier", 0, 0, 1048576);
|
||||
CRAFTING_PAUSE_THRESHOLD = serverBuilder
|
||||
.comment(
|
||||
"值越大将减少AE构建合成计划过程中的 wait/notify 次数,提升吞吐但会降低调度响应性"
|
||||
)
|
||||
.defineInRange("craftingPauseThreshold", 100000, 100, Integer.MAX_VALUE);
|
||||
serverBuilder.pop();
|
||||
|
||||
builder.pop(); // pop smart
|
||||
|
||||
// Wireless settings
|
||||
builder.push("wireless");
|
||||
// 无线收发器:最大连接距离(单位:方块)。
|
||||
// 一对多从端连接主端时,将以该值作为范围限制。
|
||||
WIRELESS_MAX_RANGE = builder
|
||||
serverBuilder.push("wireless");
|
||||
WIRELESS_MAX_RANGE = serverBuilder
|
||||
.comment(
|
||||
"无线收发器最大连接距离(单位:方块)",
|
||||
"从端与主端的直线距离需小于等于该值才会建立连接。"
|
||||
)
|
||||
.defineInRange("wirelessMaxRange", 256.0D, 1.0D, 4096.0D);
|
||||
|
||||
// 是否允许跨维度连接(忽略维度差异进行频道传输)。
|
||||
WIRELESS_CROSS_DIM_ENABLE = builder
|
||||
WIRELESS_CROSS_DIM_ENABLE = serverBuilder
|
||||
.comment(
|
||||
"是否允许无线收发器跨维度建立连接",
|
||||
"开启后,从端可连接到不同维度的主端(忽略距离限制)"
|
||||
)
|
||||
.define("wirelessCrossDimEnable", true);
|
||||
serverBuilder.pop();
|
||||
|
||||
builder.pop(); // pop wireless
|
||||
|
||||
builder.push("entitySpeedTicker");
|
||||
|
||||
ENTITY_TICKER_COST = builder
|
||||
serverBuilder.push("entitySpeedTicker");
|
||||
ENTITY_TICKER_COST = serverBuilder
|
||||
.comment(
|
||||
"实体加速器能量消耗基础值"
|
||||
)
|
||||
.defineInRange("entityTickerCost", 512, 0 , Integer.MAX_VALUE);
|
||||
|
||||
|
||||
ENTITY_TICKER_BLACK_LIST = builder
|
||||
.defineInRange("entityTickerCost", 512, 0, Integer.MAX_VALUE);
|
||||
ENTITY_TICKER_BLACK_LIST = serverBuilder
|
||||
.comment(
|
||||
"实体加速器黑名单:匹配的方块将不会被加速。支持通配符/正则(例如:minecraft:*)",
|
||||
"格式:全名或通配符/正则字符串,例如 'minecraft:chest'、'minecraft:*'、'modid:.*_fluid'"
|
||||
)
|
||||
.defineListAllowEmpty(
|
||||
List.of("entityTickerBlackList"), // 路径
|
||||
List::of, // 默认值
|
||||
() -> "", // 新元素默认值(空字符串,供配置编辑器使用)
|
||||
obj -> obj instanceof String // 验证每个元素是字符串
|
||||
List.of("entityTickerBlackList"),
|
||||
List::of,
|
||||
() -> "",
|
||||
obj -> obj instanceof String
|
||||
);
|
||||
|
||||
ENTITY_TICKER_MULTIPLIERS = builder
|
||||
ENTITY_TICKER_MULTIPLIERS = serverBuilder
|
||||
.comment(
|
||||
"额外消耗倍率配置:为某些方块设置额外能量倍率,格式 'modid:blockid multiplier',例如 'minecraft:chest 2x'",
|
||||
"支持通配符/正则匹配(例如 'minecraft:* 2x' 会对整个命名空间生效)。"
|
||||
)
|
||||
.defineListAllowEmpty(
|
||||
List.of("entityTickerMultipliers"), // 路径
|
||||
List::of, // 默认值
|
||||
() -> "", // 新元素默认值(空字符串,供配置编辑器使用)
|
||||
obj -> obj instanceof String // 验证每个元素是字符串
|
||||
List.of("entityTickerMultipliers"),
|
||||
List::of,
|
||||
() -> "",
|
||||
obj -> obj instanceof String
|
||||
);
|
||||
|
||||
builder.pop();
|
||||
|
||||
COMMON_SPEC = builder.build();
|
||||
serverBuilder.pop();
|
||||
SERVER_SPEC = serverBuilder.build();
|
||||
}
|
||||
|
||||
private ModConfigs() {
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import com.extendedae_plus.config.ModConfigs;
|
|||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
|
@ -21,7 +21,7 @@ public class EncodedPatternItemMixin {
|
|||
// 客户端:在 HoverText 显示样板的编码玩家
|
||||
@Inject(method = "appendHoverText", at = @At("TAIL"))
|
||||
public void epp$appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> lines, TooltipFlag advancedTooltips, CallbackInfo ci){
|
||||
if (ModConfigs.SHOW_ENCOD_PATTERN_PLAYER.get()) {
|
||||
if (ModConfigs.SHOW_ENCODER_PATTERN_PLAYER.get()) {
|
||||
var customData = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY);
|
||||
var tag = customData.copyTag();
|
||||
if (tag.contains("encodePlayer")) {
|
||||
|
|
|
|||
|
|
@ -67,28 +67,29 @@
|
|||
|
||||
"screen.extendedae_plus.title": "ExtendedAE Plus Configuration",
|
||||
"config.extendedae_plus": "ExtendedAE Plus",
|
||||
|
||||
"extendedae_plus.configuration.general": "General",
|
||||
|
||||
"extendedae_plus.configuration.common": "Common Configuration",
|
||||
"extendedae_plus.configuration.pageMultiplier": "Pattern Provider Slot Multiplier",
|
||||
"extendedae_plus.configuration.pageMultiplier_with_range": "Pattern Provider Slot Multiplier (1-64)",
|
||||
|
||||
"extendedae_plus.configuration.client": "Display Configuration",
|
||||
"extendedae_plus.configuration.showEncoderPatternPlayer": "Show Pattern Encoder Player",
|
||||
"extendedae_plus.configuration.patternTerminalShowSlotsDefault": "Pattern Terminal Show Slots by Default",
|
||||
"extendedae_plus.configuration.craftingPauseThreshold": "AE Crafting Calculation Pause Threshold",
|
||||
|
||||
"extendedae_plus.configuration.ae": "AE2 Configuration",
|
||||
"extendedae_plus.configuration.craftingPauseThreshold": "AE Crafting Pause Threshold",
|
||||
"extendedae_plus.configuration.smartScaling": "Smart Pattern Scaling",
|
||||
"extendedae_plus.configuration.providerRoundRobinEnable": "Enable Pattern Provider Round-Robin Allocation",
|
||||
"extendedae_plus.configuration.providerRoundRobinEnable": "Enable Pattern Provider Round-Robin",
|
||||
"extendedae_plus.configuration.smartScalingMaxMultiplier": "Smart Scaling Maximum Multiplier",
|
||||
"extendedae_plus.configuration.smartScalingMaxMultiplier_with_range": "Smart Scaling Maximum Multiplier (0 for Unlimited)",
|
||||
|
||||
"extendedae_plus.configuration.smartScalingMaxMultiplier_with_range": "Smart Scaling Maximum Multiplier (0 for unlimited)",
|
||||
"extendedae_plus.configuration.wireless": "Wireless Connector Configuration",
|
||||
"extendedae_plus.configuration.wirelessMaxRange": "Wireless Maximum Range",
|
||||
"extendedae_plus.configuration.wirelessMaxRange_with_range": "Wireless Maximum Range (1-4096)",
|
||||
"extendedae_plus.configuration.wirelessCrossDimEnable": "Allow Wireless Transceiver Cross-Dimension Connection",
|
||||
|
||||
"extendedae_plus.configuration.entitySpeedTicker": "Entity Accelerator",
|
||||
"extendedae_plus.configuration.entityTickerCost": "Entity Accelerator Base Energy Consumption",
|
||||
"extendedae_plus.configuration.entityTickerBlackList": "Entity Accelerator Blacklist",
|
||||
"extendedae_plus.configuration.entityTickerMultipliers": "Entity Accelerator Additional Consumption Multiplier",
|
||||
"extendedae_plus.configuration.wirelessCrossDimEnable": "Enable Wireless Cross-Dimensional Connection",
|
||||
"extendedae_plus.configuration.entitySpeedTicker": "Entity Speed Ticker",
|
||||
"extendedae_plus.configuration.entityTickerCost": "Entity Ticker Base Energy Cost",
|
||||
"extendedae_plus.configuration.entityTickerBlackList": "Entity Ticker Blacklist",
|
||||
"extendedae_plus.configuration.entityTickerMultipliers": "Entity Ticker Extra Cost Multipliers",
|
||||
|
||||
"extendedae_plus.configuration.state_on": "On",
|
||||
"extendedae_plus.configuration.state_off": "Off"
|
||||
|
|
|
|||
|
|
@ -68,23 +68,24 @@
|
|||
"screen.extendedae_plus.title": "ExtendedAE Plus 配置",
|
||||
"config.extendedae_plus": "ExtendedAE Plus",
|
||||
|
||||
"extendedae_plus.configuration.general": "通用",
|
||||
"extendedae_plus.configuration.common": "通用配置",
|
||||
"extendedae_plus.configuration.pageMultiplier": "扩展样板供应器槽位倍率",
|
||||
"extendedae_plus.configuration.pageMultiplier_with_range": "扩展样板供应器槽位倍率 (1-64)",
|
||||
|
||||
"extendedae_plus.configuration.client": "显示配置",
|
||||
"extendedae_plus.configuration.showEncoderPatternPlayer": "显示样板编码玩家",
|
||||
"extendedae_plus.configuration.patternTerminalShowSlotsDefault": "样板终端默认显示槽位",
|
||||
"extendedae_plus.configuration.craftingPauseThreshold": "AE合成计算暂停检查阈值",
|
||||
|
||||
"extendedae_plus.configuration.ae": "AE2配置",
|
||||
"extendedae_plus.configuration.craftingPauseThreshold": "AE合成计算暂停检查阈值",
|
||||
"extendedae_plus.configuration.smartScaling": "智能样板倍增",
|
||||
"extendedae_plus.configuration.providerRoundRobinEnable": "启用样板供应器轮询分配",
|
||||
"extendedae_plus.configuration.smartScalingMaxMultiplier": "智能倍增最大倍数",
|
||||
"extendedae_plus.configuration.smartScalingMaxMultiplier_with_range": "智能倍增最大倍数 (0为不限制)",
|
||||
|
||||
"extendedae_plus.configuration.wireless": "无线连接器配置",
|
||||
"extendedae_plus.configuration.wirelessMaxRange": "无线最大距离",
|
||||
"extendedae_plus.configuration.wirelessMaxRange_with_range": "无线最大距离 (1-4096)",
|
||||
"extendedae_plus.configuration.wirelessCrossDimEnable": "无线收发器允许跨维度连接",
|
||||
|
||||
"extendedae_plus.configuration.entitySpeedTicker": "实体加速器",
|
||||
"extendedae_plus.configuration.entityTickerCost": "实体加速器能量消耗基础值",
|
||||
"extendedae_plus.configuration.entityTickerBlackList": "实体加速器黑名单",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user