From 013b46d0a912cac4d21ebb329d3f99886731d68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E6=82=A6=E8=A7=A3=E8=AF=B4?= Date: Fri, 20 Sep 2024 21:24:42 +0800 Subject: [PATCH] Fixed "Bound For" out of width --- .../java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java | 2 +- .../main/java/ziyue/tjmetro/mod/client/RouteMapGenerator.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java index 748fb21..424ddf8 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockHighSpeedRepeater.java @@ -115,7 +115,7 @@ public void randomDisplayTick2(BlockState state, World world, BlockPos pos, Rand final double d = (double) pos.getX() + 0.5 + (random.data.nextDouble() - 0.5) * 0.2; final double e = (double) pos.getY() + 0.4 + (random.data.nextDouble() - 0.5) * 0.2; final double f = (double) pos.getZ() + 0.5 + (random.data.nextDouble() - 0.5) * 0.2; - float g = random.data.nextBoolean() ? -1 : -5.0f; + float g = random.data.nextBoolean() ? 7 : -5.0f; final double h = (g /= 16.0f) * (float) direction.getOffsetX(); final double i = g * (float) direction.getOffsetZ(); world.addParticle(new ParticleEffect(DustParticleEffect.BLUE), d + h, e, f + i, 0.0, 0.0, 0.0); diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/client/RouteMapGenerator.java b/fabric/src/main/java/ziyue/tjmetro/mod/client/RouteMapGenerator.java index 7e9b337..3df9cec 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/client/RouteMapGenerator.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/client/RouteMapGenerator.java @@ -821,7 +821,7 @@ public static NativeImage generateBoundFor(long platformId, HorizontalAlignment final boolean isTerminating = destinations.isEmpty(); final DynamicTextureCache.Text boundFor; if (isTerminating) { - boundFor = DynamicTextureCache.instance.getText(IGuiExtension.mergeTranslation("gui.tjmetro.terminus_cjk", "gui.tjmetro.terminus"), width, height, tileSize * 3 / 5, tileSize * 3 / 10, padding, horizontalAlignment, forceMTRFont); + boundFor = DynamicTextureCache.instance.getText(IGuiExtension.mergeTranslation("gui.tjmetro.terminus_cjk", "gui.tjmetro.terminus"), width - padding * 2, height, tileSize * 3 / 5, tileSize * 3 / 10, padding, horizontalAlignment, forceMTRFont); } else { String destinationString = IGui.mergeStations(destinations); final boolean isClockwise = destinationString.startsWith(TEMP_CIRCULAR_MARKER_CLOCKWISE); @@ -836,7 +836,7 @@ public static NativeImage generateBoundFor(long platformId, HorizontalAlignment destinationString = IGuiExtension.insertTranslation("gui.tjmetro.bound_for_cjk", "gui.tjmetro.bound_for", 1, destinationString); } } - boundFor = DynamicTextureCache.instance.getText(destinationString, width, height, tileSize * 3 / 5, tileSize * 3 / 10, padding, horizontalAlignment, forceMTRFont); + boundFor = DynamicTextureCache.instance.getText(destinationString, width - padding * 2, height, tileSize * 3 / 5, tileSize * 3 / 10, padding, horizontalAlignment, forceMTRFont); } final NativeImage nativeImage = new NativeImage(NativeImageFormat.RGBA, width, height, false);