From 5b582701f2bceb17f51da9f11b7aba10b20f1722 Mon Sep 17 00:00:00 2001 From: Yancey <1709185482@qq.com> Date: Thu, 26 Sep 2024 02:00:24 +0800 Subject: [PATCH] support more minecraft versions --- build.gradle.kts | 96 +++++++++++++++ copy.py | 50 ++++++++ gradle.properties | 19 +-- root.gradle.kts | 77 ++++++++++++ settings.gradle | 9 -- settings.gradle.kts | 58 +++++++++ .../nativecore/OpenParticleProject.java | 2 + .../openparticle/core/OpenParticle.java | 41 ++++--- .../core/client/GuiProgressBar.java | 112 ++++++++++++++++-- .../core/client/OpenParticleClient.java | 17 ++- .../client/core/OpenParticleClientCore.java | 61 +++++++--- .../openparticle/core/command/CommandPar.java | 2 +- .../core/core/OpenParticleServerCore.java | 21 +--- .../core/keys/KeyboardManager.java | 5 +- .../core/mixin/BufferBuilderAccessor.java | 16 ++- .../core/mixin/ParticleManagerMixin.java | 39 +++++- .../core/network/KeyboardPayloadC2S.java | 37 +++--- .../core/network/LoadAndRunPayloadS2C.java | 31 +++-- .../core/network/LoadPayloadS2C.java | 33 ++++-- .../core/network/RunPayloadC2S.java | 34 +++--- .../core/network/RunPayloadS2C.java | 34 +++--- .../core/network/RunTickPayloadS2C.java | 34 +++--- .../core/versions/IdentifierUtil.java | 15 +++ .../core/versions/PayloadBase.java | 22 ++++ .../core/versions/PayloadCodec.java | 21 ++++ .../openparticle/core/versions/PayloadId.java | 112 ++++++++++++++++++ .../openparticle/core/versions/TextUtil.java | 29 +++++ src/main/resources/fabric.mod.json | 4 +- src/main/resources/openparticle.mixins.json | 2 +- versions/1.16-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.16.1-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.16.2-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.16.3-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.16.4-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.16.5-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.17-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.17.1-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.18-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.18.1-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.18.2-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.19-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.19.1-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.19.2-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.19.3-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.19.4-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.20-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.20.1-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.20.2-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.20.3-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.20.4-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.20.5-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.20.6-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.21-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/1.21.1-fabric/gradle.properties | 1 + .../src/main/resources/fabric.mod.json | 30 +++++ versions/mainProject | 1 + versions/mapping-1.18.2-1.18.1.txt | 2 + 81 files changed, 1632 insertions(+), 179 deletions(-) create mode 100644 build.gradle.kts create mode 100644 copy.py create mode 100644 root.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts create mode 100644 src/main/java/yancey/openparticle/core/versions/IdentifierUtil.java create mode 100644 src/main/java/yancey/openparticle/core/versions/PayloadBase.java create mode 100644 src/main/java/yancey/openparticle/core/versions/PayloadCodec.java create mode 100644 src/main/java/yancey/openparticle/core/versions/PayloadId.java create mode 100644 src/main/java/yancey/openparticle/core/versions/TextUtil.java create mode 100644 versions/1.16-fabric/gradle.properties create mode 100644 versions/1.16-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.16.1-fabric/gradle.properties create mode 100644 versions/1.16.1-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.16.2-fabric/gradle.properties create mode 100644 versions/1.16.2-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.16.3-fabric/gradle.properties create mode 100644 versions/1.16.3-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.16.4-fabric/gradle.properties create mode 100644 versions/1.16.4-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.16.5-fabric/gradle.properties create mode 100644 versions/1.16.5-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.17-fabric/gradle.properties create mode 100644 versions/1.17-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.17.1-fabric/gradle.properties create mode 100644 versions/1.17.1-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.18-fabric/gradle.properties create mode 100644 versions/1.18-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.18.1-fabric/gradle.properties create mode 100644 versions/1.18.1-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.18.2-fabric/gradle.properties create mode 100644 versions/1.18.2-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.19-fabric/gradle.properties create mode 100644 versions/1.19-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.19.1-fabric/gradle.properties create mode 100644 versions/1.19.1-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.19.2-fabric/gradle.properties create mode 100644 versions/1.19.2-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.19.3-fabric/gradle.properties create mode 100644 versions/1.19.3-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.19.4-fabric/gradle.properties create mode 100644 versions/1.19.4-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.20-fabric/gradle.properties create mode 100644 versions/1.20-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.20.1-fabric/gradle.properties create mode 100644 versions/1.20.1-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.20.2-fabric/gradle.properties create mode 100644 versions/1.20.2-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.20.3-fabric/gradle.properties create mode 100644 versions/1.20.3-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.20.4-fabric/gradle.properties create mode 100644 versions/1.20.4-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.20.5-fabric/gradle.properties create mode 100644 versions/1.20.5-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.20.6-fabric/gradle.properties create mode 100644 versions/1.20.6-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.21-fabric/gradle.properties create mode 100644 versions/1.21-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/1.21.1-fabric/gradle.properties create mode 100644 versions/1.21.1-fabric/src/main/resources/fabric.mod.json create mode 100644 versions/mainProject create mode 100644 versions/mapping-1.18.2-1.18.1.txt diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..db81d2b --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,96 @@ +plugins { + // If you're using Kotlin, it needs to be applied before the multi-version plugin + // kotlin("jvm") + // Apply the multi-version plugin, this does all the configuration necessary for the preprocessor to + // work. In particular it also applies `com.replaymod.preprocess`. + // In addition it primarily also provides a `platform` extension which you can use in this build script + // to get the version and mod loader of the current project. + id("gg.essential.multi-version") + // If you do not care too much about the details, you can just apply essential-gradle-toolkits' defaults for + // Minecraft, fabric-loader, forge, mappings, etc. versions. + // You can also overwrite some of these if need be. See the `gg.essential.defaults.loom` README section. + // Otherwise you'll need to configure those as usual for (architectury) loom. + id("gg.essential.defaults") +} + +val mcVersion = platform.mcVersion + +version = "${project.name}-${rootProject.version}" +base.archivesName.set("openparticle") +java.withSourcesJar() + +val fabricApiVersion = when (mcVersion) { + 11600, 11601, 11602, 11603, 11604, 11605 -> "0.42.0+1.16" + 11700, 11701 -> "0.46.1+1.17" + 11800, 11801 -> "0.44.0+1.18" + 11802 -> "0.77.0+1.18.2" + 11900 -> "0.58.0+1.19" + 11901 -> "0.58.5+1.19.1" + 11902 -> "0.77.0+1.19.2" + 11903 -> "0.76.1+1.19.3" + 11904 -> "0.87.2+1.19.4" + 12000 -> "0.83.0+1.20" + 12001 -> "0.92.2+1.20.1" + 12002 -> "0.91.6+1.20.2" + 12003 -> "0.91.1+1.20.3" + 12004 -> "0.97.1+1.20.4" + 12005 -> "0.97.8+1.20.5" + 12006 -> "0.100.8+1.20.6" + 12100 -> "0.102.0+1.21" + 12101 -> "0.105.0+1.21.1" + else -> throw UnsupportedOperationException() +} + +dependencies { + // If you are depending on a multi-version library following the same scheme as the Essential libraries (that is + // e.g. `elementa-1.8.9-forge`), you can `toString` `platform` directly to get the respective artifact id. + // modImplementation("gg.essential:elementa-$platform:428") + if (platform.isFabric) { + val fabricApiModules = mutableListOf( + "fabric-api-base", + "fabric-networking-v0", + "fabric-command-api-v1", + "fabric-renderer-registries-v1", + "fabric-lifecycle-events-v1", + "fabric-keybindings-v0", + ) + if (mcVersion >= 11604) { + fabricApiModules.remove("fabric-networking-v0") + fabricApiModules.add("fabric-networking-api-v1") + } + if (mcVersion >= 19000) { + fabricApiModules.remove("fabric-command-api-v1") + fabricApiModules.add("fabric-command-api-v2") + } + if (mcVersion >= 11802) { + fabricApiModules.remove("fabric-renderer-registries-v1") + fabricApiModules.add("fabric-rendering-v1") + } + + for (module in fabricApiModules) { + val dep = fabricApi.module(module, fabricApiVersion) + modImplementation(dep) + "include"(dep) + } + } +} + +loom { + // If you need to use a tweaker on legacy (1.12.2 and below) forge: + // if (platform.isLegacyForge) { + // launchConfigs.named("client") { + // arg("--tweakClass", "gg.essential.loader.stage0.EssentialSetupTweaker") + // // And maybe a core mod? + // // property("fml.coreMods.load", "com.example.asm.CoreMod") + // } + // } + // Mixin on forge? (for legacy forge you will still need to register a tweaker to set up mixin) + // if (platform.isForge) { + // forge { + // mixinConfig("openparticle.mixins.json") + // // And maybe an access transformer? + // // Though try to avoid these, cause they are not automatically translated to Fabric's access widener + // accessTransformer(project.parent.file("src/main/resources/openparticle.cfg")) + // } + // } +} \ No newline at end of file diff --git a/copy.py b/copy.py new file mode 100644 index 0000000..1074204 --- /dev/null +++ b/copy.py @@ -0,0 +1,50 @@ +import os +import shutil + +modId = 'openparticle' +modVersion = '2.8' +mcVersions = [ + "1.16-fabric", + "1.16.1-fabric", + "1.16.2-fabric", + "1.16.3-fabric", + "1.16.4-fabric", + "1.16.5-fabric", + "1.17-fabric", + "1.17.1-fabric", + "1.18-fabric", + "1.18.1-fabric", + "1.18.2-fabric", + "1.19-fabric", + "1.19.1-fabric", + "1.19.2-fabric", + "1.19.3-fabric", + "1.19.4-fabric", + "1.20-fabric", + "1.20.1-fabric", + "1.20.2-fabric", + "1.20.3-fabric", + "1.20.4-fabric", + "1.20.5-fabric", + "1.20.6-fabric", + "1.21-fabric", + "1.21.1-fabric" +] + +release_dest = "./build/libs/release" +sources_dest = "./build/libs/sources" + +if not os.path.exists(release_dest): + os.makedirs(release_dest) +if not os.path.exists(sources_dest): + os.makedirs(sources_dest) + +for mcVersion in mcVersions: + shutil.copyfile( + f"./versions/{mcVersion}/build/libs/{modId}-{mcVersion}-{modVersion}.jar", + f"./build/libs/release/{modId}-{mcVersion}-{modVersion}.jar" + ) + shutil.copyfile( + f"./versions/{mcVersion}/build/libs/{modId}-{mcVersion}-{modVersion}-sources.jar", + f"./build/libs/sources/{modId}-{mcVersion}-{modVersion}-sources.jar" + ) diff --git a/gradle.properties b/gradle.properties index f2e7109..bcb2abe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,16 +1,9 @@ # Done to increase the memory available to gradle. -org.gradle.jvmargs=-Xmx1G +org.gradle.jvmargs=-Xmx8G +org.gradle.parallel=true +org.gradle.configureondemand=true -# Fabric Properties -# check these on https://modmuss50.me/fabric.html -minecraft_version=1.21.1 -yarn_mappings=1.21.1+build.3 -loader_version=0.16.5 +essential.defaults.loom=0 +essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.16.5 -# Fabric API -fabric_version=0.104.0+1.21.1 - -# Mod Properties -mod_version = 1.21.1-2.7-fabric -maven_group = yancey.openparticle -archives_base_name = OpenParticle +version=2.8 \ No newline at end of file diff --git a/root.gradle.kts b/root.gradle.kts new file mode 100644 index 0000000..87565bd --- /dev/null +++ b/root.gradle.kts @@ -0,0 +1,77 @@ +plugins { + // This marks the current project as the root of a multi-version project. + // Any project using `gg.essential.multi-version` must have a parent with this root plugin applied. + // Advanced users may use multiple (potentially independent) multi-version trees in different sub-projects. + // This is currently equivalent to applying `com.replaymod.preprocess-root`. + id("gg.essential.multi-version.root") +} + +group = "yancey.openparticle" +version = project.version + +preprocess { + // Here you first need to create a node per version you support and assign it an integer Minecraft version. + // The mappings value is currently meaningless. + val fabric11600 = createNode("1.16-fabric", 11600, "yarn") + val fabric11601 = createNode("1.16.1-fabric", 11601, "yarn") + val fabric11602 = createNode("1.16.2-fabric", 11602, "yarn") + val fabric11603 = createNode("1.16.3-fabric", 11603, "yarn") + val fabric11604 = createNode("1.16.4-fabric", 11604, "yarn") + val fabric11605 = createNode("1.16.5-fabric", 11605, "yarn") + val fabric11700 = createNode("1.17-fabric", 11700, "yarn") + val fabric11701 = createNode("1.17.1-fabric", 11701, "yarn") + val fabric11800 = createNode("1.18-fabric", 11800, "yarn") + val fabric11801 = createNode("1.18.1-fabric", 11801, "yarn") + val fabric11802 = createNode("1.18.2-fabric", 11802, "yarn") + val fabric11900 = createNode("1.19-fabric", 11900, "yarn") + val fabric11901 = createNode("1.19.1-fabric", 11901, "yarn") + val fabric11902 = createNode("1.19.2-fabric", 11902, "yarn") + val fabric11903 = createNode("1.19.3-fabric", 11903, "yarn") + val fabric11904 = createNode("1.19.4-fabric", 11904, "yarn") + val fabric12000 = createNode("1.20-fabric", 12000, "yarn") + val fabric12001 = createNode("1.20.1-fabric", 12001, "yarn") + val fabric12002 = createNode("1.20.2-fabric", 12002, "yarn") + val fabric12003 = createNode("1.20.3-fabric", 12003, "yarn") + val fabric12004 = createNode("1.20.4-fabric", 12004, "yarn") + val fabric12005 = createNode("1.20.5-fabric", 12005, "yarn") + val fabric12006 = createNode("1.20.6-fabric", 12006, "yarn") + val fabric12100 = createNode("1.21-fabric", 12100, "yarn") + val fabric12101 = createNode("1.21.1-fabric", 12101, "yarn") + + // And then you need to tell the preprocessor which versions it should directly convert between. + // This should form a directed graph with no cycles (i.e. a tree), which the preprocessor will then traverse to + // produce source code for all versions from the main version. + // Do note that the preprocessor can only convert between two projects when they are either on the same Minecraft + // version (but use different mappings, e.g. 1.16.2 forge to fabric), or when they are using the same intermediary + // mappings (but on different Minecraft versions, e.g. 1.12.2 forge to 1.8.9 forge, or 1.16.2 fabric to 1.18 fabric) + // but not both at the same time, i.e. you cannot go straight from 1.12.2 forge to 1.16.2 fabric, you need to go via + // an intermediary 1.16.2 forge project which has something in common with both. + fabric12101.link(fabric12100) + fabric12100.link(fabric12006) + fabric12006.link(fabric12005) + fabric12005.link(fabric12004) + fabric12004.link(fabric12003) + fabric12003.link(fabric12002) + fabric12002.link(fabric12001) + fabric12001.link(fabric12000) + fabric12000.link(fabric11904) + fabric11904.link(fabric11903) + fabric11903.link(fabric11902) + fabric11902.link(fabric11901) + fabric11901.link(fabric11900) + fabric11900.link(fabric11802) + fabric11802.link(fabric11801, file("versions/mapping-1.18.2-1.18.1.txt")) + fabric11801.link(fabric11800) + fabric11800.link(fabric11701) + fabric11701.link(fabric11700) + fabric11700.link(fabric11605) + fabric11605.link(fabric11604) + fabric11604.link(fabric11603) + fabric11603.link(fabric11602) + fabric11602.link(fabric11601) + fabric11601.link(fabric11600) + // For any link, you can optionally specify a file containing extra mappings which the preprocessor cannot infer by + // itself, e.g. forge intermediary names do not contain class names, so you may need to supply mappings for those + // manually. + // forge11202.link(forge10809, file("versions/1.12.2-1.8.9.txt")) +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index f91a4fe..0000000 --- a/settings.gradle +++ /dev/null @@ -1,9 +0,0 @@ -pluginManagement { - repositories { - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - gradlePluginPortal() - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..f9df543 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,58 @@ +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven("https://maven.fabricmc.net") + maven("https://maven.architectury.dev/") + maven("https://maven.minecraftforge.net") + maven("https://repo.essential.gg/repository/maven-public") + } + // We also recommend specifying your desired version here if you're using more than one of the plugins, + // so you do not have to change the version in multilpe places when updating. + plugins { + val egtVersion = "0.6.2" // should be whatever is displayed in above badge + id("gg.essential.multi-version.root") version egtVersion + id("gg.essential.multi-version.api-validation") version egtVersion + } +} + +listOf( + "1.16-fabric", + "1.16.1-fabric", + "1.16.2-fabric", + "1.16.3-fabric", + "1.16.4-fabric", + "1.16.5-fabric", + "1.17-fabric", + "1.17.1-fabric", + "1.18-fabric", + "1.18.1-fabric", + "1.18.2-fabric", + "1.19-fabric", + "1.19.1-fabric", + "1.19.2-fabric", + "1.19.3-fabric", + "1.19.4-fabric", + "1.20-fabric", + "1.20.1-fabric", + "1.20.2-fabric", + "1.20.3-fabric", + "1.20.4-fabric", + "1.20.5-fabric", + "1.20.6-fabric", + "1.21-fabric", + "1.21.1-fabric", +).forEach { version -> + include(":$version") + project(":$version").apply { + // This is where the `build` folder and per-version overwrites will reside + projectDir = file("versions/$version") + // All sub-projects get configured by the same `build.gradle.kts.kts` file, the string is relative to projectDir + // You could use separate build files for each project, but usually that would just be duplicating lots of code + buildFileName = "../../build.gradle.kts" + } +} + +// We use the `build.gradle.kts` file for all the sub-projects (cause that's where most the interesting stuff lives), +// so we need to use a different build file for the original root project. +rootProject.buildFileName = "root.gradle.kts" \ No newline at end of file diff --git a/src/main/java/yancey/openparticle/api/common/nativecore/OpenParticleProject.java b/src/main/java/yancey/openparticle/api/common/nativecore/OpenParticleProject.java index bb82a42..1ce44c5 100644 --- a/src/main/java/yancey/openparticle/api/common/nativecore/OpenParticleProject.java +++ b/src/main/java/yancey/openparticle/api/common/nativecore/OpenParticleProject.java @@ -89,6 +89,7 @@ public int getVBOSize() { */ private native static void render(long pointer, long bufferPointer, boolean isSingleThread, float tickDelta, float cameraX, float cameraY, float cameraZ, float rx, float ry, float rz, float rw); + @SuppressWarnings({"unused", "DuplicatedCode"}) public void render(Buffer directBuffer, boolean isSingleThread, float tickDelta, float cameraX, float cameraY, float cameraZ, float rx, float ry, float rz, float rw) { if (!directBuffer.isDirect()) { throw new RuntimeException("buffer is not direct"); @@ -177,6 +178,7 @@ public void close() { */ private native static void render(long pointer, Buffer directBuffer, boolean isSingleThread, float tickDelta, float cameraX, float cameraY, float cameraZ, float rx, float ry, float rz, float rw); + @SuppressWarnings({"unused", "DuplicatedCode"}) public void render(long bufferPointer, boolean isSingleThread, float tickDelta, float cameraX, float cameraY, float cameraZ, float rx, float ry, float rz, float rw) { if (tickDelta < 0 || tickDelta > 1) { throw new RuntimeException("Tick delta out of range: " + tickDelta); diff --git a/src/main/java/yancey/openparticle/core/OpenParticle.java b/src/main/java/yancey/openparticle/core/OpenParticle.java index 82ce1a5..69f619a 100644 --- a/src/main/java/yancey/openparticle/core/OpenParticle.java +++ b/src/main/java/yancey/openparticle/core/OpenParticle.java @@ -1,31 +1,44 @@ package yancey.openparticle.core; import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; -import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; -import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import yancey.openparticle.core.command.CommandPar; import yancey.openparticle.core.core.OpenParticleServerCore; import yancey.openparticle.core.keys.KeyboardManager; import yancey.openparticle.core.network.*; +//#if MC>=12005 +import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; +//#endif + +//#if MC>=19000 +import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; +//#else +//$$ import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; +//#endif + public class OpenParticle implements ModInitializer { public static final String MOD_ID = "openparticle"; @Override public void onInitialize() { - PayloadTypeRegistry.playC2S().register(KeyboardPayloadC2S.ID, KeyboardPayloadC2S.CODEC); - PayloadTypeRegistry.playC2S().register(RunPayloadC2S.ID, RunPayloadC2S.CODEC); - PayloadTypeRegistry.playS2C().register(RunTickPayloadS2C.ID, RunTickPayloadS2C.CODEC); - PayloadTypeRegistry.playS2C().register(LoadAndRunPayloadS2C.ID, LoadAndRunPayloadS2C.CODEC); - PayloadTypeRegistry.playS2C().register(LoadPayloadS2C.ID, LoadPayloadS2C.CODEC); - PayloadTypeRegistry.playS2C().register(RunPayloadS2C.ID, RunPayloadS2C.CODEC); - ServerPlayNetworking.registerGlobalReceiver(KeyboardPayloadC2S.ID, (payload, context) -> - context.player().server.execute(() -> KeyboardManager.runInServe(payload.idList(), context.player()))); - ServerPlayNetworking.registerGlobalReceiver(RunPayloadC2S.ID, (payload, context) -> - OpenParticleServerCore.run(context.player().server, payload.path(), payload.tickEnd(), payload.isSingleThread())); + //#if MC>=12005 + PayloadTypeRegistry.playC2S().register(KeyboardPayloadC2S.ID.getId(), KeyboardPayloadC2S.ID.getCodec()); + PayloadTypeRegistry.playC2S().register(RunPayloadC2S.ID.getId(), RunPayloadC2S.ID.getCodec()); + PayloadTypeRegistry.playS2C().register(RunTickPayloadS2C.ID.getId(), RunTickPayloadS2C.ID.getCodec()); + PayloadTypeRegistry.playS2C().register(LoadAndRunPayloadS2C.ID.getId(), LoadAndRunPayloadS2C.ID.getCodec()); + PayloadTypeRegistry.playS2C().register(LoadPayloadS2C.ID.getId(), LoadPayloadS2C.ID.getCodec()); + PayloadTypeRegistry.playS2C().register(RunPayloadS2C.ID.getId(), RunPayloadS2C.ID.getCodec()); + //#endif + KeyboardPayloadC2S.ID.registerServerGlobalReceiver((payload, server, player) -> + player.server.execute(() -> KeyboardManager.runInServe(payload.idList, player))); + RunPayloadC2S.ID.registerServerGlobalReceiver((payload, server, player) -> + OpenParticleServerCore.run(player.server, payload.path, payload.tickEnd, payload.isSingleThread)); KeyboardManager.init(false); - CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> CommandPar.init(dispatcher)); + //#if MC>=19000 + CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> CommandPar.register(dispatcher)); + //#else + //$$ CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> CommandPar.register(dispatcher)); + //#endif } } diff --git a/src/main/java/yancey/openparticle/core/client/GuiProgressBar.java b/src/main/java/yancey/openparticle/core/client/GuiProgressBar.java index d3f5a99..868f23e 100644 --- a/src/main/java/yancey/openparticle/core/client/GuiProgressBar.java +++ b/src/main/java/yancey/openparticle/core/client/GuiProgressBar.java @@ -3,19 +3,31 @@ import com.mojang.logging.LogUtils; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.screen.ScreenTexts; import net.minecraft.text.Text; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; import java.math.RoundingMode; import java.text.NumberFormat; +import org.slf4j.Logger; +import yancey.openparticle.core.versions.TextUtil; + +//#if MC>=12000 +import net.minecraft.client.gui.DrawContext; +import org.jetbrains.annotations.NotNull; +//#else +//$$ import net.minecraft.client.util.math.MatrixStack; +//#endif + +//#if MC>=11900 +import net.minecraft.screen.ScreenTexts; +//#endif + @Environment(EnvType.CLIENT) public class GuiProgressBar extends Screen { - public static final Logger logger = LogUtils.getLogger(); + + public static final Logger LOGGER = LogUtils.getLogger(); + public static final NumberFormat numberFormat; static { @@ -31,8 +43,12 @@ public class GuiProgressBar extends Screen { public int progress; public GuiProgressBar(String title, int max) { + //#if MC>=11900 super(ScreenTexts.EMPTY); - this.title = Text.literal(title); + //#else + //$$ super(TextUtil.empty()); + //#endif + this.title = TextUtil.literal(title); this.max = max; progress = 0; } @@ -43,39 +59,111 @@ public boolean shouldPause() { } @Override - public void render(DrawContext context, int mouseX, int mouseY, float delta) { + public void render( + //#if MC>=12000 + DrawContext context, + //#else + //$$ MatrixStack matrices, + //#endif + int mouseX, + int mouseY, + float delta + ) { + //#if MC>=12002 renderBackground(context, mouseX, mouseY, delta); + //#else + //# renderBackground(context); + //#endif + + //#if MC>=12000 context.drawCenteredTextWithShadow(textRenderer, title, width / 2, height / 2 - textRenderer.fontHeight - 20, 0xFFFFFFFF); + //#else + //$$ drawCenteredTextWithShadow(matrices, textRenderer, title, width / 2, height / 2 - textRenderer.fontHeight - 20, 0xFFFFFFFF); + //#endif + if (progress > max || progress < 0) { - logger.warn("progress bar can't show,the max progress is {},but the progress {}", max, progress); + LOGGER.warn("progress bar can't show,the max progress is {}, but the progress is {}", max, progress); close(); return; } float a = progress * 100f / max; drawProgress( + //#if MC>=12000 context, + //#else + //$$ matrices, + //#endif width / 2 - 100, width / 2 - 100 + (int) a * 2, width / 2 + 100, (height - 10) / 2, (height + 10) / 2 ); - drawString(context, numberFormat.format(a) + '%', width / 2 - 100, height / 2 + 20); + drawString( + //#if MC>=12000 + context, + //#else + //$$ matrices, + //#endif + numberFormat.format(a) + '%', + width / 2 - 100, + height / 2 + 20 + ); String b = String.valueOf(progress) + '/' + max; - drawString(context, b, width / 2 + 100 - textRenderer.getWidth(b), height / 2 + 20); + drawString( + //#if MC>=12000 + context, + //#else + //$$ matrices, + //#endif, + b, + width / 2 + 100 - textRenderer.getWidth(b), + height / 2 + 20 + ); if (progress == max) { close(); } } - public void drawString(@NotNull DrawContext context, String text, int x, int y) { + public void drawString( + //#if MC>=12000 + @NotNull DrawContext context, + //#else + //$$ MatrixStack matrices, + //#endif + String text, + int x, + int y + ) { + //#if MC>=12000 context.drawText(textRenderer, text, x, y, 0xFFFFFFFF, true); + //#else + //$$ drawTextWithShadow(matrices, textRenderer, text, x, y, 0xFFFFFFFF); + //#endif } - private void drawProgress(DrawContext context, int startX, int middleX, int endX, int startY, int endY) { + private void drawProgress( + //#if MC>=12000 + @NotNull DrawContext context, + //#else + //$$ MatrixStack matrices, + //#endif + int startX, + int middleX, + int endX, + int startY, + int endY + ) { + //#if MC>=12000 context.fill(startX - 1, startY - 1, middleX, endY + 1, 0xFFFFFFFF);//left context.fill(middleX, startY - 1, endX + 1, startY, 0xFFFFFFFF);//top context.fill(endX, startY - 1, endX + 1, endY + 1, 0xFFFFFFFF);//right context.fill(middleX, endY, endX + 1, endY + 1, 0xFFFFFFFF);//bottom + //#else + //$$ fill(matrices, startX - 1, startY - 1, middleX, endY + 1, 0xFFFFFFFF);//left + //$$ fill(matrices, middleX, startY - 1, endX + 1, startY, 0xFFFFFFFF);//top + //$$ fill(matrices, endX, startY - 1, endX + 1, endY + 1, 0xFFFFFFFF);//right + //$$ fill(matrices, middleX, endY, endX + 1, endY + 1, 0xFFFFFFFF);//bottom + //#endif } } diff --git a/src/main/java/yancey/openparticle/core/client/OpenParticleClient.java b/src/main/java/yancey/openparticle/core/client/OpenParticleClient.java index 47c4a62..906ba3b 100644 --- a/src/main/java/yancey/openparticle/core/client/OpenParticleClient.java +++ b/src/main/java/yancey/openparticle/core/client/OpenParticleClient.java @@ -2,7 +2,6 @@ import com.mojang.logging.LogUtils; import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; import net.minecraft.client.MinecraftClient; import org.slf4j.Logger; @@ -40,14 +39,14 @@ public void onInitializeClient() { } } System.load(dest.toString()); - ClientPlayNetworking.registerGlobalReceiver(RunTickPayloadS2C.ID, (payload, context) -> - OpenParticleClientCore.runTick(payload.path(), payload.tick(), payload.isSingleThread())); - ClientPlayNetworking.registerGlobalReceiver(LoadAndRunPayloadS2C.ID, (payload, context) -> - OpenParticleClientCore.loadAndRun(payload.path(), payload.isSingleThread())); - ClientPlayNetworking.registerGlobalReceiver(LoadPayloadS2C.ID, (payload, context) -> - OpenParticleClientCore.loadFile(payload.path())); - ClientPlayNetworking.registerGlobalReceiver(RunPayloadS2C.ID, (payload, context) -> - OpenParticleClientCore.run(payload.path(), payload.isSingleThread())); + RunTickPayloadS2C.ID.registerClientGlobalReceiver((payload, client, player) -> + OpenParticleClientCore.runTick(payload.path, payload.tick, payload.isSingleThread)); + LoadAndRunPayloadS2C.ID.registerClientGlobalReceiver((payload, client, player) -> + OpenParticleClientCore.loadAndRun(payload.path, payload.isSingleThread)); + LoadPayloadS2C.ID.registerClientGlobalReceiver((payload, client, player) -> + OpenParticleClientCore.loadFile(payload.path)); + RunPayloadS2C.ID.registerClientGlobalReceiver((payload, client, player) -> + OpenParticleClientCore.run(payload.path, payload.isSingleThread)); KeyboardManager.init(true); WorldRenderEvents.START.register(context -> OpenParticleClientCore.inRendered = false); } diff --git a/src/main/java/yancey/openparticle/core/client/core/OpenParticleClientCore.java b/src/main/java/yancey/openparticle/core/client/core/OpenParticleClientCore.java index 46ef049..f612f24 100644 --- a/src/main/java/yancey/openparticle/core/client/core/OpenParticleClientCore.java +++ b/src/main/java/yancey/openparticle/core/client/core/OpenParticleClientCore.java @@ -2,25 +2,25 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.minecraft.client.MinecraftClient; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.Camera; import net.minecraft.client.texture.Sprite; import net.minecraft.text.HoverEvent; -import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import net.minecraft.util.math.Vec3d; import net.minecraft.world.GameRules; -import org.joml.Quaternionf; + import yancey.openparticle.api.common.nativecore.OpenParticleProject; import yancey.openparticle.core.events.RunningEventManager; import yancey.openparticle.core.mixin.BufferBuilderAccessor; import yancey.openparticle.core.mixin.ParticleManagerAccessor; import yancey.openparticle.core.mixin.SimpleSpriteProviderAccessor; import yancey.openparticle.core.network.RunPayloadC2S; +import yancey.openparticle.core.versions.IdentifierUtil; +import yancey.openparticle.core.versions.TextUtil; import java.io.PrintWriter; import java.io.StringWriter; @@ -31,13 +31,23 @@ import java.util.Objects; import java.util.concurrent.locks.ReentrantLock; +//#if MC<12100 +//$$ import java.nio.ByteBuffer; +//#endif + +//#if MC>=11903 +import org.joml.Quaternionf; +//#else +//$$ import net.minecraft.util.math.Quaternion; +//#endif + @Environment(EnvType.CLIENT) public class OpenParticleClientCore { private static final Map spriteAwareFactories = ((ParticleManagerAccessor) MinecraftClient.getInstance().particleManager).getSpriteAwareFactories(); private static final OpenParticleProject.Bridge bridge = (namespace, value) -> { - SpriteProvider spriteProvider = spriteAwareFactories.get(Identifier.of(namespace, value)); + SpriteProvider spriteProvider = spriteAwareFactories.get(IdentifierUtil.create(namespace, value)); List sprites = ((SimpleSpriteProviderAccessor) spriteProvider).getSprites(); float[] result = new float[sprites.size() * 4]; for (int i = 0; i < sprites.size(); i++) { @@ -77,10 +87,10 @@ public static boolean loadFile(String path) { long timeEnd = System.currentTimeMillis(); if (isSuccess && client.world != null) { if (client.world.getGameRules().getBoolean(GameRules.COMMAND_BLOCK_OUTPUT)) { - client.inGameHud.getChatHud().addMessage(Text.empty() - .append(Text.literal("粒子文件加载成功(耗时")) - .append(Text.literal((timeEnd - timeStart) + "ms").formatted(Formatting.AQUA)) - .append(Text.literal(")")) + client.inGameHud.getChatHud().addMessage(TextUtil.empty() + .append(TextUtil.literal("粒子文件加载成功(耗时")) + .append(TextUtil.literal((timeEnd - timeStart) + "ms").formatted(Formatting.AQUA)) + .append(TextUtil.literal(")")) ); } } @@ -104,7 +114,7 @@ public static void run(String path, boolean isSingleThread) { return; } } - ClientPlayNetworking.send(new RunPayloadC2S(openParticleProject.path, openParticleProject.tickEnd, isSingleThread)); + RunPayloadC2S.ID.sendToServer(new RunPayloadC2S(openParticleProject.path, openParticleProject.tickEnd, isSingleThread)); } finally { LOCK.unlock(); } @@ -155,10 +165,10 @@ private static boolean loadFile0(String path) { openParticleProject = null; } if (!Files.exists(Path.of(path))) { - MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(Text.empty() - .append(Text.literal("粒子文件加载失败(找不到文件: ").formatted(Formatting.RED)) - .append(Text.literal(path).formatted(Formatting.LIGHT_PURPLE)) - .append(Text.literal(")").formatted(Formatting.RED)) + MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(TextUtil.empty() + .append(TextUtil.literal("粒子文件加载失败(找不到文件: ").formatted(Formatting.RED)) + .append(TextUtil.literal(path).formatted(Formatting.LIGHT_PURPLE)) + .append(TextUtil.literal(")").formatted(Formatting.RED)) ); return false; } @@ -166,11 +176,11 @@ private static boolean loadFile0(String path) { openParticleProject = new OpenParticleProject(bridge, path); return true; } catch (Exception e) { - MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(Text.literal("粒子文件加载失败").formatted(Formatting.RED).styled(style -> { + MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(TextUtil.literal("粒子文件加载失败").formatted(Formatting.RED).styled(style -> { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); e.printStackTrace(printWriter); - return style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal(stringWriter.toString()).formatted(Formatting.RED))); + return style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextUtil.literal(stringWriter.toString()).formatted(Formatting.RED))); })); return false; } @@ -212,15 +222,36 @@ public static void render(Camera camera, float tickDelta, BufferBuilder bufferBu return; } int elementOffset = 112 * particleCount; + + //#if MC>=12100 long pointer = ((BufferBuilderAccessor) bufferBuilder).getAllocator().allocate(elementOffset); + //#else + //$$ ((BufferBuilderAccessor) bufferBuilder).invokeGrow(elementOffset); + //$$ ByteBuffer byteBuffer = ((BufferBuilderAccessor) bufferBuilder).getBuffer(); + //#endif + Vec3d pos = camera.getPos(); + + //#if MC>=11903 Quaternionf rotation = camera.getRotation(); + //#else + //$$ Quaternion rotation = camera.getRotation(); + //#endif + openParticleProject.render( + //#if MC>=12100 pointer, + //#else + //$$ byteBuffer, + //#endif nextIsSingleThread, isRepeatTick ? 1 : tickDelta, (float) pos.x, (float) pos.y, (float) pos.z, + //#if MC>=11903 rotation.x, rotation.y, rotation.z, rotation.w + //#else + //$$ rotation.getX(), rotation.getY(), rotation.getZ(), rotation.getW() + //#endif ); ((BufferBuilderAccessor) bufferBuilder).setVertexCount(4 * particleCount); } finally { diff --git a/src/main/java/yancey/openparticle/core/command/CommandPar.java b/src/main/java/yancey/openparticle/core/command/CommandPar.java index abea33b..aed2b7a 100644 --- a/src/main/java/yancey/openparticle/core/command/CommandPar.java +++ b/src/main/java/yancey/openparticle/core/command/CommandPar.java @@ -13,7 +13,7 @@ public class CommandPar { - public static void init(CommandDispatcher dispatcher) { + public static void register(CommandDispatcher dispatcher) { dispatcher.register(literal("par") .requires(source -> source.hasPermissionLevel(2)) .then(literal("loadAndRun") diff --git a/src/main/java/yancey/openparticle/core/core/OpenParticleServerCore.java b/src/main/java/yancey/openparticle/core/core/OpenParticleServerCore.java index c871ab6..36cb073 100644 --- a/src/main/java/yancey/openparticle/core/core/OpenParticleServerCore.java +++ b/src/main/java/yancey/openparticle/core/core/OpenParticleServerCore.java @@ -1,8 +1,6 @@ package yancey.openparticle.core.core; -import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.minecraft.server.MinecraftServer; -import net.minecraft.server.network.ServerPlayerEntity; import yancey.openparticle.core.events.RunningEventManager; import yancey.openparticle.core.network.LoadAndRunPayloadS2C; import yancey.openparticle.core.network.LoadPayloadS2C; @@ -26,27 +24,19 @@ public static void stop() { public static void loadFile(MinecraftServer server, String path) { OpenParticleServerCore.path = Objects.requireNonNull(path); - for (ServerPlayerEntity serverPlayerEntity : server.getPlayerManager().getPlayerList()) { - ServerPlayNetworking.send(serverPlayerEntity, new LoadPayloadS2C(path)); - } + LoadPayloadS2C.ID.sendToAllClient(server, new LoadPayloadS2C(path)); } public static void loadAndRun(MinecraftServer server, String path, boolean isSingleThread) { OpenParticleServerCore.path = Objects.requireNonNull(path); - LoadAndRunPayloadS2C payload = new LoadAndRunPayloadS2C(path, isSingleThread); - for (ServerPlayerEntity serverPlayerEntity : server.getPlayerManager().getPlayerList()) { - ServerPlayNetworking.send(serverPlayerEntity, payload); - } + LoadAndRunPayloadS2C.ID.sendToAllClient(server, new LoadAndRunPayloadS2C(path, isSingleThread)); } public static void run(MinecraftServer server, boolean isSingleThread) { if (OpenParticleServerCore.path == null) { return; } - RunPayloadS2C payload = new RunPayloadS2C(path, isSingleThread); - for (ServerPlayerEntity serverPlayerEntity : server.getPlayerManager().getPlayerList()) { - ServerPlayNetworking.send(serverPlayerEntity, payload); - } + RunPayloadS2C.ID.sendToAllClient(server, new RunPayloadS2C(path, isSingleThread)); } public static void run(MinecraftServer server, String path, int tickEnd, boolean isSingleThread) { @@ -72,10 +62,7 @@ public static void runTick(MinecraftServer server, int tick, boolean isSingleThr if (OpenParticleServerCore.path == null) { return; } - RunTickPayloadS2C payload = new RunTickPayloadS2C(OpenParticleServerCore.path, tick, isSingleThread); - for (ServerPlayerEntity serverPlayerEntity : server.getPlayerManager().getPlayerList()) { - ServerPlayNetworking.send(serverPlayerEntity, payload); - } + RunTickPayloadS2C.ID.sendToAllClient(server, new RunTickPayloadS2C(OpenParticleServerCore.path, tick, isSingleThread)); } } diff --git a/src/main/java/yancey/openparticle/core/keys/KeyboardManager.java b/src/main/java/yancey/openparticle/core/keys/KeyboardManager.java index 82a9c46..ed2bc55 100644 --- a/src/main/java/yancey/openparticle/core/keys/KeyboardManager.java +++ b/src/main/java/yancey/openparticle/core/keys/KeyboardManager.java @@ -3,7 +3,6 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; -import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.minecraft.server.network.ServerPlayerEntity; import org.lwjgl.glfw.GLFW; import yancey.openparticle.core.core.OpenParticleServerCore; @@ -43,7 +42,7 @@ public static void init(boolean isClient) { } } if (!idList.isEmpty()) { - ClientPlayNetworking.send(new KeyboardPayloadC2S(idList)); + KeyboardPayloadC2S.ID.sendToServer(new KeyboardPayloadC2S(idList.stream().mapToInt(value -> value).toArray())); } }); } @@ -57,7 +56,7 @@ public static void register(boolean isClient, String description, int keyCode, b } } - public static void runInServe(List idList, ServerPlayerEntity entityPlayerMP) { + public static void runInServe(int[] idList, ServerPlayerEntity entityPlayerMP) { for (int id : idList) { onKeyPressedListenerList.get(id).onKeyPressed(entityPlayerMP); } diff --git a/src/main/java/yancey/openparticle/core/mixin/BufferBuilderAccessor.java b/src/main/java/yancey/openparticle/core/mixin/BufferBuilderAccessor.java index aeca9d3..61e9553 100644 --- a/src/main/java/yancey/openparticle/core/mixin/BufferBuilderAccessor.java +++ b/src/main/java/yancey/openparticle/core/mixin/BufferBuilderAccessor.java @@ -1,17 +1,31 @@ package yancey.openparticle.core.mixin; import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.util.BufferAllocator; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; +//#if MC>=12100 +import net.minecraft.client.util.BufferAllocator; +//#else +//$$ import org.spongepowered.asm.mixin.gen.Invoker; +//$$ import java.nio.ByteBuffer; +//#endif + @Mixin(BufferBuilder.class) public interface BufferBuilderAccessor { @Accessor void setVertexCount(int vertexCount); + //#if MC>=12100 @Accessor BufferAllocator getAllocator(); + //#else + //$$ @Invoker + //$$ void invokeGrow(int size); + //$$ + //$$ @Accessor + //$$ ByteBuffer getBuffer(); + //#endif } diff --git a/src/main/java/yancey/openparticle/core/mixin/ParticleManagerMixin.java b/src/main/java/yancey/openparticle/core/mixin/ParticleManagerMixin.java index db6a9b8..57f6d7a 100644 --- a/src/main/java/yancey/openparticle/core/mixin/ParticleManagerMixin.java +++ b/src/main/java/yancey/openparticle/core/mixin/ParticleManagerMixin.java @@ -14,6 +14,10 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import yancey.openparticle.core.client.core.OpenParticleClientCore; +//#if MC<11900 +//$$ import net.minecraft.client.util.math.MatrixStack; +//#endif + @Mixin(ParticleManager.class) public abstract class ParticleManagerMixin { @@ -22,21 +26,54 @@ public abstract class ParticleManagerMixin { private TextureManager textureManager; @Inject(method = "renderParticles", at = @At(value = "HEAD")) - private void injectRenderParticles(LightmapTextureManager lightmapTextureManager, Camera camera, float tickDelta, CallbackInfo ci) { + private void injectRenderParticles( + //#if MC<11900 + //$$ MatrixStack matrices, + //$$ VertexConsumerProvider.Immediate vertexConsumers, + //#endif + LightmapTextureManager lightmapTextureManager, + Camera camera, + float tickDelta, + CallbackInfo ci + ) { lightmapTextureManager.enable(); RenderSystem.enableDepthTest(); + //#if MC<11900 + //$$ MatrixStack matrixStack = RenderSystem.getModelViewStack(); + //$$ matrixStack.push(); + //$$ matrixStack.multiplyPositionMatrix(matrices.peek().getPositionMatrix()); + //$$ RenderSystem.applyModelViewMatrix(); + //#endif RenderSystem.setShader(GameRenderer::getParticleProgram); Tessellator tessellator = Tessellator.getInstance(); + //#if MC>=12100 BufferBuilder bufferBuilder = ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT.begin(tessellator, textureManager); + //#else + //$$ BufferBuilder bufferBuilder = tessellator.getBuffer(); + //$$ ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT.begin(bufferBuilder, textureManager); + //#endif if (bufferBuilder != null) { OpenParticleClientCore.render(camera, tickDelta, bufferBuilder); + //#if MC>=12100 BuiltBuffer builtBuffer = bufferBuilder.endNullable(); if (builtBuffer != null) { BufferRenderer.drawWithGlobalProgram(builtBuffer); } + //#elseif MC>=19000 + //$$ BufferBuilder.BuiltBuffer builtBuffer = bufferBuilder.endNullable(); + //$$ if (builtBuffer != null) { + //$$ BufferRenderer.drawWithGlobalProgram(builtBuffer); + //$$ } + //#else + //$$ tessellator.draw(); + //#endif } + //#if MC<11900 + //$$ matrixStack.pop(); + //$$ RenderSystem.applyModelViewMatrix(); + //#endif RenderSystem.depthMask(true); RenderSystem.disableBlend(); lightmapTextureManager.disable(); diff --git a/src/main/java/yancey/openparticle/core/network/KeyboardPayloadC2S.java b/src/main/java/yancey/openparticle/core/network/KeyboardPayloadC2S.java index 9725c97..f55a2e8 100644 --- a/src/main/java/yancey/openparticle/core/network/KeyboardPayloadC2S.java +++ b/src/main/java/yancey/openparticle/core/network/KeyboardPayloadC2S.java @@ -1,26 +1,33 @@ package yancey.openparticle.core.network; -import net.minecraft.network.RegistryByteBuf; -import net.minecraft.network.codec.PacketCodec; -import net.minecraft.network.codec.PacketCodecs; -import net.minecraft.network.packet.CustomPayload; -import net.minecraft.util.Identifier; +import net.minecraft.network.PacketByteBuf; +import yancey.openparticle.core.versions.PayloadBase; +import yancey.openparticle.core.versions.PayloadCodec; +import yancey.openparticle.core.versions.PayloadId; -import java.util.ArrayList; -import java.util.List; +public class KeyboardPayloadC2S extends PayloadBase { -import static yancey.openparticle.core.OpenParticle.MOD_ID; + public static final PayloadId ID = new PayloadId("key_board", new PayloadCodec() { + @Override + public KeyboardPayloadC2S decode(PacketByteBuf buf) { + return new KeyboardPayloadC2S(buf.readIntArray()); + } -public record KeyboardPayloadC2S(List idList) implements CustomPayload { + @Override + public void encode(PacketByteBuf buf, KeyboardPayloadC2S value) { + buf.writeIntArray(value.idList); + } + }); + + public int[] idList; + + public KeyboardPayloadC2S(int[] idList) { + this.idList = idList; + } - public static final CustomPayload.Id ID = new CustomPayload.Id<>(Identifier.of(MOD_ID, "key_board")); - public static final PacketCodec CODEC = - PacketCodec.tuple(PacketCodecs.collection(ArrayList::new, PacketCodecs.VAR_INT), - KeyboardPayloadC2S::idList, KeyboardPayloadC2S::new); @Override - public Id getId() { + public PayloadId getPayloadId() { return ID; } - } diff --git a/src/main/java/yancey/openparticle/core/network/LoadAndRunPayloadS2C.java b/src/main/java/yancey/openparticle/core/network/LoadAndRunPayloadS2C.java index a25759f..752475b 100644 --- a/src/main/java/yancey/openparticle/core/network/LoadAndRunPayloadS2C.java +++ b/src/main/java/yancey/openparticle/core/network/LoadAndRunPayloadS2C.java @@ -1,30 +1,35 @@ package yancey.openparticle.core.network; -import net.minecraft.network.RegistryByteBuf; -import net.minecraft.network.codec.PacketCodec; -import net.minecraft.network.packet.CustomPayload; -import net.minecraft.util.Identifier; +import net.minecraft.network.PacketByteBuf; +import yancey.openparticle.core.versions.PayloadBase; +import yancey.openparticle.core.versions.PayloadCodec; +import yancey.openparticle.core.versions.PayloadId; -import static yancey.openparticle.core.OpenParticle.MOD_ID; +public class LoadAndRunPayloadS2C extends PayloadBase { -public record LoadAndRunPayloadS2C(String path, boolean isSingleThread) implements CustomPayload { - - public static final Id ID = new Id<>(Identifier.of(MOD_ID, "load_and_run_project")); - public static final PacketCodec CODEC = new PacketCodec<>() { + public static final PayloadId ID = new PayloadId("load_and_run_project", new PayloadCodec() { @Override - public LoadAndRunPayloadS2C decode(RegistryByteBuf buf) { + public LoadAndRunPayloadS2C decode(PacketByteBuf buf) { return new LoadAndRunPayloadS2C(buf.readString(), buf.readBoolean()); } @Override - public void encode(RegistryByteBuf buf, LoadAndRunPayloadS2C value) { + public void encode(PacketByteBuf buf, LoadAndRunPayloadS2C value) { buf.writeString(value.path); buf.writeBoolean(value.isSingleThread); } - }; + }); + + public String path; + public boolean isSingleThread; + + public LoadAndRunPayloadS2C(String path, boolean isSingleThread) { + this.path = path; + this.isSingleThread = isSingleThread; + } @Override - public Id getId() { + public PayloadId getPayloadId() { return ID; } } diff --git a/src/main/java/yancey/openparticle/core/network/LoadPayloadS2C.java b/src/main/java/yancey/openparticle/core/network/LoadPayloadS2C.java index 397b700..1b8fe1c 100644 --- a/src/main/java/yancey/openparticle/core/network/LoadPayloadS2C.java +++ b/src/main/java/yancey/openparticle/core/network/LoadPayloadS2C.java @@ -1,21 +1,32 @@ package yancey.openparticle.core.network; -import net.minecraft.network.RegistryByteBuf; -import net.minecraft.network.codec.PacketCodec; -import net.minecraft.network.codec.PacketCodecs; -import net.minecraft.network.packet.CustomPayload; -import net.minecraft.util.Identifier; +import net.minecraft.network.PacketByteBuf; +import yancey.openparticle.core.versions.PayloadBase; +import yancey.openparticle.core.versions.PayloadCodec; +import yancey.openparticle.core.versions.PayloadId; -import static yancey.openparticle.core.OpenParticle.MOD_ID; +public class LoadPayloadS2C extends PayloadBase { -public record LoadPayloadS2C(String path) implements CustomPayload { + public static final PayloadId ID = new PayloadId("load_project", new PayloadCodec() { + @Override + public LoadPayloadS2C decode(PacketByteBuf buf) { + return new LoadPayloadS2C(buf.readString()); + } - public static final CustomPayload.Id ID = new CustomPayload.Id<>(Identifier.of(MOD_ID, "load_project")); - public static final PacketCodec CODEC = - PacketCodec.tuple(PacketCodecs.STRING, LoadPayloadS2C::path, LoadPayloadS2C::new); + @Override + public void encode(PacketByteBuf buf, LoadPayloadS2C value) { + buf.writeString(value.path); + } + }); + + public String path; + + public LoadPayloadS2C(String path) { + this.path = path; + } @Override - public Id getId() { + public PayloadId getPayloadId() { return ID; } } diff --git a/src/main/java/yancey/openparticle/core/network/RunPayloadC2S.java b/src/main/java/yancey/openparticle/core/network/RunPayloadC2S.java index 9675c4e..8188714 100644 --- a/src/main/java/yancey/openparticle/core/network/RunPayloadC2S.java +++ b/src/main/java/yancey/openparticle/core/network/RunPayloadC2S.java @@ -1,32 +1,38 @@ package yancey.openparticle.core.network; -import net.minecraft.network.RegistryByteBuf; -import net.minecraft.network.codec.PacketCodec; -import net.minecraft.network.packet.CustomPayload; -import net.minecraft.util.Identifier; +import net.minecraft.network.PacketByteBuf; +import yancey.openparticle.core.versions.PayloadBase; +import yancey.openparticle.core.versions.PayloadCodec; +import yancey.openparticle.core.versions.PayloadId; -import static yancey.openparticle.core.OpenParticle.MOD_ID; +public class RunPayloadC2S extends PayloadBase { -public record RunPayloadC2S(String path, int tickEnd, boolean isSingleThread) implements CustomPayload { - - public static final Id ID = new Id<>(Identifier.of(MOD_ID, "tick_end")); - public static final PacketCodec CODEC = new PacketCodec<>() { + public static final PayloadId ID = new PayloadId("tick_end", new PayloadCodec() { @Override - public RunPayloadC2S decode(RegistryByteBuf buf) { + public RunPayloadC2S decode(PacketByteBuf buf) { return new RunPayloadC2S(buf.readString(), buf.readVarInt(), buf.readBoolean()); } @Override - public void encode(RegistryByteBuf buf, RunPayloadC2S value) { + public void encode(PacketByteBuf buf, RunPayloadC2S value) { buf.writeString(value.path); buf.writeVarInt(value.tickEnd); buf.writeBoolean(value.isSingleThread); } - }; + }); + + public String path; + public int tickEnd; + public boolean isSingleThread; + + public RunPayloadC2S(String path, int tickEnd, boolean isSingleThread) { + this.path = path; + this.tickEnd = tickEnd; + this.isSingleThread = isSingleThread; + } @Override - public Id getId() { + public PayloadId getPayloadId() { return ID; } - } diff --git a/src/main/java/yancey/openparticle/core/network/RunPayloadS2C.java b/src/main/java/yancey/openparticle/core/network/RunPayloadS2C.java index f4474f9..7b7f975 100644 --- a/src/main/java/yancey/openparticle/core/network/RunPayloadS2C.java +++ b/src/main/java/yancey/openparticle/core/network/RunPayloadS2C.java @@ -1,30 +1,36 @@ package yancey.openparticle.core.network; -import net.minecraft.network.RegistryByteBuf; -import net.minecraft.network.codec.PacketCodec; -import net.minecraft.network.packet.CustomPayload; -import net.minecraft.util.Identifier; +import net.minecraft.network.PacketByteBuf; +import yancey.openparticle.core.versions.PayloadBase; +import yancey.openparticle.core.versions.PayloadCodec; +import yancey.openparticle.core.versions.PayloadId; -import static yancey.openparticle.core.OpenParticle.MOD_ID; +public class RunPayloadS2C extends PayloadBase { -public record RunPayloadS2C(String path, boolean isSingleThread) implements CustomPayload { - - public static final Id ID = new Id<>(Identifier.of(MOD_ID, "run_project")); - public static final PacketCodec CODEC = new PacketCodec<>() { + public static final PayloadId ID = new PayloadId("run_project", new PayloadCodec() { @Override - public RunPayloadS2C decode(RegistryByteBuf buf) { + public RunPayloadS2C decode(PacketByteBuf buf) { return new RunPayloadS2C(buf.readString(), buf.readBoolean()); } @Override - public void encode(RegistryByteBuf buf, RunPayloadS2C value) { + public void encode(PacketByteBuf buf, RunPayloadS2C value) { buf.writeString(value.path); buf.writeBoolean(value.isSingleThread); } - }; + }); + + public String path; + public boolean isSingleThread; + + public RunPayloadS2C(String path, boolean isSingleThread) { + this.path = path; + this.isSingleThread = isSingleThread; + } @Override - public Id getId() { - return ID; + public PayloadId getPayloadId() { + return null; } + } diff --git a/src/main/java/yancey/openparticle/core/network/RunTickPayloadS2C.java b/src/main/java/yancey/openparticle/core/network/RunTickPayloadS2C.java index cf9aae8..cd3bffa 100644 --- a/src/main/java/yancey/openparticle/core/network/RunTickPayloadS2C.java +++ b/src/main/java/yancey/openparticle/core/network/RunTickPayloadS2C.java @@ -1,32 +1,38 @@ package yancey.openparticle.core.network; -import net.minecraft.network.RegistryByteBuf; -import net.minecraft.network.codec.PacketCodec; -import net.minecraft.network.packet.CustomPayload; -import net.minecraft.util.Identifier; +import net.minecraft.network.PacketByteBuf; +import yancey.openparticle.core.versions.PayloadBase; +import yancey.openparticle.core.versions.PayloadCodec; +import yancey.openparticle.core.versions.PayloadId; -import static yancey.openparticle.core.OpenParticle.MOD_ID; +public class RunTickPayloadS2C extends PayloadBase { -public record RunTickPayloadS2C(String path, int tick, boolean isSingleThread) implements CustomPayload { - - public static final CustomPayload.Id ID = new CustomPayload.Id<>(Identifier.of(MOD_ID, "run_tick")); - public static final PacketCodec CODEC = new PacketCodec<>() { + public static final PayloadId ID = new PayloadId("run_tick", new PayloadCodec() { @Override - public RunTickPayloadS2C decode(RegistryByteBuf buf) { + public RunTickPayloadS2C decode(PacketByteBuf buf) { return new RunTickPayloadS2C(buf.readString(), buf.readVarInt(), buf.readBoolean()); } @Override - public void encode(RegistryByteBuf buf, RunTickPayloadS2C value) { + public void encode(PacketByteBuf buf, RunTickPayloadS2C value) { buf.writeString(value.path); buf.writeVarInt(value.tick); buf.writeBoolean(value.isSingleThread); } - }; + }); + + public String path; + public int tick; + public boolean isSingleThread; + + public RunTickPayloadS2C(String path, int tick, boolean isSingleThread) { + this.path = path; + this.tick = tick; + this.isSingleThread = isSingleThread; + } @Override - public Id getId() { + public PayloadId getPayloadId() { return ID; } - } diff --git a/src/main/java/yancey/openparticle/core/versions/IdentifierUtil.java b/src/main/java/yancey/openparticle/core/versions/IdentifierUtil.java new file mode 100644 index 0000000..1ad8491 --- /dev/null +++ b/src/main/java/yancey/openparticle/core/versions/IdentifierUtil.java @@ -0,0 +1,15 @@ +package yancey.openparticle.core.versions; + +import net.minecraft.util.Identifier; + +public class IdentifierUtil { + + public static Identifier create(String namespace, String value) { + //#if MC>=11900 + return Identifier.of(namespace, value); + //#else + //$$ return new Identifier(namespace, value); + //#endif + } + +} diff --git a/src/main/java/yancey/openparticle/core/versions/PayloadBase.java b/src/main/java/yancey/openparticle/core/versions/PayloadBase.java new file mode 100644 index 0000000..8ad53bf --- /dev/null +++ b/src/main/java/yancey/openparticle/core/versions/PayloadBase.java @@ -0,0 +1,22 @@ +package yancey.openparticle.core.versions; + +//#if MC>=12005 +import net.minecraft.network.packet.CustomPayload; +//#endif + +public abstract class PayloadBase> + //#if MC>=12005 + implements CustomPayload + //#endif +{ + + public abstract PayloadId getPayloadId(); + + //#if MC>=12005 + @Override + public Id getId() { + return getPayloadId().getId(); + } + //#endif + +} diff --git a/src/main/java/yancey/openparticle/core/versions/PayloadCodec.java b/src/main/java/yancey/openparticle/core/versions/PayloadCodec.java new file mode 100644 index 0000000..4200bab --- /dev/null +++ b/src/main/java/yancey/openparticle/core/versions/PayloadCodec.java @@ -0,0 +1,21 @@ +package yancey.openparticle.core.versions; + +import net.minecraft.network.PacketByteBuf; + +//#if MC>=12005 +import net.minecraft.network.codec.PacketCodec; +//#endif + +public abstract class PayloadCodec + //#if MC>=12005 + implements PacketCodec + //#endif +{ + + //#if MC<12005 + //$$ public abstract T decode(PacketByteBuf buf); + //$$ + //$$ public abstract void encode(PacketByteBuf buf, T value); + //#endif + +} diff --git a/src/main/java/yancey/openparticle/core/versions/PayloadId.java b/src/main/java/yancey/openparticle/core/versions/PayloadId.java new file mode 100644 index 0000000..fde75c1 --- /dev/null +++ b/src/main/java/yancey/openparticle/core/versions/PayloadId.java @@ -0,0 +1,112 @@ +package yancey.openparticle.core.versions; + +import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; +import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.Identifier; + +//#if MC>=12005 +import net.minecraft.network.packet.CustomPayload; +//#else +//$$ import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; +//$$ import net.minecraft.network.PacketByteBuf; +//#endif + +import static yancey.openparticle.core.OpenParticle.MOD_ID; + +public class PayloadId> { + + //#if MC>=12005 + private final CustomPayload.Id id; + //#else + //$$ private final Identifier id; + //#endif + private final PayloadCodec codec; + + public PayloadId(String id, PayloadCodec codec) { + //#if MC>=12005 + this.id = new CustomPayload.Id<>(IdentifierUtil.create(MOD_ID, id)); + //#else + //$$ this.id = IdentifierUtil.create(MOD_ID, id); + //#endif + this.codec = codec; + } + + //#if MC>=12005 + public CustomPayload.Id getId() { + return id; + } + //#else + //$$ public Identifier getId() { + //$$ return id; + //$$ } + //#endif + + public PayloadCodec getCodec() { + return codec; + } + + public void registerServerGlobalReceiver(ServerPayloadHandler handler) { + //#if MC>=12006 + ServerPlayNetworking.registerGlobalReceiver(id, (payload, context) -> handler.receive(payload, context.server(), context.player())); + //#elseif MC>=12005 + //$$ ServerPlayNetworking.registerGlobalReceiver(id, (payload, context) -> handler.receive(payload, context.player().server, context.player())); + //#else + //$$ ServerPlayNetworking.registerGlobalReceiver(id, (server, player, handler0, buf, responseSender) -> handler.receive(codec.decode(buf), server, player)); + //#endif + } + + public void registerClientGlobalReceiver(ClientPayloadHandler handler) { + //#if MC>=12005 + ClientPlayNetworking.registerGlobalReceiver(id, (payload, context) -> handler.receive(payload, context.client(), context.player())); + //#else + //$$ ClientPlayNetworking.registerGlobalReceiver(id, (client, handler0, buf, responseSender) -> handler.receive(codec.decode(buf), client, client.player)); + //#endif + } + + public void sendToServer(T payload) { + //#if MC>=12005 + ClientPlayNetworking.send(payload); + //#else + //$$ PacketByteBuf buf = PacketByteBufs.create(); + //$$ codec.encode(buf, payload); + //$$ ClientPlayNetworking.send(id, buf); + //#endif + } + + public void sendToClient(ServerPlayerEntity player, T payload) { + //#if MC>=12005 + ServerPlayNetworking.send(player, payload); + //#else + //$$ PacketByteBuf buf = PacketByteBufs.create(); + //$$ codec.encode(buf, payload); + //$$ ServerPlayNetworking.send(player, id, buf); + //#endif + } + + public void sendToAllClient(MinecraftServer server, T payload) { + //#if MC>=12005 + for (ServerPlayerEntity player : server.getPlayerManager().getPlayerList()) { + ServerPlayNetworking.send(player, payload); + } + //#else + //$$ PacketByteBuf buf = PacketByteBufs.create(); + //$$ codec.encode(buf, payload); + //$$ for (ServerPlayerEntity player : server.getPlayerManager().getPlayerList()) { + //$$ ServerPlayNetworking.send(player, id, buf); + //$$ } + //#endif + } + + public interface ServerPayloadHandler { + void receive(T payload, MinecraftServer server, ServerPlayerEntity player); + } + + public interface ClientPayloadHandler { + void receive(T payload, MinecraftClient client, ClientPlayerEntity player); + } + +} diff --git a/src/main/java/yancey/openparticle/core/versions/TextUtil.java b/src/main/java/yancey/openparticle/core/versions/TextUtil.java new file mode 100644 index 0000000..270b14f --- /dev/null +++ b/src/main/java/yancey/openparticle/core/versions/TextUtil.java @@ -0,0 +1,29 @@ +package yancey.openparticle.core.versions; + +import net.minecraft.text.MutableText; + +//#if MC>=11900 +import net.minecraft.text.Text; +//#else +//$$ import net.minecraft.text.LiteralText; +//#endif + +public class TextUtil { + + public static MutableText empty() { + //#if MC>=11900 + return Text.empty(); + //#else + //$$ return new LiteralText(""); + //#endif + } + + public static MutableText literal(String string) { + //#if MC>=11900 + return Text.literal(string); + //#else + //$$ return new LiteralText(string); + //#endif + } + +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 5e7d539..85cdd92 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -6,7 +6,7 @@ "description": "", "authors": [], "contact": { - "repo": "myReposiOpenParticleory" + "repo": "https://github.com/Yancey2023/OpenParticle" }, "license": "GPL-3.0", "icon": "assets/openparticle/icon.png", @@ -25,6 +25,6 @@ "depends": { "fabricloader": "*", "fabric": "*", - "minecraft": "${minecraft_version}" + "minecraft": "1.21.1" } } diff --git a/src/main/resources/openparticle.mixins.json b/src/main/resources/openparticle.mixins.json index af22812..331b334 100644 --- a/src/main/resources/openparticle.mixins.json +++ b/src/main/resources/openparticle.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "yancey.openparticle.core.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_8", "client": [ "ParticleManagerAccessor", "ParticleManagerMixin" diff --git a/versions/1.16-fabric/gradle.properties b/versions/1.16-fabric/gradle.properties new file mode 100644 index 0000000..643d4dd --- /dev/null +++ b/versions/1.16-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.16+build.4:v2 \ No newline at end of file diff --git a/versions/1.16-fabric/src/main/resources/fabric.mod.json b/versions/1.16-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..78b0808 --- /dev/null +++ b/versions/1.16-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.16" + } +} diff --git a/versions/1.16.1-fabric/gradle.properties b/versions/1.16.1-fabric/gradle.properties new file mode 100644 index 0000000..de87089 --- /dev/null +++ b/versions/1.16.1-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.16.1+build.21:v2 \ No newline at end of file diff --git a/versions/1.16.1-fabric/src/main/resources/fabric.mod.json b/versions/1.16.1-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..21e7e8b --- /dev/null +++ b/versions/1.16.1-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.16.1" + } +} diff --git a/versions/1.16.2-fabric/gradle.properties b/versions/1.16.2-fabric/gradle.properties new file mode 100644 index 0000000..116b0ad --- /dev/null +++ b/versions/1.16.2-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.16.2+build.47:v2 \ No newline at end of file diff --git a/versions/1.16.2-fabric/src/main/resources/fabric.mod.json b/versions/1.16.2-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..18bba61 --- /dev/null +++ b/versions/1.16.2-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.16.2" + } +} diff --git a/versions/1.16.3-fabric/gradle.properties b/versions/1.16.3-fabric/gradle.properties new file mode 100644 index 0000000..45045ae --- /dev/null +++ b/versions/1.16.3-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.16.3+build.47:v2 \ No newline at end of file diff --git a/versions/1.16.3-fabric/src/main/resources/fabric.mod.json b/versions/1.16.3-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..0276e68 --- /dev/null +++ b/versions/1.16.3-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.16.3" + } +} diff --git a/versions/1.16.4-fabric/gradle.properties b/versions/1.16.4-fabric/gradle.properties new file mode 100644 index 0000000..a8e3ad2 --- /dev/null +++ b/versions/1.16.4-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.16.4+build.9:v2 \ No newline at end of file diff --git a/versions/1.16.4-fabric/src/main/resources/fabric.mod.json b/versions/1.16.4-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..d9d52c3 --- /dev/null +++ b/versions/1.16.4-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.16.4" + } +} diff --git a/versions/1.16.5-fabric/gradle.properties b/versions/1.16.5-fabric/gradle.properties new file mode 100644 index 0000000..0f576b4 --- /dev/null +++ b/versions/1.16.5-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.16.5+build.10:v2 \ No newline at end of file diff --git a/versions/1.16.5-fabric/src/main/resources/fabric.mod.json b/versions/1.16.5-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..0c2289d --- /dev/null +++ b/versions/1.16.5-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.16.5" + } +} diff --git a/versions/1.17-fabric/gradle.properties b/versions/1.17-fabric/gradle.properties new file mode 100644 index 0000000..fd86dd5 --- /dev/null +++ b/versions/1.17-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.17+build.13:v2 \ No newline at end of file diff --git a/versions/1.17-fabric/src/main/resources/fabric.mod.json b/versions/1.17-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..9717cb6 --- /dev/null +++ b/versions/1.17-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.17" + } +} diff --git a/versions/1.17.1-fabric/gradle.properties b/versions/1.17.1-fabric/gradle.properties new file mode 100644 index 0000000..b656782 --- /dev/null +++ b/versions/1.17.1-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.17.1+build.65:v2 \ No newline at end of file diff --git a/versions/1.17.1-fabric/src/main/resources/fabric.mod.json b/versions/1.17.1-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..c1f2178 --- /dev/null +++ b/versions/1.17.1-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.17.1" + } +} diff --git a/versions/1.18-fabric/gradle.properties b/versions/1.18-fabric/gradle.properties new file mode 100644 index 0000000..2a9830e --- /dev/null +++ b/versions/1.18-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.18+build.1:v2 \ No newline at end of file diff --git a/versions/1.18-fabric/src/main/resources/fabric.mod.json b/versions/1.18-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..843bac5 --- /dev/null +++ b/versions/1.18-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.18" + } +} diff --git a/versions/1.18.1-fabric/gradle.properties b/versions/1.18.1-fabric/gradle.properties new file mode 100644 index 0000000..615dd1c --- /dev/null +++ b/versions/1.18.1-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.18.1+build.22:v2 \ No newline at end of file diff --git a/versions/1.18.1-fabric/src/main/resources/fabric.mod.json b/versions/1.18.1-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..418f39d --- /dev/null +++ b/versions/1.18.1-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.18.1" + } +} diff --git a/versions/1.18.2-fabric/gradle.properties b/versions/1.18.2-fabric/gradle.properties new file mode 100644 index 0000000..fd7756d --- /dev/null +++ b/versions/1.18.2-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.18.2+build.4:v2 \ No newline at end of file diff --git a/versions/1.18.2-fabric/src/main/resources/fabric.mod.json b/versions/1.18.2-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..527b5b3 --- /dev/null +++ b/versions/1.18.2-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.18.2" + } +} diff --git a/versions/1.19-fabric/gradle.properties b/versions/1.19-fabric/gradle.properties new file mode 100644 index 0000000..7dcc307 --- /dev/null +++ b/versions/1.19-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.19+build.4:v2 \ No newline at end of file diff --git a/versions/1.19-fabric/src/main/resources/fabric.mod.json b/versions/1.19-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..449f1b9 --- /dev/null +++ b/versions/1.19-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.19" + } +} diff --git a/versions/1.19.1-fabric/gradle.properties b/versions/1.19.1-fabric/gradle.properties new file mode 100644 index 0000000..f6e3b05 --- /dev/null +++ b/versions/1.19.1-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.19.1+build.6:v2 \ No newline at end of file diff --git a/versions/1.19.1-fabric/src/main/resources/fabric.mod.json b/versions/1.19.1-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..20b7842 --- /dev/null +++ b/versions/1.19.1-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.19.1" + } +} diff --git a/versions/1.19.2-fabric/gradle.properties b/versions/1.19.2-fabric/gradle.properties new file mode 100644 index 0000000..6ddd247 --- /dev/null +++ b/versions/1.19.2-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.19.2+build.28:v2 \ No newline at end of file diff --git a/versions/1.19.2-fabric/src/main/resources/fabric.mod.json b/versions/1.19.2-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..b376aa7 --- /dev/null +++ b/versions/1.19.2-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.19.2" + } +} diff --git a/versions/1.19.3-fabric/gradle.properties b/versions/1.19.3-fabric/gradle.properties new file mode 100644 index 0000000..f49aa8b --- /dev/null +++ b/versions/1.19.3-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.19.3+build.5:v2 \ No newline at end of file diff --git a/versions/1.19.3-fabric/src/main/resources/fabric.mod.json b/versions/1.19.3-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..4e84be0 --- /dev/null +++ b/versions/1.19.3-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.19.3" + } +} diff --git a/versions/1.19.4-fabric/gradle.properties b/versions/1.19.4-fabric/gradle.properties new file mode 100644 index 0000000..b2432c6 --- /dev/null +++ b/versions/1.19.4-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.19.4+build.2:v2 \ No newline at end of file diff --git a/versions/1.19.4-fabric/src/main/resources/fabric.mod.json b/versions/1.19.4-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..20dadc1 --- /dev/null +++ b/versions/1.19.4-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.19.4" + } +} diff --git a/versions/1.20-fabric/gradle.properties b/versions/1.20-fabric/gradle.properties new file mode 100644 index 0000000..7a48edb --- /dev/null +++ b/versions/1.20-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.20+build.1:v2 \ No newline at end of file diff --git a/versions/1.20-fabric/src/main/resources/fabric.mod.json b/versions/1.20-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..26ab9c8 --- /dev/null +++ b/versions/1.20-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.20" + } +} diff --git a/versions/1.20.1-fabric/gradle.properties b/versions/1.20.1-fabric/gradle.properties new file mode 100644 index 0000000..b9b1810 --- /dev/null +++ b/versions/1.20.1-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.20.1+build.10:v2 \ No newline at end of file diff --git a/versions/1.20.1-fabric/src/main/resources/fabric.mod.json b/versions/1.20.1-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..e7344e0 --- /dev/null +++ b/versions/1.20.1-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.20.1" + } +} diff --git a/versions/1.20.2-fabric/gradle.properties b/versions/1.20.2-fabric/gradle.properties new file mode 100644 index 0000000..c60092a --- /dev/null +++ b/versions/1.20.2-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.20.2+build.4:v2 \ No newline at end of file diff --git a/versions/1.20.2-fabric/src/main/resources/fabric.mod.json b/versions/1.20.2-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..15c8cbc --- /dev/null +++ b/versions/1.20.2-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.20.2" + } +} diff --git a/versions/1.20.3-fabric/gradle.properties b/versions/1.20.3-fabric/gradle.properties new file mode 100644 index 0000000..362b1d0 --- /dev/null +++ b/versions/1.20.3-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.20.3+build.1:v2 \ No newline at end of file diff --git a/versions/1.20.3-fabric/src/main/resources/fabric.mod.json b/versions/1.20.3-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..2abfdea --- /dev/null +++ b/versions/1.20.3-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.20.3" + } +} diff --git a/versions/1.20.4-fabric/gradle.properties b/versions/1.20.4-fabric/gradle.properties new file mode 100644 index 0000000..d462864 --- /dev/null +++ b/versions/1.20.4-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.20.4+build.3:v2 \ No newline at end of file diff --git a/versions/1.20.4-fabric/src/main/resources/fabric.mod.json b/versions/1.20.4-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..b3da3c4 --- /dev/null +++ b/versions/1.20.4-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.20.4" + } +} diff --git a/versions/1.20.5-fabric/gradle.properties b/versions/1.20.5-fabric/gradle.properties new file mode 100644 index 0000000..10d5eb6 --- /dev/null +++ b/versions/1.20.5-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.20.5+build.1:v2 \ No newline at end of file diff --git a/versions/1.20.5-fabric/src/main/resources/fabric.mod.json b/versions/1.20.5-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..4fc75b0 --- /dev/null +++ b/versions/1.20.5-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.20.5" + } +} diff --git a/versions/1.20.6-fabric/gradle.properties b/versions/1.20.6-fabric/gradle.properties new file mode 100644 index 0000000..7800017 --- /dev/null +++ b/versions/1.20.6-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.20.6+build.3:v2 \ No newline at end of file diff --git a/versions/1.20.6-fabric/src/main/resources/fabric.mod.json b/versions/1.20.6-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..bbabf19 --- /dev/null +++ b/versions/1.20.6-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.20.6" + } +} diff --git a/versions/1.21-fabric/gradle.properties b/versions/1.21-fabric/gradle.properties new file mode 100644 index 0000000..f4f90f4 --- /dev/null +++ b/versions/1.21-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.21+build.9:v2 \ No newline at end of file diff --git a/versions/1.21-fabric/src/main/resources/fabric.mod.json b/versions/1.21-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..b222ec1 --- /dev/null +++ b/versions/1.21-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.21" + } +} diff --git a/versions/1.21.1-fabric/gradle.properties b/versions/1.21.1-fabric/gradle.properties new file mode 100644 index 0000000..44678fb --- /dev/null +++ b/versions/1.21.1-fabric/gradle.properties @@ -0,0 +1 @@ +essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.1+build.3:v2 \ No newline at end of file diff --git a/versions/1.21.1-fabric/src/main/resources/fabric.mod.json b/versions/1.21.1-fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..85cdd92 --- /dev/null +++ b/versions/1.21.1-fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,30 @@ +{ + "schemaVersion": 1, + "id": "openparticle", + "version": "${version}", + "name": "OpenParticle", + "description": "", + "authors": [], + "contact": { + "repo": "https://github.com/Yancey2023/OpenParticle" + }, + "license": "GPL-3.0", + "icon": "assets/openparticle/icon.png", + "environment": "*", + "entrypoints": { + "client": [ + "yancey.openparticle.core.client.OpenParticleClient" + ], + "main": [ + "yancey.openparticle.core.OpenParticle" + ] + }, + "mixins": [ + "openparticle.mixins.json" + ], + "depends": { + "fabricloader": "*", + "fabric": "*", + "minecraft": "1.21.1" + } +} diff --git a/versions/mainProject b/versions/mainProject new file mode 100644 index 0000000..3eadd8b --- /dev/null +++ b/versions/mainProject @@ -0,0 +1 @@ +1.21.1-fabric \ No newline at end of file diff --git a/versions/mapping-1.18.2-1.18.1.txt b/versions/mapping-1.18.2-1.18.1.txt new file mode 100644 index 0000000..742df4a --- /dev/null +++ b/versions/mapping-1.18.2-1.18.1.txt @@ -0,0 +1,2 @@ +com.mojang.logging.LogUtils org.apache.logging.log4j.LogManager +org.slf4j.Logger org.apache.logging.log4j.Logger \ No newline at end of file