diff --git a/.gitignore b/.gitignore index ccb0c562..7c768345 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ run/ out/ *.iml .gradle/ +.vscode/ output/ bin/ libs/ @@ -14,6 +15,5 @@ libs/ .idea/ classes/ .metadata -.vscode .settings *.launch \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 5aa26aef..a1deeb97 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "java.compile.nullAnalysis.mode": "disabled", "commentTranslate.hover.enabled": false, + "java.compile.nullAnalysis.mode": "disabled", "java.configuration.updateBuildConfiguration": "automatic" } \ No newline at end of file diff --git a/README.md b/README.md index 3b8a49f1..a1634164 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Create Railways Navigator (Minecraft Create Mod Addon) +# 🚅 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 8d45b82b..53b575f7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,70 +1,82 @@ plugins { - id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.3-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}" - mappings loom.layered() { - officialMojangMappings() - parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchmentmc_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.tterrag.com/" } // Flywheel + 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://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://maven.tterrag.com/" } // Flywheel + maven { url = "https://cursemaven.com" content { includeGroup "curse.maven" } } - maven { url "https://maven.parchmentmc.org/"} } - tasks.withType(JavaCompile) { - options.encoding = "UTF-8" - options.release = 17 + 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 + } + + 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 83568dac..41024776 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,40 +1,18 @@ architectury { - common(rootProject.enabled_platforms.split(",")) + common rootProject.enabled_platforms.split(',') } loom { accessWidenerPath = file("src/main/resources/createrailwaysnavigator.accesswidener") } -repositories { - 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 -} - dependencies { - modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" - modApi(include("de.mrjulsen.mcdragonlib:dragonlib-fabric:${rootProject.minecraft_version}-${rootProject.dragonlib_version}")) - - modCompileOnly("com.simibubi.create:create-fabric-${rootProject.minecraft_version}:${rootProject.create_fabric_version}") -} - -publishing { - publications { - mavenCommon(MavenPublication) { - artifactId = rootProject.archives_base_name - from components.java - } - } + modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version" + + modCompileOnly("dev.architectury:architectury:${rootProject.architectury_api_version}") + modCompileOnly("com.electronwill.night-config:toml:3.6.0") + modCompileOnly("net.minecraftforge:forgeconfigapiport-fabric:${rootProject.forge_config_api_port_version}") + modImplementation("de.mrjulsen.mcdragonlib:dragonlib-fabric:${rootProject.minecraft_version}-${rootProject.dragonlib_version}") - repositories { - } -} + modImplementation("com.simibubi.create:create-fabric-${rootProject.minecraft_version}:${rootProject.create_fabric_version}") +} \ 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..8628b33d 100644 --- a/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecific.java +++ b/common/src/main/java/de/mrjulsen/crn/CRNPlatformSpecific.java @@ -35,4 +35,6 @@ public static MinecraftServer getServer() { public static void registerConfig() { 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/block/be/AdvancedDisplayBlockEntity.java b/common/src/main/java/de/mrjulsen/crn/block/be/AdvancedDisplayBlockEntity.java index b16dee28..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 @@ -616,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/client/ClientWrapper.java b/common/src/main/java/de/mrjulsen/crn/client/ClientWrapper.java index 4b01ea3e..ff94d66d 100644 --- a/common/src/main/java/de/mrjulsen/crn/client/ClientWrapper.java +++ b/common/src/main/java/de/mrjulsen/crn/client/ClientWrapper.java @@ -16,6 +16,7 @@ import de.mrjulsen.crn.data.GlobalSettingsManager; import de.mrjulsen.crn.network.packets.stc.ServerErrorPacket; import de.mrjulsen.mcdragonlib.client.gui.DLScreen; +import de.mrjulsen.mcdragonlib.util.TextUtils; import dev.architectury.networking.NetworkManager.PacketContext; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.toasts.SystemToast; @@ -23,7 +24,6 @@ import net.minecraft.client.resources.language.ClientLanguage; import net.minecraft.client.resources.language.LanguageInfo; import net.minecraft.locale.Language; -import net.minecraft.network.chat.TextComponent; import net.minecraft.world.level.Level; public class ClientWrapper { @@ -45,7 +45,7 @@ public static void showRouteOverlaySettingsGui(RouteDetailsOverlayScreen overlay } public static void handleErrorMessagePacket(ServerErrorPacket packet, Supplier ctx) { - Minecraft.getInstance().getToasts().addToast(new SystemToast(SystemToastIds.PERIODIC_NOTIFICATION, Constants.TEXT_SERVER_ERROR, new TextComponent(packet.message))); + Minecraft.getInstance().getToasts().addToast(new SystemToast(SystemToastIds.PERIODIC_NOTIFICATION, Constants.TEXT_SERVER_ERROR, TextUtils.text(packet.message))); } public static void showAdvancedDisplaySettingsScreen(AdvancedDisplayBlockEntity blockEntity) { @@ -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 af7e8ebc..f4d18b22 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 @@ -194,6 +194,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..53a380d9 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 @@ -407,11 +407,13 @@ 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; + public boolean mouseScrolled(double pMouseX, double pMouseY, double pDelta) { + + if (transferTimeInput.isHoveredOrFocused()) { + boolean b = transferTimeInput.mouseScrolled(pMouseX, pMouseY, pDelta); + if (b) { + return b; + } } float chaseTarget = scroll.getChaseTarget(); @@ -425,7 +427,6 @@ public boolean mouseScrolled(double pMouseX, double pMouseY, double pDelta) { scroll.chase(0, 0.7f, Chaser.EXP); } - return true; - + 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 b9643fd3..952896b8 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 c54605b8..a9fd0c27 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 ba0d40ac..cb2885d7 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 @@ -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; @@ -54,7 +56,7 @@ public static MutableComponent translate(String key, Object... args) { if (Platform.getEnv() == EnvType.CLIENT) { ModTranslatableComponent comp = 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/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/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 67863973..376237a1 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,85 +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 -} -repositories { - 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 + 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}" - modApi(include("de.mrjulsen.mcdragonlib:dragonlib-fabric:${rootProject.minecraft_version}-${rootProject.dragonlib_version}")) + modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version" - // Create - dependencies are added transitively + // 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}") - 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 - } - } - - 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/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 61de8238..5cd8755d 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.18.2", "architectury": ">=4.11.93", - "dragonlib": ">=1.18.2-2.1.8", + "dragonlib": ">=1.18.2-2.1.13", "create": "*" - } + }, + "accessWidener": "createrailwaysnavigator.accesswidener" } \ No newline at end of file diff --git a/forge/build.gradle b/forge/build.gradle index 3083a40c..31926da9 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,60 +14,56 @@ 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 -} -repositories { - maven { // Create Forge and Registrate Forge - url = "https://maven.tterrag.com/" - content { - includeGroup("com.tterrag.registrate") - includeGroup("com.simibubi.create") - } + shadowBundle { + canBeResolved = true + canBeConsumed = false } } dependencies { - forge "net.minecraftforge:forge:${rootProject.forge_version}" - modApi(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("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 { @@ -80,16 +76,4 @@ components.java { withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { skip() } -} - -publishing { - publications { - mavenForge(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name - from components.java - } - } - - repositories { - } -} +} \ 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/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index e4d3c095..40c7149e 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.18.2-2.1.8,)" +versionRange = "[1.18.2-2.1.13,)" 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 881ac97d..7f71e781 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,23 +1,28 @@ +# Done to increase the memory available to Gradle. org.gradle.jvmargs=-Xmx6G +org.gradle.parallel=true -minecraft_version=1.18.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.18.2 -maven_group=de.mrjulsen.crn +# Minecraft properties +minecraft_version = 1.18.2 +parchment_version = 2022.11.06 -parchmentmc_version=2022.11.06 -architectury_version=4.11.93 -dragonlib_version=2.1.8 +# Dependencies +architectury_api_version = 4.12.94 +fabric_loader_version = 0.15.11 +fabric_api_version = 0.77.0+1.18.2 +forge_version = 1.18.2-40.2.21 +dragonlib_version = 2.1.13 +modmenu_version=3.2.5 +forge_config_api_port_version=3.2.4 create_fabric_version = 0.5.1-f-build.1333+mc1.18.2 create_forge_version = 0.5.1.e-318 registrate_forge_version = MC1.18.2-1.1.3 flywheel_forge_version = 0.6.10-105 - -fabric_loader_version=0.14.23 -fabric_api_version=0.76.0+1.18.2 - -forge_version=1.18.2-40.2.10 - 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" \ diff --git a/settings.gradle b/settings.gradle index 34e3be87..217616d4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,7 +3,6 @@ pluginManagement { maven { url "https://maven.fabricmc.net/" } maven { url "https://maven.architectury.dev/" } maven { url "https://maven.minecraftforge.net/" } - maven { url "https://maven.parchmentmc.org/"} gradlePluginPortal() } }