diff --git a/UpdateLog-en.md b/UpdateLog-en.md index b696dceda..40e186b52 100644 --- a/UpdateLog-en.md +++ b/UpdateLog-en.md @@ -2,6 +2,11 @@ Note: Not all versions in this update log are already published. Please refer to relevant pages in CurseForge and Modrinth, or the "releases" section in the GitHub. +### 1.2.1 +- Fixed the wrong model of road slab blocks. +- Fixed the issue that using road connection state debugging tool may cause crashes. +- Added more links in the Mod Menu screen. + ### 1.2.0 - Adapted to new version BRRP. diff --git a/UpdateLog.md b/UpdateLog.md index 889b20ad4..d0ec539c0 100644 --- a/UpdateLog.md +++ b/UpdateLog.md @@ -2,6 +2,11 @@ 注意:更新记录中的版本并不一定都已发布。具体请以 CurseForge、Modrinth 中的下载页面或 GitHub 中的“releases”为准。 +### 1.2.1 +- 修复了错误的道路台阶模型。 +- 修复了使用道路连接状态调试工具可能导致崩溃的问题。 +- 在 Mod Menu 的屏幕中添加的更多的链接。 + ### 1.2.0 - 适应新版本的 BRRP。 diff --git a/gradle.properties b/gradle.properties index c373298c4..29cce3953 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ fabric_version=0.76.0+1.19.2 brrp_version=1.0.0 # Mod Properties -mod_version=1.2.0 +mod_version=1.2.1 maven_group=pers.solid archives_base_name=mishanguc diff --git a/src/main/java/pers/solid/mishang/uc/arrp/BRRPHelper.java b/src/main/java/pers/solid/mishang/uc/arrp/BRRPHelper.java index 65b2ef184..3ece01379 100644 --- a/src/main/java/pers/solid/mishang/uc/arrp/BRRPHelper.java +++ b/src/main/java/pers/solid/mishang/uc/arrp/BRRPHelper.java @@ -67,7 +67,7 @@ public static BlockStateSupplier composeStateForSlab(@NotNull BlockStateSupplier key.isEmpty() ? "type=bottom" : key + ",type=bottom", bottomModel); JsonObject topModel = blockModel.deepCopy(); - topModel.addProperty("mode", slabOf(modelId).toString()); + topModel.addProperty("model", slabOf(modelId).brrp_suffixed("_top").toString()); slabVariant.add( key.isEmpty() ? "type=top" : key + ",type=top", topModel); diff --git a/src/main/java/pers/solid/mishang/uc/item/RoadConnectionStateDebuggingToolItem.java b/src/main/java/pers/solid/mishang/uc/item/RoadConnectionStateDebuggingToolItem.java index 8c43d411d..cdbde8cf4 100644 --- a/src/main/java/pers/solid/mishang/uc/item/RoadConnectionStateDebuggingToolItem.java +++ b/src/main/java/pers/solid/mishang/uc/item/RoadConnectionStateDebuggingToolItem.java @@ -45,19 +45,17 @@ public static ActionResult sendMessageOfState( TextBridge.translatable("debug.mishanguc.roadConnectionState.allDir", String.format("%s %s %s", blockPos.getX(), blockPos.getY(), blockPos.getZ())) .formatted(Formatting.YELLOW), false); - Direction.Type.HORIZONTAL.forEach( - direction -> { - final RoadConnectionState connectionState = - road.getConnectionStateOf(blockState, direction); - playerEntity.sendMessage( - TextBridge.translatable("debug.mishanguc.roadConnectionState.brief", - RoadConnectionState.text(direction), - (connectionState.offsetLevel() == 0 ? RoadConnectionState.text(connectionState.direction()) : TextBridge.translatable("debug.mishanguc.roadConnectionState.offset", RoadConnectionState.text(direction), RoadConnectionState.text(connectionState.offsetDirection()), connectionState.offsetLevel())).formatted(Formatting.WHITE), - RoadConnectionState.text(connectionState.lineColor()), - RoadConnectionState.text(connectionState.lineType()).formatted(Formatting.WHITE), - RoadConnectionState.text(connectionState.whetherConnected())).styled(style -> style.withColor(0xcccccc)), - false); - }); + for (Direction direction : Direction.Type.HORIZONTAL) { + final RoadConnectionState connectionState = road.getConnectionStateOf(blockState, direction); + playerEntity.sendMessage( + TextBridge.translatable("debug.mishanguc.roadConnectionState.brief", + RoadConnectionState.text(direction), + (connectionState.offsetLevel() == 0 ? RoadConnectionState.text(connectionState.direction()) : TextBridge.translatable("debug.mishanguc.roadConnectionState.offset", RoadConnectionState.text(direction), RoadConnectionState.text(connectionState.offsetDirection()), connectionState.offsetLevel())).formatted(Formatting.WHITE), + RoadConnectionState.text(connectionState.lineColor()), + RoadConnectionState.text(connectionState.lineType()).formatted(Formatting.WHITE), + RoadConnectionState.text(connectionState.whetherConnected())).styled(style -> style.withColor(0xcccccc)), + false); + } return ActionResult.SUCCESS; } diff --git a/src/main/java/pers/solid/mishang/uc/util/EightHorizontalDirection.java b/src/main/java/pers/solid/mishang/uc/util/EightHorizontalDirection.java index 560e4b506..1a2bfbf00 100644 --- a/src/main/java/pers/solid/mishang/uc/util/EightHorizontalDirection.java +++ b/src/main/java/pers/solid/mishang/uc/util/EightHorizontalDirection.java @@ -47,11 +47,11 @@ public enum EightHorizontalDirection implements StringIdentifiable { this.axis = axis; } - public static EightHorizontalDirection of(Direction direction) { + public static @NotNull EightHorizontalDirection of(@NotNull Direction direction) { return DIRECTIONS.get(direction); } - public static EightHorizontalDirection of(HorizontalCornerDirection cornerDirection) { + public static @NotNull EightHorizontalDirection of(@NotNull HorizontalCornerDirection cornerDirection) { return CORNER_DIRECTIONS.get(cornerDirection); } diff --git a/src/main/java/pers/solid/mishang/uc/util/RoadConnectionState.java b/src/main/java/pers/solid/mishang/uc/util/RoadConnectionState.java index 68994ccd8..2919e4c2a 100644 --- a/src/main/java/pers/solid/mishang/uc/util/RoadConnectionState.java +++ b/src/main/java/pers/solid/mishang/uc/util/RoadConnectionState.java @@ -20,9 +20,9 @@ * @param lineOffset 该道路连接状态的偏移。 * @since 0.2.0-mc1.17+ 此类更改为记录;1.16.5 由于仍为 Java 8,因此仍使用普通类的形式。 */ -public record RoadConnectionState(WhetherConnected whetherConnected, LineColor lineColor, EightHorizontalDirection direction, LineType lineType, @Nullable LineOffset lineOffset) implements Comparable { +public record RoadConnectionState(WhetherConnected whetherConnected, LineColor lineColor, @Nullable EightHorizontalDirection direction, LineType lineType, @Nullable LineOffset lineOffset) implements Comparable { - public RoadConnectionState(WhetherConnected whetherConnected, LineColor lineColor, EightHorizontalDirection direction, LineType lineType) { + public RoadConnectionState(WhetherConnected whetherConnected, LineColor lineColor, @Nullable EightHorizontalDirection direction, LineType lineType) { this(whetherConnected, lineColor, direction, lineType, null); } @@ -46,11 +46,15 @@ public static MutableText text(@Nullable Direction direction) { return TextBridge.translatable("direction." + direction.asString()); } - public static MutableText text(HorizontalCornerDirection direction) { - return TextBridge.translatable("direction." + direction.asString()); + public static MutableText text(@Nullable HorizontalCornerDirection direction) { + if (direction == null) { + return TextBridge.translatable("direction.none"); + } else { + return TextBridge.translatable("direction." + direction.asString()); + } } - public static MutableText text(Either direction) { + public static MutableText text(@Nullable Either direction) { if (direction == null) { return TextBridge.translatable("direction.none"); } else { @@ -58,11 +62,11 @@ public static MutableText text(Either dire } } - public static MutableText text(EightHorizontalDirection direction) { - return text(direction.either); + public static MutableText text(@Nullable EightHorizontalDirection direction) { + return direction == null ? text((Direction) null) : text(direction.either); } - public static MutableText text(WhetherConnected whetherConnected) { + public static MutableText text(@NotNull WhetherConnected whetherConnected) { return TextBridge.translatable("roadConnectionState.whether." + whetherConnected.asString()).formatted(switch (whetherConnected) { case NOT_CONNECTED -> Formatting.RED; case CONNECTED -> Formatting.GREEN; @@ -70,7 +74,7 @@ public static MutableText text(WhetherConnected whetherConnected) { }); } - public static MutableText text(LineColor lineColor) { + public static MutableText text(@NotNull LineColor lineColor) { return lineColor.getName().formatted(switch (lineColor) { case WHITE -> Formatting.WHITE; case YELLOW -> Formatting.YELLOW; @@ -78,7 +82,7 @@ public static MutableText text(LineColor lineColor) { }); } - public static MutableText text(LineType lineType) { + public static MutableText text(@NotNull LineType lineType) { return lineType.getName(); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index f699de0d2..56989470c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -44,5 +44,14 @@ "breaks": { "minecraft": ">=1.19.3" }, - "custom": {"branch": "1.19.2"} + "custom": { + "branch": "1.19.2", + "modmenu": { + "links": { + "mcmod.cn": "https://www.mcmod.cn/class/5743.html", + "modmenu.modrinth": "https://modrinth.com/mod/mishang-urban-construction", + "modmenu.curseforge": "https://www.curseforge.com/minecraft/mc-mods/mishang-urban-construction" + } + } + } }