Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/me/cortex/voxy/client/ClientImportManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected ClientImportTask(IDataImporter importer) {
super(importer);

this.bossbarUUID = UUID.randomUUID();
this.bossBar = new LerpingBossEvent(this.bossbarUUID, Component.nullToEmpty("Voxy world importer"), 0.0f, BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.PROGRESS, false, false, false);
this.bossBar = new LerpingBossEvent(this.bossbarUUID, Component.translatable("voxy.command.import.bossbarTitle"), 0.0f, BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.PROGRESS, false, false, false);
Minecraft.getInstance().execute(()->{
Minecraft.getInstance().gui.hud.getBossOverlay().events.put(bossBar.getId(), bossBar);
});
Expand All @@ -31,7 +31,7 @@ protected boolean onUpdate(int completed, int outOf) {
}
Minecraft.getInstance().execute(()->{
this.bossBar.setProgress((float) (((double)completed) / ((double) Math.max(1, outOf))));
this.bossBar.setName(Component.nullToEmpty("Voxy import: " + completed + "/" + outOf + " chunks"));
this.bossBar.setName(Component.translatable("voxy.command.import.progress", completed, outOf));
});
return true;
}
Expand All @@ -44,7 +44,7 @@ protected void onCompleted(int total) {
long delta = Math.max(System.currentTimeMillis() - this.startTime, 1);

String msg = "Voxy world import finished in " + (delta/1000) + " seconds, averaging " + (int)(total/(delta/1000f)) + " chunks per second";
Minecraft.getInstance().gui.hud.getChat().addClientSystemMessage(Component.literal(msg));
Minecraft.getInstance().gui.hud.getChat().addClientSystemMessage(Component.translatable("voxy.command.import.finished", delta/1000, (int)(total/(delta/1000f))));
Logger.info(msg);
});
}
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/me/cortex/voxy/client/VoxyCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static LiteralArgumentBuilder<FabricClientCommandSource> register() {
private static int reloadInstance(CommandContext<FabricClientCommandSource> ctx) {
var instance = (VoxyClientInstance)VoxyCommon.getInstance();
if (instance == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}

Expand All @@ -98,7 +98,7 @@ private static int reloadInstance(CommandContext<FabricClientCommandSource> ctx)
private static int verifyTLNs(CommandContext<FabricClientCommandSource> ctx, boolean attemptRepair) {
var instance = VoxyCommon.getInstance();
if (instance == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}
if (Minecraft.getInstance().level == null) {
Expand All @@ -116,7 +116,7 @@ private static int verifyTLNs(CommandContext<FabricClientCommandSource> ctx, boo
private static int importDistantHorizons(CommandContext<FabricClientCommandSource> ctx) {
var instance = (VoxyClientInstance)VoxyCommon.getInstance();
if (instance == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}
var dbFile = new File(ctx.getArgument("sqlDbPath", String.class));
Expand Down Expand Up @@ -154,7 +154,7 @@ private static boolean fileBasedImporter(File directory) {

private static int importRaw(CommandContext<FabricClientCommandSource> ctx) {
if (VoxyCommon.getInstance() == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}

Expand All @@ -163,7 +163,7 @@ private static int importRaw(CommandContext<FabricClientCommandSource> ctx) {

private static int importBobby(CommandContext<FabricClientCommandSource> ctx) {
if (VoxyCommon.getInstance() == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}

Expand Down Expand Up @@ -223,26 +223,26 @@ private static CompletableFuture<Suggestions> fileDirectorySuggester(Path dir, S

private static int importCurrentWorldIn(CommandContext<FabricClientCommandSource> ctx) {
if (VoxyCommon.getInstance() == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}

var localServer = Minecraft.getInstance().getSingleplayerServer();
if (localServer == null) {
ctx.getSource().sendError(Component.translatable("You must be in single player to use this command"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.singlePlayerOnly"));
return 1;
}
var regionPath = DimensionType.getStorageFolder(Minecraft.getInstance().level.dimension(), localServer.getWorldPath(LevelResource.ROOT)).resolve("region");
if ((!regionPath.toFile().exists())||!regionPath.toFile().isDirectory()) {
ctx.getSource().sendError(Component.translatable("Cannot find region folder for current dimension"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.noRegionFolder"));
return 1;
}
return fileBasedImporter(regionPath.toFile())?0:1;
}

private static int importWorld(CommandContext<FabricClientCommandSource> ctx) {
if (VoxyCommon.getInstance() == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}

Expand Down Expand Up @@ -288,7 +288,7 @@ private static int importZip(CommandContext<FabricClientCommandSource> ctx) {

var instance = (VoxyClientInstance)VoxyCommon.getInstance();
if (instance == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}
String finalInnerDir = innerDir;
Expand All @@ -307,7 +307,7 @@ private static int importZip(CommandContext<FabricClientCommandSource> ctx) {
private static int cancelImport(CommandContext<FabricClientCommandSource> ctx) {
var instance = (VoxyClientInstance)VoxyCommon.getInstance();
if (instance == null) {
ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this"));
ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled"));
return 1;
}
var world = WorldIdentifier.ofEngineNullable(Minecraft.getInstance().level);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void registerConfigLate(ConfigBuilder B) {
SSAO.SSAOMode.class,
Component.translatable("voxy.config.general.ssao_mode"),
()->CFG.getSSAOMode(), v->CFG.setSSAOMode(v))
.setNameProvider(value -> Component.translatable("voxy.config.general.ssao_mode." + value.name().toLowerCase()))
.setImpact(OptionImpact.MEDIUM)//TODO make it on igpus this is high
.setPostChangeFlags(RENDER_RELOAD)
).setEnablerInherit(s->!IrisUtil.irisShadersEnabledInConfig(), ConfigState.UPDATE_ON_REBUILD)
Expand Down
15 changes: 14 additions & 1 deletion src/main/resources/assets/voxy/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,18 @@
"voxy.config.general.render_fog.tooltip": "Enables or disables render fog effect",

"voxy.config.general.ssao_mode": "SSAO Mode",
"voxy.config.general.ssao_mode.tooltip": "The mode used for screenspace ambient occlusion (Auto attempts to pick the best option while reducing performance impact)"
"voxy.config.general.ssao_mode.tooltip": "The mode used for screenspace ambient occlusion (Auto attempts to pick the best option while reducing performance impact)",

"voxy.config.general.ssao_mode.auto": "Auto",
"voxy.config.general.ssao_mode.basic": "Basic",
"voxy.config.general.ssao_mode.better": "Better",
"voxy.config.general.ssao_mode.best": "Best",

"voxy.command.error.voxyDisabled": "Voxy must be enabled in settings to use this",
"voxy.command.error.singlePlayerOnly": "You must be in single player to use this command",
"voxy.command.error.noRegionFolder": "Cannot find region folder for current dimension",

"voxy.command.import.bossbarTitle": "Voxy world importer",
"voxy.command.import.progress": "Voxy import: %d/%d chunks",
"voxy.command.import.finished": "Voxy world import finished in %d seconds, averaging %d chunks per second"
}
49 changes: 49 additions & 0 deletions src/main/resources/assets/voxy/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"voxy.config.title": "Voxy",

"voxy.config.general": "通用",
"voxy.config.rendering": "渲染",

"voxy.config.general.enabled": "启用 Voxy",
"voxy.config.general.enabled.tooltip": "完全启用或禁用 Voxy",

"voxy.config.general.serviceThreads": "服务线程数",
"voxy.config.general.serviceThreads.tooltip": "ServiceThreadPool 可使用的线程数量",

"voxy.config.general.useSodiumBuilder": "使用 Sodium 线程",
"voxy.config.general.useSodiumBuilder.tooltip": "使用 Sodium 的构建线程作为 Voxy 线程池的一部分,在高渲染距离下快速移动时可减少卡顿和延迟",

"voxy.config.general.ingest": "区块摄入",
"voxy.config.general.ingest.tooltip": "启用或禁用 Voxy 将新区块转换为 LOD 的功能",

"voxy.config.general.rendering": "Voxy 渲染",
"voxy.config.general.rendering.tooltip": "启用或禁用 Voxy 渲染",

"voxy.config.general.subDivisionSize": "细分大小(像素²)",
"voxy.config.general.subDivisionSize.tooltip": "细分到更小 LOD 前,屏幕空间 AABB 的最大像素大小(越小质量越高)",

"voxy.config.general.renderDistance": "渲染距离",
"voxy.config.general.renderDistance.tooltip": "Voxy 的渲染距离(以区块为单位)",

"voxy.config.general.environmental_fog": "启用环境雾",
"voxy.config.general.environmental_fog.tooltip": "启用或禁用 Voxy 渲染环境雾效果",

"voxy.config.general.render_fog": "启用渲染雾",
"voxy.config.general.render_fog.tooltip": "启用或禁用渲染雾效果",

"voxy.config.general.ssao_mode": "SSAO 模式",
"voxy.config.general.ssao_mode.tooltip": "屏幕空间环境光遮蔽的模式(自动模式会尝试选择最佳选项并减少性能影响)",

"voxy.config.general.ssao_mode.auto": "自动",
"voxy.config.general.ssao_mode.basic": "基础",
"voxy.config.general.ssao_mode.better": "较好",
"voxy.config.general.ssao_mode.best": "最佳",

"voxy.command.error.voxyDisabled": "Voxy 必须在设置中启用才能使用此命令",
"voxy.command.error.singlePlayerOnly": "你必须在单人游戏中才能使用此命令",
"voxy.command.error.noRegionFolder": "找不到当前维度的区域文件夹",

"voxy.command.import.bossbarTitle": "Voxy 世界导入器",
"voxy.command.import.progress": "Voxy 导入中:%d/%d 个区块",
"voxy.command.import.finished": "Voxy 世界导入完成,耗时 %d 秒,平均每秒处理 %d 个区块"
}