-
-
Notifications
You must be signed in to change notification settings - Fork 822
Feature: 26.1, API 2.10.0 #6271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 46 commits
5f9fbe3
58c6603
4d09ef6
09c7cdd
95a2a7b
effb253
fe1a9f9
5dfd49d
3a72865
ee5f111
3b0c9c7
6706c63
f6716f8
7d5d912
dbc4142
1f5329e
7ae010d
e46f28c
082ba3a
df97c0d
f5c539c
9ef0cb8
722abe6
436a9b8
1d96860
3e41ca6
398401f
65fe71c
42488f1
ccafa76
248b60f
61fce61
ff522d0
4c163b8
0b12ed2
b41177d
1827f52
cc7ffe9
c8091af
8455403
80eb8bd
dfb4838
cb97672
2385729
07a5757
b7847c5
0a22e8e
7f8dff2
5e3089c
f4021dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -19,10 +19,10 @@ loom { | |||||
| } | ||||||
|
|
||||||
| dependencies { | ||||||
| modImplementation(libs.fabric.loader) | ||||||
| modApi(libs.fabric.api) | ||||||
| implementation(libs.fabric.loader) | ||||||
| api(libs.fabric.api) | ||||||
|
|
||||||
| api(project(":mod", configuration = "namedElements")) | ||||||
| api(project(":mod")) | ||||||
| shadowBundle(project(path = ":mod", configuration = "transformProductionFabric")) | ||||||
| shadowBundle(projects.core) | ||||||
| includeTransitive(projects.core) | ||||||
|
|
@@ -47,7 +47,7 @@ dependencies { | |||||
| shadowBundle(projects.api) | ||||||
| shadowBundle(projects.common) | ||||||
|
|
||||||
| modImplementation(libs.cloud.fabric) | ||||||
| implementation(libs.cloud.fabric) | ||||||
| include(libs.cloud.fabric) | ||||||
| include(libs.fabric.permissions.api) | ||||||
| } | ||||||
|
|
@@ -60,23 +60,48 @@ relocate("org.cloudburstmc.netty") | |||||
| relocate("org.cloudburstmc.protocol") | ||||||
| relocate("org.spongepowered.configurate") | ||||||
|
|
||||||
| tasks { | ||||||
| remapJar { | ||||||
| archiveBaseName.set("Geyser-Fabric") | ||||||
| fabricApi { | ||||||
| configureTests { | ||||||
| createSourceSet = true | ||||||
| modId = "geyser-gametest" | ||||||
| enableClientGameTests = false | ||||||
| eula = true | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| remapModrinthJar { | ||||||
| archiveBaseName.set("geyser-fabric") | ||||||
| tasks { | ||||||
| named<Jar>("mergeShadowAndJarJar") { | ||||||
| from ( | ||||||
| zipTree( shadowJar.map { it.outputs.files.singleFile } ).matching { | ||||||
| exclude("fabric.mod.json") | ||||||
| exclude("LICENSE") | ||||||
| }, | ||||||
| zipTree( jar.map { it.outputs.files.singleFile } ).matching { | ||||||
| include("META-INF/jars/**") | ||||||
| include("fabric.mod.json") | ||||||
| include("LICENSE") | ||||||
| } | ||||||
| ) | ||||||
| archiveBaseName.set("Geyser-Fabric") | ||||||
| } | ||||||
|
|
||||||
| shadowJar { | ||||||
| mergeServiceFiles() | ||||||
| getByName("processGametestResources", ProcessResources::class) { | ||||||
| filesMatching("fabric.mod.json") { | ||||||
| expand( | ||||||
| "id" to "geyser", | ||||||
| "name" to "Geyser", | ||||||
| "version" to project.version, | ||||||
| "description" to project.description!!, | ||||||
| "url" to "https://geysermc.org", | ||||||
| "author" to "GeyserMC" | ||||||
| ) | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| modrinth { | ||||||
| loaders.add("fabric") | ||||||
| uploadFile.set(tasks.getByPath("remapModrinthJar")) | ||||||
| uploadFile.set(tasks.getByName("renameModrinthJar")) | ||||||
|
||||||
| uploadFile.set(tasks.getByName("renameModrinthJar")) | |
| uploadFile.set(tasks.named<Jar>("mergeShadowAndJarJar")) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| loom.platform=fabric | ||
| loom.platform=fabric |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| /* | ||
| * Copyright (c) 2026 GeyserMC. http://geysermc.org | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| * | ||
| * @author GeyserMC | ||
| * @link https://github.com/GeyserMC/Geyser | ||
| */ | ||
|
|
||
| package org.geysermc.geyser.gametest; | ||
|
|
||
| import com.mojang.serialization.DataResult; | ||
| import com.mojang.serialization.DynamicOps; | ||
| import com.mojang.serialization.MapCodec; | ||
| import com.mojang.serialization.MapLike; | ||
| import com.mojang.serialization.RecordBuilder; | ||
| import net.minecraft.core.Holder; | ||
| import net.minecraft.core.registries.Registries; | ||
| import net.minecraft.gametest.framework.GameTestEnvironments; | ||
| import net.minecraft.gametest.framework.TestData; | ||
| import net.minecraft.gametest.framework.TestEnvironmentDefinition; | ||
| import net.minecraft.resources.Identifier; | ||
| import net.minecraft.resources.RegistryOps; | ||
|
|
||
| import java.util.stream.Stream; | ||
|
|
||
| public class GameTestUtil { | ||
| // Cursed codec to extract a RegistryOps | ||
| public static final MapCodec<RegistryOps<?>> REGISTRY_OPS_MAP_CODEC = new MapCodec<>() { | ||
| @Override | ||
| public <T> Stream<T> keys(DynamicOps<T> ops) { | ||
| return Stream.empty(); | ||
| } | ||
|
|
||
| @Override | ||
| public <T> DataResult<RegistryOps<?>> decode(DynamicOps<T> ops, MapLike<T> input) { | ||
| if (ops instanceof RegistryOps<T> registryOps) { | ||
| return DataResult.success(registryOps); | ||
| } | ||
| return DataResult.error(() -> "Registry ops required for parsing"); | ||
| } | ||
|
|
||
| @Override | ||
| public <T> RecordBuilder<T> encode(RegistryOps<?> input, DynamicOps<T> ops, RecordBuilder<T> prefix) { | ||
| // noop | ||
| return prefix; | ||
| } | ||
| }; | ||
|
|
||
| public static TestData<Holder<TestEnvironmentDefinition<?>>> createEmptyTestData(RegistryOps<?> ops, boolean required) { | ||
| return new TestData<>(ops.getter(Registries.TEST_ENVIRONMENT) | ||
| .flatMap(getter -> getter.get(GameTestEnvironments.DEFAULT_KEY)).orElseThrow(), | ||
| Identifier.withDefaultNamespace("empty"), 1, 1, required); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Copyright (c) 2025 GeyserMC. http://geysermc.org | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| * | ||
| * @author GeyserMC | ||
| * @link https://github.com/GeyserMC/Geyser | ||
| */ | ||
|
|
||
| package org.geysermc.geyser.gametest; | ||
|
|
||
| import net.fabricmc.api.ModInitializer; | ||
|
|
||
| public class GeyserGameTestBootstrap implements ModInitializer { | ||
|
|
||
| @Override | ||
| public void onInitialize() { | ||
| GeyserGameTests.bootstrap(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* | ||
| * Copyright (c) 2025 GeyserMC. http://geysermc.org | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| * | ||
| * @author GeyserMC | ||
| * @link https://github.com/GeyserMC/Geyser | ||
| */ | ||
|
|
||
| package org.geysermc.geyser.gametest; | ||
|
|
||
| import com.mojang.serialization.MapCodec; | ||
| import net.minecraft.core.Registry; | ||
| import net.minecraft.core.registries.BuiltInRegistries; | ||
| import net.minecraft.gametest.framework.GameTestInstance; | ||
| import net.minecraft.resources.Identifier; | ||
| import org.geysermc.geyser.gametest.tests.ComponentHashTestInstance; | ||
| import org.geysermc.geyser.gametest.tests.RequiredComponentsForHashingTestInstance; | ||
|
|
||
| public class GeyserGameTests { | ||
|
|
||
| private static Identifier createKey(String name) { | ||
| return Identifier.fromNamespaceAndPath("geyser", name); | ||
| } | ||
|
|
||
| private static void register(String name, MapCodec<? extends GameTestInstance> codec) { | ||
| Registry.register(BuiltInRegistries.TEST_INSTANCE_TYPE, createKey(name), codec); | ||
| } | ||
|
|
||
| public static void bootstrap() { | ||
| register("component_hash", ComponentHashTestInstance.MAP_CODEC); | ||
| register("required_components_for_hashing", RequiredComponentsForHashingTestInstance.MAP_CODEC); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| * Copyright (c) 2026 GeyserMC. http://geysermc.org | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| * | ||
| * @author GeyserMC | ||
| * @link https://github.com/GeyserMC/Geyser | ||
| */ | ||
| @NullMarked | ||
| package org.geysermc.geyser.gametest; | ||
|
|
||
| import org.jspecify.annotations.NullMarked; |
Uh oh!
There was an error while loading. Please reload this page.