Replace VanillaGradle use and update generated API

This commit is contained in:
Jason Penilla 2024-04-25 18:40:50 -07:00
parent 48c586ab9c
commit 2432de7be3
11 changed files with 49 additions and 31 deletions

View file

@ -28,10 +28,6 @@ allprojects {
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
tasks.remapSpigotSources {
sourceCompatibility = 21 // TODO change default in paperweight
}
subprojects { subprojects {
tasks.withType<JavaCompile> { tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name() options.encoding = Charsets.UTF_8.name()

View file

@ -1,29 +1,28 @@
import org.spongepowered.gradle.vanilla.repository.MinecraftPlatform import io.papermc.paperweight.PaperweightSourceGeneratorHelper
import io.papermc.paperweight.extension.PaperweightSourceGeneratorExt
plugins { plugins {
java java
id("org.spongepowered.gradle.vanilla") version "0.2.1-SNAPSHOT"
} }
minecraft { plugins.apply(PaperweightSourceGeneratorHelper::class)
version(property("mcVersion").toString())
platform(MinecraftPlatform.SERVER)
runs { extensions.configure(PaperweightSourceGeneratorExt::class) {
server("generate") { atFile.set(projectDir.toPath().resolve("wideners.at").toFile())
mainClass("io.papermc.generator.Main")
accessWideners(projectDir.toPath().resolve("wideners.at"))
args(projectDir.toPath().resolve("generated").toString())
}
}
} }
dependencies { dependencies {
implementation("com.squareup:javapoet:1.13.0") implementation("com.squareup:javapoet:1.13.0")
implementation(project(":paper-api")) implementation(project(":paper-api"))
implementation("io.github.classgraph:classgraph:4.8.47") implementation("io.github.classgraph:classgraph:4.8.47")
implementation("org.jetbrains:annotations:24.0.1")
}
tasks.register<JavaExec>("generate") {
mainClass.set("io.papermc.generator.Main")
classpath(sourceSets.main.map { it.runtimeClasspath })
args(projectDir.toPath().resolve("generated").toString())
} }
group = "io.papermc.paper" group = "io.papermc.paper"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"

View file

@ -70,7 +70,7 @@ import org.jetbrains.annotations.NotNull;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.20.4") @GeneratedFrom("1.20.5")
public interface VanillaGoal<T extends Mob> extends Goal<T> { public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class); GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);

View file

@ -6,6 +6,7 @@ import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -23,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.20.4") @GeneratedFrom("1.20.5")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class BiomeKeys { public final class BiomeKeys {
/** /**
@ -248,6 +249,8 @@ public final class BiomeKeys {
* *
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental
@MinecraftExperimental("update 1.21")
public static final TypedKey<Biome> MANGROVE_SWAMP = create(key("mangrove_swamp")); public static final TypedKey<Biome> MANGROVE_SWAMP = create(key("mangrove_swamp"));
/** /**
@ -402,6 +405,8 @@ public final class BiomeKeys {
* *
* @apiNote This field is version-dependant and may be removed in future Minecraft versions * @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/ */
@ApiStatus.Experimental
@MinecraftExperimental("update 1.21")
public static final TypedKey<Biome> SWAMP = create(key("swamp")); public static final TypedKey<Biome> SWAMP = create(key("swamp"));
/** /**

View file

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.20.4") @GeneratedFrom("1.20.5")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class GameEventKeys { public final class GameEventKeys {
/** /**

View file

@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.20.4") @GeneratedFrom("1.20.5")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class StructureKeys { public final class StructureKeys {
/** /**

View file

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.20.4") @GeneratedFrom("1.20.5")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class StructureTypeKeys { public final class StructureTypeKeys {
/** /**

View file

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.20.4") @GeneratedFrom("1.20.5")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class TrimMaterialKeys { public final class TrimMaterialKeys {
/** /**

View file

@ -6,6 +6,7 @@ import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey; import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import org.bukkit.MinecraftExperimental;
import org.bukkit.inventory.meta.trim.TrimPattern; import org.bukkit.inventory.meta.trim.TrimPattern;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -23,9 +24,18 @@ import org.jetbrains.annotations.NotNull;
"unused", "unused",
"SpellCheckingInspection" "SpellCheckingInspection"
}) })
@GeneratedFrom("1.20.4") @GeneratedFrom("1.20.5")
@ApiStatus.Experimental @ApiStatus.Experimental
public final class TrimPatternKeys { public final class TrimPatternKeys {
/**
* {@code minecraft:bolt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental("update 1.21")
public static final TypedKey<TrimPattern> BOLT = create(key("bolt"));
/** /**
* {@code minecraft:coast} * {@code minecraft:coast}
* *
@ -47,6 +57,15 @@ public final class TrimPatternKeys {
*/ */
public static final TypedKey<TrimPattern> EYE = create(key("eye")); public static final TypedKey<TrimPattern> EYE = create(key("eye"));
/**
* {@code minecraft:flow}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental("update 1.21")
public static final TypedKey<TrimPattern> FLOW = create(key("flow"));
/** /**
* {@code minecraft:host} * {@code minecraft:host}
* *

View file

@ -6,14 +6,14 @@ import java.util.List;
import net.minecraft.core.Holder; import net.minecraft.core.Holder;
import net.minecraft.core.HolderGetter; import net.minecraft.core.HolderGetter;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.data.worldgen.BootstapContext; import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier; import org.checkerframework.framework.qual.DefaultQualifier;
@DefaultQualifier(NonNull.class) @DefaultQualifier(NonNull.class)
public record CollectingContext<T>(List<ResourceKey<T>> registered, public record CollectingContext<T>(List<ResourceKey<T>> registered,
Registry<T> registry) implements BootstapContext<T> { Registry<T> registry) implements BootstrapContext<T> {
@Override @Override
public Holder.Reference<T> register(final ResourceKey<T> resourceKey, final @NonNull T t, final Lifecycle lifecycle) { public Holder.Reference<T> register(final ResourceKey<T> resourceKey, final @NonNull T t, final Lifecycle lifecycle) {

View file

@ -1,7 +1,6 @@
accessWidener v1 named public net/minecraft/server/WorldLoader loadAndReplaceLayer(Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/server/RegistryLayer;Ljava/util/List;)Lnet/minecraft/core/LayeredRegistryAccess;
accessible method net/minecraft/server/WorldLoader loadAndReplaceLayer (Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/server/RegistryLayer;Ljava/util/List;)Lnet/minecraft/core/LayeredRegistryAccess;
# for auto-marking experimental stuff # for auto-marking experimental stuff
accessible field net/minecraft/core/RegistrySetBuilder entries Ljava/util/List; public net/minecraft/core/RegistrySetBuilder entries
accessible class net/minecraft/core/RegistrySetBuilder$RegistryStub public net/minecraft/core/RegistrySetBuilder$RegistryStub
accessible field net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER Lnet/minecraft/core/RegistrySetBuilder; public net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER