diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..a15ff07 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,23 @@ +--- +name: Bug report +about: Issues +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**Logs** +Please give logs in English. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + + + + +**Additional context** +Add any other context about the problem here. diff --git a/README.md b/README.md index 84995f5..4a52429 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,13 @@ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Discord](https://img.shields.io/discord/613163671870242838.svg?color=%237289da&label=discord)](https://discord.gg/geysermc) -[![Crowdin](https://badges.crowdin.net/geyser/localized.svg)](https://translate.geysermc.org/) Hydraulic is a companion to Geyser which allows for Bedrock players to join modded Minecraft: Java Edition servers. Hydraulic is an open collaboration project by [CubeCraft Games](https://cubecraft.net). ## What is Hydraulic? -Hydraulic is a server-side mod, which allows for Bedrock players to join modded Minecraft: Java Edition servers. This project works alongside [Geyser](https://github.com/GeyserMC/Geyser) to make this possible. +Hydraulic is a server-side mod, which allows for Bedrock players to join modded Minecraft: Java Edition servers. This project works alongside [Geyser](https://github.com/GeyserMC/Geyser) to make this possible. ### This project is still in very early development and should not be used on production setups! You can get [Hydraulic](https://geysermc.org/download?project=other-projects&hydraulic=expanded) from the GeyserMC website. @@ -22,11 +21,11 @@ you're interested in helping out with Hydraulic. 2. Navigate to the Hydraulic root directory and run `git submodule update --init --recursive`. This command downloads all the needed submodules for Hydraulic and is a crucial step in this process. 3. If your default JVM/JDK is not Java 25, please set your IDE to use a valid Java 25 JVM. Otherwise, you will run into an error while building Hydraulic. 4. The project should import into your IDE after the loom setup is complete. For more detailed information, see the [Fabric setup](https://docs.fabricmc.net/develop/getting-started/setting-up). -5. Use `./gradlew build` to compile a jar file, or use `./gradlew :fabric:runServer` or `./gradlew :neoforge:runServer` to run a server with Hydraulic installed. Make sure you have Geyser in your `mods` folder along with Hydraulic! +5. Use `./gradlew build` to compile a jar file, or use `./gradlew :fabric:runServer` to run a server with Hydraulic installed. Make sure you have Geyser in your `mods` folder along with Hydraulic! ## Links: - Website: https://geysermc.org - Docs: https://wiki.geysermc.org/geyser/ - Download: https://geysermc.org/download - Discord: https://discord.gg/geysermc -- Donate: https://opencollective.com/geysermc \ No newline at end of file +- Donate: https://opencollective.com/geysermc diff --git a/fabric/src/main/java/org/geysermc/hydraulic/fabric/FabricUtil.java b/fabric/src/main/java/org/geysermc/hydraulic/fabric/FabricUtil.java index 6be1a58..c81dd4e 100644 --- a/fabric/src/main/java/org/geysermc/hydraulic/fabric/FabricUtil.java +++ b/fabric/src/main/java/org/geysermc/hydraulic/fabric/FabricUtil.java @@ -1,6 +1,8 @@ package org.geysermc.hydraulic.fabric; import com.google.common.collect.ImmutableList; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -54,7 +56,8 @@ public static void resolveJiJ(Collection roots, Consumer output) final JsonObject fmj; try (Reader reader = Files.newBufferedReader(fmjPath)) { - fmj = GsonHelper.parse(reader); + Gson lenientGson = new GsonBuilder().setLenient().create(); + fmj = lenientGson.fromJson(reader, JsonObject.class); } catch (IOException ignored) { return; } diff --git a/shared/src/main/java/org/geysermc/hydraulic/pack/PackManager.java b/shared/src/main/java/org/geysermc/hydraulic/pack/PackManager.java index 9e9ebcd..9fa12ef 100644 --- a/shared/src/main/java/org/geysermc/hydraulic/pack/PackManager.java +++ b/shared/src/main/java/org/geysermc/hydraulic/pack/PackManager.java @@ -92,13 +92,25 @@ public void initialize() { final Collection mods = this.hydraulic.mods(); final Map> modPacks = Maps.newHashMapWithExpectedSize(mods.size()); for (final ModInfo mod : mods) { - modPacks.put( - mod.id(), - mod.roots() - .stream() - .map(path -> MinecraftResourcePackReader.minecraft().read(NioDirectoryFileTreeReader.read(path))) - .toList() - ); + try { + modPacks.put( + mod.id(), + mod.roots() + .stream() + .map(path -> { + try { + return MinecraftResourcePackReader.minecraft().read(NioDirectoryFileTreeReader.read(path)); + } catch (Exception e) { + LOGGER.error("Failed to read resource pack from mod {} at path {}: {}", mod.id(), path, e.getMessage()); + return null; + } + }) + .filter(pack -> pack != null) + .toList() + ); + } catch (Exception e) { + LOGGER.error("Failed to process mod {}: {}", mod.id(), e.getMessage(), e); + } } try { diff --git a/shared/src/main/java/org/geysermc/hydraulic/pack/modules/MetadataPackModule.java b/shared/src/main/java/org/geysermc/hydraulic/pack/modules/MetadataPackModule.java index 8ffaa42..7383c6e 100644 --- a/shared/src/main/java/org/geysermc/hydraulic/pack/modules/MetadataPackModule.java +++ b/shared/src/main/java/org/geysermc/hydraulic/pack/modules/MetadataPackModule.java @@ -39,7 +39,7 @@ public Collection extract(ResourcePack pack, ExtractionContext context) @Override public @Nullable Manifest convert(ModInfo mod, ConversionContext context) throws Exception { Manifest manifest = PackManifestConverter.INSTANCE.convert( - PackMeta.of(PackFormat.format(FormatVersion.of(0)), Component.text(mod.name().trim() + " " + mod.version() + " - Generated by " + Constants.MOD_NAME)), + PackMeta.of(PackFormat.format(FormatVersion.of(101)), Component.text(mod.name().trim() + " " + mod.version() + " - Generated by " + Constants.MOD_NAME)), new ConversionContext(mod.name().trim() + " Resource Pack", context.logListener()) );