diff --git a/.gitignore b/.gitignore index ccb0c562..93a3a465 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ run/ out/ *.iml .gradle/ +.vscode/ output/ bin/ libs/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 5aa26aef..1b6c0dc1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "java.compile.nullAnalysis.mode": "disabled", "commentTranslate.hover.enabled": false, - "java.configuration.updateBuildConfiguration": "automatic" + "java.compile.nullAnalysis.mode": "disabled" } \ No newline at end of file diff --git a/README.md b/README.md index 57209af7..a1634164 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Create Railways Navigator (Minecraft Create Mod Addon) -![Logo](https://github.com/MisterJulsen/Create-Train-Navigator/blob/1.19.2/icon_256px.png) +# 🚅 Create Railways Navigator (Minecraft Create Mod Addon) +![Logo](https://github.com/MisterJulsen/Create-Train-Navigator/blob/1.18.2/icon_256px.png) Get a list possible train connections in your world from one station to another using the Create Railways Navigator. @@ -7,22 +7,27 @@ Get a list possible train connections in your world from one station to another [![Modrinth](https://i.imgur.com/uLIB4gb.png)](https://modrinth.com/mod/create-railways-navigator) [![CurseForge](https://i.imgur.com/XZYlGVF.png)](https://www.curseforge.com/minecraft/mc-mods/create-railways-navigator) -## Dependencies +## 📚 Dependencies This mod requires the Minecraft [Create Mod v0.5.1e](https://www.curseforge.com/minecraft/mc-mods/create) or newer for [Minecraft Forge](https://files.minecraftforge.net) or later. This mod also uses [DragonLib](https://www.curseforge.com/minecraft/mc-mods/dragonlib), which is already embedded into the built jar, so you don't have to install it manually. -## Features +## ✅ Features This mod adds a new item, the Create Railways Navigator, which is inspired by the [DB Navigator](https://de.wikipedia.org/wiki/DB_Navigator) (an app in Germany where, among other things, you can get possible train connections). Like this app, the navigator in this mod is intended to suggest possible train connections for trains from the Create Mod in your Minecraft world. Various customization options allow you to specify which track stations should be treated as a single station and how your navigation results should be filtered and sorted so that you always receive the best possible route suggestions. -## Supported Languages -- English (100%) -- German (100%) -- Dutch (100%) (by TheSatanicFlame) -- Polish (100%) (by Slasherss) - -## **Please note!** +## 🗣️ Supported Languages +- English +- German +- Dutch (by TheSatanicFlame) +- Polish (by Slasherss) +- Chinese (simplified) (by Mingshuai Zhu, iaddda) +- Saxon (DE) (by PULZ418) +- Bavarian (DE) +- Spanish (by albertosaurio65) +- Russian (by VGamerGroup) + +## ⚠️ **Please note!** To protect your world from damage, you should always create a backup of your world before installing an update of this mod. Alpha versions in particular may contain critical bugs! -## **Dependencies** +## 🐉 **Dependencies** This mod uses **DragonLib** as a library mod that contains useful code shared accross all my mods. DragonLib is embedded in all builds of Create Railways Navigator since version `0.2.0-beta-1.18.2`, so you don't need to install DragonLib manually. If you are developer and are interested in this library you can find more information about it on [GitHub](https://github.com/MisterJulsen/MC-DragonLib "DragonLib on GitHub"). [![DragonLib](https://i.imgur.com/4d8BF5J.png)](https://github.com/MisterJulsen/MC-DragonLib "DragonLib on GitHub") diff --git a/build.gradle b/build.gradle index 07d29f6f..eaa5f824 100644 --- a/build.gradle +++ b/build.gradle @@ -1,102 +1,103 @@ plugins { - id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false + id 'dev.architectury.loom' version '1.6-SNAPSHOT' apply false + id 'architectury-plugin' version '3.4-SNAPSHOT' + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false } architectury { - minecraft = rootProject.minecraft_version + minecraft = project.minecraft_version } -subprojects { - apply plugin: "dev.architectury.loom" - - loom { - silentMojangMappingsLicense() - } - - dependencies { - minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" - // The following line declares the mojmap mappings, you may use other mappings as well - - mappings loom.layered() { - officialMojangMappings() - parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") - } - } +allprojects { + group = rootProject.maven_group + version = "$rootProject.minecraft_version-$rootProject.mod_version" } -allprojects { - apply plugin: "java" - apply plugin: "architectury-plugin" - apply plugin: "maven-publish" +subprojects { + apply plugin: 'dev.architectury.loom' + apply plugin: 'architectury-plugin' + apply plugin: 'maven-publish' base { - archivesName = rootProject.archives_base_name + archivesName = "$rootProject.archives_name-$project.name" } - - version = "${rootProject.mod_version}-${project.name}" - group = rootProject.maven_group repositories { - maven { // Flywheel - url = "https://maven.tterrag.com/" - content { - includeGroup("com.jozufozu.flywheel") - } - } - maven { // DragonLib - name = "MrJulsen's Mod Resources" - url = "https://raw.githubusercontent.com/MisterJulsen/modsrepo/main/maven" - } - maven { // Forge Config Api (required for fabric version of DragonLib) - name = "Fuzs Mod Resources" - url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" - } - maven { - url "https://cursemaven.com" + maven { url = "https://raw.githubusercontent.com/MisterJulsen/modsrepo/main/maven" } // DragonLib + maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API + maven { url = "https://maven.parchmentmc.org" } // ParchmentMC + maven { url = "https://maven.terraformersmc.com/" } // ModMenu + maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI + maven { url = "https://maven.blamejared.com/" } // JEI + maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings + maven { url = "https://api.modrinth.com/maven" } // LazyDFU + maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu + maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate + maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes + maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM + + maven { url = "https://cursemaven.com" content { includeGroup "curse.maven" } } - - maven { // Create Forge and Registrate Forge - url = "https://maven.tterrag.com/" + maven { url = "https://maven.tterrag.com/" // Create Forge, Registrate Forge, Flywheel content { + includeGroup("com.jozufozu.flywheel") includeGroup("com.tterrag.registrate") includeGroup("com.simibubi.create") } } - maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI - maven { url = "https://maven.blamejared.com/" } // JEI - maven { url = "https://maven.parchmentmc.org" } // Parchment mappings - maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings - maven { url = "https://api.modrinth.com/maven" } // LazyDFU - maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu - maven { url = "https://mvn.devos.one/snapshots/" } // Create, Porting Lib, Forge Tags, Milk Lib, Registrate - maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port - maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes - maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM - maven { url = "https://maven.tterrag.com/" } // Flywheel - } - - tasks.withType(JavaCompile) { - options.encoding = "UTF-8" - options.release = 17 } -publishing { - repositories { - maven { - name "GitHub" - url "file://${System.getProperty('user.home')}/.m2/github/modsrepo/maven" + dependencies { + minecraft "net.minecraft:minecraft:$rootProject.minecraft_version" + mappings loom.layered() { + officialMojangMappings() + parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") } } -} java { withSourcesJar() withJavadocJar() + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + javadoc { + options { + title = "DragNSounds API ${rootProject.release_channel}-${rootProject.mod_version}" + tags("apiNote:a:API Note:") + tags("implNote:a:Impl Note:") + tags("implSpec:a:Impl Spec:") + tags("related:a:Related:") + tags("example:a:Examples:") + tags("side:a:Valid on side:") + } + } + + tasks.withType(JavaCompile).configureEach { + it.options.release = 17 + } + + // Configure Maven publishing. + publishing { + publications { + mavenJava(MavenPublication) { + artifactId = rootProject.archives_name + "-" + project.name + from components.java + } + } + + repositories { + maven { + name "GitHub" + url "file://${System.getProperty('user.home')}/.m2/github/modsrepo/maven" + } + } } } diff --git a/common/build.gradle b/common/build.gradle index 3b9180cc..be3455d2 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,5 +1,5 @@ architectury { - common(rootProject.enabled_platforms.split(",")) + common rootProject.enabled_platforms.split(',') } loom { @@ -7,25 +7,11 @@ loom { } dependencies { - // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies - // Do NOT use other classes from fabric loader - modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" - - modImplementation(include("de.mrjulsen.mcdragonlib:dragonlib-fabric:${rootProject.minecraft_version}-${rootProject.dragonlib_version}")) + modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version" + + modImplementation("dev.architectury:architectury:${rootProject.architectury_api_version}") + modImplementation("com.electronwill.night-config:toml:3.6.0") + modImplementation("net.minecraftforge:forgeconfigapiport-fabric:${rootProject.forge_config_api_port_version}") + modImplementation("de.mrjulsen.mcdragonlib:dragonlib-fabric:${rootProject.minecraft_version}-${rootProject.dragonlib_version}") modImplementation("com.simibubi.create:create-fabric-${rootProject.minecraft_version}:${rootProject.create_fabric_version}") - -} - -publishing { - publications { - mavenCommon(MavenPublication) { - artifactId = rootProject.archives_base_name - from components.java - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - } -} +} \ No newline at end of file diff --git a/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecific.java b/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecific.java index ba28a851..f125577a 100644 --- a/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecific.java +++ b/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecific.java @@ -3,9 +3,12 @@ import dev.architectury.injectables.annotations.ExpectPlatform; import dev.architectury.platform.Platform; import net.minecraft.server.MinecraftServer; +import net.minecraft.world.level.block.entity.BlockEntity; import java.nio.file.Path; +import com.simibubi.create.content.trains.station.GlobalStation; + public class CRNPlatformSpecific { /** * We can use {@link Platform#getConfigFolder()} but this is just an example of {@link ExpectPlatform}. @@ -35,4 +38,9 @@ public static MinecraftServer getServer() { public static void registerConfig() { throw new AssertionError(); } + + @ExpectPlatform + public static GlobalStation getStationFromBlockEntity(BlockEntity be) { + throw new AssertionError(); + } } diff --git a/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecificClient.java b/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecificClient.java new file mode 100644 index 00000000..8228aa6f --- /dev/null +++ b/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecificClient.java @@ -0,0 +1,15 @@ +package de.mrjulsen.crn; + +import java.util.function.Supplier; + +import com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour; +import dev.architectury.injectables.annotations.ExpectPlatform; +import net.minecraft.world.level.block.Block; + +public class CRNPlatformSpecificClient { + + @ExpectPlatform + public static void registerCTBehviour(Block entry, Supplier behaviorSupplier) { + throw new AssertionError(); + } +} diff --git a/common/src/main/java/de/mrjulsen/crn/CreateRailwaysNavigator.java b/common/src/main/java/de/mrjulsen/crn/CreateRailwaysNavigator.java index 858a4f19..94629602 100644 --- a/common/src/main/java/de/mrjulsen/crn/CreateRailwaysNavigator.java +++ b/common/src/main/java/de/mrjulsen/crn/CreateRailwaysNavigator.java @@ -34,7 +34,7 @@ import de.mrjulsen.crn.registry.ModItems; import de.mrjulsen.mcdragonlib.net.NetworkManagerBase; import dev.architectury.platform.Platform; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; @@ -109,7 +109,7 @@ public static void init() { CRNPlatformSpecific.registerConfig(); ModEvents.init(); - if (Platform.getEnv() == EnvType.CLIENT) { + if (Platform.getEnvironment() == Env.CLIENT) { ClientEvents.init(); } } diff --git a/common/src/main/java/de/mrjulsen/crn/block/be/AdvancedDisplayBlockEntity.java b/common/src/main/java/de/mrjulsen/crn/block/be/AdvancedDisplayBlockEntity.java index 943a0923..0c94b00d 100644 --- a/common/src/main/java/de/mrjulsen/crn/block/be/AdvancedDisplayBlockEntity.java +++ b/common/src/main/java/de/mrjulsen/crn/block/be/AdvancedDisplayBlockEntity.java @@ -4,7 +4,6 @@ import java.util.Comparator; import java.util.List; -import com.simibubi.create.content.contraptions.Contraption; import com.simibubi.create.content.trains.display.FlapDisplayBlock; import com.simibubi.create.content.trains.entity.CarriageContraption; import com.simibubi.create.content.trains.entity.CarriageContraptionEntity; @@ -519,7 +518,7 @@ public void lazyTick() { } @Override - public void contraptionTick(Level level, BlockPos pos, BlockState state, Contraption contraption) { + public void contraptionTick(Level level, BlockPos pos, BlockState state, CarriageContraption carriage) { getRenderer().tick(level, pos, state, this); if (!isController()) { @@ -532,7 +531,6 @@ public void contraptionTick(Level level, BlockPos pos, BlockState state, Contrap syncTicks++; if ((syncTicks %= 100) == 0) { - CarriageContraption carriage = (CarriageContraption)contraption; long id = InstanceManager.registerClientTrainDataResponseAction((data, refreshTime) -> { if (data == null) { return; @@ -618,7 +616,9 @@ public void read(CompoundTag pTag, boolean clientPacket) { xSize = pTag.getByte(NBT_XSIZE); ySize = pTag.getByte(NBT_YSIZE); - color = pTag.getInt(NBT_COLOR); + if (pTag.contains(NBT_COLOR)) { + color = pTag.getInt(NBT_COLOR); + } glowing = pTag.getBoolean(NBT_GLOWING); isController = pTag.getBoolean(NBT_CONTROLLER); infoType = EDisplayInfo.getTypeById(pTag.getInt(NBT_INFO_TYPE)); diff --git a/common/src/main/java/de/mrjulsen/crn/block/be/IContraptionBlockEntity.java b/common/src/main/java/de/mrjulsen/crn/block/be/IContraptionBlockEntity.java index 5a4d09d9..0137773a 100644 --- a/common/src/main/java/de/mrjulsen/crn/block/be/IContraptionBlockEntity.java +++ b/common/src/main/java/de/mrjulsen/crn/block/be/IContraptionBlockEntity.java @@ -1,6 +1,6 @@ package de.mrjulsen.crn.block.be; -import com.simibubi.create.content.contraptions.Contraption; +import com.simibubi.create.content.trains.entity.CarriageContraption; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -15,5 +15,5 @@ public interface IContraptionBlockEntity { * @param state * @param contraption */ - void contraptionTick(Level level, BlockPos pos, BlockState state, Contraption contraption); + void contraptionTick(Level level, BlockPos pos, BlockState state, CarriageContraption carriage); } diff --git a/common/src/main/java/de/mrjulsen/crn/block/display/AdvancedDisplaySource.java b/common/src/main/java/de/mrjulsen/crn/block/display/AdvancedDisplaySource.java index b0b68459..84b858f9 100644 --- a/common/src/main/java/de/mrjulsen/crn/block/display/AdvancedDisplaySource.java +++ b/common/src/main/java/de/mrjulsen/crn/block/display/AdvancedDisplaySource.java @@ -12,6 +12,7 @@ import com.simibubi.create.foundation.gui.ModularGuiLineBuilder; import com.simibubi.create.foundation.utility.Lang; +import de.mrjulsen.crn.CRNPlatformSpecific; import de.mrjulsen.crn.CreateRailwaysNavigator; import de.mrjulsen.mcdragonlib.core.ITranslatableEnum; import de.mrjulsen.mcdragonlib.util.TextUtils; @@ -57,12 +58,11 @@ public void populateData(DisplayLinkContext context) { if (conf.contains(NBT_FILTER)) return; - if (!(context.getSourceBlockEntity() instanceof StationBlockEntity stationBe)) - return; - - GlobalStation station = stationBe.getStation(); - if (station == null) + + GlobalStation station = CRNPlatformSpecific.getStationFromBlockEntity(context.getSourceBlockEntity()); + if (station == null) { return; + } conf.putString(NBT_FILTER, station.name); } diff --git a/common/src/main/java/de/mrjulsen/crn/client/ClientWrapper.java b/common/src/main/java/de/mrjulsen/crn/client/ClientWrapper.java index ca97c9de..ff94d66d 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/ClientWrapper.java +++ b/common/src/main/java/de/mrjulsen/crn/client/ClientWrapper.java @@ -58,12 +58,14 @@ public static void updateLanguage(ELanguage lang, boolean force) { } LanguageInfo info = lang == ELanguage.DEFAULT ? null : Minecraft.getInstance().getLanguageManager().getLanguage(lang.getCode()); - if (info == null) { - info = Minecraft.getInstance().getLanguageManager().getSelected(); - } currentLanguage = lang; - currentClientLanguage = ClientLanguage.loadFrom(Minecraft.getInstance().getResourceManager(), List.of(info)); - CreateRailwaysNavigator.LOGGER.info("Updated custom language to: " + (info == null ? null : info.getName())); + if (lang == ELanguage.DEFAULT || info == null) { + currentClientLanguage = Language.getInstance(); + CreateRailwaysNavigator.LOGGER.info("Updated custom language to: (Default)"); + } else { + currentClientLanguage = ClientLanguage.loadFrom(Minecraft.getInstance().getResourceManager(), List.of(info)); + CreateRailwaysNavigator.LOGGER.info("Updated custom language to: " + (info == null ? null : info.getName())); + } } public static Language getCurrentClientLanguage() { diff --git a/common/src/main/java/de/mrjulsen/crn/client/ber/variants/BERPassengerInfoDetailed.java b/common/src/main/java/de/mrjulsen/crn/client/ber/variants/BERPassengerInfoDetailed.java index 1e954b34..df15f40a 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/ber/variants/BERPassengerInfoDetailed.java +++ b/common/src/main/java/de/mrjulsen/crn/client/ber/variants/BERPassengerInfoDetailed.java @@ -18,6 +18,7 @@ import de.mrjulsen.mcdragonlib.DragonLib; import de.mrjulsen.mcdragonlib.client.ber.IBlockEntityRendererInstance.BlockEntityRendererContext; import de.mrjulsen.mcdragonlib.client.ber.IBlockEntityRendererInstance.EUpdateReason; +import de.mrjulsen.mcdragonlib.util.DLUtils; import de.mrjulsen.mcdragonlib.util.TextUtils; import de.mrjulsen.mcdragonlib.util.TimeUtils; import net.minecraft.client.renderer.MultiBufferSource; @@ -34,6 +35,9 @@ public class BERPassengerInfoDetailed implements IBERRenderSubtype x.tick()); + DLUtils.doIfNotNull(whileNextStopLabel, x -> x.tick()); boolean dirty = false; @@ -72,6 +79,8 @@ public void update(Level level, BlockPos pos, BlockState state, AdvancedDisplayB } parent.labels.clear(); + announceNextStopLabel = null; + whileNextStopLabel = null; switch (this.state) { case BEFORE_NEXT_STOP: @@ -143,9 +152,26 @@ public void renderAdditional(BlockEntityRendererContext context, AdvancedDisplay default: break; } + + if (backSide) { + switch (side) { + case LEFT: + pPoseStack.translate(10, 0, 0); + break; + case RIGHT: + pPoseStack.translate(-10, 0, 0); + break; + default: + break; + } + } + + DLUtils.doIfNotNull(announceNextStopLabel, x -> x.render(pPoseStack, pBufferSource, pPackedLight)); + DLUtils.doIfNotNull(whileNextStopLabel, x -> x.render(pPoseStack, pBufferSource, pPackedLight)); } } + private void updateDefault(Level level, BlockPos pos, BlockState state, AdvancedDisplayBlockEntity blockEntity, AdvancedDisplayRenderInstance parent) { int displayWidth = blockEntity.getXSizeScaled(); boolean isSingleBlock = blockEntity.getXSizeScaled() <= 1; @@ -175,7 +201,7 @@ private void updateAnnounceNextStop(Level level, BlockPos pos, BlockState state, MutableComponent line = ELanguage.translate(keyNextStop, GlobalSettingsManager.getInstance().getSettingsData().getAliasFor(blockEntity.getTrainData().getNextStop().isPresent() ? blockEntity.getTrainData().getNextStop().get().stationTagName() : "").getAliasName().get()); float maxWidth = displayWidth * 16 - 6 - (side != TrainExitSide.UNKNOWN ? 10 : 0); - parent.labels.add(new BERText(parent.getFontUtils(), line, 0) + announceNextStopLabel = (new BERText(parent.getFontUtils(), line, 0) .withIsCentered(true) .withMaxWidth(maxWidth, true) .withStretchScale(0.75f, 0.75f) @@ -194,7 +220,7 @@ private void updateWhileNextStop(Level level, BlockPos pos, BlockState state, Ad MutableComponent line = TextUtils.text(GlobalSettingsManager.getInstance().getSettingsData().getAliasFor(blockEntity.getTrainData().getNextStop().isPresent() ? blockEntity.getTrainData().getNextStop().get().stationTagName() : null).getAliasName().get()); float maxWidth = displayWidth * 16 - 6 - (side != TrainExitSide.UNKNOWN ? 10 : 0); - parent.labels.add(new BERText(parent.getFontUtils(), line, 0) + whileNextStopLabel = (new BERText(parent.getFontUtils(), line, 0) .withIsCentered(true) .withMaxWidth(maxWidth, true) .withStretchScale(0.75f, 0.75f) diff --git a/common/src/main/java/de/mrjulsen/crn/client/ber/variants/BERPassengerInfoSimple.java b/common/src/main/java/de/mrjulsen/crn/client/ber/variants/BERPassengerInfoSimple.java index 24944743..9f3e3947 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/ber/variants/BERPassengerInfoSimple.java +++ b/common/src/main/java/de/mrjulsen/crn/client/ber/variants/BERPassengerInfoSimple.java @@ -14,6 +14,7 @@ import de.mrjulsen.crn.event.listeners.JourneyListener.State; import de.mrjulsen.mcdragonlib.client.ber.IBlockEntityRendererInstance.BlockEntityRendererContext; import de.mrjulsen.mcdragonlib.client.ber.IBlockEntityRendererInstance.EUpdateReason; +import de.mrjulsen.mcdragonlib.util.DLUtils; import de.mrjulsen.mcdragonlib.util.TextUtils; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.core.BlockPos; @@ -28,6 +29,9 @@ public class BERPassengerInfoSimple implements IBERRenderSubtype x.tick()); + DLUtils.doIfNotNull(whileNextStopLabel, x -> x.tick()); boolean dirty = false; if (pBlockEntity.getTrainData().getNextStop().isPresent()) { @@ -65,6 +72,9 @@ public void update(Level level, BlockPos pos, BlockState state, AdvancedDisplayB } parent.labels.clear(); + announceNextStopLabel = null; + whileNextStopLabel = null; + switch (this.state) { case BEFORE_NEXT_STOP: updateAnnounceNextStop(level, pos, state, blockEntity, parent); @@ -134,7 +144,23 @@ public void renderAdditional(BlockEntityRendererContext context, AdvancedDisplay break; default: break; + } + + if (backSide) { + switch (side) { + case LEFT: + pPoseStack.translate(10, 0, 0); + break; + case RIGHT: + pPoseStack.translate(-10, 0, 0); + break; + default: + break; + } } + + DLUtils.doIfNotNull(announceNextStopLabel, x -> x.render(pPoseStack, pBufferSource, pPackedLight)); + DLUtils.doIfNotNull(whileNextStopLabel, x -> x.render(pPoseStack, pBufferSource, pPackedLight)); } } @@ -161,7 +187,7 @@ private void updateAnnounceNextStop(Level level, BlockPos pos, BlockState state, MutableComponent line = ELanguage.translate(keyNextStop, GlobalSettingsManager.getInstance().getSettingsData().getAliasFor(blockEntity.getTrainData().getNextStop().isPresent() ? blockEntity.getTrainData().getNextStop().get().stationTagName() : "").getAliasName().get()); float maxWidth = displayWidth * 16 - 6 - (side != TrainExitSide.UNKNOWN ? 10 : 0); - parent.labels.add(new BERText(parent.getFontUtils(), line, 0) + announceNextStopLabel = (new BERText(parent.getFontUtils(), line, 0) .withIsCentered(true) .withMaxWidth(maxWidth, true) .withStretchScale(0.75f, 0.75f) @@ -180,7 +206,7 @@ private void updateWhileNextStop(Level level, BlockPos pos, BlockState state, Ad MutableComponent line = TextUtils.text(GlobalSettingsManager.getInstance().getSettingsData().getAliasFor(blockEntity.getTrainData().getNextStop().isPresent() ? blockEntity.getTrainData().getNextStop().get().stationTagName() : "").getAliasName().get()); float maxWidth = displayWidth * 16 - 6 - (side != TrainExitSide.UNKNOWN ? 10 : 0); - parent.labels.add(new BERText(parent.getFontUtils(), line, 0) + whileNextStopLabel = (new BERText(parent.getFontUtils(), line, 0) .withIsCentered(true) .withMaxWidth(maxWidth, true) .withStretchScale(0.75f, 0.75f) diff --git a/common/src/main/java/de/mrjulsen/crn/client/gui/overlay/RouteDetailsOverlayScreen.java b/common/src/main/java/de/mrjulsen/crn/client/gui/overlay/RouteDetailsOverlayScreen.java index eb0eab3f..76371718 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/gui/overlay/RouteDetailsOverlayScreen.java +++ b/common/src/main/java/de/mrjulsen/crn/client/gui/overlay/RouteDetailsOverlayScreen.java @@ -193,6 +193,7 @@ public void onClose() { } + @SuppressWarnings("resource") @Override public void tick() { if (Screen.hasControlDown() && ModKeys.KEY_OVERLAY_SETTINGS.isDown() && Minecraft.getInstance().player.getInventory().hasAnyOf(Set.of(ModItems.NAVIGATOR.get()))) { diff --git a/common/src/main/java/de/mrjulsen/crn/client/gui/screen/SearchSettingsScreen.java b/common/src/main/java/de/mrjulsen/crn/client/gui/screen/SearchSettingsScreen.java index d9068104..95679c9e 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/gui/screen/SearchSettingsScreen.java +++ b/common/src/main/java/de/mrjulsen/crn/client/gui/screen/SearchSettingsScreen.java @@ -406,26 +406,27 @@ public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) { } - @Override - public boolean mouseScrolled(double pMouseX, double pMouseY, double pDelta) { - - boolean b = super.mouseScrolled(pMouseX, pMouseY, pDelta) || transferTimeInput.isHoveredOrFocused(); - if (b) { - return true; - } - - float chaseTarget = scroll.getChaseTarget(); - float max = -AREA_H + getMaxScrollHeight(); +@Override +public boolean mouseScrolled(double pMouseX, double pMouseY, double pDelta) { - if (max > 0) { - chaseTarget -= pDelta * 12; - chaseTarget = Mth.clamp(chaseTarget, 0, max); - scroll.chase((int) chaseTarget, 0.7f, Chaser.EXP); - } else { - scroll.chase(0, 0.7f, Chaser.EXP); + if (transferTimeInput.isHoveredOrFocused()) { + boolean b = transferTimeInput.mouseScrolled(pMouseX, pMouseY, pDelta); + if (b) { + return b; } + } - return true; + float chaseTarget = scroll.getChaseTarget(); + float max = -AREA_H + getMaxScrollHeight(); + if (max > 0) { + chaseTarget -= pDelta * 12; + chaseTarget = Mth.clamp(chaseTarget, 0, max); + scroll.chase((int) chaseTarget, 0.7f, Chaser.EXP); + } else { + scroll.chase(0, 0.7f, Chaser.EXP); } + + return super.mouseScrolled(pMouseX, pMouseY, pDelta); +} } diff --git a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/AbstractEntryListOptionWidget.java b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/AbstractEntryListOptionWidget.java index b14c04b3..d31eba5f 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/AbstractEntryListOptionWidget.java +++ b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/AbstractEntryListOptionWidget.java @@ -7,5 +7,10 @@ public abstract class AbstractEntryListOptionWidget extends WidgetContainer impl public AbstractEntryListOptionWidget(int x, int y, int width, int height) { super(x, y, width, height); } + + @Override + public boolean consumeScrolling(double mouseX, double mouseY) { + return false; + } } diff --git a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateIconButton.java b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateIconButton.java index 581f8e59..4aac7a96 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateIconButton.java +++ b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateIconButton.java @@ -40,13 +40,62 @@ public void setMouseSelected(boolean selected) { } @Override - public int getX() { + public int x() { return x; } @Override - public int getY() { + public int y() { return y; + } + + @Override + public void set_x(int x) { + this.x = x; + } + + @Override + public void set_y(int y) { + this.y = y; + } + + @Override + public void set_width(int w) { + this.width = w; + } + + @Override + public void set_height(int h) { + this.height = h; + } + + @Override + public void set_visible(boolean b) { + this.visible = b; + } + + @Override + public boolean visible() { + return visible; + } + + @Override + public void set_active(boolean b) { + this.active = b; + } + + @Override + public boolean active() { + return super.isActive(); + } + + @Override + public int width() { + return width; + } + + @Override + public int height() { + return height; } - } diff --git a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateIndicator.java b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateIndicator.java index ef086b2e..f436b76c 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateIndicator.java +++ b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateIndicator.java @@ -33,16 +33,65 @@ public boolean isMouseSelected() { @Override public void setMouseSelected(boolean selected) { this.mouseSelected = selected; - } + } @Override - public int getX() { + public int x() { return x; } @Override - public int getY() { + public int y() { return y; + } + + @Override + public void set_x(int x) { + this.x = x; + } + + @Override + public void set_y(int y) { + this.y = y; + } + + @Override + public void set_width(int w) { + this.width = w; + } + + @Override + public void set_height(int h) { + this.height = h; + } + + @Override + public void set_visible(boolean b) { + this.visible = b; + } + + @Override + public boolean visible() { + return visible; + } + + @Override + public void set_active(boolean b) { + this.active = b; + } + + @Override + public boolean active() { + return super.isActive(); + } + + @Override + public int width() { + return width; + } + + @Override + public int height() { + return height; } - } diff --git a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateLabel.java b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateLabel.java index 67c7f151..db758ce3 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateLabel.java +++ b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateLabel.java @@ -36,13 +36,62 @@ public void setMouseSelected(boolean selected) { } @Override - public int getX() { + public int x() { return x; } @Override - public int getY() { + public int y() { return y; + } + + @Override + public void set_x(int x) { + this.x = x; + } + + @Override + public void set_y(int y) { + this.y = y; + } + + @Override + public void set_width(int w) { + this.width = w; + } + + @Override + public void set_height(int h) { + this.height = h; + } + + @Override + public void set_visible(boolean b) { + this.visible = b; + } + + @Override + public boolean visible() { + return visible; + } + + @Override + public void set_active(boolean b) { + this.active = b; + } + + @Override + public boolean active() { + return super.isActive(); + } + + @Override + public int width() { + return width; + } + + @Override + public int height() { + return height; } - } diff --git a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateSelectionScrollInput.java b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateSelectionScrollInput.java index aa80452d..8a5718fe 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateSelectionScrollInput.java +++ b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/DLCreateSelectionScrollInput.java @@ -35,13 +35,62 @@ public void setMouseSelected(boolean selected) { } @Override - public int getX() { + public int x() { return x; } @Override - public int getY() { + public int y() { return y; + } + + @Override + public void set_x(int x) { + this.x = x; + } + + @Override + public void set_y(int y) { + this.y = y; + } + + @Override + public void set_width(int w) { + this.width = w; + } + + @Override + public void set_height(int h) { + this.height = h; + } + + @Override + public void set_visible(boolean b) { + this.visible = b; + } + + @Override + public boolean visible() { + return visible; + } + + @Override + public void set_active(boolean b) { + this.active = b; + } + + @Override + public boolean active() { + return super.isActive(); + } + + @Override + public int width() { + return width; + } + + @Override + public int height() { + return height; } - } diff --git a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/WidgetContainerCollection.java b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/WidgetContainerCollection.java index 3b80fb42..c8a79d65 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/WidgetContainerCollection.java +++ b/common/src/main/java/de/mrjulsen/crn/client/gui/widgets/WidgetContainerCollection.java @@ -42,17 +42,17 @@ public boolean isEnabled() { public void setVisible(boolean v) { this.visible = v; - performForEach(x -> x.setVisible(v)); + performForEach(x -> x.set_visible(v)); } public void setEnabled(boolean e) { this.enabled = e; - performForEach(x -> x.setActive(e)); + performForEach(x -> x.set_active(e)); } public void add(W widget) { - widget.setActive(enabled); - widget.setVisible(visible); + widget.set_active(enabled); + widget.set_visible(visible); components.add(widget); } diff --git a/common/src/main/java/de/mrjulsen/crn/client/lang/ELanguage.java b/common/src/main/java/de/mrjulsen/crn/client/lang/ELanguage.java index 5e6594f8..a0c4970d 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/lang/ELanguage.java +++ b/common/src/main/java/de/mrjulsen/crn/client/lang/ELanguage.java @@ -3,7 +3,7 @@ import java.util.Arrays; import de.mrjulsen.mcdragonlib.util.TextUtils; import dev.architectury.platform.Platform; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.chat.MutableComponent; import net.minecraft.util.StringRepresentable; @@ -15,7 +15,9 @@ public enum ELanguage implements StringRepresentable { POLISH("polish", "pl_pl"), CHINESE_SIMPLIFIED("chinese_simplified", "zh_cn"), SAXON("saxon", "sxu"), - BAVARIAN("bavarian", "bar"); + BAVARIAN("bavarian", "bar"), + SPANISH("spanish", "es_es"), + RUSSIAN("russian", "ru_ru"); private String name; private String code; @@ -39,7 +41,7 @@ public static ELanguage getByCode(String code) { } public static MutableComponent translate(String key) { - if (Platform.getEnv() == EnvType.CLIENT) { + if (Platform.getEnvironment() == Env.CLIENT) { MutableComponent comp = MutableComponent.create(new ModTranslatableComponent(key)); if (comp.getString().equals(key)) { return TextUtils.translate(key); @@ -51,10 +53,10 @@ public static MutableComponent translate(String key) { } public static MutableComponent translate(String key, Object... args) { - if (Platform.getEnv() == EnvType.CLIENT) { + if (Platform.getEnvironment() == Env.CLIENT) { MutableComponent comp = MutableComponent.create(new ModTranslatableComponent(key, args)); if (comp.getString().equals(key)) { - return TextUtils.translate(key); + return TextUtils.translate(key, args); } return comp; } else { diff --git a/common/src/main/java/de/mrjulsen/crn/mixin/MountedStorageManagerMixin.java b/common/src/main/java/de/mrjulsen/crn/mixin/MountedStorageManagerMixin.java index bb359108..126dc6fa 100644 --- a/common/src/main/java/de/mrjulsen/crn/mixin/MountedStorageManagerMixin.java +++ b/common/src/main/java/de/mrjulsen/crn/mixin/MountedStorageManagerMixin.java @@ -10,6 +10,7 @@ import com.simibubi.create.content.contraptions.AbstractContraptionEntity; import com.simibubi.create.content.contraptions.MountedStorageManager; +import com.simibubi.create.content.trains.entity.CarriageContraption; import de.mrjulsen.crn.block.be.IContraptionBlockEntity; import net.minecraft.world.level.block.entity.BlockEntity; @@ -19,16 +20,18 @@ public class MountedStorageManagerMixin { @Inject(method = "entityTick", remap = false, at = @At(value = "HEAD")) public void tick$inject(AbstractContraptionEntity entity, CallbackInfo ci) { - Set beList = new LinkedHashSet<>(); - beList.addAll(entity.getContraption().maybeInstancedBlockEntities); - beList.addAll(entity.getContraption().specialRenderedBlockEntities); - - for (BlockEntity be : beList) { - if (be instanceof IContraptionBlockEntity tile) { - tile.contraptionTick(entity.level, be.getBlockPos(), be.getBlockState(), entity.getContraption()); + if (entity.getContraption() instanceof CarriageContraption carriage) { + Set beList = new LinkedHashSet<>(); + beList.addAll(entity.getContraption().maybeInstancedBlockEntities); + beList.addAll(entity.getContraption().specialRenderedBlockEntities); + + for (BlockEntity be : beList) { + if (be instanceof IContraptionBlockEntity tile) { + tile.contraptionTick(entity.level, be.getBlockPos(), be.getBlockState(), carriage); + } } - } - beList.clear(); + beList.clear(); + } } } diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/GlobalSettingsResponsePacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/GlobalSettingsResponsePacket.java index 73049567..2f97790d 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/GlobalSettingsResponsePacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/GlobalSettingsResponsePacket.java @@ -7,8 +7,8 @@ import de.mrjulsen.crn.network.InstanceManager; import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; +import dev.architectury.utils.Env; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; @@ -38,7 +38,7 @@ public GlobalSettingsResponsePacket decode(FriendlyByteBuf buffer) { @Override public void handle(GlobalSettingsResponsePacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { GlobalSettingsManager.createClientInstance().updateSettingsData(packet.settings); InstanceManager.runClientResponseReceievedAction(packet.id); diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NavigationResponsePacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NavigationResponsePacket.java index 10a9d983..043ea74e 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NavigationResponsePacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NavigationResponsePacket.java @@ -9,7 +9,7 @@ import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.FriendlyByteBuf; public class NavigationResponsePacket implements IPacketBase { @@ -53,7 +53,7 @@ public NavigationResponsePacket decode(FriendlyByteBuf buffer) { @Override public void handle(NavigationResponsePacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { InstanceManager.runClientNavigationResponseAction(packet.id, packet.routes, new NavigationResponseData(packet.lastUpdated, packet.duration)); }); diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NearestStationResponsePacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NearestStationResponsePacket.java index b307e942..cd865cab 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NearestStationResponsePacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NearestStationResponsePacket.java @@ -7,7 +7,7 @@ import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.FriendlyByteBuf; public class NearestStationResponsePacket implements IPacketBase { @@ -36,7 +36,7 @@ public NearestStationResponsePacket decode(FriendlyByteBuf buffer) { @Override public void handle(NearestStationResponsePacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { InstanceManager.runClientNearestStationResponseAction(packet.id, packet.result); }); diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NextConnectionsResponsePacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NextConnectionsResponsePacket.java index e2a7c56f..50a14eb1 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NextConnectionsResponsePacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/NextConnectionsResponsePacket.java @@ -10,7 +10,7 @@ import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.FriendlyByteBuf; public class NextConnectionsResponsePacket implements IPacketBase { @@ -50,7 +50,7 @@ public NextConnectionsResponsePacket decode(FriendlyByteBuf buffer) { @Override public void handle(NextConnectionsResponsePacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { InstanceManager.runClientNextConnectionsResponseAction(packet.id, packet.connections, packet.time); }); diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/RealtimeResponsePacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/RealtimeResponsePacket.java index 04bb40d0..a8eed92d 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/RealtimeResponsePacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/RealtimeResponsePacket.java @@ -10,7 +10,7 @@ import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.FriendlyByteBuf; public class RealtimeResponsePacket implements IPacketBase { @@ -50,7 +50,7 @@ public RealtimeResponsePacket decode(FriendlyByteBuf buffer) { @Override public void handle(RealtimeResponsePacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { new Thread(() -> { InstanceManager.runClientRealtimeResponseAction(packet.id, packet.departure, packet.time); diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/ServerErrorPacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/ServerErrorPacket.java index 5f78907d..20974106 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/ServerErrorPacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/ServerErrorPacket.java @@ -6,7 +6,7 @@ import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.FriendlyByteBuf; public class ServerErrorPacket implements IPacketBase { @@ -30,7 +30,7 @@ public ServerErrorPacket decode(FriendlyByteBuf buffer) { @Override public void handle(ServerErrorPacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { ClientWrapper.handleErrorMessagePacket(packet, contextSupplier); }); diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TimeCorrectionPacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TimeCorrectionPacket.java index d0c4281c..20d2454c 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TimeCorrectionPacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TimeCorrectionPacket.java @@ -6,7 +6,7 @@ import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.FriendlyByteBuf; public class TimeCorrectionPacket implements IPacketBase { @@ -30,7 +30,7 @@ public TimeCorrectionPacket decode(FriendlyByteBuf buffer) { @Override public void handle(TimeCorrectionPacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { JourneyListenerManager.getInstance().getAllListeners().forEach(x -> x.getListeningRoute().shiftTime(packet.amount)); }); diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TrackStationResponsePacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TrackStationResponsePacket.java index e16b4662..b99f9c07 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TrackStationResponsePacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TrackStationResponsePacket.java @@ -10,7 +10,7 @@ import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.FriendlyByteBuf; public class TrackStationResponsePacket implements IPacketBase { @@ -67,7 +67,7 @@ public TrackStationResponsePacket decode(FriendlyByteBuf buffer) { @Override public void handle(TrackStationResponsePacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { ClientTrainStationSnapshot.makeNew( packet.stationNames == null || packet.stationNames.isEmpty() ? new ArrayList<>() : new ArrayList<>(packet.stationNames), diff --git a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TrainDataResponsePacket.java b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TrainDataResponsePacket.java index f1685ca8..99208745 100644 --- a/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TrainDataResponsePacket.java +++ b/common/src/main/java/de/mrjulsen/crn/network/packets/stc/TrainDataResponsePacket.java @@ -7,7 +7,7 @@ import de.mrjulsen.mcdragonlib.net.IPacketBase; import dev.architectury.networking.NetworkManager.PacketContext; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.network.FriendlyByteBuf; public class TrainDataResponsePacket implements IPacketBase { @@ -40,7 +40,7 @@ public TrainDataResponsePacket decode(FriendlyByteBuf buffer) { } @Override public void handle(TrainDataResponsePacket packet, Supplier contextSupplier) { - EnvExecutor.runInEnv(EnvType.CLIENT, () -> () -> { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> { contextSupplier.get().queue(() -> { InstanceManager.runClientTrainDataResponseAction(packet.id, packet.departure, packet.time); }); diff --git a/common/src/main/java/de/mrjulsen/crn/registry/ClientWrapper.java b/common/src/main/java/de/mrjulsen/crn/registry/ClientWrapper.java index 3880c505..407612b5 100644 --- a/common/src/main/java/de/mrjulsen/crn/registry/ClientWrapper.java +++ b/common/src/main/java/de/mrjulsen/crn/registry/ClientWrapper.java @@ -2,17 +2,13 @@ import java.util.function.Supplier; -import com.simibubi.create.CreateClient; import com.simibubi.create.foundation.block.connected.AllCTTypes; -import com.simibubi.create.foundation.block.connected.CTModel; import com.simibubi.create.foundation.block.connected.CTSpriteShiftEntry; import com.simibubi.create.foundation.block.connected.CTSpriteShifter; import com.simibubi.create.foundation.block.connected.CTType; import com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour; -import com.simibubi.create.foundation.utility.RegisteredObjects; +import de.mrjulsen.crn.CRNPlatformSpecificClient; import de.mrjulsen.crn.CreateRailwaysNavigator; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.Block; @@ -27,11 +23,8 @@ public class ClientWrapper { public static final CTSpriteShiftEntry CT_HORIZONTAL_ADVANCED_DISPLAY_SMALL = ClientWrapper.getCT(AllCTTypes.HORIZONTAL_KRYPPERS, "advanced_display_small", "advanced_display_small"); - @Environment(EnvType.CLIENT) public static void registerCTBehviour(Block entry, Supplier behaviorSupplier) { - ConnectedTextureBehaviour behavior = behaviorSupplier.get(); - CreateClient.MODEL_SWAPPER.getCustomBlockModels() - .register(RegisteredObjects.getKeyOrThrow(entry), model -> new CTModel(model, behavior)); + CRNPlatformSpecificClient.registerCTBehviour(entry, behaviorSupplier); } public static CTSpriteShiftEntry getCT(CTType type, String blockTextureName, String connectedTextureName) { diff --git a/common/src/main/java/de/mrjulsen/crn/registry/ModBlocks.java b/common/src/main/java/de/mrjulsen/crn/registry/ModBlocks.java index b8a80ab3..287d7ef1 100644 --- a/common/src/main/java/de/mrjulsen/crn/registry/ModBlocks.java +++ b/common/src/main/java/de/mrjulsen/crn/registry/ModBlocks.java @@ -21,7 +21,7 @@ import de.mrjulsen.crn.block.connected.AdvancedDisplaySmallCTBehaviour; import de.mrjulsen.crn.block.display.AdvancedDisplayTarget; import dev.architectury.utils.EnvExecutor; -import net.fabricmc.api.EnvType; +import dev.architectury.utils.Env; import net.minecraft.client.renderer.RenderType; import net.minecraft.world.level.block.Block; @@ -105,7 +105,7 @@ public static NonNullConsumer connectedTextures( } protected static void onClient(Supplier toRun) { - EnvExecutor.runInEnv(EnvType.CLIENT, toRun); + EnvExecutor.runInEnv(Env.CLIENT, toRun); } public static void register() { diff --git a/common/src/main/resources/assets/createrailwaysnavigator/lang/es_es.json b/common/src/main/resources/assets/createrailwaysnavigator/lang/es_es.json new file mode 100644 index 00000000..bbd4eacf --- /dev/null +++ b/common/src/main/resources/assets/createrailwaysnavigator/lang/es_es.json @@ -0,0 +1,250 @@ +{ + "advancement.createrailwaysnavigator.navigator": "Gracias por viajar", + "advancement.createrailwaysnavigator.navigator.description": "Crea un navegador para buscar conexiones de tren de una estación de tren a otra.", + "advancement.createrailwaysnavigator.advanced_display": "No del todo 4k", + "advancement.createrailwaysnavigator.advanced_display.description": "Actualiza tus paneles de visualización para mostrar más información e incluso colócalos en tus trenes.", + + "itemGroup.createrailwaysnavigator.tab": "Create Railways Navigator", + + "item.createrailwaysnavigator.navigator": "Navegador de ferrocarriles", + "item.createrailwaysnavigator.navigator.tooltip.summary": "El _navegador_ muestra posibles _conexiones de trenes_ con información adicional como _escalas_, _datos en tiempo real_ y más.", + + "block.createrailwaysnavigator.train_station_clock": "Reloj de estación de tren", + "block.createrailwaysnavigator.advanced_display_block": "Bloque de pantalla avanzada", + "block.createrailwaysnavigator.advanced_display_block.tooltip.summary": "Úsalo en _trenes_, como _pantalla de destino del tren_ o _pantalla de información para pasajeros_, o en _estaciones de tren_ como pantallas de _plataforma mejoradas_ que también muestran más información que los tableros de pantalla regulares.", + "block.createrailwaysnavigator.advanced_display_block.tooltip.condition1": "Al hacer clic derecho con una llave inglesa", + "block.createrailwaysnavigator.advanced_display_block.tooltip.behaviour1": "Abre un menú para _configurar_ la _pantalla_.", + "block.createrailwaysnavigator.advanced_display": "Tablero de pantalla avanzada", + "block.createrailwaysnavigator.advanced_display.tooltip.summary": "Úsalo en _trenes_, como _pantalla de destino del tren_ o _pantalla de información para pasajeros_, o en _estaciones de tren_ como pantallas de _plataforma mejoradas_ que también muestran más información que los tableros de pantalla regulares.", + "block.createrailwaysnavigator.advanced_display.tooltip.condition1": "Al hacer clic derecho con una llave inglesa", + "block.createrailwaysnavigator.advanced_display.tooltip.behaviour1": "Abre un menú para _configurar_ la _pantalla_.", + "block.createrailwaysnavigator.advanced_display_small": "Pantalla avanzada pequeña", + "block.createrailwaysnavigator.advanced_display_small.tooltip.summary": "Úsalo en _trenes_, como _pantalla de destino del tren_ o _pantalla de información para pasajeros_, o en _estaciones de tren_ como pantallas de _plataforma mejoradas_ que también muestran más información que los tableros de pantalla regulares.", + "block.createrailwaysnavigator.advanced_display_small.tooltip.condition1": "Al hacer clic derecho con una llave inglesa", + "block.createrailwaysnavigator.advanced_display_small.tooltip.behaviour1": "Abre un menú para _configurar_ la _pantalla_.", + "block.createrailwaysnavigator.advanced_display_panel": "Panel de pantalla avanzada", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.summary": "Úsalo en _trenes_, como _pantalla de destino del tren_ o _pantalla de información para pasajeros_, o en _estaciones de tren_ como pantallas de _plataforma mejoradas_ que también muestran más información que los tableros de pantalla regulares.", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.condition1": "Al hacer clic derecho con una llave inglesa", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.behaviour1": "Abre un menú para _configurar_ la _pantalla_.", + "block.createrailwaysnavigator.advanced_display_half_panel": "Medio panel de pantalla avanzada", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.summary": "Úsalo en _trenes_, como _pantalla de destino del tren_ o _pantalla de información para pasajeros_, o en _estaciones de tren_ como pantallas de _plataforma mejoradas_ que también muestran más información que los tableros de pantalla regulares.", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.condition1": "Al hacer clic derecho con una llave inglesa", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.behaviour1": "Abre un menú para _configurar_ la _pantalla_.", + "block.createrailwaysnavigator.advanced_display_sloped": "Pantalla avanzada inclinada", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.summary": "Úsalo en _trenes_, como _pantalla de destino del tren_ o _pantalla de información para pasajeros_, o en _estaciones de tren_ como pantallas de _plataforma mejoradas_ que también muestran más información que los tableros de pantalla regulares.", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.condition1": "Al hacer clic derecho con una llave inglesa", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.behaviour1": "Abre un menú para _configurar_ la _pantalla_.", + + "block.createrailwaysnavigator.advanced_display.ber.not_in_service": "¡Fuera de servicio!", + "block.createrailwaysnavigator.advanced_display.ber.shunting_trip": "viaje sin pasajeros", + + "category.createrailwaysnavigator.crn": "Navegador de ferrocarriles", + "key.createrailwaysnavigator.route_overlay_options": "Mostrar opciones de superposición de ruta", + + "enum.createrailwaysnavigator.overlay_position": "Posición de la pantalla", + "enum.createrailwaysnavigator.overlay_position.info.top_left": "Esquina superior izquierda", + "enum.createrailwaysnavigator.overlay_position.info.top_right": "Esquina superior derecha", + "enum.createrailwaysnavigator.overlay_position.info.bottom_left": "Esquina inferior izquierda", + "enum.createrailwaysnavigator.overlay_position.info.bottom_right": "Esquina inferior derecha", + + "gui.createrailwaysnavigator.loading.title": "Descargando datos del servidor...", + + "gui.createrailwaysnavigator.overlay_settings.title": "Configuración de superposición de ruta", + "gui.createrailwaysnavigator.route_overlay_settings.show_details": "Mostrar detalles", + "gui.createrailwaysnavigator.route_overlay_settings.unpin": "Eliminar superposición de ruta", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.on": "Anuncios del narrador activados.", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.off": "Anuncios del narrador desactivados.", + "gui.createrailwaysnavigator.route_overlay_settings.notifications.on": "Notificaciones activadas", + "gui.createrailwaysnavigator.route_overlay_settings.notifications.off": "Notificaciones desactivadas", + "gui.createrailwaysnavigator.route_overlay_settings.scale": "Escala de la interfaz", + "gui.createrailwaysnavigator.route_overlay_settings.narrator": "Anuncios del narrador", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.description": "El narrador anuncia eventos importantes en tu viaje, por ejemplo, la próxima parada, cambios, etc.", + "gui.createrailwaysnavigator.route_overlay_settings.notifications": "Notificaciones", + "gui.createrailwaysnavigator.route_overlay_settings.notifications.description": "Recibe notificaciones emergentes sobre eventos importantes en tu viaje, por ejemplo, la próxima parada, cambios, etc.", + + "gui.createrailwaysnavigator.common.expand": "Mostrar detalles", + "gui.createrailwaysnavigator.common.collapse": "Ocultar detalles", + "gui.createrailwaysnavigator.common.go_back": "Volver", + "gui.createrailwaysnavigator.common.go_to_top": "Desplazarse arriba", + "gui.createrailwaysnavigator.common.reset_defaults": "Restablecer a los valores predeterminados", + "gui.createrailwaysnavigator.common.count": "Cantidad", + "gui.createrailwaysnavigator.common.true": "Sí", + "gui.createrailwaysnavigator.common.false": "No", + "gui.createrailwaysnavigator.common.search": "Buscar", + "gui.createrailwaysnavigator.common.auto": "Automático", + "gui.createrailwaysnavigator.common.server_error": "Error del servidor al ejecutar la tarea. Mira la consola para más detalles.", + + "gui.createrailwaysnavigator.navigator.title": "Navegador de ferrocarriles", + "gui.createrailwaysnavigator.navigator.no_connections": "No se encontraron conexiones.", + "gui.createrailwaysnavigator.navigator.not_searched": "Aún no se ha buscado nada.", + "gui.createrailwaysnavigator.navigator.searching": "Buscando conexiones...", + "gui.createrailwaysnavigator.navigator.error_title": "¡No se puede navegar!", + "gui.createrailwaysnavigator.navigator.start_end_null": "El inicio o el destino están vacíos.", + "gui.createrailwaysnavigator.navigator.start_end_equal": "El inicio y el destino son iguales.", + "gui.createrailwaysnavigator.navigator.route_entry.connection_in_past": "❌ Conexión en el pasado", + "gui.createrailwaysnavigator.navigator.route_entry.transfer": "Transbordo", + "gui.createrailwaysnavigator.navigator.route_entry.station_start": "desde %s", + "gui.createrailwaysnavigator.navigator.global_settings.tooltip": "Configuración global", + "gui.createrailwaysnavigator.navigator.search_settings.tooltip": "Configuración de búsqueda", + "gui.createrailwaysnavigator.navigator.search.tooltip": "Buscar", + "gui.createrailwaysnavigator.navigator.location.tooltip": "Estación más cercana desde la posición actual", + "gui.createrailwaysnavigator.navigator.switch.tooltip": "Cambiar campos", + + "gui.createrailwaysnavigator.route_details.title": "Detalles de la ruta", + "gui.createrailwaysnavigator.route_details.departure": "Salida en", + "gui.createrailwaysnavigator.route_details.next_transfer_time": "Transbordo en", + "gui.createrailwaysnavigator.route_details.transfer": "Transbordo", + "gui.createrailwaysnavigator.route_details.save_route": "Guardar conexión", + + "gui.createrailwaysnavigator.route_overview.title": "Detalles de la ruta", + "gui.createrailwaysnavigator.route_overview.journey_begins": "¡Tu viaje comienza! %s a %s, salida %s", + "gui.createrailwaysnavigator.route_overview.journey_begins_with_platform": "¡Tu viaje comienza! %s a %s, salida %s en el andén %s", + "gui.createrailwaysnavigator.route_overview.train_details": "%s a %s", + "gui.createrailwaysnavigator.route_overview.next_stop": "Próxima parada: %s", + "gui.createrailwaysnavigator.route_overview.transfer": "Transbordo a %s → %s", + "gui.createrailwaysnavigator.route_overview.transfer_with_platform": "Transbordo a %s → %s en el andén %s", + "gui.createrailwaysnavigator.route_overview.journey_completed": "Viaje completado", + "gui.createrailwaysnavigator.route_overview.after_journey": "Has llegado a %s. Gracias por viajar y que tengas un buen día.", + "gui.createrailwaysnavigator.route_overview.next_connections": "Próximas conexiones", + "gui.createrailwaysnavigator.route_overview.schedule_transfer": "Transbordo", + "gui.createrailwaysnavigator.route_overview.train_canceled": "Tren cancelado", + "gui.createrailwaysnavigator.route_overview.train_cancellation_info": "Información sobre %s", + "gui.createrailwaysnavigator.route_overview.stop_canceled": "❌ Cancelado", + "gui.createrailwaysnavigator.route_overview.connection_endangered": "Conexión en peligro", + "gui.createrailwaysnavigator.route_overview.connection_missed": "Conexión perdida", + "gui.createrailwaysnavigator.route_overview.connection_canceled": "Tren cancelado", + "gui.createrailwaysnavigator.route_overview.journey_interrupted": "Tu viaje a %s no puede continuar.", + "gui.createrailwaysnavigator.route_overview.connection_missed_info": "Debido a un retraso del tren, has perdido la conexión del tren. Busca una alternativa en el navegador. Pedimos disculpas por las molestias.", + "gui.createrailwaysnavigator.route_overview.train_canceled_info": "Información sobre %s: ¡Este tren está cancelado hoy! Pedimos disculpas por las molestias. Busca una alternativa en el navegador.", + "gui.createrailwaysnavigator.route_overview.train_canceled_title": "El tren ha sido cancelado", + "gui.createrailwaysnavigator.route_overview.journey_interrupted_info": "Tu viaje a %s no puede continuar. Busca una alternativa en el navegador.", + "gui.createrailwaysnavigator.route_overview.options": "Pulsa %s para opciones.", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins.title": "¡Tu viaje a %s comienza!", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins": "%s a %s, salida %s", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins_with_platform": "%s a %s, salida %s desde el andén %s", + "gui.createrailwaysnavigator.route_overview.notification.platform_changed.title": "¡Tu andén ha cambiado!", + "gui.createrailwaysnavigator.route_overview.notification.platform_changed": "Tu tren en %s sale hoy desde el andén %s.", + "gui.createrailwaysnavigator.route_overview.notification.train_delayed.title": "%s: Llegada %s retrasada.", + "gui.createrailwaysnavigator.route_overview.notification.train_delayed": "%s en lugar de %s en %s", + "gui.createrailwaysnavigator.route_overview.notification.train_canceled.title": "%s: Tren cancelado", + "gui.createrailwaysnavigator.route_overview.notification.train_canceled": "%s a %s está cancelado hoy.", + "gui.createrailwaysnavigator.route_overview.notification.transfer.title": "Transbordo próximo", + "gui.createrailwaysnavigator.route_overview.notification.transfer": "Cambio a %s → %s en el andén %s", + "gui.createrailwaysnavigator.route_overview.notification.transfer_with_platform": "Cambio a %s → %s en el andén %s", + "gui.createrailwaysnavigator.route_overview.notification.connection_endangered.title": "¡Tu conexión está en peligro!", + "gui.createrailwaysnavigator.route_overview.notification.connection_endangered": "Probablemente no podrás llegar a %s a %s.", + "gui.createrailwaysnavigator.route_overview.notification.connection_missed.title": "Conexión perdida", + "gui.createrailwaysnavigator.route_overview.notification.connection_missed": "Has perdido tu tren de conexión %s a %s.", + "gui.createrailwaysnavigator.route_overview.notification.journey_completed.title": "¡Has llegado a tu destino!", + "gui.createrailwaysnavigator.route_overview.notification.journey_completed": "Gracias por viajar y que tengas un buen día", + "gui.createrailwaysnavigator.route_overview.date": "Día %s, %s", + + "gui.createrailwaysnavigator.global_settings.title": "Configuración global", + "gui.createrailwaysnavigator.global_settings.option.tooltip": "Haz clic para editar", + "gui.createrailwaysnavigator.global_settings.option_alias.title": "Etiquetas de estaciones de tren", + "gui.createrailwaysnavigator.global_settings.option_alias.description": "Define etiquetas de estaciones para tratar estaciones con múltiples andenes (por ejemplo, MiEstación 1, MiEstación 2, ...) como una sola estación (por ejemplo, MiEstación) con nombres personalizados.", + "gui.createrailwaysnavigator.global_settings.option_blacklist.title": "Lista negra de estaciones de tren", + "gui.createrailwaysnavigator.global_settings.option_blacklist.description": "Excluir estaciones de tren que no deberían aparecer en los resultados de navegación. Estas estaciones serán ignoradas al generar rutas.", + "gui.createrailwaysnavigator.global_settings.train_group.title": "Grupos de trenes", + "gui.createrailwaysnavigator.global_settings.train_group.description": "Crear grupos de trenes para organizar todos los trenes (por ejemplo, servicios regionales, servicios de larga distancia, ...). Los usuarios pueden decidir qué grupos quieren usar.", + "gui.createrailwaysnavigator.global_settings.train_blacklist.title": "Lista negra de trenes", + "gui.createrailwaysnavigator.global_settings.train_blacklist.description": "Excluir trenes, por ejemplo, trenes de carga, trenes especiales, etc., para que no se utilicen en las sugerencias de rutas.", + + "gui.createrailwaysnavigator.alias_settings.title": "Configuración de etiquetas de estaciones de tren", + "gui.createrailwaysnavigator.alias_settings.summary": "Contiene %s estaciones de tren", + "gui.createrailwaysnavigator.alias_settings.editor": "Última edición por %s el %s", + "gui.createrailwaysnavigator.alias_settings.add.tooltip": "Crear nueva entrada", + "gui.createrailwaysnavigator.alias_settings.delete_alias.tooltip": "Eliminar etiqueta", + "gui.createrailwaysnavigator.alias_settings.delete_station.tooltip": "Eliminar estación", + "gui.createrailwaysnavigator.alias_settings.add_station.tooltip": "Agregar estación", + "gui.createrailwaysnavigator.alias_settings.hint.station_name": "Nombre de la estación de tren", + "gui.createrailwaysnavigator.alias_settings.hint.platform": "Andén", + "gui.createrailwaysnavigator.alias_settings.enter_name": "Introduce el nombre aquí", + + "gui.createrailwaysnavigator.train_group_settings.title": "Configuración de grupos de trenes", + "gui.createrailwaysnavigator.train_group_settings.summary": "Contiene %s trenes", + "gui.createrailwaysnavigator.train_group_settings.editor": "Última edición por %s el %s", + "gui.createrailwaysnavigator.train_group_settings.delete_alias.tooltip": "Eliminar grupo", + "gui.createrailwaysnavigator.train_group_settings.delete_station.tooltip": "Eliminar tren", + "gui.createrailwaysnavigator.train_group_settings.add_station.tooltip": "Agregar tren", + + "gui.createrailwaysnavigator.blacklist.title": "Lista negra de estaciones de tren", + "gui.createrailwaysnavigator.blacklist.add.tooltip": "Agregar a la lista negra", + "gui.createrailwaysnavigator.blacklist.delete.tooltip": "Eliminar de la lista negra", + + "gui.createrailwaysnavigator.train_blacklist.title": "Lista negra de trenes", + "gui.createrailwaysnavigator.train_blacklist.add.tooltip": "Agregar a la lista negra", + "gui.createrailwaysnavigator.train_blacklist.delete.tooltip": "Eliminar de la lista negra", + + "gui.createrailwaysnavigator.search_settings.title": "Configuración de búsqueda", + "gui.createrailwaysnavigator.search_settings.transfer_time": "Tiempo mínimo de transbordo", + "gui.createrailwaysnavigator.search_settings.transfer_time.description": "El tiempo mínimo que debería estar disponible para cambiar de tren. (1h ~ 50 segundos en tiempo real)", + "gui.createrailwaysnavigator.search_settings.train_groups": "Filtro de categoría de trenes", + "gui.createrailwaysnavigator.search_settings.train_groups.description": "Decide qué trenes de qué categorías de trenes quieres utilizar.", + "gui.createrailwaysnavigator.search_settings.train_groups.overview": "%s categorías seleccionadas", + "gui.createrailwaysnavigator.search_settings.train_groups.overview.all": "Todos", + "gui.createrailwaysnavigator.search_settings.train_groups.overview.none": "Ninguno", + "gui.createrailwaysnavigator.search_settings.train_groups.tooltip.reset": "Restablecer filtro", + + "gui.createrailwaysnavigator.new_text_entry.add.tooltip": "Agregar", + + "gui.createrailwaysnavigator.time": "Hora: %s", + "gui.createrailwaysnavigator.time.now": "ahora", + "gui.createrailwaysnavigator.time_format.dhm": "%s días %s h. %s min.", + "gui.createrailwaysnavigator.time_format.hm": "%s h. %s min.", + "gui.createrailwaysnavigator.time_format.m": "%s min.", + + "gui.createrailwaysnavigator.platform": "Andén", + "gui.createrailwaysnavigator.departure": "Salida", + "gui.createrailwaysnavigator.destination": "Destino", + "gui.createrailwaysnavigator.line": "Línea", + "gui.createrailwaysnavigator.following_trains": "Trenes siguientes:", + "gui.createrailwaysnavigator.via": "a través de", + + "gui.createrailwaysnavigator.advanced_display_settings.title": "Configuración avanzada de la pantalla", + "gui.createrailwaysnavigator.advanced_display_settings.display_type": "Tipo de pantalla", + "gui.createrailwaysnavigator.advanced_display_settings.display_type.description": "Determina la información mostrada.", + "gui.createrailwaysnavigator.advanced_display_settings.info_type": "Tipo de información", + "gui.createrailwaysnavigator.advanced_display_settings.info_type.description": "Determina el detalle de la información.", + "gui.createrailwaysnavigator.advanced_display_settings.double_sided": "Doble cara", + + "enum.createrailwaysnavigator.display_info_type": "Tipo de información de la pantalla", + "enum.createrailwaysnavigator.display_info_type.description": "Determina cuánta información se debe mostrar en tu pantalla de visualización.", + "enum.createrailwaysnavigator.display_info_type.simple": "Simple", + "enum.createrailwaysnavigator.display_info_type.info.simple": "La pantalla solo mostrará la información más importante sin detalles adicionales.", + "enum.createrailwaysnavigator.display_info_type.detailed": "Detallado", + "enum.createrailwaysnavigator.display_info_type.info.detailed": "Se mostrará la información más importante con algunos detalles, como la velocidad del tren, las paradas intermedias, etc.", + "enum.createrailwaysnavigator.display_info_type.informative": "Informativo", + "enum.createrailwaysnavigator.display_info_type.info.informative": "Muestra toda la información que podría ser interesante y la presenta en un diseño elegante. No se recomienda para pantallas pequeñas, ya que el texto podría ser muy pequeño.", + + "enum.createrailwaysnavigator.display_type": "Tipo de pantalla", + "enum.createrailwaysnavigator.display_type.description": "El tipo de pantalla depende de su propósito.", + "enum.createrailwaysnavigator.display_type.train_destination": "Destino del tren", + "enum.createrailwaysnavigator.display_type.info.train_destination": "Destinado a ser utilizado fuera de los trenes, muestra información sobre el propio tren, como el nombre, el destino y (si se selecciona) las paradas intermedias y otra información.", + "enum.createrailwaysnavigator.display_type.passenger_information": "Información para pasajeros", + "enum.createrailwaysnavigator.display_type.info.passenger_information": "Representa las pantallas que se encuentran dentro de los trenes. Estas pantallas mostrarán la próxima parada, la dirección de salida y (si se selecciona) la velocidad del tren y una vista general de la ruta.", + "enum.createrailwaysnavigator.display_type.platform": "Pantalla de plataforma", + "enum.createrailwaysnavigator.display_type.info.platform": "Estas pantallas deben usarse en las plataformas de las estaciones de tren y muestran los próximos trenes que llegan con detalles adicionales si se seleccionan. ¡No se pueden usar en los trenes!", + + "enum.createrailwaysnavigator.side": "Lado", + "enum.createrailwaysnavigator.side.description": "El lado del bloque donde se debe renderizar la información.", + "enum.createrailwaysnavigator.side.front": "Lado frontal", + "enum.createrailwaysnavigator.side.info.front": "La información solo se renderizará en el lado frontal. Este es el comportamiento predeterminado.", + "enum.createrailwaysnavigator.side.both": "Ambos lados", + "enum.createrailwaysnavigator.side.info.both": "La información se renderizará en ambos lados.", + + "enum.createrailwaysnavigator.time_display": "Visualización del tiempo", + "enum.createrailwaysnavigator.time_display.description": "Determina cómo se debe mostrar el tiempo.", + "enum.createrailwaysnavigator.time_display.abs": "ABS", + "enum.createrailwaysnavigator.time_display.info.abs": "ABS (absoluto)", + "enum.createrailwaysnavigator.time_display.eta": "ETA", + "enum.createrailwaysnavigator.time_display.info.eta": "ETA (tiempo estimado de llegada)", + + "create.display_source.advanced_display": "Pantallas avanzadas", + "gui.createrailwaysnavigator.display_source.advanced_display.train_name_width": "Ancho de columna del nombre del tren", + "gui.createrailwaysnavigator.display_source.advanced_display.train_name_width.description": "en píxeles de bloque. (Por defecto: 16)", + "gui.createrailwaysnavigator.display_source.advanced_display.platform_width": "Ancho de columna de plataforma", + "gui.createrailwaysnavigator.display_source.advanced_display.platform_width.description": "en píxeles de bloque. (Por defecto: Automático)", + + "createrailwaysnavigator.moin": "moin" +} diff --git a/common/src/main/resources/assets/createrailwaysnavigator/lang/ru_ru.json b/common/src/main/resources/assets/createrailwaysnavigator/lang/ru_ru.json new file mode 100644 index 00000000..aa3c4a38 --- /dev/null +++ b/common/src/main/resources/assets/createrailwaysnavigator/lang/ru_ru.json @@ -0,0 +1,252 @@ +{ + "advancement.createrailwaysnavigator.navigator": "Спасибо за поездку!", + "advancement.createrailwaysnavigator.navigator.description": "Создайте навигатор для поиска маршрутов следования поездов.", + "advancement.createrailwaysnavigator.advanced_display": "Не совсем 4k...", + "advancement.createrailwaysnavigator.advanced_display.description": "Обновите свои механические табло, чтобы на них отображалось больше информации, и даже разместите их в своих поездах.", + + "itemGroup.createrailwaysnavigator.tab": "Create: Навигатор железных дорог", + + "item.createrailwaysnavigator.navigator": "Железнодорожный навигатор", + "item.createrailwaysnavigator.navigator.tooltip.summary": "_Навигатор_ показывает возможные _пересадки к поездам_ и дополнительную информацию, такую как _остановки_, _данные в реальном времени_ и многое другое.", + + "block.createrailwaysnavigator.train_station_clock": "Станционные часы", + "block.createrailwaysnavigator.advanced_display_block": "Блок улучшенного механического табло", + "block.createrailwaysnavigator.advanced_display_block.tooltip.summary": "Используйте в _поездах_ в качестве _табло пункта назначения поезда_ или _табло информации для пассажиров_, а на станциях - в качестве _дисплея платформы,_ которые также отображают больше информации, чем обычные табло.", + "block.createrailwaysnavigator.advanced_display_block.tooltip.condition1": "ПКМ с гаечным ключом", + "block.createrailwaysnavigator.advanced_display_block.tooltip.behaviour1": "Открывает меню для _настройки дисплея._", + "block.createrailwaysnavigator.advanced_display": "Улучшенное механическое табло", + "block.createrailwaysnavigator.advanced_display.tooltip.summary": "Используйте в _поездах_ в качестве _табло пункта назначения поезда_ или _табло информации для пассажиров_, а на станциях - в качестве _дисплея платформы,_ которые также отображают больше информации, чем обычные табло.", + "block.createrailwaysnavigator.advanced_display.tooltip.condition1": "ПКМ с гаечным ключом", + "block.createrailwaysnavigator.advanced_display.tooltip.behaviour1": "Открывает меню для _настройки дисплея._", + "block.createrailwaysnavigator.advanced_display_small": "Малое улучшенное механическое табло", + "block.createrailwaysnavigator.advanced_display_small.tooltip.summary": "Используйте в _поездах_ в качестве _табло пункта назначения поезда_ или _табло информации для пассажиров_, а на станциях - в качестве _дисплея платформы,_ которые также отображают больше информации, чем обычные табло.", + "block.createrailwaysnavigator.advanced_display_small.tooltip.condition1": "ПКМ с гаечным ключом", + "block.createrailwaysnavigator.advanced_display_small.tooltip.behaviour1": "Открывает меню для _настройки дисплея._", + "block.createrailwaysnavigator.advanced_display_panel": "Панель улучшенного механического табло", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.summary": "Используйте в _поездах_ в качестве _табло пункта назначения поезда_ или _табло информации для пассажиров_, а на станциях - в качестве _дисплея платформы,_ которые также отображают больше информации, чем обычные табло.", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.condition1": "ПКМ с гаечным ключом", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.behaviour1": "Открывает меню для _настройки дисплея._", + "block.createrailwaysnavigator.advanced_display_half_panel": "Полупанель улучшенного механического табло", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.summary": "Используйте в _поездах_ в качестве _табло пункта назначения поезда_ или _табло информации для пассажиров_, а на станциях - в качестве _дисплея платформы,_ которые также отображают больше информации, чем обычные табло.", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.condition1": "ПКМ с гаечным ключом", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.behaviour1": "Открывает меню для _настройки дисплея._", + "block.createrailwaysnavigator.advanced_display_sloped": "Наклонное улучшенное механическое табло", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.summary": "Используйте в _поездах_ в качестве _табло пункта назначения поезда_ или _табло информации для пассажиров_, а на станциях - в качестве _дисплея платформы,_ которые также отображают больше информации, чем обычные табло.", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.condition1": "ПКМ с гаечным ключом", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.behaviour1": "Открывает меню для _настройки дисплея._", + + "block.createrailwaysnavigator.advanced_display.ber.not_in_service": "Вышел из строя!", + "block.createrailwaysnavigator.advanced_display.ber.shunting_trip": "Поездка без пассажиров", + + "category.createrailwaysnavigator.crn": "Create: Навигатор железных дорог", + "key.createrailwaysnavigator.route_overlay_options": "Показать параметры наложения маршрута", + + "enum.createrailwaysnavigator.overlay_position": "Позиция наложения", + "enum.createrailwaysnavigator.overlay_position.info.top_left": "Левый верхний угол", + "enum.createrailwaysnavigator.overlay_position.info.top_right": "Правый верхний угол", + "enum.createrailwaysnavigator.overlay_position.info.bottom_left": "Левый нижний угол", + "enum.createrailwaysnavigator.overlay_position.info.bottom_right": "Правый нижний угол", + + "gui.createrailwaysnavigator.loading.title": "Загрузка данных с сервера...", + + "gui.createrailwaysnavigator.overlay_settings.title": "Настройки наложения маршрута", + "gui.createrailwaysnavigator.route_overlay_settings.show_details": "Показать детали", + "gui.createrailwaysnavigator.route_overlay_settings.unpin": "Удалить наложение маршрута", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.on": "Объявления диктора включены.", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.off": "Объявления диктора выключены.", + "gui.createrailwaysnavigator.route_overlay_settings.notifications.on": "Уведомления включены", + "gui.createrailwaysnavigator.route_overlay_settings.notifications.off": "Уведомления выключены", + "gui.createrailwaysnavigator.route_overlay_settings.scale": "Масштаб наложения", + "gui.createrailwaysnavigator.route_overlay_settings.narrator": "Объявления диктора", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.description": "Диктор объявляет о важных событиях в вашем путешествии, например, о следующей остановке, пересадках и т.д.", + "gui.createrailwaysnavigator.route_overlay_settings.notifications": "Уведомления", + "gui.createrailwaysnavigator.route_overlay_settings.notifications.description": "Получайте мгновенные уведомления о важных событиях в вашем путешествии, например, о следующей остановке, пересадках и т.д.", + + "gui.createrailwaysnavigator.common.expand": "Показать детали", + "gui.createrailwaysnavigator.common.collapse": "Скрыть детали", + "gui.createrailwaysnavigator.common.go_back": "Вернуться", + "gui.createrailwaysnavigator.common.go_to_top": "Прокрутить к началу", + "gui.createrailwaysnavigator.common.reset_defaults": "Сбросить по умолчанию", + "gui.createrailwaysnavigator.common.count": "Количество", + "gui.createrailwaysnavigator.common.true": "Да", + "gui.createrailwaysnavigator.common.false": "Нет", + "gui.createrailwaysnavigator.common.search": "Поиск", + "gui.createrailwaysnavigator.common.auto": "Авто", + "gui.createrailwaysnavigator.common.server_error": "Ошибка сервера при выполнении задачи. Подробности смотрите в консоли.", + + "gui.createrailwaysnavigator.navigator.title": "Железнодорожный навигатор", + "gui.createrailwaysnavigator.navigator.no_connections": "Никаких маршрутов не найдено.", + "gui.createrailwaysnavigator.navigator.not_searched": "Пока ничего не найдено.", + "gui.createrailwaysnavigator.navigator.searching": "Поиск маршрутов", + "gui.createrailwaysnavigator.navigator.error_title": "Не удаётся сориентироваться!", + "gui.createrailwaysnavigator.navigator.start_end_null": "Начальная точка или пункт назначения пусты.", + "gui.createrailwaysnavigator.navigator.start_end_equal": "Начало и пункт назначения одинаковы.", + "gui.createrailwaysnavigator.navigator.route_entry.connection_in_past": "❌ Связь в прошлом", + "gui.createrailwaysnavigator.navigator.route_entry.transfer": "Поезда.", + "gui.createrailwaysnavigator.navigator.route_entry.station_start": "от %s", + "gui.createrailwaysnavigator.navigator.global_settings.tooltip": "Глобальные настройки", + "gui.createrailwaysnavigator.navigator.search_settings.tooltip": "Поиск настроек", + "gui.createrailwaysnavigator.navigator.search.tooltip": "Поиск", + "gui.createrailwaysnavigator.navigator.location.tooltip": "Ближайшая станция", + "gui.createrailwaysnavigator.navigator.switch.tooltip": "Переключить поля", + + "gui.createrailwaysnavigator.route_details.title": "Детали маршрута", + "gui.createrailwaysnavigator.route_details.departure": "Отправление через", + "gui.createrailwaysnavigator.route_details.next_transfer_time": "Пересадка на", + "gui.createrailwaysnavigator.route_details.transfer": "Пересадка", + "gui.createrailwaysnavigator.route_details.save_route": "Сохранить соединение", + + "gui.createrailwaysnavigator.route_overview.title": "Детали маршрута", + "gui.createrailwaysnavigator.route_overview.journey_begins": "Ваше поездка начинается! %s в сторону %s, отправление в %s", + "gui.createrailwaysnavigator.route_overview.journey_begins_with_platform": "Ваша поездка начинается! %s в сторону %s, отправление в %s на платформе %s", + "gui.createrailwaysnavigator.route_overview.train_details": "%s в сторону %s", + "gui.createrailwaysnavigator.route_overview.next_stop": "Следующая остановка: %s", + "gui.createrailwaysnavigator.route_overview.transfer": "Пересесть с %s на %s", + "gui.createrailwaysnavigator.route_overview.transfer_with_platform": "Пересядте с %s на %s на платформе %s", + "gui.createrailwaysnavigator.route_overview.journey_completed": "Поездка окончена", + "gui.createrailwaysnavigator.route_overview.after_journey": "Вы достигли станции %s. Спасибо за поездку.", + "gui.createrailwaysnavigator.route_overview.next_connections": "Пересадки на", + "gui.createrailwaysnavigator.route_overview.schedule_transfer": "Пересадка", + "gui.createrailwaysnavigator.route_overview.train_canceled": "Поезд отменён", + "gui.createrailwaysnavigator.route_overview.train_cancellation_info": "Информация о %s", + "gui.createrailwaysnavigator.route_overview.stop_canceled": "❌ отменено", + "gui.createrailwaysnavigator.route_overview.connection_endangered": "Соединение под угрозой", + "gui.createrailwaysnavigator.route_overview.connection_missed": "Соединение потеряно", + "gui.createrailwaysnavigator.route_overview.connection_canceled": "Поезд отменён", + "gui.createrailwaysnavigator.route_overview.journey_interrupted": "Ваша поездка к %s не может быть продолжена.", + "gui.createrailwaysnavigator.route_overview.connection_missed_info": "Из-за задержки поезда вы опоздали на стыковочный поезд. Найдите альтернативный вариант в навигаторе. Приносим извинения за доставленные неудобства.", + "gui.createrailwaysnavigator.route_overview.train_canceled_info": "Информация о %s: Этот поезд сегодня отменен! Приносим извинения за доставленные неудобства. Найдите альтернативный вариант в навигаторе.", + "gui.createrailwaysnavigator.route_overview.train_canceled_title": "Поезд был отменен", + "gui.createrailwaysnavigator.route_overview.journey_interrupted_info": "Вашу поездку к %s невозможно продолжить. Выполните поиск альтернативного маршрута в навигаторе.", + "gui.createrailwaysnavigator.route_overview.options": "Нажмите %s для опций", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins.title": "Ваша поездка к %s начинается!", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins": "%s в сторону %s, отправление в %s", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins_with_platform": "%s в сторону %s, отпрвление %s от платформы %s", + "gui.createrailwaysnavigator.route_overview.notification.platform_changed.title": "Ваша платформа изменилась!", + "gui.createrailwaysnavigator.route_overview.notification.platform_changed": "Ваш поезд в %s отходит от платформы %s сегодня.", + "gui.createrailwaysnavigator.route_overview.notification.train_delayed.title": "%s: прибытие %s задержка.", + "gui.createrailwaysnavigator.route_overview.notification.train_delayed": "%s вместо %s на %s", + "gui.createrailwaysnavigator.route_overview.notification.train_canceled.title": "%s: Поезд отменён", + "gui.createrailwaysnavigator.route_overview.notification.train_canceled": "%s в сторону %s отменён сегодня.", + "gui.createrailwaysnavigator.route_overview.notification.transfer.title": "Пересадка скоро", + "gui.createrailwaysnavigator.route_overview.notification.transfer": "Изменить %s → %s на платформе %s", + "gui.createrailwaysnavigator.route_overview.notification.transfer_with_platform": "Изменить %s → %s на платформе %s", + "gui.createrailwaysnavigator.route_overview.notification.connection_endangered.title": "Ваше соединение находится под угрозой!", + "gui.createrailwaysnavigator.route_overview.notification.connection_endangered": "Вероятно, Вы не сможете добраться из %s в %s.", + "gui.createrailwaysnavigator.route_overview.notification.connection_missed.title": "Пропущенное соединение", + "gui.createrailwaysnavigator.route_overview.notification.connection_missed": "Вы опоздали на свой стыковочный поезд %s в сторону %s.", + "gui.createrailwaysnavigator.route_overview.notification.journey_completed.title": "Вы достигли места назначения!", + "gui.createrailwaysnavigator.route_overview.notification.journey_completed": "Спасибо за поездку", + "gui.createrailwaysnavigator.route_overview.date": "День %s, %s", + + "gui.createrailwaysnavigator.global_settings.title": "Глобальные настройки", + "gui.createrailwaysnavigator.global_settings.option.tooltip": "Нажмите, чтобы изменить", + "gui.createrailwaysnavigator.global_settings.option_alias.title": "Теги станции", + "gui.createrailwaysnavigator.global_settings.option_alias.description": "Нужны для объединения многоплатформенных станций в единую с пользовательским именем для навигатора. (Нужно для создания ТПУ)", + "gui.createrailwaysnavigator.global_settings.option_blacklist.title": "Чёрный список станций", + "gui.createrailwaysnavigator.global_settings.option_blacklist.description": "Исключите станции из результатов навигации. Они будут игнорироваться при создании маршрутов.", + "gui.createrailwaysnavigator.global_settings.train_group.title": "Группы поездов", + "gui.createrailwaysnavigator.global_settings.train_group.description": "Проведите классификацию поездов (например, региональные, междугородние и т.д.). Игроки могут сами выбирать группы.", + "gui.createrailwaysnavigator.global_settings.train_blacklist.title": "Чёрный список поездов", + "gui.createrailwaysnavigator.global_settings.train_blacklist.description": "Исключите поезда, например, грузовые, специальные и т.д., чтобы они не использовались в предложениях по маршруту.", + + "gui.createrailwaysnavigator.alias_settings.title": "Настройки тегов станций", + "gui.createrailwaysnavigator.alias_settings.summary": "Количество станций: %s", + "gui.createrailwaysnavigator.alias_settings.editor": "Изменён %s в %s", + "gui.createrailwaysnavigator.alias_settings.add.tooltip": "Создать новую запись", + "gui.createrailwaysnavigator.alias_settings.delete_alias.tooltip": "Удалить тег", + "gui.createrailwaysnavigator.alias_settings.delete_station.tooltip": "Удалить станцию", + "gui.createrailwaysnavigator.alias_settings.add_station.tooltip": "Добавить станцию", + "gui.createrailwaysnavigator.alias_settings.hint.station_name": "Имя станции", + "gui.createrailwaysnavigator.alias_settings.hint.platform": "Платформа", + "gui.createrailwaysnavigator.alias_settings.enter_name": "Ввести имя здесь", + + "gui.createrailwaysnavigator.train_group_settings.title": "Найстройки групп поездов", + "gui.createrailwaysnavigator.train_group_settings.summary": "Включает %s Tпоездов", + "gui.createrailwaysnavigator.train_group_settings.editor": "Изменено %s в %s", + "gui.createrailwaysnavigator.train_group_settings.delete_alias.tooltip": "Удалить группу", + "gui.createrailwaysnavigator.train_group_settings.delete_station.tooltip": "Удалить поезд", + "gui.createrailwaysnavigator.train_group_settings.add_station.tooltip": "Добавить поезд", + + "gui.createrailwaysnavigator.blacklist.title": "Чёрный список станций", + "gui.createrailwaysnavigator.blacklist.add.tooltip": "Добавить в ЧС", + "gui.createrailwaysnavigator.blacklist.delete.tooltip": "Удалить из ЧС", + + "gui.createrailwaysnavigator.train_blacklist.title": "Чёрный список поездов", + "gui.createrailwaysnavigator.train_blacklist.add.tooltip": "Добавить в ЧС", + "gui.createrailwaysnavigator.train_blacklist.delete.tooltip": "Удалить из ЧС", + + "gui.createrailwaysnavigator.search_settings.title": "Поиск настроек", + "gui.createrailwaysnavigator.search_settings.transfer_time": "Минимальное время пересадки", + "gui.createrailwaysnavigator.search_settings.transfer_time.description": "Минимальное время для пересадки на поезд. (1h ~ 50 реальных секунд)", + "gui.createrailwaysnavigator.search_settings.train_groups": "Фильтер категории поезда", + "gui.createrailwaysnavigator.search_settings.train_groups.description": "Какой категории поездов Вы хотите воспользоваться.", + "gui.createrailwaysnavigator.search_settings.train_groups.overview": "%s", + "gui.createrailwaysnavigator.search_settings.train_groups.overview.all": "Выбраны все категории", + "gui.createrailwaysnavigator.search_settings.train_groups.overview.none": "Ни одна из категорий не выбрана", + "gui.createrailwaysnavigator.search_settings.train_groups.tooltip.reset": "Сбросить фильтры", + + "gui.createrailwaysnavigator.new_text_entry.add.tooltip": "Добавить", + + "gui.createrailwaysnavigator.time": "Время: %s", + "gui.createrailwaysnavigator.time.now": "0 сек", + "gui.createrailwaysnavigator.time_format.dhm": "%s дней %s часов %s мин.", + "gui.createrailwaysnavigator.time_format.hm": "%s часов. %s мин.", + "gui.createrailwaysnavigator.time_format.m": "%s мин.", + + "gui.createrailwaysnavigator.platform": "Платформа", + "gui.createrailwaysnavigator.departure": "Отправление", + "gui.createrailwaysnavigator.destination": "Пункт назначения", + "gui.createrailwaysnavigator.line": "Линия", + "gui.createrailwaysnavigator.following_trains": "Следующие поезда:", + "gui.createrailwaysnavigator.via": "к станции", + + "gui.createrailwaysnavigator.advanced_display_settings.title": "Настройки улучшенного дисплея", + "gui.createrailwaysnavigator.advanced_display_settings.display_type": "Тип дисплея", + "gui.createrailwaysnavigator.advanced_display_settings.display_type.description": "Определяет отображаемую информацию.", + "gui.createrailwaysnavigator.advanced_display_settings.info_type": "Тип информации", + "gui.createrailwaysnavigator.advanced_display_settings.info_type.description": "Определяет, насколько подробной является информация.", + "gui.createrailwaysnavigator.advanced_display_settings.double_sided": "Двухсторонний", + + "enum.createrailwaysnavigator.display_info_type": "Тип информации дисплея", + "enum.createrailwaysnavigator.display_info_type.description": "Определяет, какой объем информации должен отображаться на вашем дисплее.", + "enum.createrailwaysnavigator.display_info_type.simple": "Простой", + "enum.createrailwaysnavigator.display_info_type.info.simple": "На дисплее будет отображаться только самая важная информация без каких-либо дополнительных подробностей.", + "enum.createrailwaysnavigator.display_info_type.detailed": "Подробный", + "enum.createrailwaysnavigator.display_info_type.info.detailed": "Будет показана наиболее важная информация с некоторыми подробностями, такими как скорость поезда, остановки в пути и т.д.", + "enum.createrailwaysnavigator.display_info_type.informative": "Информативный", + "enum.createrailwaysnavigator.display_info_type.info.informative": "Отображает всю информацию, которая может быть интересна, и представляет ее в необычном формате. Не рекомендуется для небольших дисплеев, так как текст может стать очень мелким.", + + "enum.createrailwaysnavigator.display_type": "Тип дисплея", + "enum.createrailwaysnavigator.display_type.description": "Тип вашего дисплея зависит от его назначения.", + "enum.createrailwaysnavigator.display_type.train_destination": "Табло пункта назначения поезда", + "enum.createrailwaysnavigator.display_type.info.train_destination": "Предназначен для использования вне поездов, поскольку он отображает информацию о самом поезде, такую как название, пункт назначения и (если выбрано) промежуточные остановки, а также другую информацию.", + "enum.createrailwaysnavigator.display_type.passenger_information": "Информатор для пассажиров", + "enum.createrailwaysnavigator.display_type.info.passenger_information": "Отображает дисплеи, расположенные внутри поездов. На этих дисплеях будут отображаться следующая остановка, направление выхода и (если выбрано) скорость движения поезда, а также обзор маршрута.", + "enum.createrailwaysnavigator.display_type.platform": "Дисплей платформы", + "enum.createrailwaysnavigator.display_type.info.platform": "Эти дисплеи следует использовать на платформах железнодорожных вокзалов, и на них отображаются следующие поезда с дополнительной информацией, если они выбраны. Нельзя использовать в поездах!", + + "enum.createrailwaysnavigator.side": "Сторона", + "enum.createrailwaysnavigator.side.description": "Сторона блока, на которой должна отображаться информация.", + "enum.createrailwaysnavigator.side.front": "Лицевая сторона", + "enum.createrailwaysnavigator.side.info.front": "Информация будет отображаться только на лицевой стороне. Это поведение по умолчанию.", + "enum.createrailwaysnavigator.side.both": "Обе стороны", + "enum.createrailwaysnavigator.side.info.both": "Информация будет отображаться с обеих сторон.", + + "enum.createrailwaysnavigator.time_display": "Отображение времени", + "enum.createrailwaysnavigator.time_display.description": "Определяет, как должно отображаться время.", + "enum.createrailwaysnavigator.time_display.abs": "АБС", + "enum.createrailwaysnavigator.time_display.info.abs": "АБС (Абсолютное)", + "enum.createrailwaysnavigator.time_display.eta": "ПВП", + "enum.createrailwaysnavigator.time_display.info.eta": "ПВП (Предполагаемое время прибытия)", + + "create.display_source.advanced_display": "Улучшенные дисплеи", + "gui.createrailwaysnavigator.display_source.advanced_display.train_name_width": "Ширина столбца с названием поезда", + "gui.createrailwaysnavigator.display_source.advanced_display.train_name_width.description": "в пикселях блока. (По умолчанию: 16)", + "gui.createrailwaysnavigator.display_source.advanced_display.platform_width": "Ширина колонны платформы", + "gui.createrailwaysnavigator.display_source.advanced_display.platform_width.description": "в пикселях блока. (По умолчанию: Авто)", + + "createrailwaysnavigator.moin": "moin", + + "createrailwaysnavigator.credits": "Над переводом работал VGamerGroup" +} \ No newline at end of file diff --git a/common/src/main/resources/assets/createrailwaysnavigator/lang/zh_cn.json b/common/src/main/resources/assets/createrailwaysnavigator/lang/zh_cn.json index fa94bbae..06a2ab67 100644 --- a/common/src/main/resources/assets/createrailwaysnavigator/lang/zh_cn.json +++ b/common/src/main/resources/assets/createrailwaysnavigator/lang/zh_cn.json @@ -1,47 +1,47 @@ { "advancement.createrailwaysnavigator.navigator": "感谢您的乘坐", - "advancement.createrailwaysnavigator.navigator.description": "制造一个导航仪以搜寻路线.", + "advancement.createrailwaysnavigator.navigator.description": "制作一个导航仪,用于搜索从一个车站到另一个车站的列车路线。", "advancement.createrailwaysnavigator.advanced_display": "还不够清晰", - "advancement.createrailwaysnavigator.advanced_display.description": "升级你的信息牌以展示更多信息,你甚至可以把它放在火车上!", + "advancement.createrailwaysnavigator.advanced_display.description": "升级您的显示器以显示更多信息,甚至可以将它们放置在您的列车上。", "itemGroup.createrailwaysnavigator.tab": "机械动力:铁路导航", - "item.createrailwaysnavigator.navigator": "机械动力:铁路导航", - "item.createrailwaysnavigator.navigator.tooltip.summary": "_导航仪_ 显示 可能的 _火车线路_ 提供更多功能如 _经停站_, _实时信息_ 以及更多。", + "item.createrailwaysnavigator.navigator": "铁路导航仪", + "item.createrailwaysnavigator.navigator.tooltip.summary": "_导航仪_可以显示可能的_列车路线_,以及_经停站_、_实时信息_等。", "block.createrailwaysnavigator.train_station_clock": "车站时钟", - "block.createrailwaysnavigator.advanced_display_block": "高级展示方块", - "block.createrailwaysnavigator.advanced_display_block.tooltip.summary": "使用在 _火车上_, 可以展示 _列车终点站_ 或 _乘客信息_, 也可以放置在 _火车站_ 当作 _信息展示平台_, 拥有比普通展示牌更强大的功能。 ", - "block.createrailwaysnavigator.advanced_display_block.tooltip.condition1": "使用扳手右键时", - "block.createrailwaysnavigator.advanced_display_block.tooltip.behaviour1": "打开配置菜单", - "block.createrailwaysnavigator.advanced_display": "高级展示牌", - "block.createrailwaysnavigator.advanced_display.tooltip.summary": "使用在 _火车上_, 可以展示 _列车终点站_ 或 _乘客信息_, 也可以放置在 _火车站_ 当作 _信息展示平台_, 拥有比普通展示牌更强大的功能。", - "block.createrailwaysnavigator.advanced_display.tooltip.condition1": "使用扳手右键时", - "block.createrailwaysnavigator.advanced_display.tooltip.behaviour1": "打开配置菜单", - "block.createrailwaysnavigator.advanced_display_small": "小型高级展示牌", - "block.createrailwaysnavigator.advanced_display_small.tooltip.summary": "使用在 _火车上_, 可以展示 _列车终点站_ 或 _乘客信息_, 也可以放置在 _火车站_ 当作 _信息展示平台_, 拥有比普通展示牌更强大的功能。", - "block.createrailwaysnavigator.advanced_display_small.tooltip.condition1": "使用扳手右键时", - "block.createrailwaysnavigator.advanced_display_small.tooltip.behaviour1": "打开配置菜单", + "block.createrailwaysnavigator.advanced_display_block": "高级显示器方块", + "block.createrailwaysnavigator.advanced_display_block.tooltip.summary": "使用在_列车上_,可以展示_列车目的地_或_乘客信息_, 也可以放置在_车站_当作_站台显示器_, 比普通显示器显示更多信息。", + "block.createrailwaysnavigator.advanced_display_block.tooltip.condition1": "用扳手右击时", + "block.createrailwaysnavigator.advanced_display_block.tooltip.behaviour1": "打开菜单以_配置_显示器。", + "block.createrailwaysnavigator.advanced_display": "高级显示器", + "block.createrailwaysnavigator.advanced_display.tooltip.summary": "使用在_列车上_,可以展示_列车目的地_或_乘客信息_, 也可以放置在_车站_当作_站台显示器_, 比普通显示器显示更多信息。", + "block.createrailwaysnavigator.advanced_display.tooltip.condition1": "用扳手右击时", + "block.createrailwaysnavigator.advanced_display.tooltip.behaviour1": "打开菜单以_配置_显示器。", + "block.createrailwaysnavigator.advanced_display_small": "小型高级显示器", + "block.createrailwaysnavigator.advanced_display_small.tooltip.summary": "使用在_列车上_,可以展示_列车目的地_或_乘客信息_, 也可以放置在_车站_当作_站台显示器_, 比普通显示器显示更多信息。", + "block.createrailwaysnavigator.advanced_display_small.tooltip.condition1": "用扳手右击时", + "block.createrailwaysnavigator.advanced_display_small.tooltip.behaviour1": "打开菜单以_配置_显示器。", "block.createrailwaysnavigator.advanced_display_panel": "高级显示面板", - "block.createrailwaysnavigator.advanced_display_panel.tooltip.summary": "使用在 _火车上_, 可以展示 _列车终点站_ 或 _乘客信息_, 也可以放置在 _火车站_ 当作 _信息展示平台_, 拥有比普通展示牌更强大的功能。", - "block.createrailwaysnavigator.advanced_display_panel.tooltip.condition1": "使用扳手右键时", - "block.createrailwaysnavigator.advanced_display_panel.tooltip.behaviour1": "打开配置菜单", - "block.createrailwaysnavigator.advanced_display_half_panel": "先进的半显示面板", - "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.summary": "使用在 _火车上_, 可以展示 _列车终点站_ 或 _乘客信息_, 也可以放置在 _火车站_ 当作 _信息展示平台_, 拥有比普通展示牌更强大的功能。", - "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.condition1": "使用扳手右键时", - "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.behaviour1": "打开配置菜单", - "block.createrailwaysnavigator.advanced_display_sloped": "倾斜式高级显示器", - "block.createrailwaysnavigator.advanced_display_sloped.tooltip.summary": "使用在 _火车上_, 可以展示 _列车终点站_ 或 _乘客信息_, 也可以放置在 _火车站_ 当作 _信息展示平台_, 拥有比普通展示牌更强大的功能。", - "block.createrailwaysnavigator.advanced_display_sloped.tooltip.condition1": "使用扳手右键时", - "block.createrailwaysnavigator.advanced_display_sloped.tooltip.behaviour1": "打开配置菜单.", - - "block.createrailwaysnavigator.advanced_display.ber.not_in_service": "线路不可用", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.summary": "使用在_列车上_,可以展示_列车目的地_或_乘客信息_, 也可以放置在_车站_当作_站台显示器_, 比普通显示器显示更多信息。", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.condition1": "用扳手右击时", + "block.createrailwaysnavigator.advanced_display_panel.tooltip.behaviour1": "打开菜单以_配置_显示器。", + "block.createrailwaysnavigator.advanced_display_half_panel": "高级半显示面板", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.summary": "使用在_列车上_,可以展示_列车目的地_或_乘客信息_, 也可以放置在_车站_当作_站台显示器_, 比普通显示器显示更多信息。", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.condition1": "用扳手右击时", + "block.createrailwaysnavigator.advanced_display_half_panel.tooltip.behaviour1": "打开菜单以_配置_显示器。", + "block.createrailwaysnavigator.advanced_display_sloped": "斜面高级显示器", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.summary": "使用在_列车上_,可以展示_列车目的地_或_乘客信息_, 也可以放置在_车站_当作_站台显示器_, 比普通显示器显示更多信息。", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.condition1": "用扳手右击时", + "block.createrailwaysnavigator.advanced_display_sloped.tooltip.behaviour1": "打开菜单以_配置_显示器。", + + "block.createrailwaysnavigator.advanced_display.ber.not_in_service": "未启用", "block.createrailwaysnavigator.advanced_display.ber.shunting_trip": "调车行程", "category.createrailwaysnavigator.crn": "机械动力:铁路导航", "key.createrailwaysnavigator.route_overlay_options": "显示路线覆盖选项", - "enum.createrailwaysnavigator.overlay_position": "展示位置", + "enum.createrailwaysnavigator.overlay_position": "显示位置", "enum.createrailwaysnavigator.overlay_position.info.top_left": "左上角", "enum.createrailwaysnavigator.overlay_position.info.top_right": "右上角", "enum.createrailwaysnavigator.overlay_position.info.bottom_left": "左下角", @@ -50,22 +50,22 @@ "gui.createrailwaysnavigator.loading.title": "正在从服务器下载数据...", "gui.createrailwaysnavigator.overlay_settings.title": "路线覆盖设置", - "gui.createrailwaysnavigator.route_overlay_settings.show_details": "展示详细信息", + "gui.createrailwaysnavigator.route_overlay_settings.show_details": "显示详细信息", "gui.createrailwaysnavigator.route_overlay_settings.unpin": "移除路线覆盖", - "gui.createrailwaysnavigator.route_overlay_settings.narrator.on": "讲述人通知开启.", - "gui.createrailwaysnavigator.route_overlay_settings.narrator.off": "讲述人通知关闭.", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.on": "讲述人通知开启", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.off": "讲述人通知关闭", "gui.createrailwaysnavigator.route_overlay_settings.notifications.on": "开启通知", "gui.createrailwaysnavigator.route_overlay_settings.notifications.off": "关闭通知", "gui.createrailwaysnavigator.route_overlay_settings.scale": "GUI 大小", "gui.createrailwaysnavigator.route_overlay_settings.narrator": "讲述人通知", - "gui.createrailwaysnavigator.route_overlay_settings.narrator.description": "讲述人会播报旅程中的信息,例如下一个车站,换乘", + "gui.createrailwaysnavigator.route_overlay_settings.narrator.description": "讲述人会播报您旅途中的重要事件,例如下一站、换乘等。", "gui.createrailwaysnavigator.route_overlay_settings.notifications": "通知", - "gui.createrailwaysnavigator.route_overlay_settings.notifications.description": "通知旅程中的信息,例如下一个车站,换乘", + "gui.createrailwaysnavigator.route_overlay_settings.notifications.description": "在旅途中接收关于重要事件的弹窗通知,例如下一站、换乘等。", - "gui.createrailwaysnavigator.common.expand": "显示细节", - "gui.createrailwaysnavigator.common.collapse": "隐藏细节", + "gui.createrailwaysnavigator.common.expand": "显示详情", + "gui.createrailwaysnavigator.common.collapse": "隐藏详情", "gui.createrailwaysnavigator.common.go_back": "返回", - "gui.createrailwaysnavigator.common.go_to_top": "滚动至顶部", + "gui.createrailwaysnavigator.common.go_to_top": "滚动到顶部", "gui.createrailwaysnavigator.common.reset_defaults": "恢复初始设定", "gui.createrailwaysnavigator.common.count": "数量", "gui.createrailwaysnavigator.common.true": "是", @@ -75,176 +75,174 @@ "gui.createrailwaysnavigator.common.server_error": "执行任务时出现问题,请查看控制台以获取更多信息。", "gui.createrailwaysnavigator.navigator.title": "机械动力:铁路导航", - "gui.createrailwaysnavigator.navigator.no_connections": "没有可用线路", - "gui.createrailwaysnavigator.navigator.not_searched": "没有搜索结果", - "gui.createrailwaysnavigator.navigator.searching": "正在搜索...", - "gui.createrailwaysnavigator.navigator.error_title": "无法导航!", - "gui.createrailwaysnavigator.navigator.start_end_null": "起点或终点为空.", - "gui.createrailwaysnavigator.navigator.start_end_equal": "起点或终点不能相同.", - "gui.createrailwaysnavigator.navigator.route_entry.connection_in_past": "❌ 线路已过期", - "gui.createrailwaysnavigator.navigator.route_entry.transfer": "换乘.", - "gui.createrailwaysnavigator.navigator.route_entry.station_start": "从 %s", - "gui.createrailwaysnavigator.navigator.global_settings.tooltip": "通用设置", + "gui.createrailwaysnavigator.navigator.no_connections": "未找到路线。", + "gui.createrailwaysnavigator.navigator.not_searched": "尚未搜索。", + "gui.createrailwaysnavigator.navigator.searching": "正在搜索路线...", + "gui.createrailwaysnavigator.navigator.error_title": "无法导航!", + "gui.createrailwaysnavigator.navigator.start_end_null": "起点或终点为空。", + "gui.createrailwaysnavigator.navigator.start_end_equal": "起点和终点相同。", + "gui.createrailwaysnavigator.navigator.route_entry.connection_in_past": "❌ 过去的车次", + "gui.createrailwaysnavigator.navigator.route_entry.transfer": "换乘", + "gui.createrailwaysnavigator.navigator.route_entry.station_start": "从%s出发", + "gui.createrailwaysnavigator.navigator.global_settings.tooltip": "全局设置", "gui.createrailwaysnavigator.navigator.search_settings.tooltip": "搜索设置", "gui.createrailwaysnavigator.navigator.search.tooltip": "搜索", - "gui.createrailwaysnavigator.navigator.location.tooltip": "自动查找最近车站", + "gui.createrailwaysnavigator.navigator.location.tooltip": "定位最近的车站", "gui.createrailwaysnavigator.navigator.switch.tooltip": "交换地点", "gui.createrailwaysnavigator.route_details.title": "路线详情", - "gui.createrailwaysnavigator.route_details.departure": "出发自", - "gui.createrailwaysnavigator.route_details.next_transfer_time": "换乘于", + "gui.createrailwaysnavigator.route_details.departure": "出发时间", + "gui.createrailwaysnavigator.route_details.next_transfer_time": "换乘时间", "gui.createrailwaysnavigator.route_details.transfer": "换乘", - "gui.createrailwaysnavigator.route_details.save_route": "保存线路", + "gui.createrailwaysnavigator.route_details.save_route": "保存路线", "gui.createrailwaysnavigator.route_overview.title": "路线详情", - "gui.createrailwaysnavigator.route_overview.journey_begins": "列车出发! %s 至 %s, 起始于 %s", - "gui.createrailwaysnavigator.route_overview.journey_begins_with_platform": "列车出发! %s 至 %s, 起始于 %s 站台 %s", - "gui.createrailwaysnavigator.route_overview.train_details": "%s 至 %s", - "gui.createrailwaysnavigator.route_overview.next_stop": "下一站: %s", - "gui.createrailwaysnavigator.route_overview.transfer": "换乘 %s → %s", - "gui.createrailwaysnavigator.route_overview.transfer_with_platform": "换乘 %s → %s 在站台 %s", - "gui.createrailwaysnavigator.route_overview.journey_completed": "旅程结束", - "gui.createrailwaysnavigator.route_overview.after_journey": "您已到达 %s. 感谢您的乘坐,祝您有美好的一天.", - "gui.createrailwaysnavigator.route_overview.next_connections": "下一站", + "gui.createrailwaysnavigator.route_overview.journey_begins": "您的旅程开始了!%s到%s,出发时间%s", + "gui.createrailwaysnavigator.route_overview.journey_begins_with_platform": "您的旅程开始了!%s到%s,出发时间%s,在%s站台乘车", + "gui.createrailwaysnavigator.route_overview.train_details": "%s到%s", + "gui.createrailwaysnavigator.route_overview.next_stop": "下一站:%s", + "gui.createrailwaysnavigator.route_overview.transfer": "换乘%s→%s", + "gui.createrailwaysnavigator.route_overview.transfer_with_platform": "换乘%s→%s,在%s站台乘车", + "gui.createrailwaysnavigator.route_overview.journey_completed": "旅程完成", + "gui.createrailwaysnavigator.route_overview.after_journey": "您已抵达%s。感谢您的乘坐,祝您旅途愉快。", + "gui.createrailwaysnavigator.route_overview.next_connections": "下一车次", "gui.createrailwaysnavigator.route_overview.schedule_transfer": "换乘", - "gui.createrailwaysnavigator.route_overview.train_canceled": "列车已取消", - "gui.createrailwaysnavigator.route_overview.train_cancellation_info": "取消信息 %s", - "gui.createrailwaysnavigator.route_overview.stop_canceled": "❌ 取消", - "gui.createrailwaysnavigator.route_overview.connection_endangered": "不安全的线路", - "gui.createrailwaysnavigator.route_overview.connection_missed": "线路消失", - "gui.createrailwaysnavigator.route_overview.connection_canceled": "列车取消", - "gui.createrailwaysnavigator.route_overview.journey_interrupted": "您前往 %s 的旅程已中断。", - "gui.createrailwaysnavigator.route_overview.connection_missed_info": "由于列车延迟导致您无法换乘,请打开导航仪搜索更多线路。对于带来的不便我们深感歉意。", - "gui.createrailwaysnavigator.route_overview.train_canceled_info": "车次: %s: 车次已取消,请打开导航仪搜索更多线路。对于带来的不便我们深感歉意。", - "gui.createrailwaysnavigator.route_overview.train_canceled_title": "车次已取消", - "gui.createrailwaysnavigator.route_overview.journey_interrupted_info": "前往 %s 的旅程已中断。 请打开导航仪搜索更多线路", - "gui.createrailwaysnavigator.route_overview.options": "按 %s 展示选项.", - "gui.createrailwaysnavigator.route_overview.notification.journey_begins.title": "正在前往 %s!", - "gui.createrailwaysnavigator.route_overview.notification.journey_begins": "%s 至 %s, 起始于 %s", - "gui.createrailwaysnavigator.route_overview.notification.journey_begins_with_platform": "%s 至 %s, 起始于 %s 站台 %s", - "gui.createrailwaysnavigator.route_overview.notification.platform_changed.title": "您已切换站台!", - "gui.createrailwaysnavigator.route_overview.notification.platform_changed": "列车 %s 今日从站台 %s 离开.", - "gui.createrailwaysnavigator.route_overview.notification.train_delayed.title": "%s: 延迟抵达 %s", - "gui.createrailwaysnavigator.route_overview.notification.train_delayed": "推迟至 %s 原定 %s 抵达 %s", - "gui.createrailwaysnavigator.route_overview.notification.train_canceled.title": "%s: 车次取消", - "gui.createrailwaysnavigator.route_overview.notification.train_canceled": "今日原定从 %s 至 %s 的车次已经取消", - "gui.createrailwaysnavigator.route_overview.notification.transfer.title": "换乘列车即将到来", - "gui.createrailwaysnavigator.route_overview.notification.transfer": "换乘 %s → %s 于站台 %s", - "gui.createrailwaysnavigator.route_overview.notification.transfer_with_platform": "换乘 %s → %s 于站台 %s", - "gui.createrailwaysnavigator.route_overview.notification.connection_endangered.title": "不安全的线路!", - "gui.createrailwaysnavigator.route_overview.notification.connection_endangered": "您可能不会从 %s 抵达 %s.", - "gui.createrailwaysnavigator.route_overview.notification.connection_missed.title": "缺失线路", - "gui.createrailwaysnavigator.route_overview.notification.connection_missed": "从 %s 到 %s 线路已缺失", - "gui.createrailwaysnavigator.route_overview.notification.journey_completed.title": "您已抵达目的地!", - "gui.createrailwaysnavigator.route_overview.notification.journey_completed": "感谢您的乘坐,祝您有美好的一天", - "gui.createrailwaysnavigator.route_overview.date": "日期: %s, %s", + "gui.createrailwaysnavigator.route_overview.train_canceled": "车次取消", + "gui.createrailwaysnavigator.route_overview.train_cancellation_info": "关于%s的信息", + "gui.createrailwaysnavigator.route_overview.stop_canceled": "❌ 已取消", + "gui.createrailwaysnavigator.route_overview.connection_endangered": "换乘受阻", + "gui.createrailwaysnavigator.route_overview.connection_missed": "错过换乘", + "gui.createrailwaysnavigator.route_overview.connection_canceled": "车次取消", + "gui.createrailwaysnavigator.route_overview.journey_interrupted": "您前往%s的旅程无法继续。", + "gui.createrailwaysnavigator.route_overview.connection_missed_info": "由于列车延误,您错过了换乘列车。请在导航仪中搜索替代路线。对于给您造成的不便,我们深表歉意。", + "gui.createrailwaysnavigator.route_overview.train_canceled_info": "关于%s的信息:该车次已取消!对于给您造成的不便,我们深表歉意。请在导航仪中搜索替代路线。", + "gui.createrailwaysnavigator.route_overview.train_canceled_title": "车次取消", + "gui.createrailwaysnavigator.route_overview.journey_interrupted_info": "您前往%s的旅程无法继续。请在导航仪中搜索替代路线。", + "gui.createrailwaysnavigator.route_overview.options": "按%s键查看选项。", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins.title": "您前往%s的旅程开始了!", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins": "%s到%s,出发时间%s", + "gui.createrailwaysnavigator.route_overview.notification.journey_begins_with_platform": "%s到%s,出发时间%s,在%s站台乘车", + "gui.createrailwaysnavigator.route_overview.notification.platform_changed.title": "站台已变更!", + "gui.createrailwaysnavigator.route_overview.notification.platform_changed": "您在%s的列车将从%s号站台出发。", + "gui.createrailwaysnavigator.route_overview.notification.train_delayed.title": "%s:延误%s", + "gui.createrailwaysnavigator.route_overview.notification.train_delayed": "原定%2$s,现将于%1$s抵达%3$s", + "gui.createrailwaysnavigator.route_overview.notification.train_canceled.title": "%s:列车取消", + "gui.createrailwaysnavigator.route_overview.notification.train_canceled": "前往%2$s的%1$s已取消。", + "gui.createrailwaysnavigator.route_overview.notification.transfer.title": "即将换乘", + "gui.createrailwaysnavigator.route_overview.notification.transfer": "换乘%s→%s,在%s站台乘车", + "gui.createrailwaysnavigator.route_overview.notification.transfer_with_platform": "换乘%s→%s,在%s站台乘车", + "gui.createrailwaysnavigator.route_overview.notification.connection_endangered.title": "换乘受阻!", + "gui.createrailwaysnavigator.route_overview.notification.connection_endangered": "您可能无法赶上前往%2$s的%1$s。", + "gui.createrailwaysnavigator.route_overview.notification.connection_missed.title": "错过换乘", + "gui.createrailwaysnavigator.route_overview.notification.connection_missed": "您错过了前往%2$s的%1$s。", + "gui.createrailwaysnavigator.route_overview.notification.journey_completed.title": "您已抵达目的地!", + "gui.createrailwaysnavigator.route_overview.notification.journey_completed": "感谢您的乘坐,祝您旅途愉快", + "gui.createrailwaysnavigator.route_overview.date": "第%s天,%s", "gui.createrailwaysnavigator.global_settings.title": "全局设定", "gui.createrailwaysnavigator.global_settings.option.tooltip": "点击编辑", - "gui.createrailwaysnavigator.global_settings.option_alias.title": "列车站标签", + "gui.createrailwaysnavigator.global_settings.option_alias.title": "车站标签", "gui.createrailwaysnavigator.global_settings.option_alias.description": "对于多站台的车站,您可以建立标签 (例如 MyStation 1, MyStation 2, ...) 以把它们归于一个车站下 (例如 MyStation)。", "gui.createrailwaysnavigator.global_settings.option_blacklist.title": "车站黑名单", - "gui.createrailwaysnavigator.global_settings.option_blacklist.description": "黑名单中的车站将不会再搜索选项中出现.", - "gui.createrailwaysnavigator.global_settings.train_group.title": "列车组", - "gui.createrailwaysnavigator.global_settings.train_group.description": "将列车加入列车组以方便管理,用户可以选择列车组.", - "gui.createrailwaysnavigator.global_settings.train_blacklist.title": "火车黑名单", - "gui.createrailwaysnavigator.global_settings.train_blacklist.description": "黑名单中的火车将不会显示", - - "gui.createrailwaysnavigator.alias_settings.title": "列车站标签设定", - "gui.createrailwaysnavigator.alias_settings.summary": "包含 %s 个车站", - "gui.createrailwaysnavigator.alias_settings.editor": "最后由 %s 在 %s 编辑", - "gui.createrailwaysnavigator.alias_settings.add.tooltip": "加入新的入口", + "gui.createrailwaysnavigator.global_settings.option_blacklist.description": "排除导航结果中不应出现的车站。生成路线时将忽略这些车站。", + "gui.createrailwaysnavigator.global_settings.train_group.title": "列车分类", + "gui.createrailwaysnavigator.global_settings.train_group.description": "将列车加入列车分类(例如,区域服务、长途服务等)以方便管理,乘客可以决定要使用哪些列车分类。", + "gui.createrailwaysnavigator.global_settings.train_blacklist.title": "列车黑名单", + "gui.createrailwaysnavigator.global_settings.train_blacklist.description": "排除列车,例如货运列车、专列等,以便在路线建议中不显示它们。", + + "gui.createrailwaysnavigator.alias_settings.title": "车站标签设定", + "gui.createrailwaysnavigator.alias_settings.summary": "包含%s个车站", + "gui.createrailwaysnavigator.alias_settings.editor": "最后编辑者:%s,于%s", + "gui.createrailwaysnavigator.alias_settings.add.tooltip": "创建新条目", "gui.createrailwaysnavigator.alias_settings.delete_alias.tooltip": "删除标签", "gui.createrailwaysnavigator.alias_settings.delete_station.tooltip": "移除车站", "gui.createrailwaysnavigator.alias_settings.add_station.tooltip": "添加车站", "gui.createrailwaysnavigator.alias_settings.hint.station_name": "车站名称", "gui.createrailwaysnavigator.alias_settings.hint.platform": "站台", - "gui.createrailwaysnavigator.alias_settings.enter_name": "在此输入名字", - - "gui.createrailwaysnavigator.train_group_settings.title": "列车组设置", - "gui.createrailwaysnavigator.train_group_settings.summary": "包含 %s 辆列车", - "gui.createrailwaysnavigator.train_group_settings.editor": "最后由 %s 在 %s 编辑", - "gui.createrailwaysnavigator.train_group_settings.delete_alias.tooltip": "删除列车组", + "gui.createrailwaysnavigator.alias_settings.enter_name": "在此输入名称", + "gui.createrailwaysnavigator.train_group_settings.title": "列车分类设置", + "gui.createrailwaysnavigator.train_group_settings.summary": "包含%s辆列车", + "gui.createrailwaysnavigator.train_group_settings.editor": "最后编辑者:%s,%s", + "gui.createrailwaysnavigator.train_group_settings.delete_alias.tooltip": "删除分类", "gui.createrailwaysnavigator.train_group_settings.delete_station.tooltip": "移除列车", "gui.createrailwaysnavigator.train_group_settings.add_station.tooltip": "添加列车", - "gui.createrailwaysnavigator.blacklist.title": "列车站黑名单", + "gui.createrailwaysnavigator.blacklist.title": "车站黑名单", "gui.createrailwaysnavigator.blacklist.add.tooltip": "加入黑名单", "gui.createrailwaysnavigator.blacklist.delete.tooltip": "移除黑名单", - + "gui.createrailwaysnavigator.train_blacklist.title": "列车黑名单", "gui.createrailwaysnavigator.train_blacklist.add.tooltip": "加入黑名单", "gui.createrailwaysnavigator.train_blacklist.delete.tooltip": "移除黑名单", - + "gui.createrailwaysnavigator.search_settings.title": "搜索设定", "gui.createrailwaysnavigator.search_settings.transfer_time": "最短换乘时间", - "gui.createrailwaysnavigator.search_settings.transfer_time.description": "最短的需要换乘的时间. (一小时对应现实50秒)", + "gui.createrailwaysnavigator.search_settings.transfer_time.description": "换乘需要的最短可用时间。(1 小时 ≈ 50 秒现实时间)", "gui.createrailwaysnavigator.search_settings.train_groups": "列车过滤器", - "gui.createrailwaysnavigator.search_settings.train_groups.description": "决定想使用的列车", - "gui.createrailwaysnavigator.search_settings.train_groups.overview": "%s 个筛选项已选择", + "gui.createrailwaysnavigator.search_settings.train_groups.description": "决定想使用的列车类别。", + "gui.createrailwaysnavigator.search_settings.train_groups.overview": "%s类别选择中", "gui.createrailwaysnavigator.search_settings.train_groups.overview.all": "全部", - "gui.createrailwaysnavigator.search_settings.train_groups.overview.none": "全部否", + "gui.createrailwaysnavigator.search_settings.train_groups.overview.none": "无", "gui.createrailwaysnavigator.search_settings.train_groups.tooltip.reset": "重置筛选项", "gui.createrailwaysnavigator.new_text_entry.add.tooltip": "添加", - "gui.createrailwaysnavigator.time": "时间: %s", - "gui.createrailwaysnavigator.time.now": "现在时间是:", - "gui.createrailwaysnavigator.time_format.dhm": "%s 日 %s 时. %s 分.", - "gui.createrailwaysnavigator.time_format.hm": "%s 时. %s 分.", - "gui.createrailwaysnavigator.time_format.m": "%s 分.", - + "gui.createrailwaysnavigator.time": "时间:%s", + "gui.createrailwaysnavigator.time.now": "现在", + "gui.createrailwaysnavigator.time_format.dhm": "%s天%s小时%s分钟", + "gui.createrailwaysnavigator.time_format.hm": "%s小时%s分钟", + "gui.createrailwaysnavigator.time_format.m": "%s分钟", + "gui.createrailwaysnavigator.platform": "站台", - "gui.createrailwaysnavigator.departure": "离开", - "gui.createrailwaysnavigator.destination": "终点站", - "gui.createrailwaysnavigator.line": "线路", - "gui.createrailwaysnavigator.following_trains": "下一趟列车:", + "gui.createrailwaysnavigator.departure": "出发", + "gui.createrailwaysnavigator.destination": "目的地", + "gui.createrailwaysnavigator.line": "路线", + "gui.createrailwaysnavigator.following_trains": "后续车次:", "gui.createrailwaysnavigator.via": "经停", - "gui.createrailwaysnavigator.advanced_display_settings.title": "高级展示设置", - "gui.createrailwaysnavigator.advanced_display_settings.display_type": "展示类型", - "gui.createrailwaysnavigator.advanced_display_settings.display_type.description": "选择展示的信息", + "gui.createrailwaysnavigator.advanced_display_settings.title": "高级显示设置", + "gui.createrailwaysnavigator.advanced_display_settings.display_type": "显示器类型", + "gui.createrailwaysnavigator.advanced_display_settings.display_type.description": "决定显示的信息。", "gui.createrailwaysnavigator.advanced_display_settings.info_type": "信息类型", - "gui.createrailwaysnavigator.advanced_display_settings.info_type.description": "展示信息的详细程度", + "gui.createrailwaysnavigator.advanced_display_settings.info_type.description": "决定信息的详细程度。", "gui.createrailwaysnavigator.advanced_display_settings.double_sided": "双面显示", - "enum.createrailwaysnavigator.display_info_type": "展示类型", - "enum.createrailwaysnavigator.display_info_type.description": "展示信息的详细程度", + "enum.createrailwaysnavigator.display_info_type": "信息类型", + "enum.createrailwaysnavigator.display_info_type.description": "决定显示器上应显示多少信息。", "enum.createrailwaysnavigator.display_info_type.simple": "简洁", - "enum.createrailwaysnavigator.display_info_type.info.simple": "只展示最重要的部分", + "enum.createrailwaysnavigator.display_info_type.info.simple": "只展示最重要的部分,不显示其它细节。", "enum.createrailwaysnavigator.display_info_type.detailed": "详细", - "enum.createrailwaysnavigator.display_info_type.info.detailed": "将展示更多细节,例如火车速度", + "enum.createrailwaysnavigator.display_info_type.info.detailed": "将展示更多细节,例如列车速度、经停站等。", "enum.createrailwaysnavigator.display_info_type.informative": "全部展示", - "enum.createrailwaysnavigator.display_info_type.info.informative": "展示全部信息,不建议在小型展示牌上使用", - - "enum.createrailwaysnavigator.display_type": "展示类型", - "enum.createrailwaysnavigator.display_type.description": "选择展示的信息", + "enum.createrailwaysnavigator.display_info_type.info.informative": "以花哨的布局显示所有信息。不建议在小型显示器上使用,因为文字可能会变得非常小。", + "enum.createrailwaysnavigator.display_type": "显示器类型", + "enum.createrailwaysnavigator.display_type.description": "决定显示器的类型,由其用途决定。", "enum.createrailwaysnavigator.display_type.train_destination": "列车终点站", - "enum.createrailwaysnavigator.display_type.info.train_destination": "在列车外显示列车的详细信息,如终点站,经停站等", + "enum.createrailwaysnavigator.display_type.info.train_destination": "适用于列车外部,显示有关列车本身的信息,例如名称、终点站和(如果选择)经停站以及其他信息。", "enum.createrailwaysnavigator.display_type.passenger_information": "乘客信息", - "enum.createrailwaysnavigator.display_type.info.passenger_information": "在列车内部使用,展示路程信息", - "enum.createrailwaysnavigator.display_type.platform": "站台信息", - "enum.createrailwaysnavigator.display_type.info.platform": "在车站使用,可显示下一趟列车。无法在列车内部使用", + "enum.createrailwaysnavigator.display_type.info.passenger_information": "代表适用于列车内部的显示器。这种显示器将显示下一站、开门方向以及(如果选择)列车速度和路线概览。", + "enum.createrailwaysnavigator.display_type.platform": "站台显示", + "enum.createrailwaysnavigator.display_type.info.platform": "这种显示应在车站站台上使用,显示后续车次以及(如果选择)其他详细信息。不能在列车上使用!", "enum.createrailwaysnavigator.side": "显示方向", - "enum.createrailwaysnavigator.side.description": "显示信息的面", + "enum.createrailwaysnavigator.side.description": "决定信息应呈现在方块的哪一面。", "enum.createrailwaysnavigator.side.front": "正面", - "enum.createrailwaysnavigator.side.info.front": "(默认)只会在正面显示信息", - "enum.createrailwaysnavigator.side.both": "正反两面", - "enum.createrailwaysnavigator.side.info.both": "信息在两面都会显示", - + "enum.createrailwaysnavigator.side.info.front": "信息将仅在正面显示(默认行为)。", + "enum.createrailwaysnavigator.side.both": "双面", + "enum.createrailwaysnavigator.side.info.both": "信息将在双面显示。", + "enum.createrailwaysnavigator.time_display": "时间显示", - "enum.createrailwaysnavigator.time_display.description": "改变时间展示的方式", + "enum.createrailwaysnavigator.time_display.description": "决定时间的显示方式。", "enum.createrailwaysnavigator.time_display.abs": "ABS", - "enum.createrailwaysnavigator.time_display.info.abs": "ABS (绝对时间)", + "enum.createrailwaysnavigator.time_display.info.abs": "ABS(绝对时间、absolute)", "enum.createrailwaysnavigator.time_display.eta": "ETA", - "enum.createrailwaysnavigator.time_display.info.eta": "ETA (预计到达时间)", + "enum.createrailwaysnavigator.time_display.info.eta": "ETA(预计到达时间、estimated time of arrival)", "create.display_source.advanced_display": "高级显示", - "gui.createrailwaysnavigator.display_source.advanced_display.train_name_width": "列车名宽度", - "gui.createrailwaysnavigator.display_source.advanced_display.train_name_width.description": "以像素为单位 (默认: 16)", - "gui.createrailwaysnavigator.display_source.advanced_display.platform_width": "站台名宽度", - "gui.createrailwaysnavigator.display_source.advanced_display.platform_width.description": "以像素为单位 (默认: Auto)", + "gui.createrailwaysnavigator.display_source.advanced_display.train_name_width": "列车名称列宽", + "gui.createrailwaysnavigator.display_source.advanced_display.train_name_width.description": "以像素为单位。(默认:16)", + "gui.createrailwaysnavigator.display_source.advanced_display.platform_width": "站台列宽", + "gui.createrailwaysnavigator.display_source.advanced_display.platform_width.description": "以方块像素为单位。(默认:自动)", "createrailwaysnavigator.moin": "moin" } diff --git a/common/src/main/resources/createrailwaysnavigator-common.mixins.json b/common/src/main/resources/createrailwaysnavigator.mixins.json similarity index 100% rename from common/src/main/resources/createrailwaysnavigator-common.mixins.json rename to common/src/main/resources/createrailwaysnavigator.mixins.json diff --git a/fabric/build.gradle b/fabric/build.gradle index 8da14722..a4382f73 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,5 +1,5 @@ plugins { - id "com.github.johnrengelman.shadow" version "7.1.2" + id 'com.github.johnrengelman.shadow' } architectury { @@ -7,71 +7,52 @@ architectury { fabric() } -loom { - accessWidenerPath = project(":common").loom.accessWidenerPath -} - configurations { - common - shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files. + common { + canBeResolved = true + canBeConsumed = false + } compileClasspath.extendsFrom common runtimeClasspath.extendsFrom common developmentFabric.extendsFrom common + + shadowBundle { + canBeResolved = true + canBeConsumed = false + } } dependencies { - modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" - modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" - + modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version" + + // Fabric API. This is technically optional, but you probably want it anyway. + modImplementation "net.fabricmc.fabric-api:fabric-api:$rootProject.fabric_api_version" + + modImplementation("dev.architectury:architectury-fabric:${rootProject.architectury_api_version}") + modImplementation("com.electronwill.night-config:toml:3.6.0") + modImplementation("com.terraformersmc:modmenu:${rootProject.modmenu_version}") + modImplementation("net.minecraftforge:forgeconfigapiport-fabric:${rootProject.forge_config_api_port_version}") modImplementation(include("de.mrjulsen.mcdragonlib:dragonlib-fabric:${rootProject.minecraft_version}-${rootProject.dragonlib_version}")) - modImplementation("com.simibubi.create:create-fabric-${rootProject.minecraft_version}:${rootProject.create_fabric_version}") + +modImplementation("com.simibubi.create:create-fabric-${rootProject.minecraft_version}:${rootProject.create_fabric_version}") - common(project(path: ":common", configuration: "namedElements")) { transitive false } - shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } + common(project(path: ':common', configuration: 'namedElements')) { transitive false } + shadowBundle project(path: ':common', configuration: 'transformProductionFabric') } processResources { - inputs.property "version", project.version + inputs.property 'version', project.version - filesMatching("fabric.mod.json") { - expand "version": project.version + filesMatching('fabric.mod.json') { + expand version: project.version } } shadowJar { - exclude "architectury.common.json" - - configurations = [project.configurations.shadowCommon] - archiveClassifier = "dev-shadow" + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' } remapJar { - injectAccessWidener = true input.set shadowJar.archiveFile - dependsOn shadowJar -} - -sourcesJar { - def commonSources = project(":common").sourcesJar - dependsOn commonSources - from commonSources.archiveFile.map { zipTree(it) } -} - -components.java { - withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { - skip() - } -} - -publishing { - publications { - mavenFabric(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name - from components.java - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - } } diff --git a/fabric/src/main/java/de/mrjulsen/crn/fabric/CRNPlatformSpecificClientImpl.java b/fabric/src/main/java/de/mrjulsen/crn/fabric/CRNPlatformSpecificClientImpl.java new file mode 100644 index 00000000..d95fbe6f --- /dev/null +++ b/fabric/src/main/java/de/mrjulsen/crn/fabric/CRNPlatformSpecificClientImpl.java @@ -0,0 +1,19 @@ +package de.mrjulsen.crn.fabric; + +import java.util.function.Supplier; + +import com.simibubi.create.CreateClient; +import com.simibubi.create.foundation.block.connected.CTModel; +import com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour; +import com.simibubi.create.foundation.utility.RegisteredObjects; + +import net.minecraft.world.level.block.Block; + +public class CRNPlatformSpecificClientImpl { + + public static void registerCTBehviour(Block entry, Supplier behaviorSupplier) { + ConnectedTextureBehaviour behavior = behaviorSupplier.get(); + CreateClient.MODEL_SWAPPER.getCustomBlockModels() + .register(RegisteredObjects.getKeyOrThrow(entry), model -> new CTModel(model, behavior)); + } +} diff --git a/fabric/src/main/java/de/mrjulsen/crn/fabric/CRNPlatformSpecificImpl.java b/fabric/src/main/java/de/mrjulsen/crn/fabric/CRNPlatformSpecificImpl.java index 71e39255..3d4e8081 100644 --- a/fabric/src/main/java/de/mrjulsen/crn/fabric/CRNPlatformSpecificImpl.java +++ b/fabric/src/main/java/de/mrjulsen/crn/fabric/CRNPlatformSpecificImpl.java @@ -2,11 +2,15 @@ import net.fabricmc.loader.api.FabricLoader; import net.minecraft.server.MinecraftServer; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.api.ModLoadingContext; import net.minecraftforge.fml.config.ModConfig; import java.nio.file.Path; +import com.simibubi.create.content.trains.station.GlobalStation; +import com.simibubi.create.content.trains.station.StationBlockEntity; + import de.mrjulsen.crn.CRNPlatformSpecific; import de.mrjulsen.crn.CreateRailwaysNavigator; import de.mrjulsen.crn.config.ModClientConfig; @@ -33,4 +37,11 @@ public static void registerConfig() { } ModLoadingContext.registerConfig(CreateRailwaysNavigator.MOD_ID, ModConfig.Type.COMMON, ModCommonConfig.SPEC, CreateRailwaysNavigator.MOD_ID + "-common.toml"); } + + public static GlobalStation getStationFromBlockEntity(BlockEntity be) { + if (!(be instanceof StationBlockEntity stationBe)) + return null; + + return stationBe.getStation(); + } } diff --git a/fabric/src/main/resources/createrailwaysnavigator.mixins.json b/fabric/src/main/resources/createrailwaysnavigator.mixins.json deleted file mode 100644 index 69e234c5..00000000 --- a/fabric/src/main/resources/createrailwaysnavigator.mixins.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "required": true, - "package": "de.mrjulsen.crn.mixin.fabric", - "compatibilityLevel": "JAVA_17", - "minVersion": "0.8", - "client": [ - ], - "mixins": [ - ], - "injectors": { - "defaultRequire": 1 - } -} \ No newline at end of file diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 207a7e64..24a00cc7 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -21,14 +21,14 @@ ] }, "mixins": [ - "createrailwaysnavigator.mixins.json", - "createrailwaysnavigator-common.mixins.json" + "createrailwaysnavigator.mixins.json" ], "depends": { "fabric": "*", "minecraft": ">=1.19.2", "architectury": ">=6.5.85", - "dragonlib": ">=1.19.2-2.1.8", + "dragonlib": ">=1.19.2-2.1.12", "create": "*" - } + }, + "accessWidener": "createrailwaysnavigator.accesswidener" } \ No newline at end of file diff --git a/forge/build.gradle b/forge/build.gradle index 0a2838d2..7fdb673d 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,5 +1,5 @@ plugins { - id "com.github.johnrengelman.shadow" version "7.1.2" + id 'com.github.johnrengelman.shadow' } architectury { @@ -14,51 +14,58 @@ loom { convertAccessWideners = true extraAccessWideners.add loom.accessWidenerPath.get().asFile.name - mixinConfig "createrailwaysnavigator-common.mixins.json" mixinConfig "createrailwaysnavigator.mixins.json" } } configurations { - common - shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files. + common { + canBeResolved = true + canBeConsumed = false + } compileClasspath.extendsFrom common runtimeClasspath.extendsFrom common developmentForge.extendsFrom common + + shadowBundle { + canBeResolved = true + canBeConsumed = false + } } dependencies { - forge "net.minecraftforge:forge:${rootProject.forge_version}" - - modImplementation(include("de.mrjulsen.mcdragonlib:dragonlib-forge:${rootProject.minecraft_version}-${rootProject.dragonlib_version}")) + forge "net.minecraftforge:forge:$rootProject.forge_version" + modCompileOnly("dev.architectury:architectury-forge:${rootProject.architectury_api_version}") + modImplementation(include("de.mrjulsen.mcdragonlib:dragonlib-forge:${rootProject.minecraft_version}-${rootProject.dragonlib_version}")) + modImplementation("net.minecraftforge:forgeconfigapiport-fabric:${rootProject.forge_config_api_port_version}") + modImplementation("com.electronwill.night-config:toml:3.6.0") + modImplementation("com.simibubi.create:create-${rootProject.minecraft_version}:${rootProject.create_forge_version}:slim") { transitive = false } modImplementation("com.tterrag.registrate:Registrate:${rootProject.registrate_forge_version}") modImplementation("com.jozufozu.flywheel:flywheel-forge-${rootProject.minecraft_version}:${rootProject.flywheel_forge_version}") - common(project(path: ":common", configuration: "namedElements")) { transitive false } - shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } + common(project(path: ':common', configuration: 'namedElements')) { transitive false } + shadowBundle project(path: ':common', configuration: 'transformProductionForge') } processResources { - inputs.property "version", project.version + inputs.property 'version', project.version - filesMatching("META-INF/mods.toml") { - expand "version": project.version + filesMatching('META-INF/mods.toml') { + expand version: project.version } } shadowJar { exclude "fabric.mod.json" exclude "architectury.common.json" - - configurations = [project.configurations.shadowCommon] - archiveClassifier = "dev-shadow" + configurations = [project.configurations.shadowBundle] + archiveClassifier = 'dev-shadow' } remapJar { input.set shadowJar.archiveFile - dependsOn shadowJar } sourcesJar { @@ -71,18 +78,4 @@ components.java { withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { skip() } -} - -publishing { - publications { - mavenForge(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name - from components.java - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - } -} +} \ No newline at end of file diff --git a/forge/src/main/java/de/mrjulsen/crn/forge/CRNPlatformSpecificClientImpl.java b/forge/src/main/java/de/mrjulsen/crn/forge/CRNPlatformSpecificClientImpl.java new file mode 100644 index 00000000..620bf805 --- /dev/null +++ b/forge/src/main/java/de/mrjulsen/crn/forge/CRNPlatformSpecificClientImpl.java @@ -0,0 +1,22 @@ +package de.mrjulsen.crn.forge; + +import java.util.function.Supplier; + +import com.simibubi.create.CreateClient; +import com.simibubi.create.foundation.block.connected.CTModel; +import com.simibubi.create.foundation.block.connected.ConnectedTextureBehaviour; +import com.simibubi.create.foundation.utility.RegisteredObjects; + +import de.mrjulsen.crn.CreateRailwaysNavigator; +import net.minecraft.world.level.block.Block; +import net.minecraftforge.fml.common.Mod; + +@Mod(CreateRailwaysNavigator.MOD_ID) +public class CRNPlatformSpecificClientImpl { + + public static void registerCTBehviour(Block entry, Supplier behaviorSupplier) { + ConnectedTextureBehaviour behavior = behaviorSupplier.get(); + CreateClient.MODEL_SWAPPER.getCustomBlockModels() + .register(RegisteredObjects.getKeyOrThrow(entry), model -> new CTModel(model, behavior)); + } +} diff --git a/forge/src/main/java/de/mrjulsen/crn/forge/CRNPlatformSpecificImpl.java b/forge/src/main/java/de/mrjulsen/crn/forge/CRNPlatformSpecificImpl.java index 694d9f16..615bd5ea 100644 --- a/forge/src/main/java/de/mrjulsen/crn/forge/CRNPlatformSpecificImpl.java +++ b/forge/src/main/java/de/mrjulsen/crn/forge/CRNPlatformSpecificImpl.java @@ -1,6 +1,7 @@ package de.mrjulsen.crn.forge; import net.minecraft.server.MinecraftServer; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.loading.FMLPaths; @@ -8,6 +9,9 @@ import java.nio.file.Path; +import com.simibubi.create.content.trains.station.GlobalStation; +import com.simibubi.create.content.trains.station.StationBlockEntity; + import de.mrjulsen.crn.CRNPlatformSpecific; import de.mrjulsen.crn.CreateRailwaysNavigator; import de.mrjulsen.crn.config.ModClientConfig; @@ -33,4 +37,11 @@ public static void registerConfig() { } ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ModCommonConfig.SPEC, CreateRailwaysNavigator.MOD_ID + "-common.toml"); } + + public static GlobalStation getStationFromBlockEntity(BlockEntity be) { + if (!(be instanceof StationBlockEntity stationBe)) + return null; + + return stationBe.getStation(); + } } diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 6beb93e6..ea76800f 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -40,7 +40,7 @@ side = "BOTH" [[dependencies.createrailwaysnavigator]] modId = "dragonlib" mandatory = true -versionRange = "[1.19.2-2.1.8,)" +versionRange = "[1.19.2-2.1.12,)" ordering = "AFTER" side = "BOTH" diff --git a/forge/src/main/resources/createrailwaysnavigator.mixins.json b/forge/src/main/resources/createrailwaysnavigator.mixins.json deleted file mode 100644 index fe17a130..00000000 --- a/forge/src/main/resources/createrailwaysnavigator.mixins.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "required": true, - "package": "de.mrjulsen.crn.mixin.forge", - "compatibilityLevel": "JAVA_17", - "minVersion": "0.8", - "client": [ - ], - "mixins": [ - ], - "injectors": { - "defaultRequire": 1 - } -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index bf91f489..0a45adb9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,20 +1,28 @@ +# Done to increase the memory available to Gradle. org.gradle.jvmargs=-Xmx6G +org.gradle.parallel=true -minecraft_version=1.19.2 -enabled_platforms=fabric,forge +# Mod properties +mod_version = 0.5.4 +release_channel = beta +maven_group = de.mrjulsen.crn +archives_name = createrailwaysnavigator +enabled_platforms = fabric,forge -archives_base_name=createrailwaysnavigator -mod_version=0.5.3-beta-1.19.2 -maven_group=de.mrjulsen.crn +# Minecraft properties +minecraft_version = 1.19.2 +parchment_version = 2022.11.27 -dragonlib_version=2.1.8 +# Dependencies +architectury_api_version = 6.5.85 +fabric_loader_version = 0.15.11 +fabric_api_version = 0.77.0+1.19.2 +forge_version = 1.19.2-43.3.13 + +dragonlib_version = 2.1.12 +modmenu_version=4.1.2 +forge_config_api_port_version=4.2.11 create_fabric_version = 0.5.1-f-build.1416+mc1.19.2 create_forge_version = 0.5.1.f-46 registrate_forge_version = MC1.19-1.1.5 -flywheel_forge_version = 0.6.10-20 - -fabric_loader_version=0.14.23 -fabric_api_version=0.76.1+1.19.2 -forge_version=1.19.2-43.3.0 - -parchment_version=2022.11.27 \ No newline at end of file +flywheel_forge_version = 0.6.10-20 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba77..d64cd491 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 744c64d1..b82aa23a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d42..1aa94a42 100644 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \