Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
import static org.jackhuang.hmcl.util.logging.Logger.LOG;

public final class DatapackListPage extends ListPageBase<DatapackListPageSkin.DatapackInfoObject> {
public final class DatapackListPage extends ListPageBase<DatapackListPageSkin.DatapackInfoObject> implements WorldManagePage.WorldRefreshable {
private final Path worldDir;
private final Datapack datapack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
/**
* @author Glavo
*/
public final class WorldBackupsPage extends ListPageBase<WorldBackupsPage.BackupInfo> {
public final class WorldBackupsPage extends ListPageBase<WorldBackupsPage.BackupInfo> implements WorldManagePage.WorldRefreshable {
static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss");

private final World world;
Expand Down
306 changes: 152 additions & 154 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldInfoPage.java

Large diffs are not rendered by default.

256 changes: 157 additions & 99 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldManagePage.java

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ world.info.last_played=Last Played
world.info.generate_features=Generate Structures
world.info.player=Player Information
world.info.player.food_level=Hunger Level
world.info.player.food_saturation_level=Saturation
world.info.player.game_type=Game Mode
world.info.player.game_type.adventure=Adventure
world.info.player.game_type.creative=Creative
Expand All @@ -1195,8 +1196,9 @@ world.info.player.location=Location
world.info.player.spawn=Spawn Location
world.info.player.xp_level=Experience Level
world.info.random_seed=Seed
world.info.time=Game Time
world.info.time.format=%s days
world.info.spawn=World Spawn Location
world.info.time=Played Time
world.info.time.format=%dd %dh %dm
world.load.fail=Failed to load world
world.locked=In use
world.locked.failed=The world is currently in use. Please close the game and try again.
Expand Down
2 changes: 0 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,6 @@ world.info.player.location=الموقع
world.info.player.spawn=موقع الظهور
world.info.player.xp_level=مستوى الخبرة
world.info.random_seed=البذرة
world.info.time=وقت اللعبة
world.info.time.format=%s أيام
world.locked=قيد الاستخدام
world.locked.failed=العالم قيد الاستخدام حاليًا. يرجى إغلاق اللعبة والمحاولة مرة أخرى.
world.manage=العوالم
Expand Down
2 changes: 0 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1160,8 +1160,6 @@ world.info.player.location=Ubicación
world.info.player.spawn=Ubicación de desove
world.info.player.xp_level=Nivel de experiencia
world.info.random_seed=Semilla
world.info.time=Tiempo de juego
world.info.time.format=%s días
world.locked=En uso
world.locked.failed=El mundo está actualmente en uso. Por favor, cierra el juego e inténtalo de nuevo.
world.manage=Mundos
Expand Down
2 changes: 0 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_lzh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,6 @@ world.info.player.location=所
world.info.player.spawn=床/復生錨之所
world.info.player.xp_level=經驗之層
world.info.random_seed=種
world.info.time=戲之時辰
world.info.time.format=%s 日
world.locked=見用
world.manage=司生界
world.manage.button=司生界
Expand Down
2 changes: 0 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1152,8 +1152,6 @@ world.info.player.location=Расположение
world.info.player.spawn=Точка возрождения
world.info.player.xp_level=Уровень опыта
world.info.random_seed=Ключ генератора мира
world.info.time=Время игры
world.info.time.format=%s дн.
world.locked=В эксплуатации
world.locked.failed=В настоящее время мир находится в эксплуатации. Закройте игру и попробуйте снова.
world.manage=Миры
Expand Down
2 changes: 0 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_uk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1097,8 +1097,6 @@ world.info.player.location=Місцезнаходження
world.info.player.spawn=Місце появи
world.info.player.xp_level=Рівень досвіду
world.info.random_seed=Насіння
world.info.time=Час гри
world.info.time.format=%s днів
world.locked=Використовується
world.locked.failed=Світ наразі використовується. Закрийте гру та спробуйте знову.
world.manage=Світи
Expand Down
6 changes: 4 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ world.info.last_played=上一次遊戲時間
world.info.generate_features=生成建築
world.info.player=玩家資訊
world.info.player.food_level=饑餓值
world.info.player.food_saturation_level=飽食度
world.info.player.game_type=遊戲模式
world.info.player.game_type.adventure=冒險
world.info.player.game_type.creative=創造
Expand All @@ -982,8 +983,9 @@ world.info.player.location=位置
world.info.player.spawn=床/重生錨位置
world.info.player.xp_level=經驗等級
world.info.random_seed=種子碼
world.info.time=遊戲內時間
world.info.time.format=%s 天
world.info.spawn=世界重生點
world.info.time=遊戲時間
world.info.time.format=%d 天 %d 小時 %d 分鐘
world.load.fail=世界載入失敗
world.locked=使用中
world.locked.failed=該世界正在使用中,請關閉遊戲後重試。
Expand Down
6 changes: 4 additions & 2 deletions HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,7 @@ world.info.last_played=上一次游戏时间
world.info.generate_features=生成建筑
world.info.player=玩家信息
world.info.player.food_level=饥饿值
world.info.player.food_saturation_level=饱和度
world.info.player.game_type=游戏模式
world.info.player.game_type.adventure=冒险
world.info.player.game_type.creative=创造
Expand All @@ -987,8 +988,9 @@ world.info.player.location=位置
world.info.player.spawn=床/重生锚位置
world.info.player.xp_level=经验等级
world.info.random_seed=种子
world.info.time=游戏内时间
world.info.time.format=%s 天
world.info.spawn=世界出生点
world.info.time=游戏时长
world.info.time.format=%d 天 %d 小时 %d 分钟
world.load.fail=世界加载失败
world.locked=使用中
world.locked.failed=该世界正在使用中,请关闭游戏后重试。
Expand Down
9 changes: 9 additions & 0 deletions HMCLCore/src/main/java/org/jackhuang/hmcl/util/Lang.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ public static Double toDoubleOrNull(Object string) {
}
}

public static Float toFloatOrNull(Object string) {
try {
if (string == null) return null;
return Float.parseFloat(string.toString());
} catch (NumberFormatException e) {
return null;
}
}

/**
* Find the first non-null reference in given list.
*
Expand Down