update generator

Couple of changes coming from the other branch/PRs:
- add support for defining registry constants out
of their value class (already required by at least 4 PRs).
- remove version hint in the generated annotation (to avoid noise during updates)
- basic support for parameterized types in API
- tweaks bootstrap to allow usage of dimension registries
This commit is contained in:
Lulu13022002 2025-09-18 16:51:09 +02:00
parent b6d955746f
commit 388e6936ea
No known key found for this signature in database
GPG key ID: 491C8F0B8ACDEB01
310 changed files with 584 additions and 915 deletions

View file

@ -241,15 +241,3 @@ val scanJarForBadCalls by tasks.registering(io.papermc.paperweight.tasks.ScanJar
tasks.check {
dependsOn(scanJarForBadCalls)
}
if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) {
val scanJarForOldGeneratedCode by tasks.registering(io.papermc.paperweight.tasks.ScanJarForOldGeneratedCode::class) {
mcVersion.set(providers.gradleProperty("mcVersion"))
annotation.set("Lio/papermc/paper/generated/GeneratedFrom;")
jarToScan.set(tasks.jar.flatMap { it.archiveFile })
classpath.from(configurations.compileClasspath)
}
tasks.check {
dependsOn(scanJarForOldGeneratedCode)
}
}

View file

@ -1,8 +1,8 @@
package com.destroystokyo.paper.entity.ai;
import com.destroystokyo.paper.entity.RangedEntity;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.entity.SchoolableFish;
import io.papermc.paper.generated.GeneratedFrom;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.AbstractHorse;
import org.bukkit.entity.AbstractSkeleton;
@ -68,7 +68,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> HORSE_RANDOM_STAND = create("horse_random_stand", AbstractHorse.class);

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class AttributeKeys {
/**
* {@code minecraft:armor}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class BannerPatternKeys {
/**
* {@code minecraft:base}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class BiomeKeys {
/**
* {@code minecraft:badlands}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class BlockTypeKeys {
/**
* {@code minecraft:acacia_button}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class CatVariantKeys {
/**
* {@code minecraft:all_black}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class ChickenVariantKeys {
/**
* {@code minecraft:cold}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class CowVariantKeys {
/**
* {@code minecraft:cold}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class DamageTypeKeys {
/**
* {@code minecraft:arrow}

View file

@ -2,8 +2,8 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.datacomponent.DataComponentType;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class DataComponentTypeKeys {
/**
* {@code minecraft:attribute_modifiers}

View file

@ -2,8 +2,8 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.dialog.Dialog;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class DialogKeys {
/**
* {@code minecraft:custom_options}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class EnchantmentKeys {
/**
* {@code minecraft:aqua_affinity}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class FluidKeys {
/**
* {@code minecraft:empty}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class FrogVariantKeys {
/**
* {@code minecraft:cold}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class GameEventKeys {
/**
* {@code minecraft:block_activate}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class InstrumentKeys {
/**
* {@code minecraft:admire_goat_horn}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class ItemTypeKeys {
/**
* {@code minecraft:acacia_boat}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class JukeboxSongKeys {
/**
* {@code minecraft:11}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class MapDecorationTypeKeys {
/**
* {@code minecraft:banner_black}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class MenuTypeKeys {
/**
* {@code minecraft:anvil}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class MobEffectKeys {
/**
* {@code minecraft:absorption}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class PaintingVariantKeys {
/**
* {@code minecraft:alban}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class PigVariantKeys {
/**
* {@code minecraft:cold}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class SoundEventKeys {
/**
* {@code minecraft:ambient.basalt_deltas.additions}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class StructureKeys {
/**
* {@code minecraft:ancient_city}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class StructureTypeKeys {
/**
* {@code minecraft:buried_treasure}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class TrimMaterialKeys {
/**
* {@code minecraft:amethyst}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class TrimPatternKeys {
/**
* {@code minecraft:bolt}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class VillagerProfessionKeys {
/**
* {@code minecraft:armorer}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class VillagerTypeKeys {
/**
* {@code minecraft:desert}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class WolfSoundVariantKeys {
/**
* {@code minecraft:angry}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class WolfVariantKeys {
/**
* {@code minecraft:ashen}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class BannerPatternTagKeys {
/**
* {@code #minecraft:no_item_required}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class BiomeTagKeys {
/**
* {@code #minecraft:allows_surface_slime_spawns}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class BlockTypeTagKeys {
/**
* {@code #minecraft:acacia_logs}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class DamageTypeTagKeys {
/**
* {@code #minecraft:always_hurts_ender_dragons}

View file

@ -2,8 +2,8 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.dialog.Dialog;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class DialogTagKeys {
/**
* {@code #minecraft:pause_screen_additions}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -25,7 +25,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class EnchantmentTagKeys {
/**
* {@code #minecraft:curse}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class EntityTypeTagKeys {
/**
* {@code #minecraft:accepts_iron_golem_gift}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class FluidTagKeys {
/**
* {@code #minecraft:lava}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class GameEventTagKeys {
/**
* {@code #minecraft:allay_can_listen}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class InstrumentTagKeys {
/**
* {@code #minecraft:goat_horns}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class ItemTypeTagKeys {
/**
* {@code #minecraft:acacia_logs}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class PaintingVariantTagKeys {
/**
* {@code #minecraft:placeable}

View file

@ -2,7 +2,7 @@ package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.9-pre1")
@GeneratedClass
public final class StructureTagKeys {
/**
* {@code #minecraft:cats_spawn_as_black}

View file

@ -1,4 +1,4 @@
package io.papermc.paper.generated;
package io.papermc.paper.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@ -8,14 +8,12 @@ import java.lang.annotation.Target;
import org.jetbrains.annotations.ApiStatus;
/**
* Used to mark classes which are generated from
* a specific version of minecraft.
* Used to mark classes which are generated.
* Any manual changes will be overwritten.
*/
@ApiStatus.Internal
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface GeneratedFrom {
String value();
public @interface GeneratedClass {
}

View file

@ -8,7 +8,6 @@ import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Experimental
public enum ItemUseAnimation {
// Start generate - ItemUseAnimation
// @GeneratedFrom 1.21.9-pre1
NONE,
EAT,
DRINK,

View file

@ -33,7 +33,6 @@ public interface Dialog extends Keyed, DialogLike {
}
// Start generate - Dialog
// @GeneratedFrom 1.21.9-pre1
Dialog CUSTOM_OPTIONS = getDialog("custom_options");
Dialog QUICK_ACTIONS = getDialog("quick_actions");

View file

@ -39,7 +39,6 @@ import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create;
public final class RegistryEvents {
// Start generate - RegistryEvents
// @GeneratedFrom 1.21.9-pre1
public static final RegistryEventProvider<GameEvent, GameEventRegistryEntry.Builder> GAME_EVENT = create(RegistryKey.GAME_EVENT);
public static final RegistryEventProvider<DamageType, DamageTypeRegistryEntry.Builder> DAMAGE_TYPE = create(RegistryKey.DAMAGE_TYPE);
public static final RegistryEventProvider<Wolf.Variant, WolfVariantRegistryEntry.Builder> WOLF_VARIANT = create(RegistryKey.WOLF_VARIANT);

View file

@ -25,7 +25,6 @@ import org.jetbrains.annotations.Nullable;
public interface Art extends OldEnum<Art>, Keyed {
// Start generate - Art
// @GeneratedFrom 1.21.9-pre1
Art ALBAN = getArt("alban");
Art AZTEC = getArt("aztec");

View file

@ -13,7 +13,6 @@ import org.jetbrains.annotations.ApiStatus;
public interface FeatureFlag extends Keyed {
// Start generate - FeatureFlag
// @GeneratedFrom 1.21.9-pre1
@ApiStatus.Experimental
FeatureFlag MINECART_IMPROVEMENTS = create("minecart_improvements");

View file

@ -13,7 +13,6 @@ import org.jetbrains.annotations.NotNull;
public interface Fluid extends OldEnum<Fluid>, Keyed {
// Start generate - Fluid
// @GeneratedFrom 1.21.9-pre1
Fluid EMPTY = getFluid("empty");
Fluid FLOWING_LAVA = getFluid("flowing_lava");

View file

@ -12,7 +12,6 @@ import org.jetbrains.annotations.Nullable;
public abstract class GameEvent implements Keyed {
// Start generate - GameEvent
// @GeneratedFrom 1.21.9-pre1
public static final GameEvent BLOCK_ACTIVATE = getEvent("block_activate");
public static final GameEvent BLOCK_ATTACH = getEvent("block_attach");

View file

@ -11,7 +11,6 @@ import org.jspecify.annotations.NullMarked;
public interface JukeboxSong extends Keyed, Translatable {
// Start generate - JukeboxSong
// @GeneratedFrom 1.21.9-pre1
JukeboxSong ELEVEN = get("11");
JukeboxSong THIRTEEN = get("13");

View file

@ -147,7 +147,6 @@ import org.jetbrains.annotations.Nullable;
public enum Material implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper
//<editor-fold desc="Materials" defaultstate="collapsed">
// Start generate - Items
// @GeneratedFrom 1.21.9-pre1
ACACIA_BOAT(-1, 1),
ACACIA_CHEST_BOAT(-1, 1),
AIR(-1),
@ -626,7 +625,6 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
ZOMBIFIED_PIGLIN_SPAWN_EGG(-1),
// End generate - Items
// Start generate - Blocks
// @GeneratedFrom 1.21.9-pre1
ACACIA_BUTTON(-1, Switch.class),
ACACIA_DOOR(-1, Door.class),
ACACIA_FENCE(-1, Fence.class),

View file

@ -29,7 +29,6 @@ public abstract class MusicInstrument implements Keyed, net.kyori.adventure.tran
}
// Start generate - MusicInstrument
// @GeneratedFrom 1.21.9-pre1
public static final MusicInstrument ADMIRE_GOAT_HORN = getInstrument("admire_goat_horn");
public static final MusicInstrument CALL_GOAT_HORN = getInstrument("call_goat_horn");

View file

@ -23,7 +23,6 @@ import org.jetbrains.annotations.NotNull;
public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.Sound.Type { // Paper - implement Sound.Type
// Start generate - Sound
// @GeneratedFrom 1.21.9-pre1
Sound AMBIENT_BASALT_DELTAS_ADDITIONS = getSound("ambient.basalt_deltas.additions");
Sound AMBIENT_BASALT_DELTAS_LOOP = getSound("ambient.basalt_deltas.loop");

View file

@ -10,7 +10,6 @@ import org.jspecify.annotations.NullMarked;
public enum SoundCategory implements Sound.Source.Provider {
// Start generate - SoundCategory
// @GeneratedFrom 1.21.9-pre1
MASTER,
MUSIC,
RECORDS,

View file

@ -8,7 +8,6 @@ import org.jetbrains.annotations.NotNull;
*/
public enum Statistic implements Keyed {
// Start generate - StatisticCustom
// @GeneratedFrom 1.21.9-pre1
ANIMALS_BRED,
AVIATE_ONE_CM,
BELL_RING,
@ -87,7 +86,6 @@ public enum Statistic implements Keyed {
WALK_UNDER_WATER_ONE_CM,
// End generate - StatisticCustom
// Start generate - StatisticType
// @GeneratedFrom 1.21.9-pre1
BREAK_ITEM(Type.ITEM),
CRAFT_ITEM(Type.ITEM),
DROP(Type.ITEM),

View file

@ -20,7 +20,6 @@ import org.jetbrains.annotations.NotNull;
public interface Tag<T extends Keyed> extends Keyed {
// Start generate - Tag
// @GeneratedFrom 1.21.9-pre1
String REGISTRY_BLOCKS = "blocks";
Tag<Material> ACACIA_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("acacia_logs"), Material.class);

View file

@ -198,7 +198,6 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
*/
enum Sentiment {
// Start generate - AttributeSentiment
// @GeneratedFrom 1.21.9-pre1
POSITIVE,
NEUTRAL,
NEGATIVE;

View file

@ -25,7 +25,6 @@ import org.jetbrains.annotations.NotNull;
public interface Biome extends OldEnum<Biome>, Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
// Start generate - Biome
// @GeneratedFrom 1.21.9-pre1
Biome BADLANDS = getBiome("badlands");
Biome BAMBOO_JUNGLE = getBiome("bamboo_jungle");

View file

@ -192,7 +192,6 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
//<editor-fold desc="BlockTypes" defaultstate="collapsed">
// Start generate - BlockType
// @GeneratedFrom 1.21.9-pre1
BlockType.Typed<Switch> ACACIA_BUTTON = getBlockType("acacia_button");
BlockType.Typed<Door> ACACIA_DOOR = getBlockType("acacia_door");

View file

@ -16,7 +16,6 @@ import org.jetbrains.annotations.Nullable;
public interface PatternType extends OldEnum<PatternType>, Keyed {
// Start generate - PatternType
// @GeneratedFrom 1.21.9-pre1
PatternType BASE = getType("base");
PatternType BORDER = getType("border");

View file

@ -19,7 +19,6 @@ import org.jetbrains.annotations.NotNull;
public interface DamageType extends Keyed, Translatable {
// Start generate - DamageType
// @GeneratedFrom 1.21.9-pre1
DamageType ARROW = getDamageType("arrow");
DamageType BAD_RESPAWN_POINT = getDamageType("bad_respawn_point");

View file

@ -30,7 +30,6 @@ public interface Armadillo extends Animals {
*/
enum State {
// Start generate - ArmadilloState
// @GeneratedFrom 1.21.9-pre1
IDLE,
ROLLING,
SCARED,

View file

@ -177,7 +177,6 @@ public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Pa
NOT_IN_WORLD,
// Start generate - BoatStatus
// @GeneratedFrom 1.21.9-pre1
IN_WATER,
UNDER_WATER,
UNDER_FLOWING_WATER,

View file

@ -55,7 +55,6 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
interface Type extends OldEnum<Type>, Keyed {
// Start generate - CatType
// @GeneratedFrom 1.21.9-pre1
Type ALL_BLACK = getType("all_black");
Type BLACK = getType("black");

View file

@ -60,7 +60,6 @@ public interface Chicken extends Animals {
interface Variant extends Keyed {
// Start generate - ChickenVariant
// @GeneratedFrom 1.21.9-pre1
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");

View file

@ -32,7 +32,6 @@ public interface Cow extends AbstractCow {
interface Variant extends Keyed {
// Start generate - CowVariant
// @GeneratedFrom 1.21.9-pre1
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");

View file

@ -46,7 +46,6 @@ import org.jetbrains.annotations.Nullable;
public enum EntityType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - translatable
// Start generate - EntityType
// @GeneratedFrom 1.21.9-pre1
ACACIA_BOAT("acacia_boat", AcaciaBoat.class, -1),
ACACIA_CHEST_BOAT("acacia_chest_boat", AcaciaChestBoat.class, -1),
ALLAY("allay", Allay.class, -1),

View file

@ -90,7 +90,6 @@ public interface Fox extends Animals, Sittable {
*/
public enum Type {
// Start generate - FoxType
// @GeneratedFrom 1.21.9-pre1
RED,
SNOW;
// End generate - FoxType

View file

@ -53,7 +53,6 @@ public interface Frog extends Animals {
interface Variant extends OldEnum<Variant>, Keyed {
// Start generate - FrogVariant
// @GeneratedFrom 1.21.9-pre1
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");

View file

@ -186,7 +186,6 @@ public interface Panda extends Animals, Sittable {
public enum Gene {
// Start generate - PandaGene
// @GeneratedFrom 1.21.9-pre1
NORMAL(false),
LAZY(false),
WORRIED(false),

View file

@ -32,7 +32,6 @@ public interface Pig extends Steerable, Vehicle {
interface Variant extends Keyed {
// Start generate - PigVariant
// @GeneratedFrom 1.21.9-pre1
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");

View file

@ -28,7 +28,6 @@ public interface Salmon extends io.papermc.paper.entity.SchoolableFish { // Pape
public enum Variant {
// Start generate - SalmonVariant
// @GeneratedFrom 1.21.9-pre1
SMALL,
MEDIUM,
LARGE;

View file

@ -75,7 +75,6 @@ public interface Sniffer extends Animals {
*/
public enum State {
// Start generate - SnifferState
// @GeneratedFrom 1.21.9-pre1
IDLING,
FEELING_HAPPY,
SCENTING,

View file

@ -61,7 +61,6 @@ public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { /
public static enum Pattern {
// Start generate - TropicalFishPattern
// @GeneratedFrom 1.21.9-pre1
KOB,
SUNSTREAK,
SNOOPER,

View file

@ -172,7 +172,6 @@ public interface Villager extends AbstractVillager {
interface Type extends OldEnum<Type>, Keyed {
// Start generate - VillagerType
// @GeneratedFrom 1.21.9-pre1
Type DESERT = getType("desert");
Type JUNGLE = getType("jungle");
@ -224,7 +223,6 @@ public interface Villager extends AbstractVillager {
interface Profession extends OldEnum<Profession>, Keyed, net.kyori.adventure.translation.Translatable {
// Start generate - VillagerProfession
// @GeneratedFrom 1.21.9-pre1
/**
* Armorer profession. Wears a black apron. Armorers primarily trade for
* iron armor, chainmail armor, and sometimes diamond armor.

View file

@ -142,7 +142,6 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
interface SoundVariant extends Keyed {
// Start generate - WolfSoundVariant
// @GeneratedFrom 1.21.9-pre1
SoundVariant ANGRY = getSoundVariant("angry");
SoundVariant BIG = getSoundVariant("big");

View file

@ -47,7 +47,6 @@ public final class MemoryKey<T> implements Keyed {
private static final Map<NamespacedKey, MemoryKey<?>> MEMORY_KEYS = new HashMap<>();
// Start generate - MemoryKey
// @GeneratedFrom 1.21.9-pre1
public static final MemoryKey<Boolean> ADMIRING_DISABLED = new MemoryKey<>(NamespacedKey.minecraft("admiring_disabled"), Boolean.class);
public static final MemoryKey<Boolean> ADMIRING_ITEM = new MemoryKey<>(NamespacedKey.minecraft("admiring_item"), Boolean.class);

View file

@ -17,7 +17,6 @@ import org.jetbrains.annotations.NotNull;
public abstract class Structure implements Keyed {
// Start generate - Structure
// @GeneratedFrom 1.21.9-pre1
public static final Structure ANCIENT_CITY = getStructure("ancient_city");
public static final Structure BASTION_REMNANT = getStructure("bastion_remnant");

View file

@ -16,7 +16,6 @@ import org.jetbrains.annotations.NotNull;
public abstract class StructureType implements Keyed {
// Start generate - StructureType
// @GeneratedFrom 1.21.9-pre1
public static final StructureType BURIED_TREASURE = getStructureType("buried_treasure");
public static final StructureType DESERT_PYRAMID = getStructureType("desert_pyramid");

View file

@ -10,7 +10,6 @@ import net.kyori.adventure.text.format.TextColor;
public enum ItemRarity {
// Start generate - ItemRarity
// @GeneratedFrom 1.21.9-pre1
COMMON(NamedTextColor.WHITE),
UNCOMMON(NamedTextColor.YELLOW),
RARE(NamedTextColor.AQUA),

View file

@ -15,7 +15,6 @@ import org.jetbrains.annotations.NotNull;
public interface TrimMaterial extends Keyed, Translatable {
// Start generate - TrimMaterial
// @GeneratedFrom 1.21.9-pre1
TrimMaterial AMETHYST = getTrimMaterial("amethyst");
TrimMaterial COPPER = getTrimMaterial("copper");

View file

@ -15,7 +15,6 @@ import org.jetbrains.annotations.NotNull;
public interface TrimPattern extends Keyed, Translatable {
// Start generate - TrimPattern
// @GeneratedFrom 1.21.9-pre1
TrimPattern BOLT = getTrimPattern("bolt");
TrimPattern COAST = getTrimPattern("coast");

View file

@ -6,7 +6,6 @@ package org.bukkit.inventory.recipe;
public enum CookingBookCategory {
// Start generate - CookingBookCategory
// @GeneratedFrom 1.21.9-pre1
FOOD,
BLOCKS,
MISC;

View file

@ -6,7 +6,6 @@ package org.bukkit.inventory.recipe;
public enum CraftingBookCategory {
// Start generate - CraftingBookCategory
// @GeneratedFrom 1.21.9-pre1
BUILDING,
REDSTONE,
EQUIPMENT,

View file

@ -289,7 +289,6 @@ public final class MapCursor {
public interface Type extends OldEnum<Type>, Keyed {
// Start generate - MapCursorType
// @GeneratedFrom 1.21.9-pre1
Type BANNER_BLACK = getType("banner_black");
Type BANNER_BLUE = getType("banner_blue");

View file

@ -37,7 +37,6 @@ public final class MapPalette {
@NotNull
static final Color[] colors = {
// Start generate - MapPalette#colors
// @GeneratedFrom 1.21.9-pre1
new Color(0x00000000, true),
new Color(0x00000000, true),
new Color(0x00000000, true),

View file

@ -16,7 +16,6 @@ import org.jetbrains.annotations.Nullable;
*/
public enum PotionType implements Keyed, io.papermc.paper.world.flag.FeatureDependant { // Paper - feature flag API
// Start generate - PotionType
// @GeneratedFrom 1.21.9-pre1
AWKWARD("awkward"),
FIRE_RESISTANCE("fire_resistance"),
HARMING("harming"),

View file

@ -8,7 +8,6 @@ import org.jspecify.annotations.NullMarked;
@NullMarked
public enum DisplaySlot {
// Start generate - DisplaySlot
// @GeneratedFrom 1.21.9-pre1
PLAYER_LIST("list"),
SIDEBAR("sidebar"),
BELOW_NAME("below_name"),

View file

@ -14,7 +14,6 @@ import org.jetbrains.annotations.Nullable;
public final class DamageTypeTags {
// Start generate - DamageTypeTags
// @GeneratedFrom 1.21.9-pre1
public static final Tag<DamageType> ALWAYS_HURTS_ENDER_DRAGONS = getTag("always_hurts_ender_dragons");
public static final Tag<DamageType> ALWAYS_KILLS_ARMOR_STANDS = getTag("always_kills_armor_stands");

View file

@ -6,7 +6,7 @@ plugins {
}
paperweight {
atFile.set(layout.projectDirectory.file("wideners.at"))
atFile = layout.projectDirectory.file("wideners.at")
}
val serverRuntimeClasspath by configurations.registering { // resolvable?
@ -78,27 +78,6 @@ tasks.register("generate") {
dependsOn(generateApi, generateImpl)
}
if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) {
val scanOldGeneratedSourceCode by tasks.registering(JavaExec::class) {
group = "verification"
description = "Scan source code to detect outdated generated code"
javaLauncher = javaToolchains.defaultJavaLauncher(project)
mainClass.set("io.papermc.generator.rewriter.utils.ScanOldGeneratedSourceCode")
classpath(sourceSets.main.map { it.runtimeClasspath })
val projectDirs = listOf("paper-api", "paper-server").map { rootProject.layout.projectDirectory.dir(it) }
args(projectDirs.map { it.asFile.absolutePath })
val workDirs = projectDirs.map { it.dir("src/main/java") }
workDirs.forEach { inputs.dir(it) }
inputs.property("gameVersion", gameVersion)
outputs.dirs(workDirs)
}
tasks.check {
dependsOn(scanOldGeneratedSourceCode)
}
}
fun TaskContainer.registerGenerationTask(
name: String,
rewrite: Boolean,
@ -112,7 +91,7 @@ fun TaskContainer.registerGenerationTask(
maxHeapSize = "2G"
inputs.property("gameVersion", gameVersion)
inputs.dir(layout.projectDirectory.dir("src/main/java")).withPathSensitivity(PathSensitivity.RELATIVE)
mainClass.set("io.papermc.generator.Main")
mainClass = "io.papermc.generator.Main"
systemProperty("paper.updatingMinecraft", providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean())
val provider = objects.newInstance<GenerationArgumentProvider>()
@ -165,7 +144,7 @@ abstract class GenerationArgumentProvider : CommandLineArgumentProvider {
}
if (bootstrapTags.get()) {
args.add(("--bootstrap-tags"))
args.add("--bootstrap-tags")
}
return args.toList()
}

View file

@ -15,24 +15,31 @@ import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.stream.Stream;
import net.minecraft.SharedConstants;
import net.minecraft.Util;
import net.minecraft.commands.Commands;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.LayeredRegistryAccess;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.RegistryDataLoader;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.Bootstrap;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.RegistryLayer;
import net.minecraft.server.ReloadableServerResources;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.ServerPacksSource;
import net.minecraft.server.packs.resources.CloseableResourceManager;
import net.minecraft.server.packs.resources.MultiPackResourceManager;
import net.minecraft.tags.TagKey;
import net.minecraft.tags.TagLoader;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.level.DataPackConfig;
import net.minecraft.world.level.WorldDataConfiguration;
import org.apache.commons.io.file.PathUtils;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.slf4j.Logger;
@ -69,24 +76,29 @@ public class Main implements Callable<Integer> {
Bootstrap.bootStrap();
Bootstrap.validate();
PackRepository resourceRepository = ServerPacksSource.createVanillaTrustedRepository();
resourceRepository.reload();
MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList());
PackRepository packRepository = ServerPacksSource.createVanillaTrustedRepository();
FeatureFlagSet flags = FeatureFlags.REGISTRY.allFlags();
MinecraftServer.configurePackRepository(packRepository, new WorldDataConfiguration(new DataPackConfig(FeatureFlags.REGISTRY.toNames(flags).stream().map(ResourceLocation::getPath).toList(), List.of()), flags), true, false);
CloseableResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, packRepository.openAllSelected());
LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
List<Registry.PendingTags<?>> pendingTags = TagLoader.loadTagsForExistingRegistries(resourceManager, layers.getLayer(RegistryLayer.STATIC));
List<HolderLookup.RegistryLookup<?>> worldGenLayer = TagLoader.buildUpdatedLookups(layers.getAccessForLoading(RegistryLayer.WORLDGEN), pendingTags);
RegistryAccess.Frozen frozenWorldgenRegistries = RegistryDataLoader.load(resourceManager, worldGenLayer, RegistryDataLoader.WORLDGEN_REGISTRIES);
layers = layers.replaceFrom(RegistryLayer.WORLDGEN, frozenWorldgenRegistries);
List<HolderLookup.RegistryLookup<?>> staticAndWorldgenLookups = Stream.concat(worldGenLayer.stream(), frozenWorldgenRegistries.listRegistries()).toList();
RegistryAccess.Frozen dimensionRegistries = RegistryDataLoader.load(resourceManager, staticAndWorldgenLookups, RegistryDataLoader.DIMENSION_REGISTRIES);
layers = layers.replaceFrom(RegistryLayer.DIMENSIONS, dimensionRegistries);
REGISTRY_ACCESS = layers.compositeAccess().freeze();
if (withTags) {
return ReloadableServerResources.loadResources(
resourceManager,
layers,
pendingTags,
FeatureFlags.REGISTRY.allFlags(),
flags,
Commands.CommandSelection.DEDICATED,
Commands.LEVEL_GAMEMASTERS,
Runnable::run,
Util.backgroundExecutor(),
Runnable::run
).whenComplete((result, ex) -> {
if (ex != null) {

View file

@ -41,6 +41,7 @@ public final class RegistryEntry<T> {
private boolean delayed;
private String apiAccessName = ConstantDescs.INIT_NAME;
private Optional<String> apiRegistryField = Optional.empty();
private int genericArgCount = 0;
private @Nullable Map<ResourceKey<T>, String> fieldNames;
@ -66,6 +67,10 @@ public final class RegistryEntry<T> {
return this.registryKeyField.name();
}
public Class<T> elementClass() {
return this.elementClass;
}
public Class<? extends Keyed> apiClass() {
return this.apiClass;
}
@ -89,6 +94,12 @@ public final class RegistryEntry<T> {
return this;
}
public RegistryEntry<T> genericArgCount(int count) {
Preconditions.checkArgument(count >= 0, "Generic argument count must be non-negative");
this.genericArgCount = count;
return this;
}
public RegistryEntry<T> apiAccessName(String name) {
Preconditions.checkArgument(SourceVersion.isIdentifier(name) && !SourceVersion.isKeyword(name), "Invalid accessor name");
this.apiAccessName = name;
@ -128,6 +139,10 @@ public final class RegistryEntry<T> {
return this.apiRegistryBuilderImpl;
}
public int genericArgCount() {
return this.genericArgCount;
}
public @Nullable RegistryModificationApiSupport modificationApiSupport() {
return this.modificationApiSupport;
}

View file

@ -1,8 +1,6 @@
package io.papermc.generator.rewriter.registration;
import io.papermc.generator.rewriter.utils.Annotations;
import io.papermc.generator.types.SimpleGenerator;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.typewriter.ClassNamed;
import io.papermc.typewriter.SourceFile;
import io.papermc.typewriter.context.IndentUnit;
@ -16,7 +14,6 @@ import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import net.minecraft.SharedConstants;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.VisibleForTesting;
import org.jspecify.annotations.NullMarked;
@ -46,7 +43,6 @@ public class PaperPatternSourceSetRewriter extends SourceSetRewriterImpl<Pattern
COMMENT_MARKER_FORMAT.formatted("Start", pattern),
COMMENT_MARKER_FORMAT.formatted("End", pattern)
)
.generatedComment(Annotations.annotationStyle(GeneratedFrom.class) + " " + SharedConstants.getCurrentVersion().id())
.targetClass(targetClass);
}

View file

@ -3,7 +3,8 @@ package io.papermc.generator.rewriter.types.registry;
import com.google.common.base.Preconditions;
import com.google.common.base.Suppliers;
import com.mojang.logging.LogUtils;
import io.papermc.generator.Main;
import io.papermc.generator.registry.RegistryEntries;
import io.papermc.generator.registry.RegistryEntry;
import io.papermc.generator.rewriter.utils.Annotations;
import io.papermc.generator.utils.Formatting;
import io.papermc.generator.utils.experimental.ExperimentalCollector;
@ -12,6 +13,7 @@ import io.papermc.typewriter.ClassNamed;
import io.papermc.typewriter.SourceFile;
import io.papermc.typewriter.replace.SearchMetadata;
import io.papermc.typewriter.replace.SearchReplaceRewriter;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
@ -36,7 +38,7 @@ public class RegistryFieldRewriter<T> extends SearchReplaceRewriter {
private static final Logger LOGGER = LogUtils.getLogger();
private final ResourceKey<? extends Registry<T>> registryKey;
protected final RegistryEntry<T> registryEntry;
private final boolean isFilteredRegistry;
private final @Nullable String fetchMethod;
@ -44,7 +46,7 @@ public class RegistryFieldRewriter<T> extends SearchReplaceRewriter {
private @MonotonicNonNull Supplier<Map<ResourceKey<T>, SingleFlagHolder>> experimentalKeys;
public RegistryFieldRewriter(ResourceKey<? extends Registry<T>> registryKey, @Nullable String fetchMethod) {
this.registryKey = registryKey;
this.registryEntry = RegistryEntries.byRegistryKey(registryKey);
this.isFilteredRegistry = FeatureElement.FILTERED_REGISTRIES.contains(registryKey);
this.fetchMethod = fetchMethod;
}
@ -58,7 +60,7 @@ public class RegistryFieldRewriter<T> extends SearchReplaceRewriter {
try {
this.fieldClass.knownClass().getDeclaredMethod(this.fetchMethod, String.class);
} catch (NoSuchMethodException e) {
LOGGER.error("Fetch method not found, skipping the rewriter for registry fields of {}", this.registryKey, e);
LOGGER.error("Fetch method not found, skipping the rewriter for registry fields of {}", this.registryEntry.registryKey(), e);
return false;
}
}
@ -69,9 +71,9 @@ public class RegistryFieldRewriter<T> extends SearchReplaceRewriter {
@Override
protected void insert(SearchMetadata metadata, StringBuilder builder) {
boolean isInterface = Objects.requireNonNull(this.fieldClass.knownClass()).isInterface();
Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey);
Registry<T> registry = this.registryEntry.registry();
this.experimentalKeys = Suppliers.memoize(() -> ExperimentalCollector.collectDataDrivenElementIds(registry));
Iterator<Holder.Reference<T>> referenceIterator = registry.listElements().filter(this::canPrintField).sorted(Formatting.HOLDER_ORDER).iterator();
Iterator<Holder.Reference<T>> referenceIterator = registry.listElements().filter(this::canPrintField).sorted(this.comparator()).iterator();
while (referenceIterator.hasNext()) {
Holder.Reference<T> reference = referenceIterator.next();
@ -100,6 +102,10 @@ public class RegistryFieldRewriter<T> extends SearchReplaceRewriter {
}
}
protected Comparator<? super Holder.Reference<T>> comparator() {
return Formatting.HOLDER_ORDER;
}
protected void rewriteJavadocs(Holder.Reference<T> reference, String replacedContent, String indent, StringBuilder builder) {
}
@ -108,7 +114,7 @@ public class RegistryFieldRewriter<T> extends SearchReplaceRewriter {
}
protected String rewriteFieldType(Holder.Reference<T> reference) {
return this.fieldClass.simpleName();
return this.registryEntry.apiClass().getSimpleName();
}
protected String rewriteFieldName(Holder.Reference<T> reference) {

View file

@ -95,7 +95,7 @@ public class MemoryKeyRewriter extends RegistryFieldRewriter<MemoryModuleType<?>
this.apiMemoryType = memoryType;
}
return "%s<%s>".formatted(this.fieldClass.simpleName(), this.importCollector.getShortName(this.apiMemoryType));
return "%s<%s>".formatted(this.registryEntry.apiClass().getSimpleName(), this.importCollector.getShortName(this.apiMemoryType));
}
@Override
@ -107,7 +107,7 @@ public class MemoryKeyRewriter extends RegistryFieldRewriter<MemoryModuleType<?>
@Override
protected String rewriteFieldValue(Holder.Reference<MemoryModuleType<?>> reference) {
return "new %s<>(%s.minecraft(%s), %s.class)".formatted(
this.fieldClass.simpleName(),
this.registryEntry.apiClass().getSimpleName(),
NamespacedKey.class.getSimpleName(),
quoted(reference.key().location().getPath()),
this.apiMemoryType.getSimpleName() // assume the type is already import (see above in rewriteFieldType)

Some files were not shown because too many files have changed in this diff Show more