diff --git a/.editorconfig b/.editorconfig index 198db6e8a1..91f0599216 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,5 @@ +root = true + [*] charset=utf-8 end_of_line=lf @@ -37,6 +39,3 @@ ij_java_use_fq_class_names = false [Paper-Server/src/main/resources/data/**/*.json] indent_size = 2 - -[paper-api-generator/generated/**/*.java] -ij_java_imports_layout = $*,|,* diff --git a/.gitignore b/.gitignore index a2adff58b6..415014623f 100644 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,4 @@ paperclip.properties !gradle/wrapper/gradle-wrapper.jar test-plugin.settings.gradle.kts -paper-api-generator.settings.gradle.kts +paper-generator.settings.gradle.kts diff --git a/paper-api-generator/build.gradle.kts b/paper-api-generator/build.gradle.kts deleted file mode 100644 index 05d16d0b95..0000000000 --- a/paper-api-generator/build.gradle.kts +++ /dev/null @@ -1,35 +0,0 @@ -import io.papermc.paperweight.PaperweightSourceGeneratorHelper -import io.papermc.paperweight.extension.PaperweightSourceGeneratorExt - -plugins { - java -} - -plugins.apply(PaperweightSourceGeneratorHelper::class) - -extensions.configure(PaperweightSourceGeneratorExt::class) { - atFile.set(projectDir.toPath().resolve("wideners.at").toFile()) -} - -dependencies { - implementation("com.squareup:javapoet:1.13.0") - implementation(project(":paper-api")) - implementation("io.github.classgraph:classgraph:4.8.47") - implementation("org.jetbrains:annotations:24.0.1") - testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") - testRuntimeOnly("org.junit.platform:junit-platform-launcher") -} - -tasks.register("generate") { - dependsOn(tasks.check) - mainClass.set("io.papermc.generator.Main") - classpath(sourceSets.main.map { it.runtimeClasspath }) - args(projectDir.toPath().resolve("generated").toString()) -} - -tasks.test { - useJUnitPlatform() -} - -group = "io.papermc.paper" -version = "1.0-SNAPSHOT" diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java b/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java deleted file mode 100644 index f0c6abf8bf..0000000000 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java +++ /dev/null @@ -1,490 +0,0 @@ -package io.papermc.paper.registry.keys; - -import static net.kyori.adventure.key.Key.key; - -import io.papermc.paper.generated.GeneratedFrom; -import io.papermc.paper.registry.RegistryKey; -import io.papermc.paper.registry.TypedKey; -import net.kyori.adventure.key.Key; -import org.bukkit.block.Biome; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.jetbrains.annotations.ApiStatus; - -/** - * Vanilla keys for {@link RegistryKey#BIOME}. - * - * @apiNote The fields provided here are a direct representation of - * what is available from the vanilla game source. They may be - * changed (including removals) on any Minecraft version - * bump, so cross-version compatibility is not provided on the - * same level as it is on most of the other API. - */ -@SuppressWarnings({ - "unused", - "SpellCheckingInspection" -}) -@GeneratedFrom("1.21.1") -@ApiStatus.Experimental -public final class BiomeKeys { - /** - * {@code minecraft:badlands} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey BADLANDS = create(key("badlands")); - - /** - * {@code minecraft:bamboo_jungle} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey BAMBOO_JUNGLE = create(key("bamboo_jungle")); - - /** - * {@code minecraft:basalt_deltas} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey BASALT_DELTAS = create(key("basalt_deltas")); - - /** - * {@code minecraft:beach} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey BEACH = create(key("beach")); - - /** - * {@code minecraft:birch_forest} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey BIRCH_FOREST = create(key("birch_forest")); - - /** - * {@code minecraft:cherry_grove} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey CHERRY_GROVE = create(key("cherry_grove")); - - /** - * {@code minecraft:cold_ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey COLD_OCEAN = create(key("cold_ocean")); - - /** - * {@code minecraft:crimson_forest} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey CRIMSON_FOREST = create(key("crimson_forest")); - - /** - * {@code minecraft:dark_forest} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey DARK_FOREST = create(key("dark_forest")); - - /** - * {@code minecraft:deep_cold_ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey DEEP_COLD_OCEAN = create(key("deep_cold_ocean")); - - /** - * {@code minecraft:deep_dark} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey DEEP_DARK = create(key("deep_dark")); - - /** - * {@code minecraft:deep_frozen_ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey DEEP_FROZEN_OCEAN = create(key("deep_frozen_ocean")); - - /** - * {@code minecraft:deep_lukewarm_ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey DEEP_LUKEWARM_OCEAN = create(key("deep_lukewarm_ocean")); - - /** - * {@code minecraft:deep_ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey DEEP_OCEAN = create(key("deep_ocean")); - - /** - * {@code minecraft:desert} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey DESERT = create(key("desert")); - - /** - * {@code minecraft:dripstone_caves} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey DRIPSTONE_CAVES = create(key("dripstone_caves")); - - /** - * {@code minecraft:end_barrens} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey END_BARRENS = create(key("end_barrens")); - - /** - * {@code minecraft:end_highlands} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey END_HIGHLANDS = create(key("end_highlands")); - - /** - * {@code minecraft:end_midlands} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey END_MIDLANDS = create(key("end_midlands")); - - /** - * {@code minecraft:eroded_badlands} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey ERODED_BADLANDS = create(key("eroded_badlands")); - - /** - * {@code minecraft:flower_forest} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey FLOWER_FOREST = create(key("flower_forest")); - - /** - * {@code minecraft:forest} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey FOREST = create(key("forest")); - - /** - * {@code minecraft:frozen_ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey FROZEN_OCEAN = create(key("frozen_ocean")); - - /** - * {@code minecraft:frozen_peaks} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey FROZEN_PEAKS = create(key("frozen_peaks")); - - /** - * {@code minecraft:frozen_river} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey FROZEN_RIVER = create(key("frozen_river")); - - /** - * {@code minecraft:grove} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey GROVE = create(key("grove")); - - /** - * {@code minecraft:ice_spikes} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey ICE_SPIKES = create(key("ice_spikes")); - - /** - * {@code minecraft:jagged_peaks} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey JAGGED_PEAKS = create(key("jagged_peaks")); - - /** - * {@code minecraft:jungle} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey JUNGLE = create(key("jungle")); - - /** - * {@code minecraft:lukewarm_ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey LUKEWARM_OCEAN = create(key("lukewarm_ocean")); - - /** - * {@code minecraft:lush_caves} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey LUSH_CAVES = create(key("lush_caves")); - - /** - * {@code minecraft:mangrove_swamp} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey MANGROVE_SWAMP = create(key("mangrove_swamp")); - - /** - * {@code minecraft:meadow} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey MEADOW = create(key("meadow")); - - /** - * {@code minecraft:mushroom_fields} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey MUSHROOM_FIELDS = create(key("mushroom_fields")); - - /** - * {@code minecraft:nether_wastes} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey NETHER_WASTES = create(key("nether_wastes")); - - /** - * {@code minecraft:ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey OCEAN = create(key("ocean")); - - /** - * {@code minecraft:old_growth_birch_forest} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey OLD_GROWTH_BIRCH_FOREST = create(key("old_growth_birch_forest")); - - /** - * {@code minecraft:old_growth_pine_taiga} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey OLD_GROWTH_PINE_TAIGA = create(key("old_growth_pine_taiga")); - - /** - * {@code minecraft:old_growth_spruce_taiga} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey OLD_GROWTH_SPRUCE_TAIGA = create(key("old_growth_spruce_taiga")); - - /** - * {@code minecraft:plains} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey PLAINS = create(key("plains")); - - /** - * {@code minecraft:river} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey RIVER = create(key("river")); - - /** - * {@code minecraft:savanna} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SAVANNA = create(key("savanna")); - - /** - * {@code minecraft:savanna_plateau} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SAVANNA_PLATEAU = create(key("savanna_plateau")); - - /** - * {@code minecraft:small_end_islands} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SMALL_END_ISLANDS = create(key("small_end_islands")); - - /** - * {@code minecraft:snowy_beach} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SNOWY_BEACH = create(key("snowy_beach")); - - /** - * {@code minecraft:snowy_plains} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SNOWY_PLAINS = create(key("snowy_plains")); - - /** - * {@code minecraft:snowy_slopes} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SNOWY_SLOPES = create(key("snowy_slopes")); - - /** - * {@code minecraft:snowy_taiga} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SNOWY_TAIGA = create(key("snowy_taiga")); - - /** - * {@code minecraft:soul_sand_valley} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SOUL_SAND_VALLEY = create(key("soul_sand_valley")); - - /** - * {@code minecraft:sparse_jungle} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SPARSE_JUNGLE = create(key("sparse_jungle")); - - /** - * {@code minecraft:stony_peaks} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey STONY_PEAKS = create(key("stony_peaks")); - - /** - * {@code minecraft:stony_shore} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey STONY_SHORE = create(key("stony_shore")); - - /** - * {@code minecraft:sunflower_plains} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SUNFLOWER_PLAINS = create(key("sunflower_plains")); - - /** - * {@code minecraft:swamp} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey SWAMP = create(key("swamp")); - - /** - * {@code minecraft:taiga} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey TAIGA = create(key("taiga")); - - /** - * {@code minecraft:the_end} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey THE_END = create(key("the_end")); - - /** - * {@code minecraft:the_void} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey THE_VOID = create(key("the_void")); - - /** - * {@code minecraft:warm_ocean} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey WARM_OCEAN = create(key("warm_ocean")); - - /** - * {@code minecraft:warped_forest} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey WARPED_FOREST = create(key("warped_forest")); - - /** - * {@code minecraft:windswept_forest} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey WINDSWEPT_FOREST = create(key("windswept_forest")); - - /** - * {@code minecraft:windswept_gravelly_hills} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey WINDSWEPT_GRAVELLY_HILLS = create(key("windswept_gravelly_hills")); - - /** - * {@code minecraft:windswept_hills} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey WINDSWEPT_HILLS = create(key("windswept_hills")); - - /** - * {@code minecraft:windswept_savanna} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey WINDSWEPT_SAVANNA = create(key("windswept_savanna")); - - /** - * {@code minecraft:wooded_badlands} - * - * @apiNote This field is version-dependant and may be removed in future Minecraft versions - */ - public static final TypedKey WOODED_BADLANDS = create(key("wooded_badlands")); - - private BiomeKeys() { - } - - /** - * Creates a key for {@link Biome} in the registry {@code minecraft:worldgen/biome}. - * - * @param key the value's key in the registry - * @return a new typed key - */ - @ApiStatus.Experimental - public static @NonNull TypedKey create(final @NonNull Key key) { - return TypedKey.create(RegistryKey.BIOME, key); - } -} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/Generators.java b/paper-api-generator/src/main/java/io/papermc/generator/Generators.java deleted file mode 100644 index c46e0b2b61..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/Generators.java +++ /dev/null @@ -1,73 +0,0 @@ -package io.papermc.generator; - -import io.papermc.generator.types.GeneratedKeyType; -import io.papermc.generator.types.GeneratedTagKeyType; -import io.papermc.generator.types.SourceGenerator; -import io.papermc.generator.types.goal.MobGoalGenerator; -import io.papermc.paper.registry.RegistryKey; -import net.minecraft.core.Registry; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import org.bukkit.GameEvent; -import org.bukkit.JukeboxSong; -import org.bukkit.MusicInstrument; -import org.bukkit.block.Biome; -import org.bukkit.block.BlockType; -import org.bukkit.block.banner.PatternType; -import org.bukkit.damage.DamageType; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Cat; -import org.bukkit.entity.Frog; -import org.bukkit.entity.Villager; -import org.bukkit.entity.Wolf; -import org.bukkit.generator.structure.Structure; -import org.bukkit.generator.structure.StructureType; -import org.bukkit.inventory.ItemType; -import org.bukkit.inventory.MenuType; -import org.bukkit.inventory.meta.trim.TrimMaterial; -import org.bukkit.inventory.meta.trim.TrimPattern; -import org.bukkit.map.MapCursor; -import org.bukkit.potion.PotionEffectType; - -public interface Generators { - - SourceGenerator[] API = { - // built-ins - simpleKey("GameEventKeys", GameEvent.class, Registries.GAME_EVENT, RegistryKey.GAME_EVENT, false), - simpleKey("StructureTypeKeys", StructureType.class, Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, false), - simpleKey("InstrumentKeys", MusicInstrument.class, Registries.INSTRUMENT, RegistryKey.INSTRUMENT, false), - simpleKey("MobEffectKeys", PotionEffectType.class, Registries.MOB_EFFECT, RegistryKey.MOB_EFFECT, false), - simpleKey("BlockTypeKeys", BlockType.class, Registries.BLOCK, RegistryKey.BLOCK, false), - simpleKey("ItemTypeKeys", ItemType.class, Registries.ITEM, RegistryKey.ITEM, false), - simpleKey("CatVariantKeys", Cat.Type.class, Registries.CAT_VARIANT, RegistryKey.CAT_VARIANT, false), - simpleKey("FrogVariantKeys", Frog.Variant.class, Registries.FROG_VARIANT, RegistryKey.FROG_VARIANT, false), - simpleKey("VillagerProfessionKeys", Villager.Profession.class, Registries.VILLAGER_PROFESSION, RegistryKey.VILLAGER_PROFESSION, false), - simpleKey("VillagerTypeKeys", Villager.Type.class, Registries.VILLAGER_TYPE, RegistryKey.VILLAGER_TYPE, false), - simpleKey("MapDecorationTypeKeys", MapCursor.Type.class, Registries.MAP_DECORATION_TYPE, RegistryKey.MAP_DECORATION_TYPE, false), - simpleKey("MenuTypeKeys", MenuType.class, Registries.MENU, RegistryKey.MENU, false), - - // data-driven - simpleKey("BiomeKeys", Biome.class, Registries.BIOME, RegistryKey.BIOME, true), - simpleKey("StructureKeys", Structure.class, Registries.STRUCTURE, RegistryKey.STRUCTURE, true), - simpleKey("TrimMaterialKeys", TrimMaterial.class, Registries.TRIM_MATERIAL, RegistryKey.TRIM_MATERIAL, true), - simpleKey("TrimPatternKeys", TrimPattern.class, Registries.TRIM_PATTERN, RegistryKey.TRIM_PATTERN, true), - simpleKey("DamageTypeKeys", DamageType.class, Registries.DAMAGE_TYPE, RegistryKey.DAMAGE_TYPE, true), - simpleKey("WolfVariantKeys", Wolf.Variant.class, Registries.WOLF_VARIANT, RegistryKey.WOLF_VARIANT, true), - simpleKey("EnchantmentKeys", Enchantment.class, Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT, false), - simpleKey("JukeboxSongKeys", JukeboxSong.class, Registries.JUKEBOX_SONG, RegistryKey.JUKEBOX_SONG, true), - simpleKey("BannerPatternKeys", PatternType.class, Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN, true), - - // tags - simpleTagKey("EnchantmentTagKeys", Enchantment.class, Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT), - simpleTagKey("ItemTypeTagKeys", ItemType.class, Registries.ITEM, RegistryKey.ITEM), - new MobGoalGenerator("VanillaGoal", "com.destroystokyo.paper.entity.ai") - }; - - private static SourceGenerator simpleKey(final String className, final Class apiType, final ResourceKey> registryKey, final RegistryKey apiRegistryKey, final boolean publicCreateKeyMethod) { - return new GeneratedKeyType<>(className, apiType, "io.papermc.paper.registry.keys", registryKey, apiRegistryKey, publicCreateKeyMethod); - } - - private static SourceGenerator simpleTagKey(final String className, final Class apiType, final ResourceKey> registryKey, final RegistryKey apiRegistryKey) { - return new GeneratedTagKeyType<>(className, apiType, "io.papermc.paper.registry.keys.tags", registryKey, apiRegistryKey, true); - } -} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/Main.java b/paper-api-generator/src/main/java/io/papermc/generator/Main.java deleted file mode 100644 index bec7a0c373..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/Main.java +++ /dev/null @@ -1,79 +0,0 @@ -package io.papermc.generator; - -import com.google.common.util.concurrent.MoreExecutors; -import com.mojang.logging.LogUtils; -import io.papermc.generator.types.SourceGenerator; -import io.papermc.generator.utils.TagCollector; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Map; -import net.minecraft.SharedConstants; -import net.minecraft.commands.Commands; -import net.minecraft.core.LayeredRegistryAccess; -import net.minecraft.core.RegistryAccess; -import net.minecraft.resources.RegistryDataLoader; -import net.minecraft.server.Bootstrap; -import net.minecraft.server.RegistryLayer; -import net.minecraft.server.ReloadableServerResources; -import net.minecraft.server.WorldLoader; -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.MultiPackResourceManager; -import net.minecraft.tags.TagKey; -import net.minecraft.world.flag.FeatureFlags; -import org.apache.commons.io.file.PathUtils; -import org.slf4j.Logger; - -public final class Main { - - private static final Logger LOGGER = LogUtils.getLogger(); - public static final RegistryAccess.Frozen REGISTRY_ACCESS; - public static final Map, String> EXPERIMENTAL_TAGS; - - static { - SharedConstants.tryDetectVersion(); - Bootstrap.bootStrap(); - Bootstrap.validate(); - - final PackRepository resourceRepository = ServerPacksSource.createVanillaTrustedRepository(); - resourceRepository.reload(); - final MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList()); - LayeredRegistryAccess layers = RegistryLayer.createRegistryAccess(); - layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES); - REGISTRY_ACCESS = layers.compositeAccess().freeze(); - final ReloadableServerResources datapack = ReloadableServerResources.loadResources(resourceManager, layers, FeatureFlags.REGISTRY.allFlags(), Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join(); - datapack.updateRegistryTags(); - - EXPERIMENTAL_TAGS = TagCollector.grabExperimental(resourceManager); - } - - private Main() { - } - - public static void main(final String[] args) { - LOGGER.info("Running API generators..."); - generate(Paths.get(args[0]), Generators.API); - // LOGGER.info("Running Server generators..."); - // generate(Paths.get(args[1]), Generators.SERVER); - } - - private static void generate(Path output, SourceGenerator[] generators) { - try { - if (Files.exists(output)) { - PathUtils.deleteDirectory(output); - } - Files.createDirectories(output); - - for (final SourceGenerator generator : generators) { - generator.writeToFile(output); - } - - LOGGER.info("Files written to {}", output.toAbsolutePath()); - } catch (final Exception ex) { - throw new RuntimeException(ex); - } - } -} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java b/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java deleted file mode 100644 index cf6846134a..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java +++ /dev/null @@ -1,193 +0,0 @@ -package io.papermc.generator.types; - -import com.google.common.collect.Sets; -import com.squareup.javapoet.FieldSpec; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.MethodSpec; -import com.squareup.javapoet.ParameterSpec; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeSpec; -import io.papermc.generator.Main; -import io.papermc.generator.utils.Annotations; -import io.papermc.generator.utils.CollectingContext; -import io.papermc.generator.utils.Formatting; -import io.papermc.generator.utils.Javadocs; -import io.papermc.paper.registry.RegistryKey; -import io.papermc.paper.registry.TypedKey; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.Collections; -import java.util.HashMap; -import java.util.IdentityHashMap; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; -import net.kyori.adventure.key.Key; -import net.minecraft.core.Holder; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.Registry; -import net.minecraft.core.RegistrySetBuilder; -import net.minecraft.data.registries.VanillaRegistries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.flag.FeatureElement; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.checkerframework.framework.qual.DefaultQualifier; - -import static com.squareup.javapoet.TypeSpec.classBuilder; -import static io.papermc.generator.utils.Annotations.EXPERIMENTAL_API_ANNOTATION; -import static io.papermc.generator.utils.Annotations.NOT_NULL; -import static io.papermc.generator.utils.Annotations.experimentalAnnotations; -import static java.util.Objects.requireNonNull; -import static javax.lang.model.element.Modifier.FINAL; -import static javax.lang.model.element.Modifier.PRIVATE; -import static javax.lang.model.element.Modifier.PUBLIC; -import static javax.lang.model.element.Modifier.STATIC; - -@DefaultQualifier(NonNull.class) -public class GeneratedKeyType extends SimpleGenerator { - - private static final Map>, RegistrySetBuilder.RegistryBootstrap> VANILLA_REGISTRY_ENTRIES = VanillaRegistries.BUILDER.entries.stream() - .collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap)); - - private static final Map>, RegistrySetBuilder.RegistryBootstrap> EXPERIMENTAL_REGISTRY_ENTRIES = Collections.emptyMap(); // Update for Experimental API - - private static final Map, String> REGISTRY_KEY_FIELD_NAMES; - static { - final Map, String> map = new HashMap<>(); - try { - for (final Field field : RegistryKey.class.getFields()) { - if (!Modifier.isStatic(field.getModifiers()) || !Modifier.isFinal(field.getModifiers()) || field.getType() != RegistryKey.class) { - continue; - } - map.put((RegistryKey) field.get(null), field.getName()); - } - REGISTRY_KEY_FIELD_NAMES = Map.copyOf(map); - } catch (final ReflectiveOperationException ex) { - throw new RuntimeException(ex); - } - } - - private static final String CREATE_JAVADOC = """ - Creates a key for {@link $T} in the registry {@code $L}. - - @param key the value's key in the registry - @return a new typed key - """; - - private final Class apiType; - private final ResourceKey> registryKey; - private final RegistryKey apiRegistryKey; - private final boolean publicCreateKeyMethod; - - public GeneratedKeyType(final String keysClassName, final Class apiType, final String pkg, final ResourceKey> registryKey, final RegistryKey apiRegistryKey, final boolean publicCreateKeyMethod) { - super(keysClassName, pkg); - this.apiType = apiType; - this.registryKey = registryKey; - this.apiRegistryKey = apiRegistryKey; - this.publicCreateKeyMethod = publicCreateKeyMethod; - } - - private MethodSpec.Builder createMethod(final TypeName returnType) { - final TypeName keyType = TypeName.get(Key.class).annotated(NOT_NULL); - - final ParameterSpec keyParam = ParameterSpec.builder(keyType, "key", FINAL).build(); - final MethodSpec.Builder create = MethodSpec.methodBuilder("create") - .addModifiers(this.publicCreateKeyMethod ? PUBLIC : PRIVATE, STATIC) - .addParameter(keyParam) - .addCode("return $T.create($T.$L, $N);", TypedKey.class, RegistryKey.class, requireNonNull(REGISTRY_KEY_FIELD_NAMES.get(this.apiRegistryKey), "Missing field for " + this.apiRegistryKey), keyParam) - .returns(returnType.annotated(NOT_NULL)); - if (this.publicCreateKeyMethod) { - create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental - create.addJavadoc(CREATE_JAVADOC, this.apiType, this.registryKey.location().toString()); - } - return create; - } - - private TypeSpec.Builder keyHolderType() { - return classBuilder(this.className) - .addModifiers(PUBLIC, FINAL) - .addJavadoc(Javadocs.getVersionDependentClassHeader("{@link $T#$L}"), RegistryKey.class, REGISTRY_KEY_FIELD_NAMES.get(this.apiRegistryKey)) - .addAnnotations(Annotations.CLASS_HEADER) - .addMethod(MethodSpec.constructorBuilder() - .addModifiers(PRIVATE) - .build() - ); - } - - @Override - protected TypeSpec getTypeSpec() { - final TypeName typedKey = ParameterizedTypeName.get(TypedKey.class, this.apiType); - - final TypeSpec.Builder typeBuilder = this.keyHolderType(); - final MethodSpec.Builder createMethod = this.createMethod(typedKey); - - final Registry registry = Main.REGISTRY_ACCESS.registryOrThrow(this.registryKey); - final Set> experimental = this.collectExperimentalKeys(registry); - - boolean allExperimental = true; - for (final Holder.Reference reference : registry.holders().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) { - final ResourceKey key = reference.key(); - final String keyPath = key.location().getPath(); - final String fieldName = Formatting.formatKeyAsField(keyPath); - final FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, PUBLIC, STATIC, FINAL) - .initializer("$N(key($S))", createMethod.build(), keyPath) - .addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), key.location().toString()); - if (experimental.contains(key)) { - fieldBuilder.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API - } else { - allExperimental = false; - } - typeBuilder.addField(fieldBuilder.build()); - } - if (allExperimental) { - typeBuilder.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API - createMethod.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API - } else { - typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API - } - return typeBuilder.addMethod(createMethod.build()).build(); - } - - private Set> collectExperimentalKeys(final Registry registry) { - if (FeatureElement.FILTERED_REGISTRIES.contains(registry.key())) { - return this.collectExperimentalKeysBuiltIn(registry); - } else { - return this.collectExperimentalKeysDataDriven(registry); - } - } - - private Set> collectExperimentalKeysBuiltIn(final Registry registry) { - final HolderLookup.RegistryLookup filteredLookup = registry.asLookup().filterElements(v -> { - return false; // Update for Experimental API - }); - return filteredLookup.listElementIds().collect(Collectors.toUnmodifiableSet()); - } - - @SuppressWarnings("unchecked") - private Set> collectExperimentalKeysDataDriven(final Registry registry) { - final RegistrySetBuilder.@Nullable RegistryBootstrap experimentalBootstrap = (RegistrySetBuilder.RegistryBootstrap) EXPERIMENTAL_REGISTRY_ENTRIES.get(this.registryKey); - if (experimentalBootstrap == null) { - return Collections.emptySet(); - } - final Set> experimental = Collections.newSetFromMap(new IdentityHashMap<>()); - final CollectingContext experimentalCollector = new CollectingContext<>(experimental, registry); - experimentalBootstrap.run(experimentalCollector); - - final RegistrySetBuilder.@Nullable RegistryBootstrap vanillaBootstrap = (RegistrySetBuilder.RegistryBootstrap) VANILLA_REGISTRY_ENTRIES.get(this.registryKey); - if (vanillaBootstrap != null) { - final Set> vanilla = Collections.newSetFromMap(new IdentityHashMap<>()); - final CollectingContext vanillaCollector = new CollectingContext<>(vanilla, registry); - vanillaBootstrap.run(vanillaCollector); - return Sets.difference(experimental, vanilla); - } - return experimental; - } - - @Override - protected JavaFile.Builder file(final JavaFile.Builder builder) { - return builder - .addStaticImport(Key.class, "key"); - } -} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedTagKeyType.java b/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedTagKeyType.java deleted file mode 100644 index ff8d8b612c..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedTagKeyType.java +++ /dev/null @@ -1,137 +0,0 @@ -package io.papermc.generator.types; - -import com.squareup.javapoet.FieldSpec; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.MethodSpec; -import com.squareup.javapoet.ParameterSpec; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; -import com.squareup.javapoet.TypeSpec; -import io.papermc.generator.Main; -import io.papermc.generator.utils.Annotations; -import io.papermc.generator.utils.Formatting; -import io.papermc.generator.utils.Javadocs; -import io.papermc.paper.registry.RegistryKey; -import io.papermc.paper.registry.tag.TagKey; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; -import net.kyori.adventure.key.Key; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceKey; -import org.bukkit.MinecraftExperimental; - -import static com.squareup.javapoet.TypeSpec.classBuilder; -import static io.papermc.generator.utils.Annotations.EXPERIMENTAL_API_ANNOTATION; -import static io.papermc.generator.utils.Annotations.NOT_NULL; -import static io.papermc.generator.utils.Annotations.experimentalAnnotations; -import static java.util.Objects.requireNonNull; -import static javax.lang.model.element.Modifier.FINAL; -import static javax.lang.model.element.Modifier.PRIVATE; -import static javax.lang.model.element.Modifier.PUBLIC; -import static javax.lang.model.element.Modifier.STATIC; - -public class GeneratedTagKeyType extends SimpleGenerator { - - private static final Map, String> REGISTRY_KEY_FIELD_NAMES; - static { - final Map, String> map = new HashMap<>(); - try { - for (final Field field : RegistryKey.class.getFields()) { - if (!Modifier.isStatic(field.getModifiers()) || !Modifier.isFinal(field.getModifiers()) || field.getType() != RegistryKey.class) { - continue; - } - map.put((RegistryKey) field.get(null), field.getName()); - } - REGISTRY_KEY_FIELD_NAMES = Map.copyOf(map); - } catch (final ReflectiveOperationException ex) { - throw new RuntimeException(ex); - } - } - - private static final String CREATE_JAVADOC = """ - Creates a tag key for {@link $T} in the registry {@code $L}. - - @param key the tag key's key - @return a new tag key - """; - - private final Class apiType; - private final ResourceKey> registryKey; - private final RegistryKey apiRegistryKey; - private final boolean publicCreateKeyMethod; - - public GeneratedTagKeyType(final String keysClassName, final Class apiType, final String pkg, final ResourceKey> registryKey, final RegistryKey apiRegistryKey, final boolean publicCreateKeyMethod) { - super(keysClassName, pkg); - this.apiType = apiType; - this.registryKey = registryKey; - this.apiRegistryKey = apiRegistryKey; - this.publicCreateKeyMethod = publicCreateKeyMethod; - } - - private MethodSpec.Builder createMethod(final TypeName returnType) { - final TypeName keyType = TypeName.get(Key.class).annotated(NOT_NULL); - - final ParameterSpec keyParam = ParameterSpec.builder(keyType, "key", FINAL).build(); - final MethodSpec.Builder create = MethodSpec.methodBuilder("create") - .addModifiers(this.publicCreateKeyMethod ? PUBLIC : PRIVATE, STATIC) - .addParameter(keyParam) - .addCode("return $T.create($T.$L, $N);", TagKey.class, RegistryKey.class, requireNonNull(REGISTRY_KEY_FIELD_NAMES.get(this.apiRegistryKey), "Missing field for " + this.apiRegistryKey), keyParam) - .returns(returnType.annotated(NOT_NULL)); - if (this.publicCreateKeyMethod) { - create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental - create.addJavadoc(CREATE_JAVADOC, this.apiType, this.registryKey.location().toString()); - } - return create; - } - - private TypeSpec.Builder keyHolderType() { - return classBuilder(this.className) - .addModifiers(PUBLIC, FINAL) - .addJavadoc(Javadocs.getVersionDependentClassHeader("{@link $T#$L}"), RegistryKey.class, REGISTRY_KEY_FIELD_NAMES.get(this.apiRegistryKey)) - .addAnnotations(Annotations.CLASS_HEADER) - .addMethod(MethodSpec.constructorBuilder() - .addModifiers(PRIVATE) - .build() - ); - } - - @Override - protected TypeSpec getTypeSpec() { - final TypeName tagKey = ParameterizedTypeName.get(TagKey.class, this.apiType); - - final TypeSpec.Builder typeBuilder = this.keyHolderType(); - final MethodSpec.Builder createMethod = this.createMethod(tagKey); - - final Registry registry = Main.REGISTRY_ACCESS.registryOrThrow(this.registryKey); - - final AtomicBoolean allExperimental = new AtomicBoolean(true); - registry.getTagNames().sorted(Formatting.alphabeticKeyOrder(nmsTagKey -> nmsTagKey.location().getPath())).forEach(nmsTagKey -> { - final String fieldName = Formatting.formatKeyAsField(nmsTagKey.location().getPath()); - final FieldSpec.Builder fieldBuilder = FieldSpec.builder(tagKey, fieldName, PUBLIC, STATIC, FINAL) - .initializer("$N(key($S))", createMethod.build(), nmsTagKey.location().getPath()) - .addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), "#" + nmsTagKey.location()); - if (Main.EXPERIMENTAL_TAGS.containsKey(nmsTagKey)) { - fieldBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.TRADE_REBALANCE)); // Update for Experimental API - } else { - allExperimental.set(false); - } - typeBuilder.addField(fieldBuilder.build()); - }); - if (allExperimental.get()) { - typeBuilder.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API - createMethod.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API - } else { - typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API - } - return typeBuilder.addMethod(createMethod.build()).build(); - } - - @Override - protected JavaFile.Builder file(final JavaFile.Builder builder) { - return builder - .addStaticImport(Key.class, "key"); - } -} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java b/paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java deleted file mode 100644 index f625c25a55..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java +++ /dev/null @@ -1,64 +0,0 @@ -package io.papermc.generator.utils; - -import com.squareup.javapoet.AnnotationSpec; -import java.util.ArrayList; -import java.util.List; - -import io.papermc.paper.generated.GeneratedFrom; -import net.minecraft.SharedConstants; -import org.bukkit.MinecraftExperimental; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; - -public final class Annotations { - - public static List experimentalAnnotations(final MinecraftExperimental.@Nullable Requires requiredFeatureFlag) { - final List annotationSpecs = new ArrayList<>(); - annotationSpecs.add(AnnotationSpec.builder(ApiStatus.Experimental.class).build()); - if (requiredFeatureFlag != null) { - annotationSpecs.add(AnnotationSpec.builder(MinecraftExperimental.class) - .addMember("value", "$T.$L", MinecraftExperimental.Requires.class, requiredFeatureFlag.name()) - .build()); - } else { - annotationSpecs.add(AnnotationSpec.builder(MinecraftExperimental.class).build()); - } - return annotationSpecs; - } - - public static AnnotationSpec deprecatedVersioned(final @Nullable String version, final boolean forRemoval) { - final AnnotationSpec.Builder annotationSpec = AnnotationSpec.builder(Deprecated.class); - if (forRemoval) { - annotationSpec.addMember("forRemoval", "$L", true); - } - if (version != null) { - annotationSpec.addMember("since", "$S", version); - } - - return annotationSpec.build(); - } - - public static AnnotationSpec scheduledRemoval(final @Nullable String version) { - return AnnotationSpec.builder(ApiStatus.ScheduledForRemoval.class) - .addMember("inVersion", "$S", version) - .build(); - } - - @ApiStatus.Experimental - public static final AnnotationSpec EXPERIMENTAL_API_ANNOTATION = AnnotationSpec.builder(ApiStatus.Experimental.class).build(); - public static final AnnotationSpec NOT_NULL = AnnotationSpec.builder(NonNull.class).build(); - private static final AnnotationSpec SUPPRESS_WARNINGS = AnnotationSpec.builder(SuppressWarnings.class) - .addMember("value", "$S", "unused") - .addMember("value", "$S", "SpellCheckingInspection") - .build(); - private static final AnnotationSpec GENERATED_FROM = AnnotationSpec.builder(GeneratedFrom.class) - .addMember("value", "$S", SharedConstants.getCurrentVersion().getName()) - .build(); - public static final Iterable CLASS_HEADER = List.of( - SUPPRESS_WARNINGS, - GENERATED_FROM - ); - - private Annotations() { - } -} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/utils/Javadocs.java b/paper-api-generator/src/main/java/io/papermc/generator/utils/Javadocs.java deleted file mode 100644 index 33536c8311..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/Javadocs.java +++ /dev/null @@ -1,27 +0,0 @@ -package io.papermc.generator.utils; - -public final class Javadocs { - - public static String getVersionDependentClassHeader(String headerIdentifier) { - return """ - Vanilla keys for %s. - - @apiNote The fields provided here are a direct representation of - what is available from the vanilla game source. They may be - changed (including removals) on any Minecraft version - bump, so cross-version compatibility is not provided on the - same level as it is on most of the other API. - """.formatted(headerIdentifier); - } - - public static String getVersionDependentField(String headerIdentifier) { - return """ - %s - - @apiNote This field is version-dependant and may be removed in future Minecraft versions - """.formatted(headerIdentifier); - } - - private Javadocs() { - } -} diff --git a/paper-api-generator/wideners.at b/paper-api-generator/wideners.at deleted file mode 100644 index 6928316973..0000000000 --- a/paper-api-generator/wideners.at +++ /dev/null @@ -1,7 +0,0 @@ -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; - -# for auto-marking experimental stuff -public net/minecraft/core/RegistrySetBuilder entries -public net/minecraft/core/RegistrySetBuilder$RegistryStub -public net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER -public net/minecraft/data/registries/VanillaRegistries BUILDER diff --git a/paper-generator/.editorconfig b/paper-generator/.editorconfig new file mode 100644 index 0000000000..406d023f3e --- /dev/null +++ b/paper-generator/.editorconfig @@ -0,0 +1,6 @@ +[*.java] +ij_java_generate_final_locals = false +ij_java_generate_final_parameters = false + +[generated{Api,Server}/**/*.java] +ij_java_imports_layout = $*,|,* diff --git a/paper-generator/build.gradle.kts b/paper-generator/build.gradle.kts new file mode 100644 index 0000000000..f23d61eaa3 --- /dev/null +++ b/paper-generator/build.gradle.kts @@ -0,0 +1,55 @@ +import io.papermc.paperweight.PaperweightSourceGeneratorHelper +import io.papermc.paperweight.extension.PaperweightSourceGeneratorExt + +plugins { + java +} + +plugins.apply(PaperweightSourceGeneratorHelper::class) + +extensions.configure(PaperweightSourceGeneratorExt::class) { + atFile.set(file("wideners.at")) +} + +repositories { + mavenLocal() // todo publish typewriter somewhere +} + +dependencies { + implementation("com.squareup:javapoet:1.13.0") + implementation(project(":paper-api")) + implementation("io.github.classgraph:classgraph:4.8.47") + implementation("org.jetbrains:annotations:24.1.0") + implementation("io.papermc.typewriter:typewriter:1.0-SNAPSHOT") { + isTransitive = false // paper-api already have everything + } + testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") +} + +val generatedApiPath = file("generatedApi") +val generatedServerPath = file("generatedServer") + +tasks.register("generate") { + dependsOn(tasks.check) + mainClass.set("io.papermc.generator.Main") + classpath(sourceSets.main.map { it.runtimeClasspath }) + args(generatedApiPath.toString(), + project(":paper-api").sourceSets["main"].java.srcDirs.first().toString(), + generatedServerPath.toString(), + project(":paper-server").sourceSets["main"].java.srcDirs.first().toString()) +} + +tasks.register("scanOldGeneratedSourceCode") { + mainClass.set("io.papermc.generator.rewriter.OldGeneratedCodeTest") + classpath(sourceSets.test.map { it.runtimeClasspath }) + args(generatedApiPath.toString(), + generatedServerPath.toString()) +} + +tasks.test { + useJUnitPlatform() +} + +group = "io.papermc.paper" +version = "1.0-SNAPSHOT" diff --git a/paper-api-generator/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/paper-generator/generatedApi/com/destroystokyo/paper/entity/ai/VanillaGoal.java similarity index 98% rename from paper-api-generator/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java rename to paper-generator/generatedApi/com/destroystokyo/paper/entity/ai/VanillaGoal.java index 02411466bd..5a780f852a 100644 --- a/paper-api-generator/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java +++ b/paper-generator/generatedApi/com/destroystokyo/paper/entity/ai/VanillaGoal.java @@ -51,7 +51,7 @@ import org.bukkit.entity.WanderingTrader; import org.bukkit.entity.Wither; import org.bukkit.entity.Wolf; import org.bukkit.entity.Zombie; -import org.checkerframework.checker.nullness.qual.NonNull; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for Mob Goals. @@ -66,6 +66,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") public interface VanillaGoal extends Goal { GoalKey RANDOM_STAND = create("random_stand", AbstractHorse.class); @@ -436,8 +437,7 @@ public interface VanillaGoal extends Goal { GoalKey ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class); - private static @NonNull GoalKey create(final @NonNull String key, - final @NonNull Class type) { + private static GoalKey create(final String key, final Class type) { return GoalKey.of(type, NamespacedKey.minecraft(key)); } } diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/event/RegistryEvents.java b/paper-generator/generatedApi/io/papermc/paper/registry/event/RegistryEvents.java new file mode 100644 index 0000000000..7cc0135b04 --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/event/RegistryEvents.java @@ -0,0 +1,27 @@ +package io.papermc.paper.registry.event; + +import io.papermc.paper.registry.RegistryKey; +import io.papermc.paper.registry.data.EnchantmentRegistryEntry; +import io.papermc.paper.registry.data.GameEventRegistryEntry; +import org.bukkit.GameEvent; +import org.bukkit.enchantments.Enchantment; +import org.jetbrains.annotations.ApiStatus; + +import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create; + +/** + * Holds providers for {@link RegistryEntryAddEvent} and {@link RegistryFreezeEvent} + * handlers for each applicable registry. + */ +@ApiStatus.Experimental +public final class RegistryEvents { + + // Paper start - Generated/RegistryEvents + // @GeneratedFrom 1.21.1 + public static final RegistryEventProvider GAME_EVENT = create(RegistryKey.GAME_EVENT); + public static final RegistryEventProvider ENCHANTMENT = create(RegistryKey.ENCHANTMENT); + // Paper end - Generated/RegistryEvents + + private RegistryEvents() { + } +} diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/BannerPatternKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/BannerPatternKeys.java similarity index 98% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/BannerPatternKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/BannerPatternKeys.java index e585ebb00a..048e0ce1c9 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/BannerPatternKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/BannerPatternKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.block.banner.PatternType; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#BANNER_PATTERN}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class BannerPatternKeys { @@ -331,13 +332,13 @@ public final class BannerPatternKeys { } /** - * Creates a key for {@link PatternType} in the registry {@code minecraft:banner_pattern}. + * Creates a typed key for {@link PatternType} in the registry {@code minecraft:banner_pattern}. * * @param key the value's key in the registry * @return a new typed key */ @ApiStatus.Experimental - public static @NonNull TypedKey create(final @NonNull Key key) { + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.BANNER_PATTERN, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/BlockTypeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/BlockTypeKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/BlockTypeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/BlockTypeKeys.java index 3daa9b638c..750ef3fddf 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/BlockTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/BlockTypeKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.block.BlockType; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#BLOCK}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class BlockTypeKeys { @@ -7449,7 +7450,7 @@ public final class BlockTypeKeys { private BlockTypeKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.BLOCK, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/CatVariantKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/CatVariantKeys.java similarity index 96% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/CatVariantKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/CatVariantKeys.java index a8cbc4c9a0..6d30ebdd5d 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/CatVariantKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/CatVariantKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Cat; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#CAT_VARIANT}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class CatVariantKeys { @@ -106,7 +107,7 @@ public final class CatVariantKeys { private CatVariantKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.CAT_VARIANT, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/DamageTypeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/DamageTypeKeys.java similarity index 98% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/DamageTypeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/DamageTypeKeys.java index 9cb651fb14..12f46a57fc 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/DamageTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/DamageTypeKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.damage.DamageType; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#DAMAGE_TYPE}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class DamageTypeKeys { @@ -359,13 +360,13 @@ public final class DamageTypeKeys { } /** - * Creates a key for {@link DamageType} in the registry {@code minecraft:damage_type}. + * Creates a typed key for {@link DamageType} in the registry {@code minecraft:damage_type}. * * @param key the value's key in the registry * @return a new typed key */ @ApiStatus.Experimental - public static @NonNull TypedKey create(final @NonNull Key key) { + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.DAMAGE_TYPE, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/EnchantmentKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/EnchantmentKeys.java similarity index 96% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/EnchantmentKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/EnchantmentKeys.java index 8a7b691af6..4d349cb709 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/EnchantmentKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/EnchantmentKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.enchantments.Enchantment; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#ENCHANTMENT}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class EnchantmentKeys { @@ -323,7 +324,14 @@ public final class EnchantmentKeys { private EnchantmentKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + /** + * Creates a typed key for {@link Enchantment} in the registry {@code minecraft:enchantment}. + * + * @param key the value's key in the registry + * @return a new typed key + */ + @ApiStatus.Experimental + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.ENCHANTMENT, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/FrogVariantKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/FrogVariantKeys.java similarity index 92% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/FrogVariantKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/FrogVariantKeys.java index 2b9c007e49..0552864fa8 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/FrogVariantKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/FrogVariantKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Frog; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#FROG_VARIANT}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class FrogVariantKeys { @@ -50,7 +51,7 @@ public final class FrogVariantKeys { private FrogVariantKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.FROG_VARIANT, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/GameEventKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/GameEventKeys.java similarity index 97% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/GameEventKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/GameEventKeys.java index e8a8e5f89a..7fd0b55658 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/GameEventKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/GameEventKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.GameEvent; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#GAME_EVENT}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class GameEventKeys { @@ -449,7 +450,14 @@ public final class GameEventKeys { private GameEventKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + /** + * Creates a typed key for {@link GameEvent} in the registry {@code minecraft:game_event}. + * + * @param key the value's key in the registry + * @return a new typed key + */ + @ApiStatus.Experimental + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.GAME_EVENT, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/InstrumentKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/InstrumentKeys.java similarity index 95% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/InstrumentKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/InstrumentKeys.java index 4d59a6b6e1..5b026cca90 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/InstrumentKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/InstrumentKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.MusicInstrument; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#INSTRUMENT}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class InstrumentKeys { @@ -85,7 +86,7 @@ public final class InstrumentKeys { private InstrumentKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.INSTRUMENT, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/ItemTypeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/ItemTypeKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/ItemTypeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/ItemTypeKeys.java index 052d129630..51d97f2567 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/ItemTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/ItemTypeKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.ItemType; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#ITEM}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class ItemTypeKeys { @@ -9360,7 +9361,7 @@ public final class ItemTypeKeys { private ItemTypeKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.ITEM, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/JukeboxSongKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/JukeboxSongKeys.java similarity index 95% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/JukeboxSongKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/JukeboxSongKeys.java index 4789b7e571..1e86e63b88 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/JukeboxSongKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/JukeboxSongKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.JukeboxSong; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#JUKEBOX_SONG}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class JukeboxSongKeys { @@ -163,13 +164,13 @@ public final class JukeboxSongKeys { } /** - * Creates a key for {@link JukeboxSong} in the registry {@code minecraft:jukebox_song}. + * Creates a typed key for {@link JukeboxSong} in the registry {@code minecraft:jukebox_song}. * * @param key the value's key in the registry * @return a new typed key */ @ApiStatus.Experimental - public static @NonNull TypedKey create(final @NonNull Key key) { + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.JUKEBOX_SONG, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java similarity index 98% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java index 6aa67743ec..f5bd644ce6 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.map.MapCursor; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#MAP_DECORATION_TYPE}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class MapDecorationTypeKeys { @@ -274,7 +275,7 @@ public final class MapDecorationTypeKeys { private MapDecorationTypeKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.MAP_DECORATION_TYPE, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/MenuTypeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MenuTypeKeys.java similarity index 98% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/MenuTypeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/MenuTypeKeys.java index 98e9563029..2ab9fc525e 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/MenuTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MenuTypeKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.MenuType; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#MENU}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class MenuTypeKeys { @@ -204,7 +205,7 @@ public final class MenuTypeKeys { private MenuTypeKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.MENU, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/MobEffectKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MobEffectKeys.java similarity index 98% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/MobEffectKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/MobEffectKeys.java index 621705fe8a..405e4112e6 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/MobEffectKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MobEffectKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.potion.PotionEffectType; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#MOB_EFFECT}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class MobEffectKeys { @@ -302,7 +303,7 @@ public final class MobEffectKeys { private MobEffectKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.MOB_EFFECT, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/StructureKeys.java similarity index 97% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/StructureKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/StructureKeys.java index a49c8cff2e..2acd7a6b31 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/StructureKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.generator.structure.Structure; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#STRUCTURE}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class StructureKeys { @@ -268,13 +269,13 @@ public final class StructureKeys { } /** - * Creates a key for {@link Structure} in the registry {@code minecraft:worldgen/structure}. + * Creates a typed key for {@link Structure} in the registry {@code minecraft:worldgen/structure}. * * @param key the value's key in the registry * @return a new typed key */ @ApiStatus.Experimental - public static @NonNull TypedKey create(final @NonNull Key key) { + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.STRUCTURE, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureTypeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/StructureTypeKeys.java similarity index 97% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/StructureTypeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/StructureTypeKeys.java index 353c0fa302..fb1048bc5f 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/StructureTypeKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.generator.structure.StructureType; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#STRUCTURE_TYPE}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class StructureTypeKeys { @@ -141,7 +142,7 @@ public final class StructureTypeKeys { private StructureTypeKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.STRUCTURE_TYPE, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimMaterialKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/TrimMaterialKeys.java similarity index 93% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/TrimMaterialKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/TrimMaterialKeys.java index e75f850a31..e5fc21a0c2 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimMaterialKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/TrimMaterialKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.meta.trim.TrimMaterial; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#TRIM_MATERIAL}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class TrimMaterialKeys { @@ -100,13 +101,13 @@ public final class TrimMaterialKeys { } /** - * Creates a key for {@link TrimMaterial} in the registry {@code minecraft:trim_material}. + * Creates a typed key for {@link TrimMaterial} in the registry {@code minecraft:trim_material}. * * @param key the value's key in the registry * @return a new typed key */ @ApiStatus.Experimental - public static @NonNull TypedKey create(final @NonNull Key key) { + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.TRIM_MATERIAL, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimPatternKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/TrimPatternKeys.java similarity index 95% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/TrimPatternKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/TrimPatternKeys.java index 65d2d63e85..3f9c2c351f 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimPatternKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/TrimPatternKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.meta.trim.TrimPattern; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#TRIM_PATTERN}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class TrimPatternKeys { @@ -156,13 +157,13 @@ public final class TrimPatternKeys { } /** - * Creates a key for {@link TrimPattern} in the registry {@code minecraft:trim_pattern}. + * Creates a typed key for {@link TrimPattern} in the registry {@code minecraft:trim_pattern}. * * @param key the value's key in the registry * @return a new typed key */ @ApiStatus.Experimental - public static @NonNull TypedKey create(final @NonNull Key key) { + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.TRIM_PATTERN, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/VillagerProfessionKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/VillagerProfessionKeys.java similarity index 96% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/VillagerProfessionKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/VillagerProfessionKeys.java index 6d8d0801bf..cc0a85261a 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/VillagerProfessionKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/VillagerProfessionKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Villager; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#VILLAGER_PROFESSION}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class VillagerProfessionKeys { @@ -134,7 +135,7 @@ public final class VillagerProfessionKeys { private VillagerProfessionKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.VILLAGER_PROFESSION, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/VillagerTypeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/VillagerTypeKeys.java similarity index 94% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/VillagerTypeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/VillagerTypeKeys.java index 524880dbaa..12c0220a84 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/VillagerTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/VillagerTypeKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Villager; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#VILLAGER_TYPE}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class VillagerTypeKeys { @@ -78,7 +79,7 @@ public final class VillagerTypeKeys { private VillagerTypeKeys() { } - private static @NonNull TypedKey create(final @NonNull Key key) { + private static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.VILLAGER_TYPE, key); } } diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/WolfVariantKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/WolfVariantKeys.java similarity index 93% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/WolfVariantKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/WolfVariantKeys.java index 7108d41c8d..c9e4bf73a9 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/WolfVariantKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/WolfVariantKeys.java @@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.TypedKey; import net.kyori.adventure.key.Key; import org.bukkit.entity.Wolf; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** * Vanilla keys for {@link RegistryKey#WOLF_VARIANT}. @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class WolfVariantKeys { @@ -93,13 +94,13 @@ public final class WolfVariantKeys { } /** - * Creates a key for {@link Wolf.Variant} in the registry {@code minecraft:wolf_variant}. + * Creates a typed key for {@link Wolf.Variant} in the registry {@code minecraft:wolf_variant}. * * @param key the value's key in the registry * @return a new typed key */ @ApiStatus.Experimental - public static @NonNull TypedKey create(final @NonNull Key key) { + public static TypedKey create(final Key key) { return TypedKey.create(RegistryKey.WOLF_VARIANT, key); } } diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java new file mode 100644 index 0000000000..8a8267eebd --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java @@ -0,0 +1,106 @@ +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.registry.RegistryKey; +import io.papermc.paper.registry.tag.TagKey; +import net.kyori.adventure.key.Key; +import org.bukkit.block.banner.PatternType; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +/** + * Vanilla tag keys for {@link RegistryKey#BANNER_PATTERN}. + * + * @apiNote The fields provided here are a direct representation of + * what is available from the vanilla game source. They may be + * changed (including removals) on any Minecraft version + * bump, so cross-version compatibility is not provided on the + * same level as it is on most of the other API. + */ +@SuppressWarnings({ + "unused", + "SpellCheckingInspection" +}) +@NullMarked +@GeneratedFrom("1.21.1") +@ApiStatus.Experimental +public final class BannerPatternTagKeys { + /** + * {@code #minecraft:no_item_required} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NO_ITEM_REQUIRED = create(key("no_item_required")); + + /** + * {@code #minecraft:pattern_item/creeper} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PATTERN_ITEM_CREEPER = create(key("pattern_item/creeper")); + + /** + * {@code #minecraft:pattern_item/flow} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PATTERN_ITEM_FLOW = create(key("pattern_item/flow")); + + /** + * {@code #minecraft:pattern_item/flower} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PATTERN_ITEM_FLOWER = create(key("pattern_item/flower")); + + /** + * {@code #minecraft:pattern_item/globe} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PATTERN_ITEM_GLOBE = create(key("pattern_item/globe")); + + /** + * {@code #minecraft:pattern_item/guster} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PATTERN_ITEM_GUSTER = create(key("pattern_item/guster")); + + /** + * {@code #minecraft:pattern_item/mojang} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PATTERN_ITEM_MOJANG = create(key("pattern_item/mojang")); + + /** + * {@code #minecraft:pattern_item/piglin} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PATTERN_ITEM_PIGLIN = create(key("pattern_item/piglin")); + + /** + * {@code #minecraft:pattern_item/skull} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PATTERN_ITEM_SKULL = create(key("pattern_item/skull")); + + private BannerPatternTagKeys() { + } + + /** + * Creates a tag key for {@link PatternType} in the registry {@code minecraft:banner_pattern}. + * + * @param key the tag key's key + * @return a new tag key + */ + @ApiStatus.Experimental + public static TagKey create(final Key key) { + return TagKey.create(RegistryKey.BANNER_PATTERN, key); + } +} diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java new file mode 100644 index 0000000000..49847331ee --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java @@ -0,0 +1,1331 @@ +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.registry.RegistryKey; +import io.papermc.paper.registry.tag.TagKey; +import net.kyori.adventure.key.Key; +import org.bukkit.block.BlockType; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +/** + * Vanilla tag keys for {@link RegistryKey#BLOCK}. + * + * @apiNote The fields provided here are a direct representation of + * what is available from the vanilla game source. They may be + * changed (including removals) on any Minecraft version + * bump, so cross-version compatibility is not provided on the + * same level as it is on most of the other API. + */ +@SuppressWarnings({ + "unused", + "SpellCheckingInspection" +}) +@NullMarked +@GeneratedFrom("1.21.1") +@ApiStatus.Experimental +public final class BlockTypeTagKeys { + /** + * {@code #minecraft:acacia_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ACACIA_LOGS = create(key("acacia_logs")); + + /** + * {@code #minecraft:air} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey AIR = create(key("air")); + + /** + * {@code #minecraft:all_hanging_signs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ALL_HANGING_SIGNS = create(key("all_hanging_signs")); + + /** + * {@code #minecraft:all_signs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ALL_SIGNS = create(key("all_signs")); + + /** + * {@code #minecraft:ancient_city_replaceable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ANCIENT_CITY_REPLACEABLE = create(key("ancient_city_replaceable")); + + /** + * {@code #minecraft:animals_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ANIMALS_SPAWNABLE_ON = create(key("animals_spawnable_on")); + + /** + * {@code #minecraft:anvil} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ANVIL = create(key("anvil")); + + /** + * {@code #minecraft:armadillo_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ARMADILLO_SPAWNABLE_ON = create(key("armadillo_spawnable_on")); + + /** + * {@code #minecraft:axolotls_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey AXOLOTLS_SPAWNABLE_ON = create(key("axolotls_spawnable_on")); + + /** + * {@code #minecraft:azalea_grows_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey AZALEA_GROWS_ON = create(key("azalea_grows_on")); + + /** + * {@code #minecraft:azalea_root_replaceable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey AZALEA_ROOT_REPLACEABLE = create(key("azalea_root_replaceable")); + + /** + * {@code #minecraft:badlands_terracotta} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BADLANDS_TERRACOTTA = create(key("badlands_terracotta")); + + /** + * {@code #minecraft:bamboo_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BAMBOO_BLOCKS = create(key("bamboo_blocks")); + + /** + * {@code #minecraft:bamboo_plantable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BAMBOO_PLANTABLE_ON = create(key("bamboo_plantable_on")); + + /** + * {@code #minecraft:banners} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BANNERS = create(key("banners")); + + /** + * {@code #minecraft:base_stone_nether} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BASE_STONE_NETHER = create(key("base_stone_nether")); + + /** + * {@code #minecraft:base_stone_overworld} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BASE_STONE_OVERWORLD = create(key("base_stone_overworld")); + + /** + * {@code #minecraft:beacon_base_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BEACON_BASE_BLOCKS = create(key("beacon_base_blocks")); + + /** + * {@code #minecraft:beds} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BEDS = create(key("beds")); + + /** + * {@code #minecraft:bee_growables} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BEE_GROWABLES = create(key("bee_growables")); + + /** + * {@code #minecraft:beehives} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BEEHIVES = create(key("beehives")); + + /** + * {@code #minecraft:big_dripleaf_placeable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BIG_DRIPLEAF_PLACEABLE = create(key("big_dripleaf_placeable")); + + /** + * {@code #minecraft:birch_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BIRCH_LOGS = create(key("birch_logs")); + + /** + * {@code #minecraft:blocks_wind_charge_explosions} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BLOCKS_WIND_CHARGE_EXPLOSIONS = create(key("blocks_wind_charge_explosions")); + + /** + * {@code #minecraft:buttons} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BUTTONS = create(key("buttons")); + + /** + * {@code #minecraft:camel_sand_step_sound_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CAMEL_SAND_STEP_SOUND_BLOCKS = create(key("camel_sand_step_sound_blocks")); + + /** + * {@code #minecraft:campfires} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CAMPFIRES = create(key("campfires")); + + /** + * {@code #minecraft:candle_cakes} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CANDLE_CAKES = create(key("candle_cakes")); + + /** + * {@code #minecraft:candles} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CANDLES = create(key("candles")); + + /** + * {@code #minecraft:cauldrons} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CAULDRONS = create(key("cauldrons")); + + /** + * {@code #minecraft:cave_vines} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CAVE_VINES = create(key("cave_vines")); + + /** + * {@code #minecraft:ceiling_hanging_signs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CEILING_HANGING_SIGNS = create(key("ceiling_hanging_signs")); + + /** + * {@code #minecraft:cherry_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CHERRY_LOGS = create(key("cherry_logs")); + + /** + * {@code #minecraft:climbable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CLIMBABLE = create(key("climbable")); + + /** + * {@code #minecraft:coal_ores} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey COAL_ORES = create(key("coal_ores")); + + /** + * {@code #minecraft:combination_step_sound_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey COMBINATION_STEP_SOUND_BLOCKS = create(key("combination_step_sound_blocks")); + + /** + * {@code #minecraft:completes_find_tree_tutorial} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey COMPLETES_FIND_TREE_TUTORIAL = create(key("completes_find_tree_tutorial")); + + /** + * {@code #minecraft:concrete_powder} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CONCRETE_POWDER = create(key("concrete_powder")); + + /** + * {@code #minecraft:convertable_to_mud} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CONVERTABLE_TO_MUD = create(key("convertable_to_mud")); + + /** + * {@code #minecraft:copper_ores} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey COPPER_ORES = create(key("copper_ores")); + + /** + * {@code #minecraft:coral_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CORAL_BLOCKS = create(key("coral_blocks")); + + /** + * {@code #minecraft:coral_plants} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CORAL_PLANTS = create(key("coral_plants")); + + /** + * {@code #minecraft:corals} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CORALS = create(key("corals")); + + /** + * {@code #minecraft:crimson_stems} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CRIMSON_STEMS = create(key("crimson_stems")); + + /** + * {@code #minecraft:crops} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CROPS = create(key("crops")); + + /** + * {@code #minecraft:crystal_sound_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CRYSTAL_SOUND_BLOCKS = create(key("crystal_sound_blocks")); + + /** + * {@code #minecraft:dampens_vibrations} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DAMPENS_VIBRATIONS = create(key("dampens_vibrations")); + + /** + * {@code #minecraft:dark_oak_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DARK_OAK_LOGS = create(key("dark_oak_logs")); + + /** + * {@code #minecraft:dead_bush_may_place_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DEAD_BUSH_MAY_PLACE_ON = create(key("dead_bush_may_place_on")); + + /** + * {@code #minecraft:deepslate_ore_replaceables} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DEEPSLATE_ORE_REPLACEABLES = create(key("deepslate_ore_replaceables")); + + /** + * {@code #minecraft:diamond_ores} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DIAMOND_ORES = create(key("diamond_ores")); + + /** + * {@code #minecraft:dirt} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DIRT = create(key("dirt")); + + /** + * {@code #minecraft:does_not_block_hoppers} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DOES_NOT_BLOCK_HOPPERS = create(key("does_not_block_hoppers")); + + /** + * {@code #minecraft:doors} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DOORS = create(key("doors")); + + /** + * {@code #minecraft:dragon_immune} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DRAGON_IMMUNE = create(key("dragon_immune")); + + /** + * {@code #minecraft:dragon_transparent} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DRAGON_TRANSPARENT = create(key("dragon_transparent")); + + /** + * {@code #minecraft:dripstone_replaceable_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DRIPSTONE_REPLACEABLE_BLOCKS = create(key("dripstone_replaceable_blocks")); + + /** + * {@code #minecraft:emerald_ores} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey EMERALD_ORES = create(key("emerald_ores")); + + /** + * {@code #minecraft:enchantment_power_provider} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ENCHANTMENT_POWER_PROVIDER = create(key("enchantment_power_provider")); + + /** + * {@code #minecraft:enchantment_power_transmitter} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ENCHANTMENT_POWER_TRANSMITTER = create(key("enchantment_power_transmitter")); + + /** + * {@code #minecraft:enderman_holdable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ENDERMAN_HOLDABLE = create(key("enderman_holdable")); + + /** + * {@code #minecraft:fall_damage_resetting} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FALL_DAMAGE_RESETTING = create(key("fall_damage_resetting")); + + /** + * {@code #minecraft:features_cannot_replace} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FEATURES_CANNOT_REPLACE = create(key("features_cannot_replace")); + + /** + * {@code #minecraft:fence_gates} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FENCE_GATES = create(key("fence_gates")); + + /** + * {@code #minecraft:fences} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FENCES = create(key("fences")); + + /** + * {@code #minecraft:fire} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FIRE = create(key("fire")); + + /** + * {@code #minecraft:flower_pots} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FLOWER_POTS = create(key("flower_pots")); + + /** + * {@code #minecraft:flowers} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FLOWERS = create(key("flowers")); + + /** + * {@code #minecraft:foxes_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FOXES_SPAWNABLE_ON = create(key("foxes_spawnable_on")); + + /** + * {@code #minecraft:frog_prefer_jump_to} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FROG_PREFER_JUMP_TO = create(key("frog_prefer_jump_to")); + + /** + * {@code #minecraft:frogs_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FROGS_SPAWNABLE_ON = create(key("frogs_spawnable_on")); + + /** + * {@code #minecraft:geode_invalid_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey GEODE_INVALID_BLOCKS = create(key("geode_invalid_blocks")); + + /** + * {@code #minecraft:goats_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey GOATS_SPAWNABLE_ON = create(key("goats_spawnable_on")); + + /** + * {@code #minecraft:gold_ores} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey GOLD_ORES = create(key("gold_ores")); + + /** + * {@code #minecraft:guarded_by_piglins} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey GUARDED_BY_PIGLINS = create(key("guarded_by_piglins")); + + /** + * {@code #minecraft:hoglin_repellents} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey HOGLIN_REPELLENTS = create(key("hoglin_repellents")); + + /** + * {@code #minecraft:ice} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ICE = create(key("ice")); + + /** + * {@code #minecraft:impermeable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IMPERMEABLE = create(key("impermeable")); + + /** + * {@code #minecraft:incorrect_for_diamond_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INCORRECT_FOR_DIAMOND_TOOL = create(key("incorrect_for_diamond_tool")); + + /** + * {@code #minecraft:incorrect_for_gold_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INCORRECT_FOR_GOLD_TOOL = create(key("incorrect_for_gold_tool")); + + /** + * {@code #minecraft:incorrect_for_iron_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INCORRECT_FOR_IRON_TOOL = create(key("incorrect_for_iron_tool")); + + /** + * {@code #minecraft:incorrect_for_netherite_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INCORRECT_FOR_NETHERITE_TOOL = create(key("incorrect_for_netherite_tool")); + + /** + * {@code #minecraft:incorrect_for_stone_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INCORRECT_FOR_STONE_TOOL = create(key("incorrect_for_stone_tool")); + + /** + * {@code #minecraft:incorrect_for_wooden_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INCORRECT_FOR_WOODEN_TOOL = create(key("incorrect_for_wooden_tool")); + + /** + * {@code #minecraft:infiniburn_end} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INFINIBURN_END = create(key("infiniburn_end")); + + /** + * {@code #minecraft:infiniburn_nether} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INFINIBURN_NETHER = create(key("infiniburn_nether")); + + /** + * {@code #minecraft:infiniburn_overworld} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INFINIBURN_OVERWORLD = create(key("infiniburn_overworld")); + + /** + * {@code #minecraft:inside_step_sound_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INSIDE_STEP_SOUND_BLOCKS = create(key("inside_step_sound_blocks")); + + /** + * {@code #minecraft:invalid_spawn_inside} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey INVALID_SPAWN_INSIDE = create(key("invalid_spawn_inside")); + + /** + * {@code #minecraft:iron_ores} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IRON_ORES = create(key("iron_ores")); + + /** + * {@code #minecraft:jungle_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey JUNGLE_LOGS = create(key("jungle_logs")); + + /** + * {@code #minecraft:lapis_ores} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey LAPIS_ORES = create(key("lapis_ores")); + + /** + * {@code #minecraft:lava_pool_stone_cannot_replace} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey LAVA_POOL_STONE_CANNOT_REPLACE = create(key("lava_pool_stone_cannot_replace")); + + /** + * {@code #minecraft:leaves} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey LEAVES = create(key("leaves")); + + /** + * {@code #minecraft:logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey LOGS = create(key("logs")); + + /** + * {@code #minecraft:logs_that_burn} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey LOGS_THAT_BURN = create(key("logs_that_burn")); + + /** + * {@code #minecraft:lush_ground_replaceable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey LUSH_GROUND_REPLACEABLE = create(key("lush_ground_replaceable")); + + /** + * {@code #minecraft:maintains_farmland} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MAINTAINS_FARMLAND = create(key("maintains_farmland")); + + /** + * {@code #minecraft:mangrove_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MANGROVE_LOGS = create(key("mangrove_logs")); + + /** + * {@code #minecraft:mangrove_logs_can_grow_through} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MANGROVE_LOGS_CAN_GROW_THROUGH = create(key("mangrove_logs_can_grow_through")); + + /** + * {@code #minecraft:mangrove_roots_can_grow_through} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MANGROVE_ROOTS_CAN_GROW_THROUGH = create(key("mangrove_roots_can_grow_through")); + + /** + * {@code #minecraft:mineable/axe} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MINEABLE_AXE = create(key("mineable/axe")); + + /** + * {@code #minecraft:mineable/hoe} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MINEABLE_HOE = create(key("mineable/hoe")); + + /** + * {@code #minecraft:mineable/pickaxe} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MINEABLE_PICKAXE = create(key("mineable/pickaxe")); + + /** + * {@code #minecraft:mineable/shovel} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MINEABLE_SHOVEL = create(key("mineable/shovel")); + + /** + * {@code #minecraft:mob_interactable_doors} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MOB_INTERACTABLE_DOORS = create(key("mob_interactable_doors")); + + /** + * {@code #minecraft:mooshrooms_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MOOSHROOMS_SPAWNABLE_ON = create(key("mooshrooms_spawnable_on")); + + /** + * {@code #minecraft:moss_replaceable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MOSS_REPLACEABLE = create(key("moss_replaceable")); + + /** + * {@code #minecraft:mushroom_grow_block} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MUSHROOM_GROW_BLOCK = create(key("mushroom_grow_block")); + + /** + * {@code #minecraft:needs_diamond_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NEEDS_DIAMOND_TOOL = create(key("needs_diamond_tool")); + + /** + * {@code #minecraft:needs_iron_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NEEDS_IRON_TOOL = create(key("needs_iron_tool")); + + /** + * {@code #minecraft:needs_stone_tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NEEDS_STONE_TOOL = create(key("needs_stone_tool")); + + /** + * {@code #minecraft:nether_carver_replaceables} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NETHER_CARVER_REPLACEABLES = create(key("nether_carver_replaceables")); + + /** + * {@code #minecraft:nylium} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NYLIUM = create(key("nylium")); + + /** + * {@code #minecraft:oak_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey OAK_LOGS = create(key("oak_logs")); + + /** + * {@code #minecraft:occludes_vibration_signals} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey OCCLUDES_VIBRATION_SIGNALS = create(key("occludes_vibration_signals")); + + /** + * {@code #minecraft:overworld_carver_replaceables} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey OVERWORLD_CARVER_REPLACEABLES = create(key("overworld_carver_replaceables")); + + /** + * {@code #minecraft:overworld_natural_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey OVERWORLD_NATURAL_LOGS = create(key("overworld_natural_logs")); + + /** + * {@code #minecraft:parrots_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PARROTS_SPAWNABLE_ON = create(key("parrots_spawnable_on")); + + /** + * {@code #minecraft:piglin_repellents} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PIGLIN_REPELLENTS = create(key("piglin_repellents")); + + /** + * {@code #minecraft:planks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PLANKS = create(key("planks")); + + /** + * {@code #minecraft:polar_bears_spawnable_on_alternate} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey POLAR_BEARS_SPAWNABLE_ON_ALTERNATE = create(key("polar_bears_spawnable_on_alternate")); + + /** + * {@code #minecraft:portals} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PORTALS = create(key("portals")); + + /** + * {@code #minecraft:pressure_plates} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PRESSURE_PLATES = create(key("pressure_plates")); + + /** + * {@code #minecraft:prevent_mob_spawning_inside} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PREVENT_MOB_SPAWNING_INSIDE = create(key("prevent_mob_spawning_inside")); + + /** + * {@code #minecraft:rabbits_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey RABBITS_SPAWNABLE_ON = create(key("rabbits_spawnable_on")); + + /** + * {@code #minecraft:rails} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey RAILS = create(key("rails")); + + /** + * {@code #minecraft:redstone_ores} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey REDSTONE_ORES = create(key("redstone_ores")); + + /** + * {@code #minecraft:replaceable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey REPLACEABLE = create(key("replaceable")); + + /** + * {@code #minecraft:replaceable_by_trees} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey REPLACEABLE_BY_TREES = create(key("replaceable_by_trees")); + + /** + * {@code #minecraft:sand} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SAND = create(key("sand")); + + /** + * {@code #minecraft:saplings} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SAPLINGS = create(key("saplings")); + + /** + * {@code #minecraft:sculk_replaceable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SCULK_REPLACEABLE = create(key("sculk_replaceable")); + + /** + * {@code #minecraft:sculk_replaceable_world_gen} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SCULK_REPLACEABLE_WORLD_GEN = create(key("sculk_replaceable_world_gen")); + + /** + * {@code #minecraft:shulker_boxes} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SHULKER_BOXES = create(key("shulker_boxes")); + + /** + * {@code #minecraft:signs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SIGNS = create(key("signs")); + + /** + * {@code #minecraft:slabs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SLABS = create(key("slabs")); + + /** + * {@code #minecraft:small_dripleaf_placeable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SMALL_DRIPLEAF_PLACEABLE = create(key("small_dripleaf_placeable")); + + /** + * {@code #minecraft:small_flowers} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SMALL_FLOWERS = create(key("small_flowers")); + + /** + * {@code #minecraft:smelts_to_glass} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SMELTS_TO_GLASS = create(key("smelts_to_glass")); + + /** + * {@code #minecraft:snaps_goat_horn} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SNAPS_GOAT_HORN = create(key("snaps_goat_horn")); + + /** + * {@code #minecraft:sniffer_diggable_block} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SNIFFER_DIGGABLE_BLOCK = create(key("sniffer_diggable_block")); + + /** + * {@code #minecraft:sniffer_egg_hatch_boost} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SNIFFER_EGG_HATCH_BOOST = create(key("sniffer_egg_hatch_boost")); + + /** + * {@code #minecraft:snow} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SNOW = create(key("snow")); + + /** + * {@code #minecraft:snow_layer_can_survive_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SNOW_LAYER_CAN_SURVIVE_ON = create(key("snow_layer_can_survive_on")); + + /** + * {@code #minecraft:snow_layer_cannot_survive_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SNOW_LAYER_CANNOT_SURVIVE_ON = create(key("snow_layer_cannot_survive_on")); + + /** + * {@code #minecraft:soul_fire_base_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SOUL_FIRE_BASE_BLOCKS = create(key("soul_fire_base_blocks")); + + /** + * {@code #minecraft:soul_speed_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SOUL_SPEED_BLOCKS = create(key("soul_speed_blocks")); + + /** + * {@code #minecraft:spruce_logs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SPRUCE_LOGS = create(key("spruce_logs")); + + /** + * {@code #minecraft:stairs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey STAIRS = create(key("stairs")); + + /** + * {@code #minecraft:standing_signs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey STANDING_SIGNS = create(key("standing_signs")); + + /** + * {@code #minecraft:stone_bricks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey STONE_BRICKS = create(key("stone_bricks")); + + /** + * {@code #minecraft:stone_buttons} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey STONE_BUTTONS = create(key("stone_buttons")); + + /** + * {@code #minecraft:stone_ore_replaceables} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey STONE_ORE_REPLACEABLES = create(key("stone_ore_replaceables")); + + /** + * {@code #minecraft:stone_pressure_plates} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey STONE_PRESSURE_PLATES = create(key("stone_pressure_plates")); + + /** + * {@code #minecraft:strider_warm_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey STRIDER_WARM_BLOCKS = create(key("strider_warm_blocks")); + + /** + * {@code #minecraft:sword_efficient} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SWORD_EFFICIENT = create(key("sword_efficient")); + + /** + * {@code #minecraft:tall_flowers} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey TALL_FLOWERS = create(key("tall_flowers")); + + /** + * {@code #minecraft:terracotta} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey TERRACOTTA = create(key("terracotta")); + + /** + * {@code #minecraft:trail_ruins_replaceable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey TRAIL_RUINS_REPLACEABLE = create(key("trail_ruins_replaceable")); + + /** + * {@code #minecraft:trapdoors} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey TRAPDOORS = create(key("trapdoors")); + + /** + * {@code #minecraft:underwater_bonemeals} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey UNDERWATER_BONEMEALS = create(key("underwater_bonemeals")); + + /** + * {@code #minecraft:unstable_bottom_center} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey UNSTABLE_BOTTOM_CENTER = create(key("unstable_bottom_center")); + + /** + * {@code #minecraft:valid_spawn} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey VALID_SPAWN = create(key("valid_spawn")); + + /** + * {@code #minecraft:vibration_resonators} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey VIBRATION_RESONATORS = create(key("vibration_resonators")); + + /** + * {@code #minecraft:wall_corals} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WALL_CORALS = create(key("wall_corals")); + + /** + * {@code #minecraft:wall_hanging_signs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WALL_HANGING_SIGNS = create(key("wall_hanging_signs")); + + /** + * {@code #minecraft:wall_post_override} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WALL_POST_OVERRIDE = create(key("wall_post_override")); + + /** + * {@code #minecraft:wall_signs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WALL_SIGNS = create(key("wall_signs")); + + /** + * {@code #minecraft:walls} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WALLS = create(key("walls")); + + /** + * {@code #minecraft:warped_stems} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WARPED_STEMS = create(key("warped_stems")); + + /** + * {@code #minecraft:wart_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WART_BLOCKS = create(key("wart_blocks")); + + /** + * {@code #minecraft:wither_immune} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WITHER_IMMUNE = create(key("wither_immune")); + + /** + * {@code #minecraft:wither_summon_base_blocks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WITHER_SUMMON_BASE_BLOCKS = create(key("wither_summon_base_blocks")); + + /** + * {@code #minecraft:wolves_spawnable_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOLVES_SPAWNABLE_ON = create(key("wolves_spawnable_on")); + + /** + * {@code #minecraft:wooden_buttons} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOODEN_BUTTONS = create(key("wooden_buttons")); + + /** + * {@code #minecraft:wooden_doors} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOODEN_DOORS = create(key("wooden_doors")); + + /** + * {@code #minecraft:wooden_fences} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOODEN_FENCES = create(key("wooden_fences")); + + /** + * {@code #minecraft:wooden_pressure_plates} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOODEN_PRESSURE_PLATES = create(key("wooden_pressure_plates")); + + /** + * {@code #minecraft:wooden_slabs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOODEN_SLABS = create(key("wooden_slabs")); + + /** + * {@code #minecraft:wooden_stairs} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOODEN_STAIRS = create(key("wooden_stairs")); + + /** + * {@code #minecraft:wooden_trapdoors} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOODEN_TRAPDOORS = create(key("wooden_trapdoors")); + + /** + * {@code #minecraft:wool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOOL = create(key("wool")); + + /** + * {@code #minecraft:wool_carpets} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WOOL_CARPETS = create(key("wool_carpets")); + + private BlockTypeTagKeys() { + } + + /** + * Creates a tag key for {@link BlockType} in the registry {@code minecraft:block}. + * + * @param key the tag key's key + * @return a new tag key + */ + @ApiStatus.Experimental + public static TagKey create(final Key key) { + return TagKey.create(RegistryKey.BLOCK, key); + } +} diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java new file mode 100644 index 0000000000..0d8257bf65 --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java @@ -0,0 +1,57 @@ +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.registry.RegistryKey; +import io.papermc.paper.registry.tag.TagKey; +import net.kyori.adventure.key.Key; +import org.bukkit.entity.Cat; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +/** + * Vanilla tag keys for {@link RegistryKey#CAT_VARIANT}. + * + * @apiNote The fields provided here are a direct representation of + * what is available from the vanilla game source. They may be + * changed (including removals) on any Minecraft version + * bump, so cross-version compatibility is not provided on the + * same level as it is on most of the other API. + */ +@SuppressWarnings({ + "unused", + "SpellCheckingInspection" +}) +@NullMarked +@GeneratedFrom("1.21.1") +@ApiStatus.Experimental +public final class CatVariantTagKeys { + /** + * {@code #minecraft:default_spawns} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DEFAULT_SPAWNS = create(key("default_spawns")); + + /** + * {@code #minecraft:full_moon_spawns} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey FULL_MOON_SPAWNS = create(key("full_moon_spawns")); + + private CatVariantTagKeys() { + } + + /** + * Creates a tag key for {@link Cat.Type} in the registry {@code minecraft:cat_variant}. + * + * @param key the tag key's key + * @return a new tag key + */ + @ApiStatus.Experimental + public static TagKey create(final Key key) { + return TagKey.create(RegistryKey.CAT_VARIANT, key); + } +} diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java new file mode 100644 index 0000000000..2f0dc2b7b8 --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java @@ -0,0 +1,267 @@ +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.registry.RegistryKey; +import io.papermc.paper.registry.tag.TagKey; +import net.kyori.adventure.key.Key; +import org.bukkit.damage.DamageType; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +/** + * Vanilla tag keys for {@link RegistryKey#DAMAGE_TYPE}. + * + * @apiNote The fields provided here are a direct representation of + * what is available from the vanilla game source. They may be + * changed (including removals) on any Minecraft version + * bump, so cross-version compatibility is not provided on the + * same level as it is on most of the other API. + */ +@SuppressWarnings({ + "unused", + "SpellCheckingInspection" +}) +@NullMarked +@GeneratedFrom("1.21.1") +@ApiStatus.Experimental +public final class DamageTypeTagKeys { + /** + * {@code #minecraft:always_hurts_ender_dragons} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ALWAYS_HURTS_ENDER_DRAGONS = create(key("always_hurts_ender_dragons")); + + /** + * {@code #minecraft:always_kills_armor_stands} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ALWAYS_KILLS_ARMOR_STANDS = create(key("always_kills_armor_stands")); + + /** + * {@code #minecraft:always_most_significant_fall} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ALWAYS_MOST_SIGNIFICANT_FALL = create(key("always_most_significant_fall")); + + /** + * {@code #minecraft:always_triggers_silverfish} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ALWAYS_TRIGGERS_SILVERFISH = create(key("always_triggers_silverfish")); + + /** + * {@code #minecraft:avoids_guardian_thorns} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey AVOIDS_GUARDIAN_THORNS = create(key("avoids_guardian_thorns")); + + /** + * {@code #minecraft:burn_from_stepping} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BURN_FROM_STEPPING = create(key("burn_from_stepping")); + + /** + * {@code #minecraft:burns_armor_stands} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BURNS_ARMOR_STANDS = create(key("burns_armor_stands")); + + /** + * {@code #minecraft:bypasses_armor} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BYPASSES_ARMOR = create(key("bypasses_armor")); + + /** + * {@code #minecraft:bypasses_effects} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BYPASSES_EFFECTS = create(key("bypasses_effects")); + + /** + * {@code #minecraft:bypasses_enchantments} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BYPASSES_ENCHANTMENTS = create(key("bypasses_enchantments")); + + /** + * {@code #minecraft:bypasses_invulnerability} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BYPASSES_INVULNERABILITY = create(key("bypasses_invulnerability")); + + /** + * {@code #minecraft:bypasses_resistance} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BYPASSES_RESISTANCE = create(key("bypasses_resistance")); + + /** + * {@code #minecraft:bypasses_shield} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BYPASSES_SHIELD = create(key("bypasses_shield")); + + /** + * {@code #minecraft:bypasses_wolf_armor} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey BYPASSES_WOLF_ARMOR = create(key("bypasses_wolf_armor")); + + /** + * {@code #minecraft:can_break_armor_stand} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CAN_BREAK_ARMOR_STAND = create(key("can_break_armor_stand")); + + /** + * {@code #minecraft:damages_helmet} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DAMAGES_HELMET = create(key("damages_helmet")); + + /** + * {@code #minecraft:ignites_armor_stands} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IGNITES_ARMOR_STANDS = create(key("ignites_armor_stands")); + + /** + * {@code #minecraft:is_drowning} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IS_DROWNING = create(key("is_drowning")); + + /** + * {@code #minecraft:is_explosion} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IS_EXPLOSION = create(key("is_explosion")); + + /** + * {@code #minecraft:is_fall} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IS_FALL = create(key("is_fall")); + + /** + * {@code #minecraft:is_fire} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IS_FIRE = create(key("is_fire")); + + /** + * {@code #minecraft:is_freezing} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IS_FREEZING = create(key("is_freezing")); + + /** + * {@code #minecraft:is_lightning} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IS_LIGHTNING = create(key("is_lightning")); + + /** + * {@code #minecraft:is_player_attack} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IS_PLAYER_ATTACK = create(key("is_player_attack")); + + /** + * {@code #minecraft:is_projectile} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IS_PROJECTILE = create(key("is_projectile")); + + /** + * {@code #minecraft:no_anger} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NO_ANGER = create(key("no_anger")); + + /** + * {@code #minecraft:no_impact} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NO_IMPACT = create(key("no_impact")); + + /** + * {@code #minecraft:no_knockback} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey NO_KNOCKBACK = create(key("no_knockback")); + + /** + * {@code #minecraft:panic_causes} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PANIC_CAUSES = create(key("panic_causes")); + + /** + * {@code #minecraft:panic_environmental_causes} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey PANIC_ENVIRONMENTAL_CAUSES = create(key("panic_environmental_causes")); + + /** + * {@code #minecraft:witch_resistant_to} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WITCH_RESISTANT_TO = create(key("witch_resistant_to")); + + /** + * {@code #minecraft:wither_immune_to} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WITHER_IMMUNE_TO = create(key("wither_immune_to")); + + private DamageTypeTagKeys() { + } + + /** + * Creates a tag key for {@link DamageType} in the registry {@code minecraft:damage_type}. + * + * @param key the tag key's key + * @return a new tag key + */ + @ApiStatus.Experimental + public static TagKey create(final Key key) { + return TagKey.create(RegistryKey.DAMAGE_TYPE, key); + } +} diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/EnchantmentTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/EnchantmentTagKeys.java similarity index 98% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/EnchantmentTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/EnchantmentTagKeys.java index 5d2a22742f..66a448ff70 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/EnchantmentTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/EnchantmentTagKeys.java @@ -8,11 +8,11 @@ import io.papermc.paper.registry.tag.TagKey; import net.kyori.adventure.key.Key; import org.bukkit.MinecraftExperimental; import org.bukkit.enchantments.Enchantment; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#ENCHANTMENT}. + * Vanilla tag keys for {@link RegistryKey#ENCHANTMENT}. * * @apiNote The fields provided here are a direct representation of * what is available from the vanilla game source. They may be @@ -24,6 +24,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class EnchantmentTagKeys { @@ -317,7 +318,7 @@ public final class EnchantmentTagKeys { * @return a new tag key */ @ApiStatus.Experimental - public static @NonNull TagKey create(final @NonNull Key key) { + public static TagKey create(final Key key) { return TagKey.create(RegistryKey.ENCHANTMENT, key); } } diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java new file mode 100644 index 0000000000..1478a66b20 --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java @@ -0,0 +1,78 @@ +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.registry.RegistryKey; +import io.papermc.paper.registry.tag.TagKey; +import net.kyori.adventure.key.Key; +import org.bukkit.GameEvent; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +/** + * Vanilla tag keys for {@link RegistryKey#GAME_EVENT}. + * + * @apiNote The fields provided here are a direct representation of + * what is available from the vanilla game source. They may be + * changed (including removals) on any Minecraft version + * bump, so cross-version compatibility is not provided on the + * same level as it is on most of the other API. + */ +@SuppressWarnings({ + "unused", + "SpellCheckingInspection" +}) +@NullMarked +@GeneratedFrom("1.21.1") +@ApiStatus.Experimental +public final class GameEventTagKeys { + /** + * {@code #minecraft:allay_can_listen} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ALLAY_CAN_LISTEN = create(key("allay_can_listen")); + + /** + * {@code #minecraft:ignore_vibrations_sneaking} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey IGNORE_VIBRATIONS_SNEAKING = create(key("ignore_vibrations_sneaking")); + + /** + * {@code #minecraft:shrieker_can_listen} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SHRIEKER_CAN_LISTEN = create(key("shrieker_can_listen")); + + /** + * {@code #minecraft:vibrations} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey VIBRATIONS = create(key("vibrations")); + + /** + * {@code #minecraft:warden_can_listen} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey WARDEN_CAN_LISTEN = create(key("warden_can_listen")); + + private GameEventTagKeys() { + } + + /** + * Creates a tag key for {@link GameEvent} in the registry {@code minecraft:game_event}. + * + * @param key the tag key's key + * @return a new tag key + */ + @ApiStatus.Experimental + public static TagKey create(final Key key) { + return TagKey.create(RegistryKey.GAME_EVENT, key); + } +} diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java new file mode 100644 index 0000000000..48d38c19f2 --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java @@ -0,0 +1,64 @@ +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.registry.RegistryKey; +import io.papermc.paper.registry.tag.TagKey; +import net.kyori.adventure.key.Key; +import org.bukkit.MusicInstrument; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +/** + * Vanilla tag keys for {@link RegistryKey#INSTRUMENT}. + * + * @apiNote The fields provided here are a direct representation of + * what is available from the vanilla game source. They may be + * changed (including removals) on any Minecraft version + * bump, so cross-version compatibility is not provided on the + * same level as it is on most of the other API. + */ +@SuppressWarnings({ + "unused", + "SpellCheckingInspection" +}) +@NullMarked +@GeneratedFrom("1.21.1") +@ApiStatus.Experimental +public final class InstrumentTagKeys { + /** + * {@code #minecraft:goat_horns} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey GOAT_HORNS = create(key("goat_horns")); + + /** + * {@code #minecraft:regular_goat_horns} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey REGULAR_GOAT_HORNS = create(key("regular_goat_horns")); + + /** + * {@code #minecraft:screaming_goat_horns} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SCREAMING_GOAT_HORNS = create(key("screaming_goat_horns")); + + private InstrumentTagKeys() { + } + + /** + * Creates a tag key for {@link MusicInstrument} in the registry {@code minecraft:instrument}. + * + * @param key the tag key's key + * @return a new tag key + */ + @ApiStatus.Experimental + public static TagKey create(final Key key) { + return TagKey.create(RegistryKey.INSTRUMENT, key); + } +} diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/ItemTypeTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/ItemTypeTagKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/ItemTypeTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/ItemTypeTagKeys.java index b0a153f670..eedb2bf3f2 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/ItemTypeTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/ItemTypeTagKeys.java @@ -7,11 +7,11 @@ import io.papermc.paper.registry.RegistryKey; import io.papermc.paper.registry.tag.TagKey; import net.kyori.adventure.key.Key; import org.bukkit.inventory.ItemType; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#ITEM}. + * Vanilla tag keys for {@link RegistryKey#ITEM}. * * @apiNote The fields provided here are a direct representation of * what is available from the vanilla game source. They may be @@ -23,6 +23,7 @@ import org.jetbrains.annotations.ApiStatus; "unused", "SpellCheckingInspection" }) +@NullMarked @GeneratedFrom("1.21.1") @ApiStatus.Experimental public final class ItemTypeTagKeys { @@ -1065,7 +1066,7 @@ public final class ItemTypeTagKeys { * @return a new tag key */ @ApiStatus.Experimental - public static @NonNull TagKey create(final @NonNull Key key) { + public static TagKey create(final Key key) { return TagKey.create(RegistryKey.ITEM, key); } } diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/StructureTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/StructureTagKeys.java new file mode 100644 index 0000000000..c6b1149891 --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/StructureTagKeys.java @@ -0,0 +1,198 @@ +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.registry.RegistryKey; +import io.papermc.paper.registry.tag.TagKey; +import net.kyori.adventure.key.Key; +import org.bukkit.MinecraftExperimental; +import org.bukkit.generator.structure.Structure; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +/** + * Vanilla tag keys for {@link RegistryKey#STRUCTURE}. + * + * @apiNote The fields provided here are a direct representation of + * what is available from the vanilla game source. They may be + * changed (including removals) on any Minecraft version + * bump, so cross-version compatibility is not provided on the + * same level as it is on most of the other API. + */ +@SuppressWarnings({ + "unused", + "SpellCheckingInspection" +}) +@NullMarked +@GeneratedFrom("1.21.1") +@ApiStatus.Experimental +public final class StructureTagKeys { + /** + * {@code #minecraft:cats_spawn_as_black} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CATS_SPAWN_AS_BLACK = create(key("cats_spawn_as_black")); + + /** + * {@code #minecraft:cats_spawn_in} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey CATS_SPAWN_IN = create(key("cats_spawn_in")); + + /** + * {@code #minecraft:dolphin_located} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey DOLPHIN_LOCATED = create(key("dolphin_located")); + + /** + * {@code #minecraft:eye_of_ender_located} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey EYE_OF_ENDER_LOCATED = create(key("eye_of_ender_located")); + + /** + * {@code #minecraft:mineshaft} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey MINESHAFT = create(key("mineshaft")); + + /** + * {@code #minecraft:ocean_ruin} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey OCEAN_RUIN = create(key("ocean_ruin")); + + /** + * {@code #minecraft:on_desert_village_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + @ApiStatus.Experimental + @MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE) + public static final TagKey ON_DESERT_VILLAGE_MAPS = create(key("on_desert_village_maps")); + + /** + * {@code #minecraft:on_jungle_explorer_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + @ApiStatus.Experimental + @MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE) + public static final TagKey ON_JUNGLE_EXPLORER_MAPS = create(key("on_jungle_explorer_maps")); + + /** + * {@code #minecraft:on_ocean_explorer_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ON_OCEAN_EXPLORER_MAPS = create(key("on_ocean_explorer_maps")); + + /** + * {@code #minecraft:on_plains_village_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + @ApiStatus.Experimental + @MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE) + public static final TagKey ON_PLAINS_VILLAGE_MAPS = create(key("on_plains_village_maps")); + + /** + * {@code #minecraft:on_savanna_village_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + @ApiStatus.Experimental + @MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE) + public static final TagKey ON_SAVANNA_VILLAGE_MAPS = create(key("on_savanna_village_maps")); + + /** + * {@code #minecraft:on_snowy_village_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + @ApiStatus.Experimental + @MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE) + public static final TagKey ON_SNOWY_VILLAGE_MAPS = create(key("on_snowy_village_maps")); + + /** + * {@code #minecraft:on_swamp_explorer_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + @ApiStatus.Experimental + @MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE) + public static final TagKey ON_SWAMP_EXPLORER_MAPS = create(key("on_swamp_explorer_maps")); + + /** + * {@code #minecraft:on_taiga_village_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + @ApiStatus.Experimental + @MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE) + public static final TagKey ON_TAIGA_VILLAGE_MAPS = create(key("on_taiga_village_maps")); + + /** + * {@code #minecraft:on_treasure_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ON_TREASURE_MAPS = create(key("on_treasure_maps")); + + /** + * {@code #minecraft:on_trial_chambers_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ON_TRIAL_CHAMBERS_MAPS = create(key("on_trial_chambers_maps")); + + /** + * {@code #minecraft:on_woodland_explorer_maps} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey ON_WOODLAND_EXPLORER_MAPS = create(key("on_woodland_explorer_maps")); + + /** + * {@code #minecraft:ruined_portal} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey RUINED_PORTAL = create(key("ruined_portal")); + + /** + * {@code #minecraft:shipwreck} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey SHIPWRECK = create(key("shipwreck")); + + /** + * {@code #minecraft:village} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TagKey VILLAGE = create(key("village")); + + private StructureTagKeys() { + } + + /** + * Creates a tag key for {@link Structure} in the registry {@code minecraft:worldgen/structure}. + * + * @param key the tag key's key + * @return a new tag key + */ + @ApiStatus.Experimental + public static TagKey create(final Key key) { + return TagKey.create(RegistryKey.STRUCTURE, key); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/Art.java b/paper-generator/generatedApi/org/bukkit/Art.java new file mode 100644 index 0000000000..7896a09c01 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Art.java @@ -0,0 +1,156 @@ +package org.bukkit; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import java.util.HashMap; +import java.util.Locale; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents the art on a painting + */ +public enum Art implements Keyed { + // Paper start - Generated/Art + // @GeneratedFrom 1.21.1 + ALBAN(0, 1, 1), + AZTEC(1, 1, 1), + AZTEC2(2, 1, 1), + BACKYARD(3, 3, 4), + BAROQUE(4, 2, 2), + BOMB(5, 1, 1), + BOUQUET(6, 3, 3), + BURNING_SKULL(7, 4, 4), + BUST(8, 2, 2), + CAVEBIRD(9, 3, 3), + CHANGING(10, 4, 2), + COTAN(11, 3, 3), + COURBET(12, 2, 1), + CREEBET(13, 2, 1), + DONKEY_KONG(14, 4, 3), + EARTH(15, 2, 2), + ENDBOSS(16, 3, 3), + FERN(17, 3, 3), + FIGHTERS(18, 4, 2), + FINDING(19, 4, 2), + FIRE(20, 2, 2), + GRAHAM(21, 1, 2), + HUMBLE(22, 2, 2), + KEBAB(23, 1, 1), + LOWMIST(24, 4, 2), + MATCH(25, 2, 2), + MEDITATIVE(26, 1, 1), + ORB(27, 4, 4), + OWLEMONS(28, 3, 3), + PASSAGE(29, 4, 2), + PIGSCENE(30, 4, 4), + PLANT(31, 1, 1), + POINTER(32, 4, 4), + POND(33, 3, 4), + POOL(34, 2, 1), + PRAIRIE_RIDE(35, 1, 2), + SEA(36, 2, 1), + SKELETON(37, 4, 3), + SKULL_AND_ROSES(38, 2, 2), + STAGE(39, 2, 2), + SUNFLOWERS(40, 3, 3), + SUNSET(41, 2, 1), + TIDES(42, 3, 3), + UNPACKED(43, 4, 4), + VOID(44, 2, 2), + WANDERER(45, 1, 2), + WASTELAND(46, 1, 1), + WATER(47, 2, 2), + WIND(48, 2, 2), + WITHER(49, 2, 2); + // Paper end - Generated/Art + + private final int id, width, height; + private final NamespacedKey key; + private static final HashMap BY_NAME = Maps.newHashMap(); + private static final HashMap BY_ID = Maps.newHashMap(); + + private Art(int id, int width, int height) { + this.id = id; + this.width = width; + this.height = height; + this.key = NamespacedKey.minecraft(name().toLowerCase(Locale.ROOT)); + } + + /** + * Gets the width of the painting, in blocks + * + * @return The width of the painting, in blocks + */ + public int getBlockWidth() { + return width; + } + + /** + * Gets the height of the painting, in blocks + * + * @return The height of the painting, in blocks + */ + public int getBlockHeight() { + return height; + } + + /** + * Get the ID of this painting. + * + * @return The ID of this painting + * @apiNote Internal Use Only + */ + @org.jetbrains.annotations.ApiStatus.Internal // Paper + public int getId() { + return id; + } + + // Paper start - deprecate getKey + /** + * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)}, + * and {@link io.papermc.paper.registry.RegistryKey#PAINTING_VARIANT}. Painting variants can exist without a key. + */ + @Deprecated(since = "1.21") + // Paper end - deprecate getKey + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + + /** + * Get a painting by its numeric ID + * + * @param id The ID + * @return The painting + * @apiNote Internal Use Only + */ + @org.jetbrains.annotations.ApiStatus.Internal // Paper + @Nullable + public static Art getById(int id) { + return BY_ID.get(id); + } + + /** + * Get a painting by its unique name + *

+ * This ignores underscores and capitalization + * + * @param name The name + * @return The painting + */ + @Nullable + public static Art getByName(@NotNull String name) { + Preconditions.checkArgument(name != null, "Name cannot be null"); + + return BY_NAME.get(name.toLowerCase(Locale.ROOT)); + } + + static { + for (Art art : values()) { + BY_ID.put(art.id, art); + BY_NAME.put(art.toString().toLowerCase(Locale.ROOT), art); + } + } +} diff --git a/paper-generator/generatedApi/org/bukkit/FeatureFlag.java b/paper-generator/generatedApi/org/bukkit/FeatureFlag.java new file mode 100644 index 0000000000..4dd3147ad9 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/FeatureFlag.java @@ -0,0 +1,50 @@ +package org.bukkit; + +// Paper start - overhaul FeatureFlag API +import com.google.common.base.Preconditions; +import java.util.List; +import net.kyori.adventure.key.Key; +import net.kyori.adventure.util.Index; +import org.intellij.lang.annotations.Subst; +// Paper end - overhaul FeatureFlag API +import org.jetbrains.annotations.ApiStatus; + +/** + * This represents a Feature Flag for a {@link io.papermc.paper.world.flag.FeatureFlagSetHolder}. + */ +public interface FeatureFlag extends Keyed { + + // Paper start - overhaul FeatureFlag API + // Paper start - Generated/FeatureFlag + // @GeneratedFrom 1.21.1 + @ApiStatus.Experimental + FeatureFlag BUNDLE = create("bundle"); + + @ApiStatus.Experimental + FeatureFlag TRADE_REBALANCE = create("trade_rebalance"); + + FeatureFlag VANILLA = create("vanilla"); + // Paper end - Generated/FeatureFlag + + @Deprecated(since = "1.20") + FeatureFlag UPDATE_1_20 = deprecated("update_1_20"); + + @Deprecated(since = "1.21") + FeatureFlag UPDATE_121 = deprecated("update_1_21"); + + /** + * An index of all feature flags. + */ + Index ALL_FLAGS = Index.create(FeatureFlag::key, List.copyOf(FeatureFlagImpl.ALL_FLAGS)); + + private static FeatureFlag create(@Subst("vanilla") final String name) { + final FeatureFlag flag = new FeatureFlagImpl(NamespacedKey.minecraft(name)); + Preconditions.checkState(FeatureFlagImpl.ALL_FLAGS.add(flag), "Tried to add duplicate feature flag: " + name); + return flag; + } + + private static FeatureFlag deprecated(@Subst("vanilla") final String name) { + return new FeatureFlagImpl.Deprecated(NamespacedKey.minecraft(name)); + } + // Paper end - overhaul FeatureFlag API +} diff --git a/paper-generator/generatedApi/org/bukkit/Fluid.java b/paper-generator/generatedApi/org/bukkit/Fluid.java new file mode 100644 index 0000000000..12930ef0af --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Fluid.java @@ -0,0 +1,31 @@ +package org.bukkit; + +import java.util.Locale; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a fluid type. + */ +public enum Fluid implements Keyed { + + // Paper start - Generated/Fluid + // @GeneratedFrom 1.21.1 + EMPTY, + FLOWING_LAVA, + FLOWING_WATER, + LAVA, + WATER; + // Paper end - Generated/Fluid + + private final NamespacedKey key; + + private Fluid() { + this.key = NamespacedKey.minecraft(this.name().toLowerCase(Locale.ROOT)); + } + + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } +} diff --git a/paper-generator/generatedApi/org/bukkit/GameEvent.java b/paper-generator/generatedApi/org/bukkit/GameEvent.java new file mode 100644 index 0000000000..f1023b8358 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/GameEvent.java @@ -0,0 +1,230 @@ +package org.bukkit; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Collection; +import java.util.Collections; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a generic Mojang game event. + */ +public abstract class GameEvent implements Keyed { + + // Paper start - Generated/GameEvent + // @GeneratedFrom 1.21.1 + public static final GameEvent BLOCK_ACTIVATE = getEvent("block_activate"); + + public static final GameEvent BLOCK_ATTACH = getEvent("block_attach"); + + public static final GameEvent BLOCK_CHANGE = getEvent("block_change"); + + public static final GameEvent BLOCK_CLOSE = getEvent("block_close"); + + public static final GameEvent BLOCK_DEACTIVATE = getEvent("block_deactivate"); + + public static final GameEvent BLOCK_DESTROY = getEvent("block_destroy"); + + public static final GameEvent BLOCK_DETACH = getEvent("block_detach"); + + public static final GameEvent BLOCK_OPEN = getEvent("block_open"); + + public static final GameEvent BLOCK_PLACE = getEvent("block_place"); + + public static final GameEvent CONTAINER_CLOSE = getEvent("container_close"); + + public static final GameEvent CONTAINER_OPEN = getEvent("container_open"); + + public static final GameEvent DRINK = getEvent("drink"); + + public static final GameEvent EAT = getEvent("eat"); + + public static final GameEvent ELYTRA_GLIDE = getEvent("elytra_glide"); + + public static final GameEvent ENTITY_ACTION = getEvent("entity_action"); + + public static final GameEvent ENTITY_DAMAGE = getEvent("entity_damage"); + + public static final GameEvent ENTITY_DIE = getEvent("entity_die"); + + public static final GameEvent ENTITY_DISMOUNT = getEvent("entity_dismount"); + + public static final GameEvent ENTITY_INTERACT = getEvent("entity_interact"); + + public static final GameEvent ENTITY_MOUNT = getEvent("entity_mount"); + + public static final GameEvent ENTITY_PLACE = getEvent("entity_place"); + + public static final GameEvent EQUIP = getEvent("equip"); + + public static final GameEvent EXPLODE = getEvent("explode"); + + public static final GameEvent FLAP = getEvent("flap"); + + public static final GameEvent FLUID_PICKUP = getEvent("fluid_pickup"); + + public static final GameEvent FLUID_PLACE = getEvent("fluid_place"); + + public static final GameEvent HIT_GROUND = getEvent("hit_ground"); + + public static final GameEvent INSTRUMENT_PLAY = getEvent("instrument_play"); + + public static final GameEvent ITEM_INTERACT_FINISH = getEvent("item_interact_finish"); + + public static final GameEvent ITEM_INTERACT_START = getEvent("item_interact_start"); + + public static final GameEvent JUKEBOX_PLAY = getEvent("jukebox_play"); + + public static final GameEvent JUKEBOX_STOP_PLAY = getEvent("jukebox_stop_play"); + + public static final GameEvent LIGHTNING_STRIKE = getEvent("lightning_strike"); + + public static final GameEvent NOTE_BLOCK_PLAY = getEvent("note_block_play"); + + public static final GameEvent PRIME_FUSE = getEvent("prime_fuse"); + + public static final GameEvent PROJECTILE_LAND = getEvent("projectile_land"); + + public static final GameEvent PROJECTILE_SHOOT = getEvent("projectile_shoot"); + + public static final GameEvent RESONATE_1 = getEvent("resonate_1"); + + public static final GameEvent RESONATE_2 = getEvent("resonate_2"); + + public static final GameEvent RESONATE_3 = getEvent("resonate_3"); + + public static final GameEvent RESONATE_4 = getEvent("resonate_4"); + + public static final GameEvent RESONATE_5 = getEvent("resonate_5"); + + public static final GameEvent RESONATE_6 = getEvent("resonate_6"); + + public static final GameEvent RESONATE_7 = getEvent("resonate_7"); + + public static final GameEvent RESONATE_8 = getEvent("resonate_8"); + + public static final GameEvent RESONATE_9 = getEvent("resonate_9"); + + public static final GameEvent RESONATE_10 = getEvent("resonate_10"); + + public static final GameEvent RESONATE_11 = getEvent("resonate_11"); + + public static final GameEvent RESONATE_12 = getEvent("resonate_12"); + + public static final GameEvent RESONATE_13 = getEvent("resonate_13"); + + public static final GameEvent RESONATE_14 = getEvent("resonate_14"); + + public static final GameEvent RESONATE_15 = getEvent("resonate_15"); + + public static final GameEvent SCULK_SENSOR_TENDRILS_CLICKING = getEvent("sculk_sensor_tendrils_clicking"); + + public static final GameEvent SHEAR = getEvent("shear"); + + public static final GameEvent SHRIEK = getEvent("shriek"); + + public static final GameEvent SPLASH = getEvent("splash"); + + public static final GameEvent STEP = getEvent("step"); + + public static final GameEvent SWIM = getEvent("swim"); + + public static final GameEvent TELEPORT = getEvent("teleport"); + + public static final GameEvent UNEQUIP = getEvent("unequip"); + // Paper end - Generated/GameEvent + @Deprecated + public static final GameEvent BLOCK_PRESS = getEvent("block_activate"); + @Deprecated + public static final GameEvent BLOCK_SWITCH = getEvent("block_activate"); + @Deprecated + public static final GameEvent BLOCK_UNPRESS = getEvent("block_deactivate"); + @Deprecated + public static final GameEvent BLOCK_UNSWITCH = getEvent("block_deactivate"); + @Deprecated + public static final GameEvent DISPENSE_FAIL = getEvent("block_activate"); + @Deprecated + public static final GameEvent DRINKING_FINISH = getEvent("drink"); + @Deprecated + public static final GameEvent ELYTRA_FREE_FALL = getEvent("elytra_glide"); + @Deprecated + public static final GameEvent ENTITY_DAMAGED = getEvent("entity_damage"); + @Deprecated + public static final GameEvent ENTITY_DYING = getEvent("entity_die"); + @Deprecated + public static final GameEvent ENTITY_KILLED = getEvent("entity_die"); + @Deprecated + public static final GameEvent ENTITY_ROAR = getEvent("entity_action"); + @Deprecated + public static final GameEvent ENTITY_SHAKE = getEvent("entity_action"); + @Deprecated + public static final GameEvent MOB_INTERACT = getEvent("entity_interact"); + @Deprecated + public static final GameEvent PISTON_CONTRACT = getEvent("block_deactivate"); + @Deprecated + public static final GameEvent PISTON_EXTEND = getEvent("block_activate"); + @Deprecated + public static final GameEvent RAVAGER_ROAR = getEvent("entity_action"); + @Deprecated + public static final GameEvent RING_BELL = getEvent("block_change"); + @Deprecated + public static final GameEvent SHULKER_CLOSE = getEvent("container_close"); + @Deprecated + public static final GameEvent SHULKER_OPEN = getEvent("container_open"); + @Deprecated + public static final GameEvent WOLF_SHAKING = getEvent("entity_action"); + + /** + * Returns a {@link GameEvent} by a {@link NamespacedKey}. + * + * @param namespacedKey the key + * @return the event or null + * @deprecated Use {@link Registry#get(NamespacedKey)} instead. + */ + @Nullable + @Deprecated + public static GameEvent getByKey(@NotNull NamespacedKey namespacedKey) { + return Registry.GAME_EVENT.get(namespacedKey); + } + + /** + * Returns the set of all GameEvents. + * + * @return the memoryKeys + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated + public static Collection values() { + return Collections.unmodifiableCollection(Lists.newArrayList(Registry.GAME_EVENT)); + } + + @NotNull + private static GameEvent getEvent(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + GameEvent gameEvent = Registry.GAME_EVENT.get(namespacedKey); + + Preconditions.checkNotNull(gameEvent, "No GameEvent found for %s. This is a bug.", namespacedKey); + + return gameEvent; + } + // Paper start + /** + * Gets the range of the event which is used to + * notify listeners of the event. + * + * @return the range + */ + public abstract int getRange(); + + /** + * Gets the vibration level of the game event for vibration listeners. + * Not all events have vibration levels, and a level of 0 means + * it won't cause any vibrations. + * + * @return the vibration level + */ + public abstract int getVibrationLevel(); + // Paper end +} diff --git a/paper-generator/generatedApi/org/bukkit/JukeboxSong.java b/paper-generator/generatedApi/org/bukkit/JukeboxSong.java new file mode 100644 index 0000000000..24ee52072c --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/JukeboxSong.java @@ -0,0 +1,68 @@ +package org.bukkit; + +import java.util.Objects; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a song which may play in a Jukebox. + */ +@ApiStatus.Experimental +public interface JukeboxSong extends Keyed, Translatable { + + // Paper start - Generated/JukeboxSong + // @GeneratedFrom 1.21.1 + JukeboxSong ELEVEN = get("11"); + + JukeboxSong THIRTEEN = get("13"); + + JukeboxSong FIVE = get("5"); + + JukeboxSong BLOCKS = get("blocks"); + + JukeboxSong CAT = get("cat"); + + JukeboxSong CHIRP = get("chirp"); + + JukeboxSong CREATOR = get("creator"); + + JukeboxSong CREATOR_MUSIC_BOX = get("creator_music_box"); + + JukeboxSong FAR = get("far"); + + JukeboxSong MALL = get("mall"); + + JukeboxSong MELLOHI = get("mellohi"); + + JukeboxSong OTHERSIDE = get("otherside"); + + JukeboxSong PIGSTEP = get("pigstep"); + + JukeboxSong PRECIPICE = get("precipice"); + + JukeboxSong RELIC = get("relic"); + + JukeboxSong STAL = get("stal"); + + JukeboxSong STRAD = get("strad"); + + JukeboxSong WAIT = get("wait"); + + JukeboxSong WARD = get("ward"); + // Paper end - Generated/JukeboxSong + + @NotNull + private static JukeboxSong get(@NotNull String s) { + return Objects.requireNonNull(Registry.JUKEBOX_SONG.get(NamespacedKey.minecraft(s)), "Missing song " + s); + } + + // Paper start - adventure + /** + * @deprecated this method assumes that jukebox song description will + * always be a translatable component which is not guaranteed. + */ + @Override + @Deprecated(forRemoval = true) + @org.jetbrains.annotations.NotNull String getTranslationKey(); + // Paper end - adventure +} diff --git a/paper-generator/generatedApi/org/bukkit/Material.java b/paper-generator/generatedApi/org/bukkit/Material.java new file mode 100644 index 0000000000..926b3a0c5f --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Material.java @@ -0,0 +1,3575 @@ +package org.bukkit; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import java.lang.reflect.Constructor; +import java.util.Locale; +import java.util.Map; +import java.util.function.Consumer; +import org.bukkit.attribute.Attribute; +import org.bukkit.attribute.AttributeModifier; +import org.bukkit.block.Block; +import org.bukkit.block.BlockType; +import org.bukkit.block.data.Ageable; +import org.bukkit.block.data.AnaloguePowerable; +import org.bukkit.block.data.Bisected; +import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.Brushable; +import org.bukkit.block.data.Directional; +import org.bukkit.block.data.Hatchable; +import org.bukkit.block.data.Levelled; +import org.bukkit.block.data.Lightable; +import org.bukkit.block.data.MultipleFacing; +import org.bukkit.block.data.Orientable; +import org.bukkit.block.data.Powerable; +import org.bukkit.block.data.Rail; +import org.bukkit.block.data.Rotatable; +import org.bukkit.block.data.Snowable; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.block.data.type.AmethystCluster; +import org.bukkit.block.data.type.Bamboo; +import org.bukkit.block.data.type.Barrel; +import org.bukkit.block.data.type.Bed; +import org.bukkit.block.data.type.Beehive; +import org.bukkit.block.data.type.Bell; +import org.bukkit.block.data.type.BigDripleaf; +import org.bukkit.block.data.type.BrewingStand; +import org.bukkit.block.data.type.BubbleColumn; +import org.bukkit.block.data.type.Cake; +import org.bukkit.block.data.type.CalibratedSculkSensor; +import org.bukkit.block.data.type.Campfire; +import org.bukkit.block.data.type.Candle; +import org.bukkit.block.data.type.CaveVines; +import org.bukkit.block.data.type.CaveVinesPlant; +import org.bukkit.block.data.type.Chain; +import org.bukkit.block.data.type.Chest; +import org.bukkit.block.data.type.ChiseledBookshelf; +import org.bukkit.block.data.type.Cocoa; +import org.bukkit.block.data.type.CommandBlock; +import org.bukkit.block.data.type.Comparator; +import org.bukkit.block.data.type.CopperBulb; +import org.bukkit.block.data.type.CoralWallFan; +import org.bukkit.block.data.type.Crafter; +import org.bukkit.block.data.type.DaylightDetector; +import org.bukkit.block.data.type.DecoratedPot; +import org.bukkit.block.data.type.Dispenser; +import org.bukkit.block.data.type.Door; +import org.bukkit.block.data.type.Dripleaf; +import org.bukkit.block.data.type.EndPortalFrame; +import org.bukkit.block.data.type.EnderChest; +import org.bukkit.block.data.type.Farmland; +import org.bukkit.block.data.type.Fence; +import org.bukkit.block.data.type.Fire; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.block.data.type.Gate; +import org.bukkit.block.data.type.GlassPane; +import org.bukkit.block.data.type.GlowLichen; +import org.bukkit.block.data.type.Grindstone; +import org.bukkit.block.data.type.HangingSign; +import org.bukkit.block.data.type.Hopper; +import org.bukkit.block.data.type.Jigsaw; +import org.bukkit.block.data.type.Jukebox; +import org.bukkit.block.data.type.Ladder; +import org.bukkit.block.data.type.Lantern; +import org.bukkit.block.data.type.Leaves; +import org.bukkit.block.data.type.Lectern; +import org.bukkit.block.data.type.Light; +import org.bukkit.block.data.type.LightningRod; +import org.bukkit.block.data.type.MangrovePropagule; +import org.bukkit.block.data.type.NoteBlock; +import org.bukkit.block.data.type.Observer; +import org.bukkit.block.data.type.PinkPetals; +import org.bukkit.block.data.type.Piston; +import org.bukkit.block.data.type.PistonHead; +import org.bukkit.block.data.type.PitcherCrop; +import org.bukkit.block.data.type.PointedDripstone; +import org.bukkit.block.data.type.RedstoneRail; +import org.bukkit.block.data.type.RedstoneWallTorch; +import org.bukkit.block.data.type.RedstoneWire; +import org.bukkit.block.data.type.Repeater; +import org.bukkit.block.data.type.RespawnAnchor; +import org.bukkit.block.data.type.Sapling; +import org.bukkit.block.data.type.Scaffolding; +import org.bukkit.block.data.type.SculkCatalyst; +import org.bukkit.block.data.type.SculkSensor; +import org.bukkit.block.data.type.SculkShrieker; +import org.bukkit.block.data.type.SculkVein; +import org.bukkit.block.data.type.SeaPickle; +import org.bukkit.block.data.type.Sign; +import org.bukkit.block.data.type.Skull; +import org.bukkit.block.data.type.Slab; +import org.bukkit.block.data.type.SmallDripleaf; +import org.bukkit.block.data.type.Snow; +import org.bukkit.block.data.type.Stairs; +import org.bukkit.block.data.type.StructureBlock; +import org.bukkit.block.data.type.Switch; +import org.bukkit.block.data.type.TNT; +import org.bukkit.block.data.type.TechnicalPiston; +import org.bukkit.block.data.type.TrapDoor; +import org.bukkit.block.data.type.TrialSpawner; +import org.bukkit.block.data.type.Tripwire; +import org.bukkit.block.data.type.TripwireHook; +import org.bukkit.block.data.type.TurtleEgg; +import org.bukkit.block.data.type.Vault; +import org.bukkit.block.data.type.Wall; +import org.bukkit.block.data.type.WallHangingSign; +import org.bukkit.block.data.type.WallSign; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.inventory.CreativeCategory; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.ItemType; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.material.MaterialData; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * An enum of all material IDs accepted by the official server and client + */ +@SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper +public enum Material implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper + // + // Paper start - Generated/Items + // @GeneratedFrom 1.21.1 + ACACIA_BOAT(-1, 1), + ACACIA_CHEST_BOAT(-1, 1), + AIR(-1, 0), + ALLAY_SPAWN_EGG(-1), + AMETHYST_SHARD(-1), + ANGLER_POTTERY_SHERD(-1), + APPLE(-1), + ARCHER_POTTERY_SHERD(-1), + ARMADILLO_SCUTE(-1), + ARMADILLO_SPAWN_EGG(-1), + ARMOR_STAND(-1, 16), + ARMS_UP_POTTERY_SHERD(-1), + ARROW(-1), + AXOLOTL_BUCKET(-1, 1), + AXOLOTL_SPAWN_EGG(-1), + BAKED_POTATO(-1), + BAMBOO_CHEST_RAFT(-1, 1), + BAMBOO_RAFT(-1, 1), + BAT_SPAWN_EGG(-1), + BEE_SPAWN_EGG(-1), + BEEF(-1), + BEETROOT(-1), + BEETROOT_SEEDS(-1), + BEETROOT_SOUP(-1, 1), + BIRCH_BOAT(-1, 1), + BIRCH_CHEST_BOAT(-1, 1), + BLACK_DYE(-1), + BLADE_POTTERY_SHERD(-1), + BLAZE_POWDER(-1), + BLAZE_ROD(-1), + BLAZE_SPAWN_EGG(-1), + BLUE_DYE(-1), + BOGGED_SPAWN_EGG(-1), + BOLT_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + BONE(-1), + BONE_MEAL(-1), + BOOK(-1), + BOW(-1, 1, 384), + BOWL(-1), + BREAD(-1), + BREEZE_ROD(-1), + BREEZE_SPAWN_EGG(-1), + BREWER_POTTERY_SHERD(-1), + BRICK(-1), + BROWN_DYE(-1), + BRUSH(-1, 1, 64), + BUCKET(-1, 16), + @MinecraftExperimental(MinecraftExperimental.Requires.BUNDLE) + @ApiStatus.Experimental + BUNDLE(-1, 1), + BURN_POTTERY_SHERD(-1), + CAMEL_SPAWN_EGG(-1), + CARROT(-1), + CARROT_ON_A_STICK(-1, 1, 25), + CAT_SPAWN_EGG(-1), + CAVE_SPIDER_SPAWN_EGG(-1), + CHAINMAIL_BOOTS(-1, 1, 195), + CHAINMAIL_CHESTPLATE(-1, 1, 240), + CHAINMAIL_HELMET(-1, 1, 165), + CHAINMAIL_LEGGINGS(-1, 1, 225), + CHARCOAL(-1), + CHERRY_BOAT(-1, 1), + CHERRY_CHEST_BOAT(-1, 1), + CHEST_MINECART(-1, 1), + CHICKEN(-1), + CHICKEN_SPAWN_EGG(-1), + CHORUS_FRUIT(-1), + CLAY_BALL(-1), + CLOCK(-1), + COAL(-1), + COAST_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + COCOA_BEANS(-1), + COD(-1), + COD_BUCKET(-1, 1), + COD_SPAWN_EGG(-1), + COMMAND_BLOCK_MINECART(-1, 1), + COMPASS(-1), + COOKED_BEEF(-1), + COOKED_CHICKEN(-1), + COOKED_COD(-1), + COOKED_MUTTON(-1), + COOKED_PORKCHOP(-1), + COOKED_RABBIT(-1), + COOKED_SALMON(-1), + COOKIE(-1), + COPPER_INGOT(-1), + COW_SPAWN_EGG(-1), + CREEPER_BANNER_PATTERN(-1, 1), + CREEPER_SPAWN_EGG(-1), + CROSSBOW(-1, 1, 465), + CYAN_DYE(-1), + DANGER_POTTERY_SHERD(-1), + DARK_OAK_BOAT(-1, 1), + DARK_OAK_CHEST_BOAT(-1, 1), + DEBUG_STICK(-1, 1), + DIAMOND(-1), + DIAMOND_AXE(-1, 1, 1561), + DIAMOND_BOOTS(-1, 1, 429), + DIAMOND_CHESTPLATE(-1, 1, 528), + DIAMOND_HELMET(-1, 1, 363), + DIAMOND_HOE(-1, 1, 1561), + DIAMOND_HORSE_ARMOR(-1, 1), + DIAMOND_LEGGINGS(-1, 1, 495), + DIAMOND_PICKAXE(-1, 1, 1561), + DIAMOND_SHOVEL(-1, 1, 1561), + DIAMOND_SWORD(-1, 1, 1561), + DISC_FRAGMENT_5(-1), + DOLPHIN_SPAWN_EGG(-1), + DONKEY_SPAWN_EGG(-1), + DRAGON_BREATH(-1), + DRIED_KELP(-1), + DROWNED_SPAWN_EGG(-1), + DUNE_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + ECHO_SHARD(-1), + EGG(-1, 16), + ELDER_GUARDIAN_SPAWN_EGG(-1), + ELYTRA(-1, 1, 432), + EMERALD(-1), + ENCHANTED_BOOK(-1, 1), + ENCHANTED_GOLDEN_APPLE(-1), + END_CRYSTAL(-1), + ENDER_DRAGON_SPAWN_EGG(-1), + ENDER_EYE(-1), + ENDER_PEARL(-1, 16), + ENDERMAN_SPAWN_EGG(-1), + ENDERMITE_SPAWN_EGG(-1), + EVOKER_SPAWN_EGG(-1), + EXPERIENCE_BOTTLE(-1), + EXPLORER_POTTERY_SHERD(-1), + EYE_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + FEATHER(-1), + FERMENTED_SPIDER_EYE(-1), + FILLED_MAP(-1), + FIRE_CHARGE(-1), + FIREWORK_ROCKET(-1), + FIREWORK_STAR(-1), + FISHING_ROD(-1, 1, 64), + FLINT(-1), + FLINT_AND_STEEL(-1, 1, 64), + FLOW_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + FLOW_BANNER_PATTERN(-1, 1), + FLOW_POTTERY_SHERD(-1), + FLOWER_BANNER_PATTERN(-1, 1), + FOX_SPAWN_EGG(-1), + FRIEND_POTTERY_SHERD(-1), + FROG_SPAWN_EGG(-1), + FURNACE_MINECART(-1, 1), + GHAST_SPAWN_EGG(-1), + GHAST_TEAR(-1), + GLASS_BOTTLE(-1), + GLISTERING_MELON_SLICE(-1), + GLOBE_BANNER_PATTERN(-1, 1), + GLOW_BERRIES(-1), + GLOW_INK_SAC(-1), + GLOW_ITEM_FRAME(-1), + GLOW_SQUID_SPAWN_EGG(-1), + GLOWSTONE_DUST(-1), + GOAT_HORN(-1, 1), + GOAT_SPAWN_EGG(-1), + GOLD_INGOT(-1), + GOLD_NUGGET(-1), + GOLDEN_APPLE(-1), + GOLDEN_AXE(-1, 1, 32), + GOLDEN_BOOTS(-1, 1, 91), + GOLDEN_CARROT(-1), + GOLDEN_CHESTPLATE(-1, 1, 112), + GOLDEN_HELMET(-1, 1, 77), + GOLDEN_HOE(-1, 1, 32), + GOLDEN_HORSE_ARMOR(-1, 1), + GOLDEN_LEGGINGS(-1, 1, 105), + GOLDEN_PICKAXE(-1, 1, 32), + GOLDEN_SHOVEL(-1, 1, 32), + GOLDEN_SWORD(-1, 1, 32), + GRAY_DYE(-1), + GREEN_DYE(-1), + GUARDIAN_SPAWN_EGG(-1), + GUNPOWDER(-1), + GUSTER_BANNER_PATTERN(-1, 1), + GUSTER_POTTERY_SHERD(-1), + HEART_OF_THE_SEA(-1), + HEART_POTTERY_SHERD(-1), + HEARTBREAK_POTTERY_SHERD(-1), + HOGLIN_SPAWN_EGG(-1), + HONEY_BOTTLE(-1, 16), + HONEYCOMB(-1), + HOPPER_MINECART(-1, 1), + HORSE_SPAWN_EGG(-1), + HOST_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + HOWL_POTTERY_SHERD(-1), + HUSK_SPAWN_EGG(-1), + INK_SAC(-1), + IRON_AXE(-1, 1, 250), + IRON_BOOTS(-1, 1, 195), + IRON_CHESTPLATE(-1, 1, 240), + IRON_GOLEM_SPAWN_EGG(-1), + IRON_HELMET(-1, 1, 165), + IRON_HOE(-1, 1, 250), + IRON_HORSE_ARMOR(-1, 1), + IRON_INGOT(-1), + IRON_LEGGINGS(-1, 1, 225), + IRON_NUGGET(-1), + IRON_PICKAXE(-1, 1, 250), + IRON_SHOVEL(-1, 1, 250), + IRON_SWORD(-1, 1, 250), + ITEM_FRAME(-1), + JUNGLE_BOAT(-1, 1), + JUNGLE_CHEST_BOAT(-1, 1), + KNOWLEDGE_BOOK(-1, 1), + LAPIS_LAZULI(-1), + LAVA_BUCKET(-1, 1), + LEAD(-1), + LEATHER(-1), + LEATHER_BOOTS(-1, 1, 65), + LEATHER_CHESTPLATE(-1, 1, 80), + LEATHER_HELMET(-1, 1, 55), + LEATHER_HORSE_ARMOR(-1, 1), + LEATHER_LEGGINGS(-1, 1, 75), + LIGHT_BLUE_DYE(-1), + LIGHT_GRAY_DYE(-1), + LIME_DYE(-1), + LINGERING_POTION(-1, 1), + LLAMA_SPAWN_EGG(-1), + MACE(-1, 1, 500), + MAGENTA_DYE(-1), + MAGMA_CREAM(-1), + MAGMA_CUBE_SPAWN_EGG(-1), + MANGROVE_BOAT(-1, 1), + MANGROVE_CHEST_BOAT(-1, 1), + MAP(-1), + MELON_SEEDS(-1), + MELON_SLICE(-1), + MILK_BUCKET(-1, 1), + MINECART(-1, 1), + MINER_POTTERY_SHERD(-1), + MOJANG_BANNER_PATTERN(-1, 1), + MOOSHROOM_SPAWN_EGG(-1), + MOURNER_POTTERY_SHERD(-1), + MULE_SPAWN_EGG(-1), + MUSHROOM_STEW(-1, 1), + MUSIC_DISC_5(-1, 1), + MUSIC_DISC_11(-1, 1), + MUSIC_DISC_13(-1, 1), + MUSIC_DISC_BLOCKS(-1, 1), + MUSIC_DISC_CAT(-1, 1), + MUSIC_DISC_CHIRP(-1, 1), + MUSIC_DISC_CREATOR(-1, 1), + MUSIC_DISC_CREATOR_MUSIC_BOX(-1, 1), + MUSIC_DISC_FAR(-1, 1), + MUSIC_DISC_MALL(-1, 1), + MUSIC_DISC_MELLOHI(-1, 1), + MUSIC_DISC_OTHERSIDE(-1, 1), + MUSIC_DISC_PIGSTEP(-1, 1), + MUSIC_DISC_PRECIPICE(-1, 1), + MUSIC_DISC_RELIC(-1, 1), + MUSIC_DISC_STAL(-1, 1), + MUSIC_DISC_STRAD(-1, 1), + MUSIC_DISC_WAIT(-1, 1), + MUSIC_DISC_WARD(-1, 1), + MUTTON(-1), + NAME_TAG(-1), + NAUTILUS_SHELL(-1), + NETHER_BRICK(-1), + NETHER_STAR(-1), + NETHERITE_AXE(-1, 1, 2031), + NETHERITE_BOOTS(-1, 1, 481), + NETHERITE_CHESTPLATE(-1, 1, 592), + NETHERITE_HELMET(-1, 1, 407), + NETHERITE_HOE(-1, 1, 2031), + NETHERITE_INGOT(-1), + NETHERITE_LEGGINGS(-1, 1, 555), + NETHERITE_PICKAXE(-1, 1, 2031), + NETHERITE_SCRAP(-1), + NETHERITE_SHOVEL(-1, 1, 2031), + NETHERITE_SWORD(-1, 1, 2031), + NETHERITE_UPGRADE_SMITHING_TEMPLATE(-1), + OAK_BOAT(-1, 1), + OAK_CHEST_BOAT(-1, 1), + OCELOT_SPAWN_EGG(-1), + OMINOUS_BOTTLE(-1), + OMINOUS_TRIAL_KEY(-1), + ORANGE_DYE(-1), + PAINTING(-1), + PANDA_SPAWN_EGG(-1), + PAPER(-1), + PARROT_SPAWN_EGG(-1), + PHANTOM_MEMBRANE(-1), + PHANTOM_SPAWN_EGG(-1), + PIG_SPAWN_EGG(-1), + PIGLIN_BANNER_PATTERN(-1, 1), + PIGLIN_BRUTE_SPAWN_EGG(-1), + PIGLIN_SPAWN_EGG(-1), + PILLAGER_SPAWN_EGG(-1), + PINK_DYE(-1), + PITCHER_POD(-1), + PLENTY_POTTERY_SHERD(-1), + POISONOUS_POTATO(-1), + POLAR_BEAR_SPAWN_EGG(-1), + POPPED_CHORUS_FRUIT(-1), + PORKCHOP(-1), + POTATO(-1), + POTION(-1, 1), + POWDER_SNOW_BUCKET(-1, 1), + PRISMARINE_CRYSTALS(-1), + PRISMARINE_SHARD(-1), + PRIZE_POTTERY_SHERD(-1), + PUFFERFISH(-1), + PUFFERFISH_BUCKET(-1, 1), + PUFFERFISH_SPAWN_EGG(-1), + PUMPKIN_PIE(-1), + PUMPKIN_SEEDS(-1), + PURPLE_DYE(-1), + QUARTZ(-1), + RABBIT(-1), + RABBIT_FOOT(-1), + RABBIT_HIDE(-1), + RABBIT_SPAWN_EGG(-1), + RABBIT_STEW(-1, 1), + RAISER_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + RAVAGER_SPAWN_EGG(-1), + RAW_COPPER(-1), + RAW_GOLD(-1), + RAW_IRON(-1), + RECOVERY_COMPASS(-1), + RED_DYE(-1), + REDSTONE(-1), + RIB_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + ROTTEN_FLESH(-1), + SADDLE(-1, 1), + SALMON(-1), + SALMON_BUCKET(-1, 1), + SALMON_SPAWN_EGG(-1), + SCRAPE_POTTERY_SHERD(-1), + SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + SHEAF_POTTERY_SHERD(-1), + SHEARS(-1, 1, 238), + SHEEP_SPAWN_EGG(-1), + SHELTER_POTTERY_SHERD(-1), + SHIELD(-1, 1, 336), + SHULKER_SHELL(-1), + SHULKER_SPAWN_EGG(-1), + SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + SILVERFISH_SPAWN_EGG(-1), + SKELETON_HORSE_SPAWN_EGG(-1), + SKELETON_SPAWN_EGG(-1), + SKULL_BANNER_PATTERN(-1, 1), + SKULL_POTTERY_SHERD(-1), + SLIME_BALL(-1), + SLIME_SPAWN_EGG(-1), + SNIFFER_SPAWN_EGG(-1), + SNORT_POTTERY_SHERD(-1), + SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + SNOW_GOLEM_SPAWN_EGG(-1), + SNOWBALL(-1, 16), + SPECTRAL_ARROW(-1), + SPIDER_EYE(-1), + SPIDER_SPAWN_EGG(-1), + SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + SPLASH_POTION(-1, 1), + SPRUCE_BOAT(-1, 1), + SPRUCE_CHEST_BOAT(-1, 1), + SPYGLASS(-1, 1), + SQUID_SPAWN_EGG(-1), + STICK(-1), + STONE_AXE(-1, 1, 131), + STONE_HOE(-1, 1, 131), + STONE_PICKAXE(-1, 1, 131), + STONE_SHOVEL(-1, 1, 131), + STONE_SWORD(-1, 1, 131), + STRAY_SPAWN_EGG(-1), + STRIDER_SPAWN_EGG(-1), + STRING(-1), + SUGAR(-1), + SUSPICIOUS_STEW(-1, 1), + SWEET_BERRIES(-1), + TADPOLE_BUCKET(-1, 1), + TADPOLE_SPAWN_EGG(-1), + TIDE_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + TIPPED_ARROW(-1), + TNT_MINECART(-1, 1), + TORCHFLOWER_SEEDS(-1), + TOTEM_OF_UNDYING(-1, 1), + TRADER_LLAMA_SPAWN_EGG(-1), + TRIAL_KEY(-1), + TRIDENT(-1, 1, 250), + TROPICAL_FISH(-1), + TROPICAL_FISH_BUCKET(-1, 1), + TROPICAL_FISH_SPAWN_EGG(-1), + TURTLE_HELMET(-1, 1, 275), + TURTLE_SCUTE(-1), + TURTLE_SPAWN_EGG(-1), + VEX_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + VEX_SPAWN_EGG(-1), + VILLAGER_SPAWN_EGG(-1), + VINDICATOR_SPAWN_EGG(-1), + WANDERING_TRADER_SPAWN_EGG(-1), + WARD_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + WARDEN_SPAWN_EGG(-1), + WARPED_FUNGUS_ON_A_STICK(-1, 1, 100), + WATER_BUCKET(-1, 1), + WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + WHEAT_SEEDS(-1), + WHITE_DYE(-1), + WILD_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + WIND_CHARGE(-1), + WITCH_SPAWN_EGG(-1), + WITHER_SKELETON_SPAWN_EGG(-1), + WITHER_SPAWN_EGG(-1), + WOLF_ARMOR(-1, 1, 64), + WOLF_SPAWN_EGG(-1), + WOODEN_AXE(-1, 1, 59), + WOODEN_HOE(-1, 1, 59), + WOODEN_PICKAXE(-1, 1, 59), + WOODEN_SHOVEL(-1, 1, 59), + WOODEN_SWORD(-1, 1, 59), + WRITABLE_BOOK(-1, 1), + WRITTEN_BOOK(-1, 16), + YELLOW_DYE(-1), + ZOGLIN_SPAWN_EGG(-1), + ZOMBIE_HORSE_SPAWN_EGG(-1), + ZOMBIE_SPAWN_EGG(-1), + ZOMBIE_VILLAGER_SPAWN_EGG(-1), + ZOMBIFIED_PIGLIN_SPAWN_EGG(-1), + // Paper end - Generated/Items + // Paper start - Generated/Blocks + // @GeneratedFrom 1.21.1 + ACACIA_BUTTON(-1, Switch.class), + ACACIA_DOOR(-1, Door.class), + ACACIA_FENCE(-1, Fence.class), + ACACIA_FENCE_GATE(-1, Gate.class), + ACACIA_HANGING_SIGN(-1, 16, HangingSign.class), + ACACIA_LEAVES(-1, Leaves.class), + ACACIA_LOG(-1, Orientable.class), + ACACIA_PLANKS(-1), + ACACIA_PRESSURE_PLATE(-1, Powerable.class), + ACACIA_SAPLING(-1, Sapling.class), + ACACIA_SIGN(-1, 16, Sign.class), + ACACIA_SLAB(-1, Slab.class), + ACACIA_STAIRS(-1, Stairs.class), + ACACIA_TRAPDOOR(-1, TrapDoor.class), + ACACIA_WALL_HANGING_SIGN(-1, WallHangingSign.class), + ACACIA_WALL_SIGN(-1, 16, WallSign.class), + ACACIA_WOOD(-1, Orientable.class), + ACTIVATOR_RAIL(-1, RedstoneRail.class), + ALLIUM(-1), + AMETHYST_BLOCK(-1), + AMETHYST_CLUSTER(-1, AmethystCluster.class), + ANCIENT_DEBRIS(-1), + ANDESITE(-1), + ANDESITE_SLAB(-1, Slab.class), + ANDESITE_STAIRS(-1, Stairs.class), + ANDESITE_WALL(-1, Wall.class), + ANVIL(-1, Directional.class), + ATTACHED_MELON_STEM(-1, Directional.class), + ATTACHED_PUMPKIN_STEM(-1, Directional.class), + AZALEA(-1), + AZALEA_LEAVES(-1, Leaves.class), + AZURE_BLUET(-1), + BAMBOO(-1, Bamboo.class), + BAMBOO_BLOCK(-1, Orientable.class), + BAMBOO_BUTTON(-1, Switch.class), + BAMBOO_DOOR(-1, Door.class), + BAMBOO_FENCE(-1, Fence.class), + BAMBOO_FENCE_GATE(-1, Gate.class), + BAMBOO_HANGING_SIGN(-1, 16, HangingSign.class), + BAMBOO_MOSAIC(-1), + BAMBOO_MOSAIC_SLAB(-1, Slab.class), + BAMBOO_MOSAIC_STAIRS(-1, Stairs.class), + BAMBOO_PLANKS(-1), + BAMBOO_PRESSURE_PLATE(-1, Powerable.class), + BAMBOO_SAPLING(-1), + BAMBOO_SIGN(-1, 16, Sign.class), + BAMBOO_SLAB(-1, Slab.class), + BAMBOO_STAIRS(-1, Stairs.class), + BAMBOO_TRAPDOOR(-1, TrapDoor.class), + BAMBOO_WALL_HANGING_SIGN(-1, WallHangingSign.class), + BAMBOO_WALL_SIGN(-1, 16, WallSign.class), + BARREL(-1, Barrel.class), + BARRIER(-1, Waterlogged.class), + BASALT(-1, Orientable.class), + BEACON(-1), + BEDROCK(-1), + BEE_NEST(-1, Beehive.class), + BEEHIVE(-1, Beehive.class), + BEETROOTS(-1, Ageable.class), + BELL(-1, Bell.class), + BIG_DRIPLEAF(-1, BigDripleaf.class), + BIG_DRIPLEAF_STEM(-1, Dripleaf.class), + BIRCH_BUTTON(-1, Switch.class), + BIRCH_DOOR(-1, Door.class), + BIRCH_FENCE(-1, Fence.class), + BIRCH_FENCE_GATE(-1, Gate.class), + BIRCH_HANGING_SIGN(-1, 16, HangingSign.class), + BIRCH_LEAVES(-1, Leaves.class), + BIRCH_LOG(-1, Orientable.class), + BIRCH_PLANKS(-1), + BIRCH_PRESSURE_PLATE(-1, Powerable.class), + BIRCH_SAPLING(-1, Sapling.class), + BIRCH_SIGN(-1, 16, Sign.class), + BIRCH_SLAB(-1, Slab.class), + BIRCH_STAIRS(-1, Stairs.class), + BIRCH_TRAPDOOR(-1, TrapDoor.class), + BIRCH_WALL_HANGING_SIGN(-1, WallHangingSign.class), + BIRCH_WALL_SIGN(-1, 16, WallSign.class), + BIRCH_WOOD(-1, Orientable.class), + BLACK_BANNER(-1, 16, Rotatable.class), + BLACK_BED(-1, 1, Bed.class), + BLACK_CANDLE(-1, Candle.class), + BLACK_CANDLE_CAKE(-1, Lightable.class), + BLACK_CARPET(-1), + BLACK_CONCRETE(-1), + BLACK_CONCRETE_POWDER(-1), + BLACK_GLAZED_TERRACOTTA(-1, Directional.class), + BLACK_SHULKER_BOX(-1, 1, Directional.class), + BLACK_STAINED_GLASS(-1), + BLACK_STAINED_GLASS_PANE(-1, GlassPane.class), + BLACK_TERRACOTTA(-1), + BLACK_WALL_BANNER(-1, Directional.class), + BLACK_WOOL(-1), + BLACKSTONE(-1), + BLACKSTONE_SLAB(-1, Slab.class), + BLACKSTONE_STAIRS(-1, Stairs.class), + BLACKSTONE_WALL(-1, Wall.class), + BLAST_FURNACE(-1, Furnace.class), + BLUE_BANNER(-1, 16, Rotatable.class), + BLUE_BED(-1, 1, Bed.class), + BLUE_CANDLE(-1, Candle.class), + BLUE_CANDLE_CAKE(-1, Lightable.class), + BLUE_CARPET(-1), + BLUE_CONCRETE(-1), + BLUE_CONCRETE_POWDER(-1), + BLUE_GLAZED_TERRACOTTA(-1, Directional.class), + BLUE_ICE(-1), + BLUE_ORCHID(-1), + BLUE_SHULKER_BOX(-1, 1, Directional.class), + BLUE_STAINED_GLASS(-1), + BLUE_STAINED_GLASS_PANE(-1, GlassPane.class), + BLUE_TERRACOTTA(-1), + BLUE_WALL_BANNER(-1, Directional.class), + BLUE_WOOL(-1), + BONE_BLOCK(-1, Orientable.class), + BOOKSHELF(-1), + BRAIN_CORAL(-1, Waterlogged.class), + BRAIN_CORAL_BLOCK(-1), + BRAIN_CORAL_FAN(-1, Waterlogged.class), + BRAIN_CORAL_WALL_FAN(-1, CoralWallFan.class), + BREWING_STAND(-1, BrewingStand.class), + BRICK_SLAB(-1, Slab.class), + BRICK_STAIRS(-1, Stairs.class), + BRICK_WALL(-1, Wall.class), + BRICKS(-1), + BROWN_BANNER(-1, 16, Rotatable.class), + BROWN_BED(-1, 1, Bed.class), + BROWN_CANDLE(-1, Candle.class), + BROWN_CANDLE_CAKE(-1, Lightable.class), + BROWN_CARPET(-1), + BROWN_CONCRETE(-1), + BROWN_CONCRETE_POWDER(-1), + BROWN_GLAZED_TERRACOTTA(-1, Directional.class), + BROWN_MUSHROOM(-1), + BROWN_MUSHROOM_BLOCK(-1, MultipleFacing.class), + BROWN_SHULKER_BOX(-1, 1, Directional.class), + BROWN_STAINED_GLASS(-1), + BROWN_STAINED_GLASS_PANE(-1, GlassPane.class), + BROWN_TERRACOTTA(-1), + BROWN_WALL_BANNER(-1, Directional.class), + BROWN_WOOL(-1), + BUBBLE_COLUMN(-1, BubbleColumn.class), + BUBBLE_CORAL(-1, Waterlogged.class), + BUBBLE_CORAL_BLOCK(-1), + BUBBLE_CORAL_FAN(-1, Waterlogged.class), + BUBBLE_CORAL_WALL_FAN(-1, CoralWallFan.class), + BUDDING_AMETHYST(-1), + CACTUS(-1, Ageable.class), + CAKE(-1, 1, Cake.class), + CALCITE(-1), + CALIBRATED_SCULK_SENSOR(-1, CalibratedSculkSensor.class), + CAMPFIRE(-1, Campfire.class), + CANDLE(-1, Candle.class), + CANDLE_CAKE(-1, Lightable.class), + CARROTS(-1, Ageable.class), + CARTOGRAPHY_TABLE(-1), + CARVED_PUMPKIN(-1, Directional.class), + CAULDRON(-1), + CAVE_AIR(-1), + CAVE_VINES(-1, CaveVines.class), + CAVE_VINES_PLANT(-1, CaveVinesPlant.class), + CHAIN(-1, Chain.class), + CHAIN_COMMAND_BLOCK(-1, CommandBlock.class), + CHERRY_BUTTON(-1, Switch.class), + CHERRY_DOOR(-1, Door.class), + CHERRY_FENCE(-1, Fence.class), + CHERRY_FENCE_GATE(-1, Gate.class), + CHERRY_HANGING_SIGN(-1, 16, HangingSign.class), + CHERRY_LEAVES(-1, Leaves.class), + CHERRY_LOG(-1, Orientable.class), + CHERRY_PLANKS(-1), + CHERRY_PRESSURE_PLATE(-1, Powerable.class), + CHERRY_SAPLING(-1, Sapling.class), + CHERRY_SIGN(-1, 16, Sign.class), + CHERRY_SLAB(-1, Slab.class), + CHERRY_STAIRS(-1, Stairs.class), + CHERRY_TRAPDOOR(-1, TrapDoor.class), + CHERRY_WALL_HANGING_SIGN(-1, WallHangingSign.class), + CHERRY_WALL_SIGN(-1, 16, WallSign.class), + CHERRY_WOOD(-1, Orientable.class), + CHEST(-1, Chest.class), + CHIPPED_ANVIL(-1, Directional.class), + CHISELED_BOOKSHELF(-1, ChiseledBookshelf.class), + CHISELED_COPPER(-1), + CHISELED_DEEPSLATE(-1), + CHISELED_NETHER_BRICKS(-1), + CHISELED_POLISHED_BLACKSTONE(-1), + CHISELED_QUARTZ_BLOCK(-1), + CHISELED_RED_SANDSTONE(-1), + CHISELED_SANDSTONE(-1), + CHISELED_STONE_BRICKS(-1), + CHISELED_TUFF(-1), + CHISELED_TUFF_BRICKS(-1), + CHORUS_FLOWER(-1, Ageable.class), + CHORUS_PLANT(-1, MultipleFacing.class), + CLAY(-1), + COAL_BLOCK(-1), + COAL_ORE(-1), + COARSE_DIRT(-1), + COBBLED_DEEPSLATE(-1), + COBBLED_DEEPSLATE_SLAB(-1, Slab.class), + COBBLED_DEEPSLATE_STAIRS(-1, Stairs.class), + COBBLED_DEEPSLATE_WALL(-1, Wall.class), + COBBLESTONE(-1), + COBBLESTONE_SLAB(-1, Slab.class), + COBBLESTONE_STAIRS(-1, Stairs.class), + COBBLESTONE_WALL(-1, Wall.class), + COBWEB(-1), + COCOA(-1, Cocoa.class), + COMMAND_BLOCK(-1, CommandBlock.class), + COMPARATOR(-1, Comparator.class), + COMPOSTER(-1, Levelled.class), + CONDUIT(-1, Waterlogged.class), + COPPER_BLOCK(-1), + COPPER_BULB(-1, CopperBulb.class), + COPPER_DOOR(-1, Door.class), + COPPER_GRATE(-1, Waterlogged.class), + COPPER_ORE(-1), + COPPER_TRAPDOOR(-1, TrapDoor.class), + CORNFLOWER(-1), + CRACKED_DEEPSLATE_BRICKS(-1), + CRACKED_DEEPSLATE_TILES(-1), + CRACKED_NETHER_BRICKS(-1), + CRACKED_POLISHED_BLACKSTONE_BRICKS(-1), + CRACKED_STONE_BRICKS(-1), + CRAFTER(-1, Crafter.class), + CRAFTING_TABLE(-1), + CREEPER_HEAD(-1, Skull.class), + CREEPER_WALL_HEAD(-1, WallSkull.class), + CRIMSON_BUTTON(-1, Switch.class), + CRIMSON_DOOR(-1, Door.class), + CRIMSON_FENCE(-1, Fence.class), + CRIMSON_FENCE_GATE(-1, Gate.class), + CRIMSON_FUNGUS(-1), + CRIMSON_HANGING_SIGN(-1, 16, HangingSign.class), + CRIMSON_HYPHAE(-1, Orientable.class), + CRIMSON_NYLIUM(-1), + CRIMSON_PLANKS(-1), + CRIMSON_PRESSURE_PLATE(-1, Powerable.class), + CRIMSON_ROOTS(-1), + CRIMSON_SIGN(-1, 16, Sign.class), + CRIMSON_SLAB(-1, Slab.class), + CRIMSON_STAIRS(-1, Stairs.class), + CRIMSON_STEM(-1, Orientable.class), + CRIMSON_TRAPDOOR(-1, TrapDoor.class), + CRIMSON_WALL_HANGING_SIGN(-1, WallHangingSign.class), + CRIMSON_WALL_SIGN(-1, 16, WallSign.class), + CRYING_OBSIDIAN(-1), + CUT_COPPER(-1), + CUT_COPPER_SLAB(-1, Slab.class), + CUT_COPPER_STAIRS(-1, Stairs.class), + CUT_RED_SANDSTONE(-1), + CUT_RED_SANDSTONE_SLAB(-1, Slab.class), + CUT_SANDSTONE(-1), + CUT_SANDSTONE_SLAB(-1, Slab.class), + CYAN_BANNER(-1, 16, Rotatable.class), + CYAN_BED(-1, 1, Bed.class), + CYAN_CANDLE(-1, Candle.class), + CYAN_CANDLE_CAKE(-1, Lightable.class), + CYAN_CARPET(-1), + CYAN_CONCRETE(-1), + CYAN_CONCRETE_POWDER(-1), + CYAN_GLAZED_TERRACOTTA(-1, Directional.class), + CYAN_SHULKER_BOX(-1, 1, Directional.class), + CYAN_STAINED_GLASS(-1), + CYAN_STAINED_GLASS_PANE(-1, GlassPane.class), + CYAN_TERRACOTTA(-1), + CYAN_WALL_BANNER(-1, Directional.class), + CYAN_WOOL(-1), + DAMAGED_ANVIL(-1, Directional.class), + DANDELION(-1), + DARK_OAK_BUTTON(-1, Switch.class), + DARK_OAK_DOOR(-1, Door.class), + DARK_OAK_FENCE(-1, Fence.class), + DARK_OAK_FENCE_GATE(-1, Gate.class), + DARK_OAK_HANGING_SIGN(-1, 16, HangingSign.class), + DARK_OAK_LEAVES(-1, Leaves.class), + DARK_OAK_LOG(-1, Orientable.class), + DARK_OAK_PLANKS(-1), + DARK_OAK_PRESSURE_PLATE(-1, Powerable.class), + DARK_OAK_SAPLING(-1, Sapling.class), + DARK_OAK_SIGN(-1, 16, Sign.class), + DARK_OAK_SLAB(-1, Slab.class), + DARK_OAK_STAIRS(-1, Stairs.class), + DARK_OAK_TRAPDOOR(-1, TrapDoor.class), + DARK_OAK_WALL_HANGING_SIGN(-1, WallHangingSign.class), + DARK_OAK_WALL_SIGN(-1, 16, WallSign.class), + DARK_OAK_WOOD(-1, Orientable.class), + DARK_PRISMARINE(-1), + DARK_PRISMARINE_SLAB(-1, Slab.class), + DARK_PRISMARINE_STAIRS(-1, Stairs.class), + DAYLIGHT_DETECTOR(-1, DaylightDetector.class), + DEAD_BRAIN_CORAL(-1, Waterlogged.class), + DEAD_BRAIN_CORAL_BLOCK(-1), + DEAD_BRAIN_CORAL_FAN(-1, Waterlogged.class), + DEAD_BRAIN_CORAL_WALL_FAN(-1, CoralWallFan.class), + DEAD_BUBBLE_CORAL(-1, Waterlogged.class), + DEAD_BUBBLE_CORAL_BLOCK(-1), + DEAD_BUBBLE_CORAL_FAN(-1, Waterlogged.class), + DEAD_BUBBLE_CORAL_WALL_FAN(-1, CoralWallFan.class), + DEAD_BUSH(-1), + DEAD_FIRE_CORAL(-1, Waterlogged.class), + DEAD_FIRE_CORAL_BLOCK(-1), + DEAD_FIRE_CORAL_FAN(-1, Waterlogged.class), + DEAD_FIRE_CORAL_WALL_FAN(-1, CoralWallFan.class), + DEAD_HORN_CORAL(-1, Waterlogged.class), + DEAD_HORN_CORAL_BLOCK(-1), + DEAD_HORN_CORAL_FAN(-1, Waterlogged.class), + DEAD_HORN_CORAL_WALL_FAN(-1, CoralWallFan.class), + DEAD_TUBE_CORAL(-1, Waterlogged.class), + DEAD_TUBE_CORAL_BLOCK(-1), + DEAD_TUBE_CORAL_FAN(-1, Waterlogged.class), + DEAD_TUBE_CORAL_WALL_FAN(-1, CoralWallFan.class), + DECORATED_POT(-1, DecoratedPot.class), + DEEPSLATE(-1, Orientable.class), + DEEPSLATE_BRICK_SLAB(-1, Slab.class), + DEEPSLATE_BRICK_STAIRS(-1, Stairs.class), + DEEPSLATE_BRICK_WALL(-1, Wall.class), + DEEPSLATE_BRICKS(-1), + DEEPSLATE_COAL_ORE(-1), + DEEPSLATE_COPPER_ORE(-1), + DEEPSLATE_DIAMOND_ORE(-1), + DEEPSLATE_EMERALD_ORE(-1), + DEEPSLATE_GOLD_ORE(-1), + DEEPSLATE_IRON_ORE(-1), + DEEPSLATE_LAPIS_ORE(-1), + DEEPSLATE_REDSTONE_ORE(-1, Lightable.class), + DEEPSLATE_TILE_SLAB(-1, Slab.class), + DEEPSLATE_TILE_STAIRS(-1, Stairs.class), + DEEPSLATE_TILE_WALL(-1, Wall.class), + DEEPSLATE_TILES(-1), + DETECTOR_RAIL(-1, RedstoneRail.class), + DIAMOND_BLOCK(-1), + DIAMOND_ORE(-1), + DIORITE(-1), + DIORITE_SLAB(-1, Slab.class), + DIORITE_STAIRS(-1, Stairs.class), + DIORITE_WALL(-1, Wall.class), + DIRT(-1), + DIRT_PATH(-1), + DISPENSER(-1, Dispenser.class), + DRAGON_EGG(-1), + DRAGON_HEAD(-1, Skull.class), + DRAGON_WALL_HEAD(-1, WallSkull.class), + DRIED_KELP_BLOCK(-1), + DRIPSTONE_BLOCK(-1), + DROPPER(-1, Dispenser.class), + EMERALD_BLOCK(-1), + EMERALD_ORE(-1), + ENCHANTING_TABLE(-1), + END_GATEWAY(-1), + END_PORTAL(-1), + END_PORTAL_FRAME(-1, EndPortalFrame.class), + END_ROD(-1, Directional.class), + END_STONE(-1), + END_STONE_BRICK_SLAB(-1, Slab.class), + END_STONE_BRICK_STAIRS(-1, Stairs.class), + END_STONE_BRICK_WALL(-1, Wall.class), + END_STONE_BRICKS(-1), + ENDER_CHEST(-1, EnderChest.class), + EXPOSED_CHISELED_COPPER(-1), + EXPOSED_COPPER(-1), + EXPOSED_COPPER_BULB(-1, CopperBulb.class), + EXPOSED_COPPER_DOOR(-1, Door.class), + EXPOSED_COPPER_GRATE(-1, Waterlogged.class), + EXPOSED_COPPER_TRAPDOOR(-1, TrapDoor.class), + EXPOSED_CUT_COPPER(-1), + EXPOSED_CUT_COPPER_SLAB(-1, Slab.class), + EXPOSED_CUT_COPPER_STAIRS(-1, Stairs.class), + FARMLAND(-1, Farmland.class), + FERN(-1), + FIRE(-1, Fire.class), + FIRE_CORAL(-1, Waterlogged.class), + FIRE_CORAL_BLOCK(-1), + FIRE_CORAL_FAN(-1, Waterlogged.class), + FIRE_CORAL_WALL_FAN(-1, CoralWallFan.class), + FLETCHING_TABLE(-1), + FLOWER_POT(-1), + FLOWERING_AZALEA(-1), + FLOWERING_AZALEA_LEAVES(-1, Leaves.class), + FROGSPAWN(-1), + FROSTED_ICE(-1, Ageable.class), + FURNACE(-1, Furnace.class), + GILDED_BLACKSTONE(-1), + GLASS(-1), + GLASS_PANE(-1, Fence.class), + GLOW_LICHEN(-1, GlowLichen.class), + GLOWSTONE(-1), + GOLD_BLOCK(-1), + GOLD_ORE(-1), + GRANITE(-1), + GRANITE_SLAB(-1, Slab.class), + GRANITE_STAIRS(-1, Stairs.class), + GRANITE_WALL(-1, Wall.class), + GRASS_BLOCK(-1, Snowable.class), + GRAVEL(-1), + GRAY_BANNER(-1, 16, Rotatable.class), + GRAY_BED(-1, 1, Bed.class), + GRAY_CANDLE(-1, Candle.class), + GRAY_CANDLE_CAKE(-1, Lightable.class), + GRAY_CARPET(-1), + GRAY_CONCRETE(-1), + GRAY_CONCRETE_POWDER(-1), + GRAY_GLAZED_TERRACOTTA(-1, Directional.class), + GRAY_SHULKER_BOX(-1, 1, Directional.class), + GRAY_STAINED_GLASS(-1), + GRAY_STAINED_GLASS_PANE(-1, GlassPane.class), + GRAY_TERRACOTTA(-1), + GRAY_WALL_BANNER(-1, Directional.class), + GRAY_WOOL(-1), + GREEN_BANNER(-1, 16, Rotatable.class), + GREEN_BED(-1, 1, Bed.class), + GREEN_CANDLE(-1, Candle.class), + GREEN_CANDLE_CAKE(-1, Lightable.class), + GREEN_CARPET(-1), + GREEN_CONCRETE(-1), + GREEN_CONCRETE_POWDER(-1), + GREEN_GLAZED_TERRACOTTA(-1, Directional.class), + GREEN_SHULKER_BOX(-1, 1, Directional.class), + GREEN_STAINED_GLASS(-1), + GREEN_STAINED_GLASS_PANE(-1, GlassPane.class), + GREEN_TERRACOTTA(-1), + GREEN_WALL_BANNER(-1, Directional.class), + GREEN_WOOL(-1), + GRINDSTONE(-1, Grindstone.class), + HANGING_ROOTS(-1, Waterlogged.class), + HAY_BLOCK(-1, Orientable.class), + HEAVY_CORE(-1, Waterlogged.class), + HEAVY_WEIGHTED_PRESSURE_PLATE(-1, AnaloguePowerable.class), + HONEY_BLOCK(-1), + HONEYCOMB_BLOCK(-1), + HOPPER(-1, Hopper.class), + HORN_CORAL(-1, Waterlogged.class), + HORN_CORAL_BLOCK(-1), + HORN_CORAL_FAN(-1, Waterlogged.class), + HORN_CORAL_WALL_FAN(-1, CoralWallFan.class), + ICE(-1), + INFESTED_CHISELED_STONE_BRICKS(-1), + INFESTED_COBBLESTONE(-1), + INFESTED_CRACKED_STONE_BRICKS(-1), + INFESTED_DEEPSLATE(-1, Orientable.class), + INFESTED_MOSSY_STONE_BRICKS(-1), + INFESTED_STONE(-1), + INFESTED_STONE_BRICKS(-1), + IRON_BARS(-1, Fence.class), + IRON_BLOCK(-1), + IRON_DOOR(-1, Door.class), + IRON_ORE(-1), + IRON_TRAPDOOR(-1, TrapDoor.class), + JACK_O_LANTERN(-1, Directional.class), + JIGSAW(-1, Jigsaw.class), + JUKEBOX(-1, Jukebox.class), + JUNGLE_BUTTON(-1, Switch.class), + JUNGLE_DOOR(-1, Door.class), + JUNGLE_FENCE(-1, Fence.class), + JUNGLE_FENCE_GATE(-1, Gate.class), + JUNGLE_HANGING_SIGN(-1, 16, HangingSign.class), + JUNGLE_LEAVES(-1, Leaves.class), + JUNGLE_LOG(-1, Orientable.class), + JUNGLE_PLANKS(-1), + JUNGLE_PRESSURE_PLATE(-1, Powerable.class), + JUNGLE_SAPLING(-1, Sapling.class), + JUNGLE_SIGN(-1, 16, Sign.class), + JUNGLE_SLAB(-1, Slab.class), + JUNGLE_STAIRS(-1, Stairs.class), + JUNGLE_TRAPDOOR(-1, TrapDoor.class), + JUNGLE_WALL_HANGING_SIGN(-1, WallHangingSign.class), + JUNGLE_WALL_SIGN(-1, 16, WallSign.class), + JUNGLE_WOOD(-1, Orientable.class), + KELP(-1, Ageable.class), + KELP_PLANT(-1), + LADDER(-1, Ladder.class), + LANTERN(-1, Lantern.class), + LAPIS_BLOCK(-1), + LAPIS_ORE(-1), + LARGE_AMETHYST_BUD(-1, AmethystCluster.class), + LARGE_FERN(-1, Bisected.class), + LAVA(-1, Levelled.class), + LAVA_CAULDRON(-1), + LECTERN(-1, Lectern.class), + LEVER(-1, Switch.class), + LIGHT(-1, Light.class), + LIGHT_BLUE_BANNER(-1, 16, Rotatable.class), + LIGHT_BLUE_BED(-1, 1, Bed.class), + LIGHT_BLUE_CANDLE(-1, Candle.class), + LIGHT_BLUE_CANDLE_CAKE(-1, Lightable.class), + LIGHT_BLUE_CARPET(-1), + LIGHT_BLUE_CONCRETE(-1), + LIGHT_BLUE_CONCRETE_POWDER(-1), + LIGHT_BLUE_GLAZED_TERRACOTTA(-1, Directional.class), + LIGHT_BLUE_SHULKER_BOX(-1, 1, Directional.class), + LIGHT_BLUE_STAINED_GLASS(-1), + LIGHT_BLUE_STAINED_GLASS_PANE(-1, GlassPane.class), + LIGHT_BLUE_TERRACOTTA(-1), + LIGHT_BLUE_WALL_BANNER(-1, Directional.class), + LIGHT_BLUE_WOOL(-1), + LIGHT_GRAY_BANNER(-1, 16, Rotatable.class), + LIGHT_GRAY_BED(-1, 1, Bed.class), + LIGHT_GRAY_CANDLE(-1, Candle.class), + LIGHT_GRAY_CANDLE_CAKE(-1, Lightable.class), + LIGHT_GRAY_CARPET(-1), + LIGHT_GRAY_CONCRETE(-1), + LIGHT_GRAY_CONCRETE_POWDER(-1), + LIGHT_GRAY_GLAZED_TERRACOTTA(-1, Directional.class), + LIGHT_GRAY_SHULKER_BOX(-1, 1, Directional.class), + LIGHT_GRAY_STAINED_GLASS(-1), + LIGHT_GRAY_STAINED_GLASS_PANE(-1, GlassPane.class), + LIGHT_GRAY_TERRACOTTA(-1), + LIGHT_GRAY_WALL_BANNER(-1, Directional.class), + LIGHT_GRAY_WOOL(-1), + LIGHT_WEIGHTED_PRESSURE_PLATE(-1, AnaloguePowerable.class), + LIGHTNING_ROD(-1, LightningRod.class), + LILAC(-1, Bisected.class), + LILY_OF_THE_VALLEY(-1), + LILY_PAD(-1), + LIME_BANNER(-1, 16, Rotatable.class), + LIME_BED(-1, 1, Bed.class), + LIME_CANDLE(-1, Candle.class), + LIME_CANDLE_CAKE(-1, Lightable.class), + LIME_CARPET(-1), + LIME_CONCRETE(-1), + LIME_CONCRETE_POWDER(-1), + LIME_GLAZED_TERRACOTTA(-1, Directional.class), + LIME_SHULKER_BOX(-1, 1, Directional.class), + LIME_STAINED_GLASS(-1), + LIME_STAINED_GLASS_PANE(-1, GlassPane.class), + LIME_TERRACOTTA(-1), + LIME_WALL_BANNER(-1, Directional.class), + LIME_WOOL(-1), + LODESTONE(-1), + LOOM(-1, Directional.class), + MAGENTA_BANNER(-1, 16, Rotatable.class), + MAGENTA_BED(-1, 1, Bed.class), + MAGENTA_CANDLE(-1, Candle.class), + MAGENTA_CANDLE_CAKE(-1, Lightable.class), + MAGENTA_CARPET(-1), + MAGENTA_CONCRETE(-1), + MAGENTA_CONCRETE_POWDER(-1), + MAGENTA_GLAZED_TERRACOTTA(-1, Directional.class), + MAGENTA_SHULKER_BOX(-1, 1, Directional.class), + MAGENTA_STAINED_GLASS(-1), + MAGENTA_STAINED_GLASS_PANE(-1, GlassPane.class), + MAGENTA_TERRACOTTA(-1), + MAGENTA_WALL_BANNER(-1, Directional.class), + MAGENTA_WOOL(-1), + MAGMA_BLOCK(-1), + MANGROVE_BUTTON(-1, Switch.class), + MANGROVE_DOOR(-1, Door.class), + MANGROVE_FENCE(-1, Fence.class), + MANGROVE_FENCE_GATE(-1, Gate.class), + MANGROVE_HANGING_SIGN(-1, 16, HangingSign.class), + MANGROVE_LEAVES(-1, Leaves.class), + MANGROVE_LOG(-1, Orientable.class), + MANGROVE_PLANKS(-1), + MANGROVE_PRESSURE_PLATE(-1, Powerable.class), + MANGROVE_PROPAGULE(-1, MangrovePropagule.class), + MANGROVE_ROOTS(-1, Waterlogged.class), + MANGROVE_SIGN(-1, 16, Sign.class), + MANGROVE_SLAB(-1, Slab.class), + MANGROVE_STAIRS(-1, Stairs.class), + MANGROVE_TRAPDOOR(-1, TrapDoor.class), + MANGROVE_WALL_HANGING_SIGN(-1, WallHangingSign.class), + MANGROVE_WALL_SIGN(-1, 16, WallSign.class), + MANGROVE_WOOD(-1, Orientable.class), + MEDIUM_AMETHYST_BUD(-1, AmethystCluster.class), + MELON(-1), + MELON_STEM(-1, Ageable.class), + MOSS_BLOCK(-1), + MOSS_CARPET(-1), + MOSSY_COBBLESTONE(-1), + MOSSY_COBBLESTONE_SLAB(-1, Slab.class), + MOSSY_COBBLESTONE_STAIRS(-1, Stairs.class), + MOSSY_COBBLESTONE_WALL(-1, Wall.class), + MOSSY_STONE_BRICK_SLAB(-1, Slab.class), + MOSSY_STONE_BRICK_STAIRS(-1, Stairs.class), + MOSSY_STONE_BRICK_WALL(-1, Wall.class), + MOSSY_STONE_BRICKS(-1), + MOVING_PISTON(-1, TechnicalPiston.class), + MUD(-1), + MUD_BRICK_SLAB(-1, Slab.class), + MUD_BRICK_STAIRS(-1, Stairs.class), + MUD_BRICK_WALL(-1, Wall.class), + MUD_BRICKS(-1), + MUDDY_MANGROVE_ROOTS(-1, Orientable.class), + MUSHROOM_STEM(-1, MultipleFacing.class), + MYCELIUM(-1, Snowable.class), + NETHER_BRICK_FENCE(-1, Fence.class), + NETHER_BRICK_SLAB(-1, Slab.class), + NETHER_BRICK_STAIRS(-1, Stairs.class), + NETHER_BRICK_WALL(-1, Wall.class), + NETHER_BRICKS(-1), + NETHER_GOLD_ORE(-1), + NETHER_PORTAL(-1, Orientable.class), + NETHER_QUARTZ_ORE(-1), + NETHER_SPROUTS(-1), + NETHER_WART(-1, Ageable.class), + NETHER_WART_BLOCK(-1), + NETHERITE_BLOCK(-1), + NETHERRACK(-1), + NOTE_BLOCK(-1, NoteBlock.class), + OAK_BUTTON(-1, Switch.class), + OAK_DOOR(-1, Door.class), + OAK_FENCE(-1, Fence.class), + OAK_FENCE_GATE(-1, Gate.class), + OAK_HANGING_SIGN(-1, 16, HangingSign.class), + OAK_LEAVES(-1, Leaves.class), + OAK_LOG(-1, Orientable.class), + OAK_PLANKS(-1), + OAK_PRESSURE_PLATE(-1, Powerable.class), + OAK_SAPLING(-1, Sapling.class), + OAK_SIGN(-1, 16, Sign.class), + OAK_SLAB(-1, Slab.class), + OAK_STAIRS(-1, Stairs.class), + OAK_TRAPDOOR(-1, TrapDoor.class), + OAK_WALL_HANGING_SIGN(-1, WallHangingSign.class), + OAK_WALL_SIGN(-1, 16, WallSign.class), + OAK_WOOD(-1, Orientable.class), + OBSERVER(-1, Observer.class), + OBSIDIAN(-1), + OCHRE_FROGLIGHT(-1, Orientable.class), + ORANGE_BANNER(-1, 16, Rotatable.class), + ORANGE_BED(-1, 1, Bed.class), + ORANGE_CANDLE(-1, Candle.class), + ORANGE_CANDLE_CAKE(-1, Lightable.class), + ORANGE_CARPET(-1), + ORANGE_CONCRETE(-1), + ORANGE_CONCRETE_POWDER(-1), + ORANGE_GLAZED_TERRACOTTA(-1, Directional.class), + ORANGE_SHULKER_BOX(-1, 1, Directional.class), + ORANGE_STAINED_GLASS(-1), + ORANGE_STAINED_GLASS_PANE(-1, GlassPane.class), + ORANGE_TERRACOTTA(-1), + ORANGE_TULIP(-1), + ORANGE_WALL_BANNER(-1, Directional.class), + ORANGE_WOOL(-1), + OXEYE_DAISY(-1), + OXIDIZED_CHISELED_COPPER(-1), + OXIDIZED_COPPER(-1), + OXIDIZED_COPPER_BULB(-1, CopperBulb.class), + OXIDIZED_COPPER_DOOR(-1, Door.class), + OXIDIZED_COPPER_GRATE(-1, Waterlogged.class), + OXIDIZED_COPPER_TRAPDOOR(-1, TrapDoor.class), + OXIDIZED_CUT_COPPER(-1), + OXIDIZED_CUT_COPPER_SLAB(-1, Slab.class), + OXIDIZED_CUT_COPPER_STAIRS(-1, Stairs.class), + PACKED_ICE(-1), + PACKED_MUD(-1), + PEARLESCENT_FROGLIGHT(-1, Orientable.class), + PEONY(-1, Bisected.class), + PETRIFIED_OAK_SLAB(-1, Slab.class), + PIGLIN_HEAD(-1, Skull.class), + PIGLIN_WALL_HEAD(-1, WallSkull.class), + PINK_BANNER(-1, 16, Rotatable.class), + PINK_BED(-1, 1, Bed.class), + PINK_CANDLE(-1, Candle.class), + PINK_CANDLE_CAKE(-1, Lightable.class), + PINK_CARPET(-1), + PINK_CONCRETE(-1), + PINK_CONCRETE_POWDER(-1), + PINK_GLAZED_TERRACOTTA(-1, Directional.class), + PINK_PETALS(-1, PinkPetals.class), + PINK_SHULKER_BOX(-1, 1, Directional.class), + PINK_STAINED_GLASS(-1), + PINK_STAINED_GLASS_PANE(-1, GlassPane.class), + PINK_TERRACOTTA(-1), + PINK_TULIP(-1), + PINK_WALL_BANNER(-1, Directional.class), + PINK_WOOL(-1), + PISTON(-1, Piston.class), + PISTON_HEAD(-1, PistonHead.class), + PITCHER_CROP(-1, PitcherCrop.class), + PITCHER_PLANT(-1, Bisected.class), + PLAYER_HEAD(-1, Skull.class), + PLAYER_WALL_HEAD(-1, WallSkull.class), + PODZOL(-1, Snowable.class), + POINTED_DRIPSTONE(-1, PointedDripstone.class), + POLISHED_ANDESITE(-1), + POLISHED_ANDESITE_SLAB(-1, Slab.class), + POLISHED_ANDESITE_STAIRS(-1, Stairs.class), + POLISHED_BASALT(-1, Orientable.class), + POLISHED_BLACKSTONE(-1), + POLISHED_BLACKSTONE_BRICK_SLAB(-1, Slab.class), + POLISHED_BLACKSTONE_BRICK_STAIRS(-1, Stairs.class), + POLISHED_BLACKSTONE_BRICK_WALL(-1, Wall.class), + POLISHED_BLACKSTONE_BRICKS(-1), + POLISHED_BLACKSTONE_BUTTON(-1, Switch.class), + POLISHED_BLACKSTONE_PRESSURE_PLATE(-1, Powerable.class), + POLISHED_BLACKSTONE_SLAB(-1, Slab.class), + POLISHED_BLACKSTONE_STAIRS(-1, Stairs.class), + POLISHED_BLACKSTONE_WALL(-1, Wall.class), + POLISHED_DEEPSLATE(-1), + POLISHED_DEEPSLATE_SLAB(-1, Slab.class), + POLISHED_DEEPSLATE_STAIRS(-1, Stairs.class), + POLISHED_DEEPSLATE_WALL(-1, Wall.class), + POLISHED_DIORITE(-1), + POLISHED_DIORITE_SLAB(-1, Slab.class), + POLISHED_DIORITE_STAIRS(-1, Stairs.class), + POLISHED_GRANITE(-1), + POLISHED_GRANITE_SLAB(-1, Slab.class), + POLISHED_GRANITE_STAIRS(-1, Stairs.class), + POLISHED_TUFF(-1), + POLISHED_TUFF_SLAB(-1, Slab.class), + POLISHED_TUFF_STAIRS(-1, Stairs.class), + POLISHED_TUFF_WALL(-1, Wall.class), + POPPY(-1), + POTATOES(-1, Ageable.class), + POTTED_ACACIA_SAPLING(-1), + POTTED_ALLIUM(-1), + POTTED_AZALEA_BUSH(-1), + POTTED_AZURE_BLUET(-1), + POTTED_BAMBOO(-1), + POTTED_BIRCH_SAPLING(-1), + POTTED_BLUE_ORCHID(-1), + POTTED_BROWN_MUSHROOM(-1), + POTTED_CACTUS(-1), + POTTED_CHERRY_SAPLING(-1), + POTTED_CORNFLOWER(-1), + POTTED_CRIMSON_FUNGUS(-1), + POTTED_CRIMSON_ROOTS(-1), + POTTED_DANDELION(-1), + POTTED_DARK_OAK_SAPLING(-1), + POTTED_DEAD_BUSH(-1), + POTTED_FERN(-1), + POTTED_FLOWERING_AZALEA_BUSH(-1), + POTTED_JUNGLE_SAPLING(-1), + POTTED_LILY_OF_THE_VALLEY(-1), + POTTED_MANGROVE_PROPAGULE(-1), + POTTED_OAK_SAPLING(-1), + POTTED_ORANGE_TULIP(-1), + POTTED_OXEYE_DAISY(-1), + POTTED_PINK_TULIP(-1), + POTTED_POPPY(-1), + POTTED_RED_MUSHROOM(-1), + POTTED_RED_TULIP(-1), + POTTED_SPRUCE_SAPLING(-1), + POTTED_TORCHFLOWER(-1), + POTTED_WARPED_FUNGUS(-1), + POTTED_WARPED_ROOTS(-1), + POTTED_WHITE_TULIP(-1), + POTTED_WITHER_ROSE(-1), + POWDER_SNOW(-1), + POWDER_SNOW_CAULDRON(-1, Levelled.class), + POWERED_RAIL(-1, RedstoneRail.class), + PRISMARINE(-1), + PRISMARINE_BRICK_SLAB(-1, Slab.class), + PRISMARINE_BRICK_STAIRS(-1, Stairs.class), + PRISMARINE_BRICKS(-1), + PRISMARINE_SLAB(-1, Slab.class), + PRISMARINE_STAIRS(-1, Stairs.class), + PRISMARINE_WALL(-1, Wall.class), + PUMPKIN(-1), + PUMPKIN_STEM(-1, Ageable.class), + PURPLE_BANNER(-1, 16, Rotatable.class), + PURPLE_BED(-1, 1, Bed.class), + PURPLE_CANDLE(-1, Candle.class), + PURPLE_CANDLE_CAKE(-1, Lightable.class), + PURPLE_CARPET(-1), + PURPLE_CONCRETE(-1), + PURPLE_CONCRETE_POWDER(-1), + PURPLE_GLAZED_TERRACOTTA(-1, Directional.class), + PURPLE_SHULKER_BOX(-1, 1, Directional.class), + PURPLE_STAINED_GLASS(-1), + PURPLE_STAINED_GLASS_PANE(-1, GlassPane.class), + PURPLE_TERRACOTTA(-1), + PURPLE_WALL_BANNER(-1, Directional.class), + PURPLE_WOOL(-1), + PURPUR_BLOCK(-1), + PURPUR_PILLAR(-1, Orientable.class), + PURPUR_SLAB(-1, Slab.class), + PURPUR_STAIRS(-1, Stairs.class), + QUARTZ_BLOCK(-1), + QUARTZ_BRICKS(-1), + QUARTZ_PILLAR(-1, Orientable.class), + QUARTZ_SLAB(-1, Slab.class), + QUARTZ_STAIRS(-1, Stairs.class), + RAIL(-1, Rail.class), + RAW_COPPER_BLOCK(-1), + RAW_GOLD_BLOCK(-1), + RAW_IRON_BLOCK(-1), + RED_BANNER(-1, 16, Rotatable.class), + RED_BED(-1, 1, Bed.class), + RED_CANDLE(-1, Candle.class), + RED_CANDLE_CAKE(-1, Lightable.class), + RED_CARPET(-1), + RED_CONCRETE(-1), + RED_CONCRETE_POWDER(-1), + RED_GLAZED_TERRACOTTA(-1, Directional.class), + RED_MUSHROOM(-1), + RED_MUSHROOM_BLOCK(-1, MultipleFacing.class), + RED_NETHER_BRICK_SLAB(-1, Slab.class), + RED_NETHER_BRICK_STAIRS(-1, Stairs.class), + RED_NETHER_BRICK_WALL(-1, Wall.class), + RED_NETHER_BRICKS(-1), + RED_SAND(-1), + RED_SANDSTONE(-1), + RED_SANDSTONE_SLAB(-1, Slab.class), + RED_SANDSTONE_STAIRS(-1, Stairs.class), + RED_SANDSTONE_WALL(-1, Wall.class), + RED_SHULKER_BOX(-1, 1, Directional.class), + RED_STAINED_GLASS(-1), + RED_STAINED_GLASS_PANE(-1, GlassPane.class), + RED_TERRACOTTA(-1), + RED_TULIP(-1), + RED_WALL_BANNER(-1, Directional.class), + RED_WOOL(-1), + REDSTONE_BLOCK(-1), + REDSTONE_LAMP(-1, Lightable.class), + REDSTONE_ORE(-1, Lightable.class), + REDSTONE_TORCH(-1, Lightable.class), + REDSTONE_WALL_TORCH(-1, RedstoneWallTorch.class), + REDSTONE_WIRE(-1, RedstoneWire.class), + REINFORCED_DEEPSLATE(-1), + REPEATER(-1, Repeater.class), + REPEATING_COMMAND_BLOCK(-1, CommandBlock.class), + RESPAWN_ANCHOR(-1, RespawnAnchor.class), + ROOTED_DIRT(-1), + ROSE_BUSH(-1, Bisected.class), + SAND(-1), + SANDSTONE(-1), + SANDSTONE_SLAB(-1, Slab.class), + SANDSTONE_STAIRS(-1, Stairs.class), + SANDSTONE_WALL(-1, Wall.class), + SCAFFOLDING(-1, Scaffolding.class), + SCULK(-1), + SCULK_CATALYST(-1, SculkCatalyst.class), + SCULK_SENSOR(-1, SculkSensor.class), + SCULK_SHRIEKER(-1, SculkShrieker.class), + SCULK_VEIN(-1, SculkVein.class), + SEA_LANTERN(-1), + SEA_PICKLE(-1, SeaPickle.class), + SEAGRASS(-1), + SHORT_GRASS(-1), + SHROOMLIGHT(-1), + SHULKER_BOX(-1, 1, Directional.class), + SKELETON_SKULL(-1, Skull.class), + SKELETON_WALL_SKULL(-1, WallSkull.class), + SLIME_BLOCK(-1), + SMALL_AMETHYST_BUD(-1, AmethystCluster.class), + SMALL_DRIPLEAF(-1, SmallDripleaf.class), + SMITHING_TABLE(-1), + SMOKER(-1, Furnace.class), + SMOOTH_BASALT(-1), + SMOOTH_QUARTZ(-1), + SMOOTH_QUARTZ_SLAB(-1, Slab.class), + SMOOTH_QUARTZ_STAIRS(-1, Stairs.class), + SMOOTH_RED_SANDSTONE(-1), + SMOOTH_RED_SANDSTONE_SLAB(-1, Slab.class), + SMOOTH_RED_SANDSTONE_STAIRS(-1, Stairs.class), + SMOOTH_SANDSTONE(-1), + SMOOTH_SANDSTONE_SLAB(-1, Slab.class), + SMOOTH_SANDSTONE_STAIRS(-1, Stairs.class), + SMOOTH_STONE(-1), + SMOOTH_STONE_SLAB(-1, Slab.class), + SNIFFER_EGG(-1, Hatchable.class), + SNOW(-1, Snow.class), + SNOW_BLOCK(-1), + SOUL_CAMPFIRE(-1, Campfire.class), + SOUL_FIRE(-1), + SOUL_LANTERN(-1, Lantern.class), + SOUL_SAND(-1), + SOUL_SOIL(-1), + SOUL_TORCH(-1), + SOUL_WALL_TORCH(-1, Directional.class), + SPAWNER(-1), + SPONGE(-1), + SPORE_BLOSSOM(-1), + SPRUCE_BUTTON(-1, Switch.class), + SPRUCE_DOOR(-1, Door.class), + SPRUCE_FENCE(-1, Fence.class), + SPRUCE_FENCE_GATE(-1, Gate.class), + SPRUCE_HANGING_SIGN(-1, 16, HangingSign.class), + SPRUCE_LEAVES(-1, Leaves.class), + SPRUCE_LOG(-1, Orientable.class), + SPRUCE_PLANKS(-1), + SPRUCE_PRESSURE_PLATE(-1, Powerable.class), + SPRUCE_SAPLING(-1, Sapling.class), + SPRUCE_SIGN(-1, 16, Sign.class), + SPRUCE_SLAB(-1, Slab.class), + SPRUCE_STAIRS(-1, Stairs.class), + SPRUCE_TRAPDOOR(-1, TrapDoor.class), + SPRUCE_WALL_HANGING_SIGN(-1, WallHangingSign.class), + SPRUCE_WALL_SIGN(-1, 16, WallSign.class), + SPRUCE_WOOD(-1, Orientable.class), + STICKY_PISTON(-1, Piston.class), + STONE(-1), + STONE_BRICK_SLAB(-1, Slab.class), + STONE_BRICK_STAIRS(-1, Stairs.class), + STONE_BRICK_WALL(-1, Wall.class), + STONE_BRICKS(-1), + STONE_BUTTON(-1, Switch.class), + STONE_PRESSURE_PLATE(-1, Powerable.class), + STONE_SLAB(-1, Slab.class), + STONE_STAIRS(-1, Stairs.class), + STONECUTTER(-1, Directional.class), + STRIPPED_ACACIA_LOG(-1, Orientable.class), + STRIPPED_ACACIA_WOOD(-1, Orientable.class), + STRIPPED_BAMBOO_BLOCK(-1, Orientable.class), + STRIPPED_BIRCH_LOG(-1, Orientable.class), + STRIPPED_BIRCH_WOOD(-1, Orientable.class), + STRIPPED_CHERRY_LOG(-1, Orientable.class), + STRIPPED_CHERRY_WOOD(-1, Orientable.class), + STRIPPED_CRIMSON_HYPHAE(-1, Orientable.class), + STRIPPED_CRIMSON_STEM(-1, Orientable.class), + STRIPPED_DARK_OAK_LOG(-1, Orientable.class), + STRIPPED_DARK_OAK_WOOD(-1, Orientable.class), + STRIPPED_JUNGLE_LOG(-1, Orientable.class), + STRIPPED_JUNGLE_WOOD(-1, Orientable.class), + STRIPPED_MANGROVE_LOG(-1, Orientable.class), + STRIPPED_MANGROVE_WOOD(-1, Orientable.class), + STRIPPED_OAK_LOG(-1, Orientable.class), + STRIPPED_OAK_WOOD(-1, Orientable.class), + STRIPPED_SPRUCE_LOG(-1, Orientable.class), + STRIPPED_SPRUCE_WOOD(-1, Orientable.class), + STRIPPED_WARPED_HYPHAE(-1, Orientable.class), + STRIPPED_WARPED_STEM(-1, Orientable.class), + STRUCTURE_BLOCK(-1, StructureBlock.class), + STRUCTURE_VOID(-1), + SUGAR_CANE(-1, Ageable.class), + SUNFLOWER(-1, Bisected.class), + SUSPICIOUS_GRAVEL(-1, Brushable.class), + SUSPICIOUS_SAND(-1, Brushable.class), + SWEET_BERRY_BUSH(-1, Ageable.class), + TALL_GRASS(-1, Bisected.class), + TALL_SEAGRASS(-1, Bisected.class), + TARGET(-1, AnaloguePowerable.class), + TERRACOTTA(-1), + TINTED_GLASS(-1), + TNT(-1, TNT.class), + TORCH(-1), + TORCHFLOWER(-1), + TORCHFLOWER_CROP(-1, Ageable.class), + TRAPPED_CHEST(-1, Chest.class), + TRIAL_SPAWNER(-1, TrialSpawner.class), + TRIPWIRE(-1, Tripwire.class), + TRIPWIRE_HOOK(-1, TripwireHook.class), + TUBE_CORAL(-1, Waterlogged.class), + TUBE_CORAL_BLOCK(-1), + TUBE_CORAL_FAN(-1, Waterlogged.class), + TUBE_CORAL_WALL_FAN(-1, CoralWallFan.class), + TUFF(-1), + TUFF_BRICK_SLAB(-1, Slab.class), + TUFF_BRICK_STAIRS(-1, Stairs.class), + TUFF_BRICK_WALL(-1, Wall.class), + TUFF_BRICKS(-1), + TUFF_SLAB(-1, Slab.class), + TUFF_STAIRS(-1, Stairs.class), + TUFF_WALL(-1, Wall.class), + TURTLE_EGG(-1, TurtleEgg.class), + TWISTING_VINES(-1, Ageable.class), + TWISTING_VINES_PLANT(-1), + VAULT(-1, Vault.class), + VERDANT_FROGLIGHT(-1, Orientable.class), + VINE(-1, MultipleFacing.class), + VOID_AIR(-1), + WALL_TORCH(-1, Directional.class), + WARPED_BUTTON(-1, Switch.class), + WARPED_DOOR(-1, Door.class), + WARPED_FENCE(-1, Fence.class), + WARPED_FENCE_GATE(-1, Gate.class), + WARPED_FUNGUS(-1), + WARPED_HANGING_SIGN(-1, 16, HangingSign.class), + WARPED_HYPHAE(-1, Orientable.class), + WARPED_NYLIUM(-1), + WARPED_PLANKS(-1), + WARPED_PRESSURE_PLATE(-1, Powerable.class), + WARPED_ROOTS(-1), + WARPED_SIGN(-1, 16, Sign.class), + WARPED_SLAB(-1, Slab.class), + WARPED_STAIRS(-1, Stairs.class), + WARPED_STEM(-1, Orientable.class), + WARPED_TRAPDOOR(-1, TrapDoor.class), + WARPED_WALL_HANGING_SIGN(-1, WallHangingSign.class), + WARPED_WALL_SIGN(-1, 16, WallSign.class), + WARPED_WART_BLOCK(-1), + WATER(-1, Levelled.class), + WATER_CAULDRON(-1, Levelled.class), + WAXED_CHISELED_COPPER(-1), + WAXED_COPPER_BLOCK(-1), + WAXED_COPPER_BULB(-1, CopperBulb.class), + WAXED_COPPER_DOOR(-1, Door.class), + WAXED_COPPER_GRATE(-1, Waterlogged.class), + WAXED_COPPER_TRAPDOOR(-1, TrapDoor.class), + WAXED_CUT_COPPER(-1), + WAXED_CUT_COPPER_SLAB(-1, Slab.class), + WAXED_CUT_COPPER_STAIRS(-1, Stairs.class), + WAXED_EXPOSED_CHISELED_COPPER(-1), + WAXED_EXPOSED_COPPER(-1), + WAXED_EXPOSED_COPPER_BULB(-1, CopperBulb.class), + WAXED_EXPOSED_COPPER_DOOR(-1, Door.class), + WAXED_EXPOSED_COPPER_GRATE(-1, Waterlogged.class), + WAXED_EXPOSED_COPPER_TRAPDOOR(-1, TrapDoor.class), + WAXED_EXPOSED_CUT_COPPER(-1), + WAXED_EXPOSED_CUT_COPPER_SLAB(-1, Slab.class), + WAXED_EXPOSED_CUT_COPPER_STAIRS(-1, Stairs.class), + WAXED_OXIDIZED_CHISELED_COPPER(-1), + WAXED_OXIDIZED_COPPER(-1), + WAXED_OXIDIZED_COPPER_BULB(-1, CopperBulb.class), + WAXED_OXIDIZED_COPPER_DOOR(-1, Door.class), + WAXED_OXIDIZED_COPPER_GRATE(-1, Waterlogged.class), + WAXED_OXIDIZED_COPPER_TRAPDOOR(-1, TrapDoor.class), + WAXED_OXIDIZED_CUT_COPPER(-1), + WAXED_OXIDIZED_CUT_COPPER_SLAB(-1, Slab.class), + WAXED_OXIDIZED_CUT_COPPER_STAIRS(-1, Stairs.class), + WAXED_WEATHERED_CHISELED_COPPER(-1), + WAXED_WEATHERED_COPPER(-1), + WAXED_WEATHERED_COPPER_BULB(-1, CopperBulb.class), + WAXED_WEATHERED_COPPER_DOOR(-1, Door.class), + WAXED_WEATHERED_COPPER_GRATE(-1, Waterlogged.class), + WAXED_WEATHERED_COPPER_TRAPDOOR(-1, TrapDoor.class), + WAXED_WEATHERED_CUT_COPPER(-1), + WAXED_WEATHERED_CUT_COPPER_SLAB(-1, Slab.class), + WAXED_WEATHERED_CUT_COPPER_STAIRS(-1, Stairs.class), + WEATHERED_CHISELED_COPPER(-1), + WEATHERED_COPPER(-1), + WEATHERED_COPPER_BULB(-1, CopperBulb.class), + WEATHERED_COPPER_DOOR(-1, Door.class), + WEATHERED_COPPER_GRATE(-1, Waterlogged.class), + WEATHERED_COPPER_TRAPDOOR(-1, TrapDoor.class), + WEATHERED_CUT_COPPER(-1), + WEATHERED_CUT_COPPER_SLAB(-1, Slab.class), + WEATHERED_CUT_COPPER_STAIRS(-1, Stairs.class), + WEEPING_VINES(-1, Ageable.class), + WEEPING_VINES_PLANT(-1), + WET_SPONGE(-1), + WHEAT(-1, Ageable.class), + WHITE_BANNER(-1, 16, Rotatable.class), + WHITE_BED(-1, 1, Bed.class), + WHITE_CANDLE(-1, Candle.class), + WHITE_CANDLE_CAKE(-1, Lightable.class), + WHITE_CARPET(-1), + WHITE_CONCRETE(-1), + WHITE_CONCRETE_POWDER(-1), + WHITE_GLAZED_TERRACOTTA(-1, Directional.class), + WHITE_SHULKER_BOX(-1, 1, Directional.class), + WHITE_STAINED_GLASS(-1), + WHITE_STAINED_GLASS_PANE(-1, GlassPane.class), + WHITE_TERRACOTTA(-1), + WHITE_TULIP(-1), + WHITE_WALL_BANNER(-1, Directional.class), + WHITE_WOOL(-1), + WITHER_ROSE(-1), + WITHER_SKELETON_SKULL(-1, Skull.class), + WITHER_SKELETON_WALL_SKULL(-1, WallSkull.class), + YELLOW_BANNER(-1, 16, Rotatable.class), + YELLOW_BED(-1, 1, Bed.class), + YELLOW_CANDLE(-1, Candle.class), + YELLOW_CANDLE_CAKE(-1, Lightable.class), + YELLOW_CARPET(-1), + YELLOW_CONCRETE(-1), + YELLOW_CONCRETE_POWDER(-1), + YELLOW_GLAZED_TERRACOTTA(-1, Directional.class), + YELLOW_SHULKER_BOX(-1, 1, Directional.class), + YELLOW_STAINED_GLASS(-1), + YELLOW_STAINED_GLASS_PANE(-1, GlassPane.class), + YELLOW_TERRACOTTA(-1), + YELLOW_WALL_BANNER(-1, Directional.class), + YELLOW_WOOL(-1), + ZOMBIE_HEAD(-1, Skull.class), + ZOMBIE_WALL_HEAD(-1, WallSkull.class), + // Paper end - Generated/Blocks + // ----- Legacy Separator ----- + @Deprecated + LEGACY_AIR(0, 0), + @Deprecated + LEGACY_STONE(1), + @Deprecated + LEGACY_GRASS(2), + @Deprecated + LEGACY_DIRT(3), + @Deprecated + LEGACY_COBBLESTONE(4), + @Deprecated + LEGACY_WOOD(5, org.bukkit.material.Wood.class), + @Deprecated + LEGACY_SAPLING(6, org.bukkit.material.Sapling.class), + @Deprecated + LEGACY_BEDROCK(7), + @Deprecated + LEGACY_WATER(8, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_STATIONARY_WATER(9, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_LAVA(10, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_STATIONARY_LAVA(11, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_SAND(12), + @Deprecated + LEGACY_GRAVEL(13), + @Deprecated + LEGACY_GOLD_ORE(14), + @Deprecated + LEGACY_IRON_ORE(15), + @Deprecated + LEGACY_COAL_ORE(16), + @Deprecated + LEGACY_LOG(17, org.bukkit.material.Tree.class), + @Deprecated + LEGACY_LEAVES(18, org.bukkit.material.Leaves.class), + @Deprecated + LEGACY_SPONGE(19), + @Deprecated + LEGACY_GLASS(20), + @Deprecated + LEGACY_LAPIS_ORE(21), + @Deprecated + LEGACY_LAPIS_BLOCK(22), + @Deprecated + LEGACY_DISPENSER(23, org.bukkit.material.Dispenser.class), + @Deprecated + LEGACY_SANDSTONE(24, org.bukkit.material.Sandstone.class), + @Deprecated + LEGACY_NOTE_BLOCK(25), + @Deprecated + LEGACY_BED_BLOCK(26, org.bukkit.material.Bed.class), + @Deprecated + LEGACY_POWERED_RAIL(27, org.bukkit.material.PoweredRail.class), + @Deprecated + LEGACY_DETECTOR_RAIL(28, org.bukkit.material.DetectorRail.class), + @Deprecated + LEGACY_PISTON_STICKY_BASE(29, org.bukkit.material.PistonBaseMaterial.class), + @Deprecated + LEGACY_WEB(30), + @Deprecated + LEGACY_LONG_GRASS(31, org.bukkit.material.LongGrass.class), + @Deprecated + LEGACY_DEAD_BUSH(32), + @Deprecated + LEGACY_PISTON_BASE(33, org.bukkit.material.PistonBaseMaterial.class), + @Deprecated + LEGACY_PISTON_EXTENSION(34, org.bukkit.material.PistonExtensionMaterial.class), + @Deprecated + LEGACY_WOOL(35, org.bukkit.material.Wool.class), + @Deprecated + LEGACY_PISTON_MOVING_PIECE(36), + @Deprecated + LEGACY_YELLOW_FLOWER(37), + @Deprecated + LEGACY_RED_ROSE(38), + @Deprecated + LEGACY_BROWN_MUSHROOM(39), + @Deprecated + LEGACY_RED_MUSHROOM(40), + @Deprecated + LEGACY_GOLD_BLOCK(41), + @Deprecated + LEGACY_IRON_BLOCK(42), + @Deprecated + LEGACY_DOUBLE_STEP(43, org.bukkit.material.Step.class), + @Deprecated + LEGACY_STEP(44, org.bukkit.material.Step.class), + @Deprecated + LEGACY_BRICK(45), + @Deprecated + LEGACY_TNT(46), + @Deprecated + LEGACY_BOOKSHELF(47), + @Deprecated + LEGACY_MOSSY_COBBLESTONE(48), + @Deprecated + LEGACY_OBSIDIAN(49), + @Deprecated + LEGACY_TORCH(50, org.bukkit.material.Torch.class), + @Deprecated + LEGACY_FIRE(51), + @Deprecated + LEGACY_MOB_SPAWNER(52), + @Deprecated + LEGACY_WOOD_STAIRS(53, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_CHEST(54, org.bukkit.material.Chest.class), + @Deprecated + LEGACY_REDSTONE_WIRE(55, org.bukkit.material.RedstoneWire.class), + @Deprecated + LEGACY_DIAMOND_ORE(56), + @Deprecated + LEGACY_DIAMOND_BLOCK(57), + @Deprecated + LEGACY_WORKBENCH(58), + @Deprecated + LEGACY_CROPS(59, org.bukkit.material.Crops.class), + @Deprecated + LEGACY_SOIL(60, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_FURNACE(61, org.bukkit.material.Furnace.class), + @Deprecated + LEGACY_BURNING_FURNACE(62, org.bukkit.material.Furnace.class), + @Deprecated + LEGACY_SIGN_POST(63, 64, org.bukkit.material.Sign.class), + @Deprecated + LEGACY_WOODEN_DOOR(64, org.bukkit.material.Door.class), + @Deprecated + LEGACY_LADDER(65, org.bukkit.material.Ladder.class), + @Deprecated + LEGACY_RAILS(66, org.bukkit.material.Rails.class), + @Deprecated + LEGACY_COBBLESTONE_STAIRS(67, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_WALL_SIGN(68, 64, org.bukkit.material.Sign.class), + @Deprecated + LEGACY_LEVER(69, org.bukkit.material.Lever.class), + @Deprecated + LEGACY_STONE_PLATE(70, org.bukkit.material.PressurePlate.class), + @Deprecated + LEGACY_IRON_DOOR_BLOCK(71, org.bukkit.material.Door.class), + @Deprecated + LEGACY_WOOD_PLATE(72, org.bukkit.material.PressurePlate.class), + @Deprecated + LEGACY_REDSTONE_ORE(73), + @Deprecated + LEGACY_GLOWING_REDSTONE_ORE(74), + @Deprecated + LEGACY_REDSTONE_TORCH_OFF(75, org.bukkit.material.RedstoneTorch.class), + @Deprecated + LEGACY_REDSTONE_TORCH_ON(76, org.bukkit.material.RedstoneTorch.class), + @Deprecated + LEGACY_STONE_BUTTON(77, org.bukkit.material.Button.class), + @Deprecated + LEGACY_SNOW(78), + @Deprecated + LEGACY_ICE(79), + @Deprecated + LEGACY_SNOW_BLOCK(80), + @Deprecated + LEGACY_CACTUS(81, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_CLAY(82), + @Deprecated + LEGACY_SUGAR_CANE_BLOCK(83, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_JUKEBOX(84), + @Deprecated + LEGACY_FENCE(85), + @Deprecated + LEGACY_PUMPKIN(86, org.bukkit.material.Pumpkin.class), + @Deprecated + LEGACY_NETHERRACK(87), + @Deprecated + LEGACY_SOUL_SAND(88), + @Deprecated + LEGACY_GLOWSTONE(89), + @Deprecated + LEGACY_PORTAL(90), + @Deprecated + LEGACY_JACK_O_LANTERN(91, org.bukkit.material.Pumpkin.class), + @Deprecated + LEGACY_CAKE_BLOCK(92, 64, org.bukkit.material.Cake.class), + @Deprecated + LEGACY_DIODE_BLOCK_OFF(93, org.bukkit.material.Diode.class), + @Deprecated + LEGACY_DIODE_BLOCK_ON(94, org.bukkit.material.Diode.class), + @Deprecated + LEGACY_STAINED_GLASS(95), + @Deprecated + LEGACY_TRAP_DOOR(96, org.bukkit.material.TrapDoor.class), + @Deprecated + LEGACY_MONSTER_EGGS(97, org.bukkit.material.MonsterEggs.class), + @Deprecated + LEGACY_SMOOTH_BRICK(98, org.bukkit.material.SmoothBrick.class), + @Deprecated + LEGACY_HUGE_MUSHROOM_1(99, org.bukkit.material.Mushroom.class), + @Deprecated + LEGACY_HUGE_MUSHROOM_2(100, org.bukkit.material.Mushroom.class), + @Deprecated + LEGACY_IRON_FENCE(101), + @Deprecated + LEGACY_THIN_GLASS(102), + @Deprecated + LEGACY_MELON_BLOCK(103), + @Deprecated + LEGACY_PUMPKIN_STEM(104, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_MELON_STEM(105, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_VINE(106, org.bukkit.material.Vine.class), + @Deprecated + LEGACY_FENCE_GATE(107, org.bukkit.material.Gate.class), + @Deprecated + LEGACY_BRICK_STAIRS(108, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_SMOOTH_STAIRS(109, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_MYCEL(110), + @Deprecated + LEGACY_WATER_LILY(111), + @Deprecated + LEGACY_NETHER_BRICK(112), + @Deprecated + LEGACY_NETHER_FENCE(113), + @Deprecated + LEGACY_NETHER_BRICK_STAIRS(114, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_NETHER_WARTS(115, org.bukkit.material.NetherWarts.class), + @Deprecated + LEGACY_ENCHANTMENT_TABLE(116), + @Deprecated + LEGACY_BREWING_STAND(117, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_CAULDRON(118, org.bukkit.material.Cauldron.class), + @Deprecated + LEGACY_ENDER_PORTAL(119), + @Deprecated + LEGACY_ENDER_PORTAL_FRAME(120), + @Deprecated + LEGACY_ENDER_STONE(121), + @Deprecated + LEGACY_DRAGON_EGG(122), + @Deprecated + LEGACY_REDSTONE_LAMP_OFF(123), + @Deprecated + LEGACY_REDSTONE_LAMP_ON(124), + @Deprecated + LEGACY_WOOD_DOUBLE_STEP(125, org.bukkit.material.Wood.class), + @Deprecated + LEGACY_WOOD_STEP(126, org.bukkit.material.WoodenStep.class), + @Deprecated + LEGACY_COCOA(127, org.bukkit.material.CocoaPlant.class), + @Deprecated + LEGACY_SANDSTONE_STAIRS(128, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_EMERALD_ORE(129), + @Deprecated + LEGACY_ENDER_CHEST(130, org.bukkit.material.EnderChest.class), + @Deprecated + LEGACY_TRIPWIRE_HOOK(131, org.bukkit.material.TripwireHook.class), + @Deprecated + LEGACY_TRIPWIRE(132, org.bukkit.material.Tripwire.class), + @Deprecated + LEGACY_EMERALD_BLOCK(133), + @Deprecated + LEGACY_SPRUCE_WOOD_STAIRS(134, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_BIRCH_WOOD_STAIRS(135, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_JUNGLE_WOOD_STAIRS(136, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_COMMAND(137, org.bukkit.material.Command.class), + @Deprecated + LEGACY_BEACON(138), + @Deprecated + LEGACY_COBBLE_WALL(139), + @Deprecated + LEGACY_FLOWER_POT(140, org.bukkit.material.FlowerPot.class), + @Deprecated + LEGACY_CARROT(141, org.bukkit.material.Crops.class), + @Deprecated + LEGACY_POTATO(142, org.bukkit.material.Crops.class), + @Deprecated + LEGACY_WOOD_BUTTON(143, org.bukkit.material.Button.class), + @Deprecated + LEGACY_SKULL(144, org.bukkit.material.Skull.class), + @Deprecated + LEGACY_ANVIL(145), + @Deprecated + LEGACY_TRAPPED_CHEST(146, org.bukkit.material.Chest.class), + @Deprecated + LEGACY_GOLD_PLATE(147), + @Deprecated + LEGACY_IRON_PLATE(148), + @Deprecated + LEGACY_REDSTONE_COMPARATOR_OFF(149, org.bukkit.material.Comparator.class), + @Deprecated + LEGACY_REDSTONE_COMPARATOR_ON(150, org.bukkit.material.Comparator.class), + @Deprecated + LEGACY_DAYLIGHT_DETECTOR(151), + @Deprecated + LEGACY_REDSTONE_BLOCK(152), + @Deprecated + LEGACY_QUARTZ_ORE(153), + @Deprecated + LEGACY_HOPPER(154, org.bukkit.material.Hopper.class), + @Deprecated + LEGACY_QUARTZ_BLOCK(155), + @Deprecated + LEGACY_QUARTZ_STAIRS(156, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_ACTIVATOR_RAIL(157, org.bukkit.material.PoweredRail.class), + @Deprecated + LEGACY_DROPPER(158, org.bukkit.material.Dispenser.class), + @Deprecated + LEGACY_STAINED_CLAY(159), + @Deprecated + LEGACY_STAINED_GLASS_PANE(160), + @Deprecated + LEGACY_LEAVES_2(161, org.bukkit.material.Leaves.class), + @Deprecated + LEGACY_LOG_2(162, org.bukkit.material.Tree.class), + @Deprecated + LEGACY_ACACIA_STAIRS(163, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_DARK_OAK_STAIRS(164, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_SLIME_BLOCK(165), + @Deprecated + LEGACY_BARRIER(166), + @Deprecated + LEGACY_IRON_TRAPDOOR(167, org.bukkit.material.TrapDoor.class), + @Deprecated + LEGACY_PRISMARINE(168), + @Deprecated + LEGACY_SEA_LANTERN(169), + @Deprecated + LEGACY_HAY_BLOCK(170), + @Deprecated + LEGACY_CARPET(171), + @Deprecated + LEGACY_HARD_CLAY(172), + @Deprecated + LEGACY_COAL_BLOCK(173), + @Deprecated + LEGACY_PACKED_ICE(174), + @Deprecated + LEGACY_DOUBLE_PLANT(175), + @Deprecated + LEGACY_STANDING_BANNER(176, org.bukkit.material.Banner.class), + @Deprecated + LEGACY_WALL_BANNER(177, org.bukkit.material.Banner.class), + @Deprecated + LEGACY_DAYLIGHT_DETECTOR_INVERTED(178), + @Deprecated + LEGACY_RED_SANDSTONE(179), + @Deprecated + LEGACY_RED_SANDSTONE_STAIRS(180, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_DOUBLE_STONE_SLAB2(181), + @Deprecated + LEGACY_STONE_SLAB2(182), + @Deprecated + LEGACY_SPRUCE_FENCE_GATE(183, org.bukkit.material.Gate.class), + @Deprecated + LEGACY_BIRCH_FENCE_GATE(184, org.bukkit.material.Gate.class), + @Deprecated + LEGACY_JUNGLE_FENCE_GATE(185, org.bukkit.material.Gate.class), + @Deprecated + LEGACY_DARK_OAK_FENCE_GATE(186, org.bukkit.material.Gate.class), + @Deprecated + LEGACY_ACACIA_FENCE_GATE(187, org.bukkit.material.Gate.class), + @Deprecated + LEGACY_SPRUCE_FENCE(188), + @Deprecated + LEGACY_BIRCH_FENCE(189), + @Deprecated + LEGACY_JUNGLE_FENCE(190), + @Deprecated + LEGACY_DARK_OAK_FENCE(191), + @Deprecated + LEGACY_ACACIA_FENCE(192), + @Deprecated + LEGACY_SPRUCE_DOOR(193, org.bukkit.material.Door.class), + @Deprecated + LEGACY_BIRCH_DOOR(194, org.bukkit.material.Door.class), + @Deprecated + LEGACY_JUNGLE_DOOR(195, org.bukkit.material.Door.class), + @Deprecated + LEGACY_ACACIA_DOOR(196, org.bukkit.material.Door.class), + @Deprecated + LEGACY_DARK_OAK_DOOR(197, org.bukkit.material.Door.class), + @Deprecated + LEGACY_END_ROD(198), + @Deprecated + LEGACY_CHORUS_PLANT(199), + @Deprecated + LEGACY_CHORUS_FLOWER(200), + @Deprecated + LEGACY_PURPUR_BLOCK(201), + @Deprecated + LEGACY_PURPUR_PILLAR(202), + @Deprecated + LEGACY_PURPUR_STAIRS(203, org.bukkit.material.Stairs.class), + @Deprecated + LEGACY_PURPUR_DOUBLE_SLAB(204), + @Deprecated + LEGACY_PURPUR_SLAB(205), + @Deprecated + LEGACY_END_BRICKS(206), + @Deprecated + LEGACY_BEETROOT_BLOCK(207, org.bukkit.material.Crops.class), + @Deprecated + LEGACY_GRASS_PATH(208), + @Deprecated + LEGACY_END_GATEWAY(209), + @Deprecated + LEGACY_COMMAND_REPEATING(210, org.bukkit.material.Command.class), + @Deprecated + LEGACY_COMMAND_CHAIN(211, org.bukkit.material.Command.class), + @Deprecated + LEGACY_FROSTED_ICE(212), + @Deprecated + LEGACY_MAGMA(213), + @Deprecated + LEGACY_NETHER_WART_BLOCK(214), + @Deprecated + LEGACY_RED_NETHER_BRICK(215), + @Deprecated + LEGACY_BONE_BLOCK(216), + @Deprecated + LEGACY_STRUCTURE_VOID(217), + @Deprecated + LEGACY_OBSERVER(218, org.bukkit.material.Observer.class), + @Deprecated + LEGACY_WHITE_SHULKER_BOX(219, 1), + @Deprecated + LEGACY_ORANGE_SHULKER_BOX(220, 1), + @Deprecated + LEGACY_MAGENTA_SHULKER_BOX(221, 1), + @Deprecated + LEGACY_LIGHT_BLUE_SHULKER_BOX(222, 1), + @Deprecated + LEGACY_YELLOW_SHULKER_BOX(223, 1), + @Deprecated + LEGACY_LIME_SHULKER_BOX(224, 1), + @Deprecated + LEGACY_PINK_SHULKER_BOX(225, 1), + @Deprecated + LEGACY_GRAY_SHULKER_BOX(226, 1), + @Deprecated + LEGACY_SILVER_SHULKER_BOX(227, 1), + @Deprecated + LEGACY_CYAN_SHULKER_BOX(228, 1), + @Deprecated + LEGACY_PURPLE_SHULKER_BOX(229, 1), + @Deprecated + LEGACY_BLUE_SHULKER_BOX(230, 1), + @Deprecated + LEGACY_BROWN_SHULKER_BOX(231, 1), + @Deprecated + LEGACY_GREEN_SHULKER_BOX(232, 1), + @Deprecated + LEGACY_RED_SHULKER_BOX(233, 1), + @Deprecated + LEGACY_BLACK_SHULKER_BOX(234, 1), + @Deprecated + LEGACY_WHITE_GLAZED_TERRACOTTA(235), + @Deprecated + LEGACY_ORANGE_GLAZED_TERRACOTTA(236), + @Deprecated + LEGACY_MAGENTA_GLAZED_TERRACOTTA(237), + @Deprecated + LEGACY_LIGHT_BLUE_GLAZED_TERRACOTTA(238), + @Deprecated + LEGACY_YELLOW_GLAZED_TERRACOTTA(239), + @Deprecated + LEGACY_LIME_GLAZED_TERRACOTTA(240), + @Deprecated + LEGACY_PINK_GLAZED_TERRACOTTA(241), + @Deprecated + LEGACY_GRAY_GLAZED_TERRACOTTA(242), + @Deprecated + LEGACY_SILVER_GLAZED_TERRACOTTA(243), + @Deprecated + LEGACY_CYAN_GLAZED_TERRACOTTA(244), + @Deprecated + LEGACY_PURPLE_GLAZED_TERRACOTTA(245), + @Deprecated + LEGACY_BLUE_GLAZED_TERRACOTTA(246), + @Deprecated + LEGACY_BROWN_GLAZED_TERRACOTTA(247), + @Deprecated + LEGACY_GREEN_GLAZED_TERRACOTTA(248), + @Deprecated + LEGACY_RED_GLAZED_TERRACOTTA(249), + @Deprecated + LEGACY_BLACK_GLAZED_TERRACOTTA(250), + @Deprecated + LEGACY_CONCRETE(251), + @Deprecated + LEGACY_CONCRETE_POWDER(252), + @Deprecated + LEGACY_STRUCTURE_BLOCK(255), + // ----- Item Separator ----- + @Deprecated + LEGACY_IRON_SPADE(256, 1, 250), + @Deprecated + LEGACY_IRON_PICKAXE(257, 1, 250), + @Deprecated + LEGACY_IRON_AXE(258, 1, 250), + @Deprecated + LEGACY_FLINT_AND_STEEL(259, 1, 64), + @Deprecated + LEGACY_APPLE(260), + @Deprecated + LEGACY_BOW(261, 1, 384), + @Deprecated + LEGACY_ARROW(262), + @Deprecated + LEGACY_COAL(263, org.bukkit.material.Coal.class), + @Deprecated + LEGACY_DIAMOND(264), + @Deprecated + LEGACY_IRON_INGOT(265), + @Deprecated + LEGACY_GOLD_INGOT(266), + @Deprecated + LEGACY_IRON_SWORD(267, 1, 250), + @Deprecated + LEGACY_WOOD_SWORD(268, 1, 59), + @Deprecated + LEGACY_WOOD_SPADE(269, 1, 59), + @Deprecated + LEGACY_WOOD_PICKAXE(270, 1, 59), + @Deprecated + LEGACY_WOOD_AXE(271, 1, 59), + @Deprecated + LEGACY_STONE_SWORD(272, 1, 131), + @Deprecated + LEGACY_STONE_SPADE(273, 1, 131), + @Deprecated + LEGACY_STONE_PICKAXE(274, 1, 131), + @Deprecated + LEGACY_STONE_AXE(275, 1, 131), + @Deprecated + LEGACY_DIAMOND_SWORD(276, 1, 1561), + @Deprecated + LEGACY_DIAMOND_SPADE(277, 1, 1561), + @Deprecated + LEGACY_DIAMOND_PICKAXE(278, 1, 1561), + @Deprecated + LEGACY_DIAMOND_AXE(279, 1, 1561), + @Deprecated + LEGACY_STICK(280), + @Deprecated + LEGACY_BOWL(281), + @Deprecated + LEGACY_MUSHROOM_SOUP(282, 1), + @Deprecated + LEGACY_GOLD_SWORD(283, 1, 32), + @Deprecated + LEGACY_GOLD_SPADE(284, 1, 32), + @Deprecated + LEGACY_GOLD_PICKAXE(285, 1, 32), + @Deprecated + LEGACY_GOLD_AXE(286, 1, 32), + @Deprecated + LEGACY_STRING(287), + @Deprecated + LEGACY_FEATHER(288), + @Deprecated + LEGACY_SULPHUR(289), + @Deprecated + LEGACY_WOOD_HOE(290, 1, 59), + @Deprecated + LEGACY_STONE_HOE(291, 1, 131), + @Deprecated + LEGACY_IRON_HOE(292, 1, 250), + @Deprecated + LEGACY_DIAMOND_HOE(293, 1, 1561), + @Deprecated + LEGACY_GOLD_HOE(294, 1, 32), + @Deprecated + LEGACY_SEEDS(295), + @Deprecated + LEGACY_WHEAT(296), + @Deprecated + LEGACY_BREAD(297), + @Deprecated + LEGACY_LEATHER_HELMET(298, 1, 55), + @Deprecated + LEGACY_LEATHER_CHESTPLATE(299, 1, 80), + @Deprecated + LEGACY_LEATHER_LEGGINGS(300, 1, 75), + @Deprecated + LEGACY_LEATHER_BOOTS(301, 1, 65), + @Deprecated + LEGACY_CHAINMAIL_HELMET(302, 1, 165), + @Deprecated + LEGACY_CHAINMAIL_CHESTPLATE(303, 1, 240), + @Deprecated + LEGACY_CHAINMAIL_LEGGINGS(304, 1, 225), + @Deprecated + LEGACY_CHAINMAIL_BOOTS(305, 1, 195), + @Deprecated + LEGACY_IRON_HELMET(306, 1, 165), + @Deprecated + LEGACY_IRON_CHESTPLATE(307, 1, 240), + @Deprecated + LEGACY_IRON_LEGGINGS(308, 1, 225), + @Deprecated + LEGACY_IRON_BOOTS(309, 1, 195), + @Deprecated + LEGACY_DIAMOND_HELMET(310, 1, 363), + @Deprecated + LEGACY_DIAMOND_CHESTPLATE(311, 1, 528), + @Deprecated + LEGACY_DIAMOND_LEGGINGS(312, 1, 495), + @Deprecated + LEGACY_DIAMOND_BOOTS(313, 1, 429), + @Deprecated + LEGACY_GOLD_HELMET(314, 1, 77), + @Deprecated + LEGACY_GOLD_CHESTPLATE(315, 1, 112), + @Deprecated + LEGACY_GOLD_LEGGINGS(316, 1, 105), + @Deprecated + LEGACY_GOLD_BOOTS(317, 1, 91), + @Deprecated + LEGACY_FLINT(318), + @Deprecated + LEGACY_PORK(319), + @Deprecated + LEGACY_GRILLED_PORK(320), + @Deprecated + LEGACY_PAINTING(321), + @Deprecated + LEGACY_GOLDEN_APPLE(322), + @Deprecated + LEGACY_SIGN(323, 16), + @Deprecated + LEGACY_WOOD_DOOR(324, 64), + @Deprecated + LEGACY_BUCKET(325, 16), + @Deprecated + LEGACY_WATER_BUCKET(326, 1), + @Deprecated + LEGACY_LAVA_BUCKET(327, 1), + @Deprecated + LEGACY_MINECART(328, 1), + @Deprecated + LEGACY_SADDLE(329, 1), + @Deprecated + LEGACY_IRON_DOOR(330, 64), + @Deprecated + LEGACY_REDSTONE(331), + @Deprecated + LEGACY_SNOW_BALL(332, 16), + @Deprecated + LEGACY_BOAT(333, 1), + @Deprecated + LEGACY_LEATHER(334), + @Deprecated + LEGACY_MILK_BUCKET(335, 1), + @Deprecated + LEGACY_CLAY_BRICK(336), + @Deprecated + LEGACY_CLAY_BALL(337), + @Deprecated + LEGACY_SUGAR_CANE(338), + @Deprecated + LEGACY_PAPER(339), + @Deprecated + LEGACY_BOOK(340), + @Deprecated + LEGACY_SLIME_BALL(341), + @Deprecated + LEGACY_STORAGE_MINECART(342, 1), + @Deprecated + LEGACY_POWERED_MINECART(343, 1), + @Deprecated + LEGACY_EGG(344, 16), + @Deprecated + LEGACY_COMPASS(345), + @Deprecated + LEGACY_FISHING_ROD(346, 1, 64), + @Deprecated + LEGACY_WATCH(347), + @Deprecated + LEGACY_GLOWSTONE_DUST(348), + @Deprecated + LEGACY_RAW_FISH(349), + @Deprecated + LEGACY_COOKED_FISH(350), + @Deprecated + LEGACY_INK_SACK(351, org.bukkit.material.Dye.class), + @Deprecated + LEGACY_BONE(352), + @Deprecated + LEGACY_SUGAR(353), + @Deprecated + LEGACY_CAKE(354, 1), + @Deprecated + LEGACY_BED(355, 1), + @Deprecated + LEGACY_DIODE(356), + @Deprecated + LEGACY_COOKIE(357), + /** + * @see org.bukkit.map.MapView + */ + @Deprecated + LEGACY_MAP(358, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_SHEARS(359, 1, 238), + @Deprecated + LEGACY_MELON(360), + @Deprecated + LEGACY_PUMPKIN_SEEDS(361), + @Deprecated + LEGACY_MELON_SEEDS(362), + @Deprecated + LEGACY_RAW_BEEF(363), + @Deprecated + LEGACY_COOKED_BEEF(364), + @Deprecated + LEGACY_RAW_CHICKEN(365), + @Deprecated + LEGACY_COOKED_CHICKEN(366), + @Deprecated + LEGACY_ROTTEN_FLESH(367), + @Deprecated + LEGACY_ENDER_PEARL(368, 16), + @Deprecated + LEGACY_BLAZE_ROD(369), + @Deprecated + LEGACY_GHAST_TEAR(370), + @Deprecated + LEGACY_GOLD_NUGGET(371), + @Deprecated + LEGACY_NETHER_STALK(372), + @Deprecated + LEGACY_POTION(373, 1, org.bukkit.material.MaterialData.class), + @Deprecated + LEGACY_GLASS_BOTTLE(374), + @Deprecated + LEGACY_SPIDER_EYE(375), + @Deprecated + LEGACY_FERMENTED_SPIDER_EYE(376), + @Deprecated + LEGACY_BLAZE_POWDER(377), + @Deprecated + LEGACY_MAGMA_CREAM(378), + @Deprecated + LEGACY_BREWING_STAND_ITEM(379), + @Deprecated + LEGACY_CAULDRON_ITEM(380), + @Deprecated + LEGACY_EYE_OF_ENDER(381), + @Deprecated + LEGACY_SPECKLED_MELON(382), + @Deprecated + LEGACY_MONSTER_EGG(383, 64, org.bukkit.material.SpawnEgg.class), + @Deprecated + LEGACY_EXP_BOTTLE(384, 64), + @Deprecated + LEGACY_FIREBALL(385, 64), + @Deprecated + LEGACY_BOOK_AND_QUILL(386, 1), + @Deprecated + LEGACY_WRITTEN_BOOK(387, 16), + @Deprecated + LEGACY_EMERALD(388, 64), + @Deprecated + LEGACY_ITEM_FRAME(389), + @Deprecated + LEGACY_FLOWER_POT_ITEM(390), + @Deprecated + LEGACY_CARROT_ITEM(391), + @Deprecated + LEGACY_POTATO_ITEM(392), + @Deprecated + LEGACY_BAKED_POTATO(393), + @Deprecated + LEGACY_POISONOUS_POTATO(394), + @Deprecated + LEGACY_EMPTY_MAP(395), + @Deprecated + LEGACY_GOLDEN_CARROT(396), + @Deprecated + LEGACY_SKULL_ITEM(397), + @Deprecated + LEGACY_CARROT_STICK(398, 1, 25), + @Deprecated + LEGACY_NETHER_STAR(399), + @Deprecated + LEGACY_PUMPKIN_PIE(400), + @Deprecated + LEGACY_FIREWORK(401), + @Deprecated + LEGACY_FIREWORK_CHARGE(402), + @Deprecated + LEGACY_ENCHANTED_BOOK(403, 1), + @Deprecated + LEGACY_REDSTONE_COMPARATOR(404), + @Deprecated + LEGACY_NETHER_BRICK_ITEM(405), + @Deprecated + LEGACY_QUARTZ(406), + @Deprecated + LEGACY_EXPLOSIVE_MINECART(407, 1), + @Deprecated + LEGACY_HOPPER_MINECART(408, 1), + @Deprecated + LEGACY_PRISMARINE_SHARD(409), + @Deprecated + LEGACY_PRISMARINE_CRYSTALS(410), + @Deprecated + LEGACY_RABBIT(411), + @Deprecated + LEGACY_COOKED_RABBIT(412), + @Deprecated + LEGACY_RABBIT_STEW(413, 1), + @Deprecated + LEGACY_RABBIT_FOOT(414), + @Deprecated + LEGACY_RABBIT_HIDE(415), + @Deprecated + LEGACY_ARMOR_STAND(416, 16), + @Deprecated + LEGACY_IRON_BARDING(417, 1), + @Deprecated + LEGACY_GOLD_BARDING(418, 1), + @Deprecated + LEGACY_DIAMOND_BARDING(419, 1), + @Deprecated + LEGACY_LEASH(420), + @Deprecated + LEGACY_NAME_TAG(421), + @Deprecated + LEGACY_COMMAND_MINECART(422, 1), + @Deprecated + LEGACY_MUTTON(423), + @Deprecated + LEGACY_COOKED_MUTTON(424), + @Deprecated + LEGACY_BANNER(425, 16), + @Deprecated + LEGACY_END_CRYSTAL(426), + @Deprecated + LEGACY_SPRUCE_DOOR_ITEM(427), + @Deprecated + LEGACY_BIRCH_DOOR_ITEM(428), + @Deprecated + LEGACY_JUNGLE_DOOR_ITEM(429), + @Deprecated + LEGACY_ACACIA_DOOR_ITEM(430), + @Deprecated + LEGACY_DARK_OAK_DOOR_ITEM(431), + @Deprecated + LEGACY_CHORUS_FRUIT(432), + @Deprecated + LEGACY_CHORUS_FRUIT_POPPED(433), + @Deprecated + LEGACY_BEETROOT(434), + @Deprecated + LEGACY_BEETROOT_SEEDS(435), + @Deprecated + LEGACY_BEETROOT_SOUP(436, 1), + @Deprecated + LEGACY_DRAGONS_BREATH(437), + @Deprecated + LEGACY_SPLASH_POTION(438, 1), + @Deprecated + LEGACY_SPECTRAL_ARROW(439), + @Deprecated + LEGACY_TIPPED_ARROW(440), + @Deprecated + LEGACY_LINGERING_POTION(441, 1), + @Deprecated + LEGACY_SHIELD(442, 1, 336), + @Deprecated + LEGACY_ELYTRA(443, 1, 431), + @Deprecated + LEGACY_BOAT_SPRUCE(444, 1), + @Deprecated + LEGACY_BOAT_BIRCH(445, 1), + @Deprecated + LEGACY_BOAT_JUNGLE(446, 1), + @Deprecated + LEGACY_BOAT_ACACIA(447, 1), + @Deprecated + LEGACY_BOAT_DARK_OAK(448, 1), + @Deprecated + LEGACY_TOTEM(449, 1), + @Deprecated + LEGACY_SHULKER_SHELL(450), + @Deprecated + LEGACY_IRON_NUGGET(452), + @Deprecated + LEGACY_KNOWLEDGE_BOOK(453, 1), + @Deprecated + LEGACY_GOLD_RECORD(2256, 1), + @Deprecated + LEGACY_GREEN_RECORD(2257, 1), + @Deprecated + LEGACY_RECORD_3(2258, 1), + @Deprecated + LEGACY_RECORD_4(2259, 1), + @Deprecated + LEGACY_RECORD_5(2260, 1), + @Deprecated + LEGACY_RECORD_6(2261, 1), + @Deprecated + LEGACY_RECORD_7(2262, 1), + @Deprecated + LEGACY_RECORD_8(2263, 1), + @Deprecated + LEGACY_RECORD_9(2264, 1), + @Deprecated + LEGACY_RECORD_10(2265, 1), + @Deprecated + LEGACY_RECORD_11(2266, 1), + @Deprecated + LEGACY_RECORD_12(2267, 1), + ; + // + + @Deprecated + public static final String LEGACY_PREFIX = "LEGACY_"; + + private final int id; + private final Constructor ctor; + private static final Map BY_NAME = Maps.newHashMap(); + private final int maxStack; + private final short durability; + public final Class data; + private final boolean legacy; + private final NamespacedKey key; + + private Material(final int id) { + this(id, 64); + } + + private Material(final int id, final int stack) { + this(id, stack, MaterialData.class); + } + + private Material(final int id, final int stack, final int durability) { + this(id, stack, durability, MaterialData.class); + } + + private Material(final int id, /*@NotNull*/ final Class data) { + this(id, 64, data); + } + + private Material(final int id, final int stack, /*@NotNull*/ final Class data) { + this(id, stack, 0, data); + } + + private Material(final int id, final int stack, final int durability, /*@NotNull*/ final Class data) { + this.id = id; + this.durability = (short) durability; + this.maxStack = stack; + this.data = data; + this.legacy = this.name().startsWith(LEGACY_PREFIX); + this.key = NamespacedKey.minecraft(this.name().toLowerCase(Locale.ROOT)); + // try to cache the constructor for this material + try { + if (MaterialData.class.isAssignableFrom(data)) { + this.ctor = (Constructor) data.getConstructor(Material.class, byte.class); + } else { + this.ctor = null; + } + } catch (NoSuchMethodException ex) { + throw new AssertionError(ex); + } catch (SecurityException ex) { + throw new AssertionError(ex); + } + } + + // Paper start + + /** + * @return If the type is either AIR, CAVE_AIR or VOID_AIR + */ + public boolean isEmpty() { + switch (this) { + case AIR: + case CAVE_AIR: + case VOID_AIR: + return true; + } + return false; + } + // Paper end + + // Paper start - add Translatable + @Override + public @NotNull String translationKey() { + if (this.isItem()) { + return java.util.Objects.requireNonNull(this.asItemType()).translationKey(); + } else { + return java.util.Objects.requireNonNull(this.asBlockType()).translationKey(); + } + } + // Paper end - add Translatable + + // Paper start - item rarity API + /** + * Returns the item rarity for the item. The Material MUST be an Item not a block. + * Use {@link #isItem()} before this. + * + * @return the item rarity + * @deprecated use {@link org.bukkit.inventory.meta.ItemMeta#hasRarity()} and {@link org.bukkit.inventory.meta.ItemMeta#getRarity()} + */ + @NotNull + @Deprecated(forRemoval = true, since = "1.20.5") + public io.papermc.paper.inventory.ItemRarity getItemRarity() { + return new org.bukkit.inventory.ItemStack(this).getRarity(); + } + // Paper end - item rarity API + + // Paper start - item default attributes API + /** + * Returns an immutable multimap of attributes for the slot. + * {@link #isItem()} must be true for this material. + * + * @param equipmentSlot the slot to get the attributes for + * @throws IllegalArgumentException if {@link #isItem()} is false + * @return an immutable multimap of attributes + * @deprecated use {@link #getDefaultAttributeModifiers(EquipmentSlot)} + */ + @NotNull + @Deprecated(forRemoval = true, since = "1.20.5") + public Multimap getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { + return this.getDefaultAttributeModifiers(equipmentSlot); + } + // Paper end - item default attributes API + + // Paper start - isCollidable API + /** + * Checks if this material is collidable. + * + * @return true if collidable + * @throws IllegalArgumentException if {@link #isBlock()} is false + */ + public boolean isCollidable() { + if (this.isBlock()) { + return this.asBlockType().hasCollision(); + } + throw new IllegalArgumentException(this + " isn't a block type"); + } + // Paper end - isCollidable API + + /** + * Do not use for any reason. + * + * @return ID of this material + * @apiNote Internal Use Only + */ + @ApiStatus.Internal // Paper + public int getId() { + Preconditions.checkArgument(legacy, "Cannot get ID of Modern Material"); + return id; + } + + /** + * Checks if this constant is a legacy material. + * + * @return legacy status + */ + // @Deprecated // Paper - this is useful, don't deprecate + public boolean isLegacy() { + return legacy; + } + + @NotNull + @Override + public NamespacedKey getKey() { + Preconditions.checkArgument(!legacy, "Cannot get key of Legacy Material"); + return key; + } + + /** + * Gets the maximum amount of this material that can be held in a stack. + *

+ * Note that this is the default maximum size for this Material. + * {@link ItemStack ItemStacks} are able to change their maximum stack size per + * stack with {@link ItemMeta#setMaxStackSize(Integer)}. If an ItemStack instance + * is available, {@link ItemStack#getMaxStackSize()} may be preferred. + * + * @return Maximum stack size for this material + */ + public int getMaxStackSize() { + return maxStack; + } + + /** + * Gets the maximum durability of this material + * + * @return Maximum durability for this material + */ + public short getMaxDurability() { + return durability; + } + + /** + * Creates a new {@link BlockData} instance for this Material, with all + * properties initialized to unspecified defaults. + * + * @return new data instance + */ + @NotNull + public BlockData createBlockData() { + return Bukkit.createBlockData(this); + } + + /** + * Creates a new {@link BlockData} instance for this Material, with + * all properties initialized to unspecified defaults. + * + * @param consumer consumer to run on new instance before returning + * @return new data instance + */ + @NotNull + public BlockData createBlockData(@Nullable Consumer consumer) { + return Bukkit.createBlockData(this, consumer); + } + + /** + * Creates a new {@link BlockData} instance for this Material, with all + * properties initialized to unspecified defaults, except for those provided + * in data. + * + * @param data data string + * @return new data instance + * @throws IllegalArgumentException if the specified data is not valid + */ + @NotNull + public BlockData createBlockData(@Nullable String data) throws IllegalArgumentException { + return Bukkit.createBlockData(this, data); + } + + /** + * Gets the MaterialData class associated with this Material + * + * @return MaterialData associated with this Material + * @deprecated use {@link #createBlockData()} + */ + @NotNull + @Deprecated // Paper + public Class getData() { + Preconditions.checkArgument(legacy, "Cannot get data class of Modern Material"); + return ctor.getDeclaringClass(); + } + + /** + * Constructs a new MaterialData relevant for this Material, with the + * given initial data + * + * @param raw Initial data to construct the MaterialData with + * @return New MaterialData with the given data + * @deprecated Magic value + */ + @Deprecated + @NotNull + public MaterialData getNewData(final byte raw) { + Preconditions.checkArgument(legacy, "Cannot get new data of Modern Material"); + try { + return ctor.newInstance(this, raw); + } catch (InstantiationException ex) { + final Throwable t = ex.getCause(); + if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } + if (t instanceof Error) { + throw (Error) t; + } + throw new AssertionError(t); + } catch (Throwable t) { + throw new AssertionError(t); + } + } + + /** + * Checks if this Material is a placable block + * + * @return true if this material is a block + */ + public boolean isBlock() { + return asBlockType() != null; + } + + /** + * Checks if this Material is edible. + * + * @return true if this Material is edible. + */ + public boolean isEdible() { + ItemType type = asItemType(); + return type == null ? false : type.isEdible(); + } + + /** + * Attempts to get the Material with the given name. + *

+ * This is a normal lookup, names must be the precise name they are given + * in the enum. + * + * @param name Name of the material to get + * @return Material if found, or null + */ + @Nullable + public static Material getMaterial(@NotNull final String name) { + return getMaterial(name, false); + } + + /** + * Attempts to get the Material with the given name. + *

+ * This is a normal lookup, names must be the precise name they are given in + * the enum (but optionally including the LEGACY_PREFIX if legacyName is + * true). + *

+ * If legacyName is true, then the lookup will be against legacy materials, + * but the returned Material will be a modern material (ie this method is + * useful for updating stored data). + * + * @param name Name of the material to get + * @param legacyName whether this is a legacy name lookup + * @return Material if found, or null + */ + @Nullable + public static Material getMaterial(@NotNull String name, boolean legacyName) { + if (legacyName) { + if (!name.startsWith(LEGACY_PREFIX)) { + name = LEGACY_PREFIX + name; + } + + Material match = BY_NAME.get(name); + return Bukkit.getUnsafe().fromLegacy(match); + } + + return BY_NAME.get(name); + } + + /** + * Attempts to match the Material with the given name. + *

+ * This is a match lookup; names will be stripped of the "minecraft:" + * namespace, converted to uppercase, then stripped of special characters in + * an attempt to format it like the enum. + * + * @param name Name of the material to get + * @return Material if found, or null + */ + @Nullable + public static Material matchMaterial(@NotNull final String name) { + return matchMaterial(name, false); + } + + /** + * Attempts to match the Material with the given name. + *

+ * This is a match lookup; names will be stripped of the "minecraft:" + * namespace, converted to uppercase, then stripped of special characters in + * an attempt to format it like the enum. + * + * @param name Name of the material to get + * @param legacyName whether this is a legacy name (see + * {@link #getMaterial(java.lang.String, boolean)} + * @return Material if found, or null + */ + @Nullable + public static Material matchMaterial(@NotNull final String name, boolean legacyName) { + Preconditions.checkArgument(name != null, "Name cannot be null"); + + String filtered = name; + if (filtered.startsWith(NamespacedKey.MINECRAFT + ":")) { + filtered = filtered.substring((NamespacedKey.MINECRAFT + ":").length()); + } + + filtered = filtered.toUpperCase(Locale.ROOT); + + filtered = filtered.replaceAll("\\s+", "_").replaceAll("\\W", ""); + return getMaterial(filtered, legacyName); + } + + static { + for (Material material : values()) { + BY_NAME.put(material.name(), material); + } + } + + /** + * @return True if this material represents a playable music disk. + */ + public boolean isRecord() { + ItemType type = asItemType(); + return type != null && type.isRecord(); + } + + /** + * Check if the material is a block and solid (can be built upon) + * + * @return True if this material is a block and solid + */ + public boolean isSolid() { + BlockType type = asBlockType(); + return type != null && type.isSolid(); + } + + /** + * Check if the material is an air block. + * + * @return True if this material is an air block. + */ + public boolean isAir() { + BlockType type = asBlockType(); + return type != null && type.isAir(); + } + + /** + * Check if the material is a block and does not block any light + * + * @return True if this material is a block and does not block any light + * @deprecated currently does not have an implementation which is well + * linked to the underlying server. Contributions welcome. + */ + @Deprecated + public boolean isTransparent() { + if (!isBlock()) { + return false; + } + switch (this) { + // + // Paper start - Generated/Material#isTransparent + case ACACIA_BUTTON: + case ACACIA_SAPLING: + case ACTIVATOR_RAIL: + case AIR: + case ALLIUM: + case ATTACHED_MELON_STEM: + case ATTACHED_PUMPKIN_STEM: + case AZURE_BLUET: + case BARRIER: + case BEETROOTS: + case BIRCH_BUTTON: + case BIRCH_SAPLING: + case BLACK_CARPET: + case BLUE_CARPET: + case BLUE_ORCHID: + case BROWN_CARPET: + case BROWN_MUSHROOM: + case CARROTS: + case CAVE_AIR: + case CHORUS_FLOWER: + case CHORUS_PLANT: + case COCOA: + case COMPARATOR: + case CREEPER_HEAD: + case CREEPER_WALL_HEAD: + case CYAN_CARPET: + case DANDELION: + case DARK_OAK_BUTTON: + case DARK_OAK_SAPLING: + case DEAD_BUSH: + case DETECTOR_RAIL: + case DRAGON_HEAD: + case DRAGON_WALL_HEAD: + case END_GATEWAY: + case END_PORTAL: + case END_ROD: + case FERN: + case FIRE: + case FLOWER_POT: + case GRAY_CARPET: + case GREEN_CARPET: + case JUNGLE_BUTTON: + case JUNGLE_SAPLING: + case LADDER: + case LARGE_FERN: + case LEVER: + case LIGHT_BLUE_CARPET: + case LIGHT_GRAY_CARPET: + case LILAC: + case LILY_PAD: + case LIME_CARPET: + case MAGENTA_CARPET: + case MELON_STEM: + case NETHER_PORTAL: + case NETHER_WART: + case OAK_BUTTON: + case OAK_SAPLING: + case ORANGE_CARPET: + case ORANGE_TULIP: + case OXEYE_DAISY: + case PEONY: + case PINK_CARPET: + case PINK_TULIP: + case PLAYER_HEAD: + case PLAYER_WALL_HEAD: + case POPPY: + case POTATOES: + case POTTED_ACACIA_SAPLING: + case POTTED_ALLIUM: + case POTTED_AZALEA_BUSH: + case POTTED_AZURE_BLUET: + case POTTED_BIRCH_SAPLING: + case POTTED_BLUE_ORCHID: + case POTTED_BROWN_MUSHROOM: + case POTTED_CACTUS: + case POTTED_DANDELION: + case POTTED_DARK_OAK_SAPLING: + case POTTED_DEAD_BUSH: + case POTTED_FERN: + case POTTED_FLOWERING_AZALEA_BUSH: + case POTTED_JUNGLE_SAPLING: + case POTTED_OAK_SAPLING: + case POTTED_ORANGE_TULIP: + case POTTED_OXEYE_DAISY: + case POTTED_PINK_TULIP: + case POTTED_POPPY: + case POTTED_RED_MUSHROOM: + case POTTED_RED_TULIP: + case POTTED_SPRUCE_SAPLING: + case POTTED_WHITE_TULIP: + case POWERED_RAIL: + case PUMPKIN_STEM: + case PURPLE_CARPET: + case RAIL: + case REDSTONE_TORCH: + case REDSTONE_WALL_TORCH: + case REDSTONE_WIRE: + case RED_CARPET: + case RED_MUSHROOM: + case RED_TULIP: + case REPEATER: + case ROSE_BUSH: + case SHORT_GRASS: + case SKELETON_SKULL: + case SKELETON_WALL_SKULL: + case SNOW: + case SPRUCE_BUTTON: + case SPRUCE_SAPLING: + case STONE_BUTTON: + case STRUCTURE_VOID: + case SUGAR_CANE: + case SUNFLOWER: + case TALL_GRASS: + case TORCH: + case TRIPWIRE: + case TRIPWIRE_HOOK: + case VINE: + case VOID_AIR: + case WALL_TORCH: + case WHEAT: + case WHITE_CARPET: + case WHITE_TULIP: + case WITHER_SKELETON_SKULL: + case WITHER_SKELETON_WALL_SKULL: + case YELLOW_CARPET: + case ZOMBIE_HEAD: + case ZOMBIE_WALL_HEAD: + // Paper end - Generated/Material#isTransparent + // ----- Legacy Separator ----- + case LEGACY_AIR: + case LEGACY_SAPLING: + case LEGACY_POWERED_RAIL: + case LEGACY_DETECTOR_RAIL: + case LEGACY_LONG_GRASS: + case LEGACY_DEAD_BUSH: + case LEGACY_YELLOW_FLOWER: + case LEGACY_RED_ROSE: + case LEGACY_BROWN_MUSHROOM: + case LEGACY_RED_MUSHROOM: + case LEGACY_TORCH: + case LEGACY_FIRE: + case LEGACY_REDSTONE_WIRE: + case LEGACY_CROPS: + case LEGACY_LADDER: + case LEGACY_RAILS: + case LEGACY_LEVER: + case LEGACY_REDSTONE_TORCH_OFF: + case LEGACY_REDSTONE_TORCH_ON: + case LEGACY_STONE_BUTTON: + case LEGACY_SNOW: + case LEGACY_SUGAR_CANE_BLOCK: + case LEGACY_PORTAL: + case LEGACY_DIODE_BLOCK_OFF: + case LEGACY_DIODE_BLOCK_ON: + case LEGACY_PUMPKIN_STEM: + case LEGACY_MELON_STEM: + case LEGACY_VINE: + case LEGACY_WATER_LILY: + case LEGACY_NETHER_WARTS: + case LEGACY_ENDER_PORTAL: + case LEGACY_COCOA: + case LEGACY_TRIPWIRE_HOOK: + case LEGACY_TRIPWIRE: + case LEGACY_FLOWER_POT: + case LEGACY_CARROT: + case LEGACY_POTATO: + case LEGACY_WOOD_BUTTON: + case LEGACY_SKULL: + case LEGACY_REDSTONE_COMPARATOR_OFF: + case LEGACY_REDSTONE_COMPARATOR_ON: + case LEGACY_ACTIVATOR_RAIL: + case LEGACY_CARPET: + case LEGACY_DOUBLE_PLANT: + case LEGACY_END_ROD: + case LEGACY_CHORUS_PLANT: + case LEGACY_CHORUS_FLOWER: + case LEGACY_BEETROOT_BLOCK: + case LEGACY_END_GATEWAY: + case LEGACY_STRUCTURE_VOID: + // + return true; + default: + return false; + } + } + + /** + * Check if the material is a block and can catch fire + * + * @return True if this material is a block and can catch fire + */ + public boolean isFlammable() { + BlockType type = asBlockType(); + return type != null && type.isFlammable(); + } + + /** + * Check if the material is a block and can burn away + * + * @return True if this material is a block and can burn away + */ + public boolean isBurnable() { + BlockType type = asBlockType(); + return type != null && type.isBurnable(); + } + + /** + * Checks if this Material can be used as fuel in a Furnace + * + * @return true if this Material can be used as fuel. + */ + public boolean isFuel() { + ItemType type = asItemType(); + return type != null && type.isFuel(); + } + + /** + * Check if the material is a block and occludes light in the lighting engine. + *

+ * Generally speaking, most full blocks will occlude light. Non-full blocks are + * not occluding (e.g. anvils, chests, tall grass, stairs, etc.), nor are specific + * full blocks such as barriers or spawners which block light despite their texture. + *

+ * An occluding block will have the following effects: + *

    + *
  • Chests cannot be opened if an occluding block is above it. + *
  • Mobs cannot spawn inside of occluding blocks. + *
  • Only occluding blocks can be "powered" ({@link Block#isBlockPowered()}). + *
+ * This list may be inconclusive. For a full list of the side effects of an occluding + * block, see the
Minecraft Wiki. + * + * @return True if this material is a block and occludes light + */ + public boolean isOccluding() { + BlockType type = asBlockType(); + return type != null && type.isOccluding(); + } + + /** + * @return True if this material is affected by gravity. + */ + public boolean hasGravity() { + BlockType type = asBlockType(); + return type != null && type.hasGravity(); + } + + /** + * Checks if this Material is an obtainable item. + * + * @return true if this material is an item + */ + public boolean isItem() { + return asItemType() != null; + } + + /** + * Checks if this Material can be interacted with. + * + * Interactable materials include those with functionality when they are + * interacted with by a player such as chests, furnaces, etc. + * + * Some blocks such as piston heads and stairs are considered interactable + * though may not perform any additional functionality. + * + * Note that the interactability of some materials may be dependant on their + * state as well. This method will return true if there is at least one + * state in which additional interact handling is performed for the + * material. + * + * @return true if this material can be interacted with. + * @deprecated This method is not comprehensive and does not accurately reflect what block types are + * interactable. Many "interactions" are defined on the item not block, and many are conditional on some other world state + * checks being true. + */ + @Deprecated // Paper + public boolean isInteractable() { + BlockType type = asBlockType(); + return type != null && type.isInteractable(); + } + + /** + * Obtains the block's hardness level (also known as "strength"). + *
+ * This number is used to calculate the time required to break each block. + *
+ * Only available when {@link #isBlock()} is true. + * + * @return the hardness of that material. + */ + public float getHardness() { + BlockType type = asBlockType(); + Preconditions.checkArgument(type != null, "The Material is not a block!"); + return type.getHardness(); + + } + + /** + * Obtains the blast resistance value (also known as block "durability"). + *
+ * This value is used in explosions to calculate whether a block should be + * broken or not. + *
+ * Only available when {@link #isBlock()} is true. + * + * @return the blast resistance of that material. + */ + public float getBlastResistance() { + BlockType type = asBlockType(); + Preconditions.checkArgument(type != null, "The Material is not a block!"); + return type.getBlastResistance(); + } + + /** + * Returns a value that represents how 'slippery' the block is. + * + * Blocks with higher slipperiness, like {@link Material#ICE} can be slid on + * further by the player and other entities. + * + * Most blocks have a default slipperiness of {@code 0.6f}. + * + * Only available when {@link #isBlock()} is true. + * + * @return the slipperiness of this block + */ + public float getSlipperiness() { + BlockType type = asBlockType(); + Preconditions.checkArgument(type != null, "The Material is not a block!"); + return type.getSlipperiness(); + } + + /** + * Determines the remaining item in a crafting grid after crafting with this + * ingredient. + *
+ * Only available when {@link #isItem()} is true. + * + * @return the item left behind when crafting, or null if nothing is. + */ + @Nullable + public Material getCraftingRemainingItem() { + ItemType type = asItemType(); + Preconditions.checkArgument(type != null, "The Material is not an item!"); + return type.getCraftingRemainingItem() == null ? null : type.getCraftingRemainingItem().asMaterial(); + } + + /** + * Get the best suitable slot for this Material. + * + * For most items this will be {@link EquipmentSlot#HAND}. + * + * @return the best EquipmentSlot for this Material + */ + @NotNull + public EquipmentSlot getEquipmentSlot() { + Preconditions.checkArgument(isItem(), "The Material is not an item!"); + switch (this) { + // + // Paper start - Generated/Material#getEquipmentSlot + // @GeneratedFrom 1.21.1 + case BLACK_CARPET: + case BLUE_CARPET: + case BROWN_CARPET: + case CYAN_CARPET: + case DIAMOND_HORSE_ARMOR: + case GOLDEN_HORSE_ARMOR: + case GRAY_CARPET: + case GREEN_CARPET: + case IRON_HORSE_ARMOR: + case LEATHER_HORSE_ARMOR: + case LIGHT_BLUE_CARPET: + case LIGHT_GRAY_CARPET: + case LIME_CARPET: + case MAGENTA_CARPET: + case ORANGE_CARPET: + case PINK_CARPET: + case PURPLE_CARPET: + case RED_CARPET: + case WHITE_CARPET: + case WOLF_ARMOR: + case YELLOW_CARPET: + return EquipmentSlot.BODY; + case CARVED_PUMPKIN: + case CHAINMAIL_HELMET: + case CREEPER_HEAD: + case DIAMOND_HELMET: + case DRAGON_HEAD: + case GOLDEN_HELMET: + case IRON_HELMET: + case LEATHER_HELMET: + case NETHERITE_HELMET: + case PIGLIN_HEAD: + case PLAYER_HEAD: + case SKELETON_SKULL: + case TURTLE_HELMET: + case WITHER_SKELETON_SKULL: + case ZOMBIE_HEAD: + return EquipmentSlot.HEAD; + case CHAINMAIL_CHESTPLATE: + case DIAMOND_CHESTPLATE: + case ELYTRA: + case GOLDEN_CHESTPLATE: + case IRON_CHESTPLATE: + case LEATHER_CHESTPLATE: + case NETHERITE_CHESTPLATE: + return EquipmentSlot.CHEST; + case CHAINMAIL_LEGGINGS: + case DIAMOND_LEGGINGS: + case GOLDEN_LEGGINGS: + case IRON_LEGGINGS: + case LEATHER_LEGGINGS: + case NETHERITE_LEGGINGS: + return EquipmentSlot.LEGS; + case CHAINMAIL_BOOTS: + case DIAMOND_BOOTS: + case GOLDEN_BOOTS: + case IRON_BOOTS: + case LEATHER_BOOTS: + case NETHERITE_BOOTS: + return EquipmentSlot.FEET; + case SHIELD: + return EquipmentSlot.OFF_HAND; + default: + return EquipmentSlot.HAND; + // Paper end - Generated/Material#getEquipmentSlot + // + } + } + + // Paper start - improve default item attribute API + /** + * Return an immutable copy of all default {@link Attribute}s and their {@link AttributeModifier}s. + *

+ * Default attributes are those that are always preset on some items, unless + * they are specifically overridden on that {@link ItemStack}. Examples include + * the attack damage on weapons or the armor value on armor. + *

+ * Only available when {@link #isItem()} is true. + * + * @return the immutable {@link Multimap} with the respective default + * Attributes and modifiers, or an empty map if no attributes are set. + */ + public @NotNull @org.jetbrains.annotations.Unmodifiable Multimap getDefaultAttributeModifiers() { + final ItemType type = this.asItemType(); + Preconditions.checkArgument(type != null, "The Material is not an item!"); + return type.getDefaultAttributeModifiers(); + } + // Paper end - improve default item attribute API + + /** + * Return an immutable copy of all default {@link Attribute}s and their + * {@link AttributeModifier}s for a given {@link EquipmentSlot}. + *

+ * Default attributes are those that are always preset on some items, unless + * they are specifically overridden on that {@link ItemStack}. Examples include + * the attack damage on weapons or the armor value on armor. + *

+ * Only available when {@link #isItem()} is true. + * + * @param slot the {@link EquipmentSlot} to check + * @return the immutable {@link Multimap} with the respective default + * Attributes and modifiers, or an empty map if no attributes are set. + */ + @NotNull + public Multimap getDefaultAttributeModifiers(@NotNull EquipmentSlot slot) { + ItemType type = asItemType(); + Preconditions.checkArgument(type != null, "The Material is not an item!"); + return type.getDefaultAttributeModifiers(slot); + } + + /** + * Get the {@link CreativeCategory} to which this material belongs. + * + * @return the creative category. null if does not belong to a category + */ + @Nullable + public CreativeCategory getCreativeCategory() { + ItemType type = asItemType(); + return type == null ? null : type.getCreativeCategory(); + } + + /** + * Get the translation key of the item or block associated with this + * material. + * + * If this material has both an item and a block form, the item form is + * used. + * + * @return the translation key of the item or block associated with this + * material + * @see #getBlockTranslationKey() + * @see #getItemTranslationKey() + * @deprecated use {@link #translationKey()} + */ + @Override + @NotNull + @Deprecated(forRemoval = true) // Paper + public String getTranslationKey() { + if (this.isItem()) { + return asItemType().getTranslationKey(); + } else { + return asBlockType().getTranslationKey(); + } + } + + /** + * Get the translation key of the block associated with this material, or + * null if this material does not have an associated block. + * + * @return the translation key of the block associated with this material, + * or null if this material does not have an associated block + */ + @Nullable + public String getBlockTranslationKey() { + BlockType type = asBlockType(); + return type == null ? null : type.getTranslationKey(); + } + + /** + * Get the translation key of the item associated with this material, or + * null if this material does not have an associated item. + * + * @return the translation key of the item associated with this material, or + * null if this material does not have an associated item. + */ + @Nullable + public String getItemTranslationKey() { + ItemType type = asItemType(); + return type == null ? null : type.getTranslationKey(); + } + + /** + * Gets if the Material is enabled by the features in a world. + * + * @param world the world to check + * @return true if this material can be used in this World. + */ + @Deprecated(forRemoval = true, since = "1.20") // Paper + public boolean isEnabledByFeature(@NotNull World world) { + if (isItem()) { + return Bukkit.getDataPackManager().isEnabledByFeature(asItemType(), world); + } + + return Bukkit.getDataPackManager().isEnabledByFeature(asBlockType(), world); + } + + /** + * Checks whether this material is compostable (can be inserted into a + * composter). + * + * @return true if this material is compostable + * @see #getCompostChance() + */ + public boolean isCompostable() { + return isItem() && asItemType().isCompostable(); + } + + /** + * Get the chance that this material will successfully compost. The returned + * value is between 0 and 1 (inclusive). + * + * Materials with a compost chance of 1 will always raise the composter's + * level, while materials with a compost chance of 0 will never raise it. + * + * Plugins should check that {@link #isCompostable} returns true before + * calling this method. + * + * @return the chance that this material will successfully compost + * @throws IllegalArgumentException if the material is not compostable + * @see #isCompostable() + */ + public float getCompostChance() { + ItemType type = asItemType(); + Preconditions.checkArgument(type != null, "The Material is not an item!"); + return type.getCompostChance(); + } + + /** + * Tries to convert this Material to an item type + * + * @return the converted item type or null + * @apiNote only for internal use + */ + @ApiStatus.Internal + @Nullable + public ItemType asItemType() { + Material material = this; + if (isLegacy()) { + material = Bukkit.getUnsafe().fromLegacy(this); + } + return Registry.ITEM.get(material.key); + } + + /** + * Tries to convert this Material to a block type + * + * @return the converted block type or null + * @apiNote only for internal use + */ + @ApiStatus.Internal + @Nullable + public BlockType asBlockType() { + Material material = this; + if (isLegacy()) { + material = Bukkit.getUnsafe().fromLegacy(this); + } + return Registry.BLOCK.get(material.key); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/MusicInstrument.java b/paper-generator/generatedApi/org/bukkit/MusicInstrument.java new file mode 100644 index 0000000000..c8773cb513 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/MusicInstrument.java @@ -0,0 +1,82 @@ +package org.bukkit; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Collection; +import java.util.Collections; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public abstract class MusicInstrument implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - translation keys + + // Paper start - Generated/MusicInstrument + // @GeneratedFrom 1.21.1 + public static final MusicInstrument ADMIRE_GOAT_HORN = getInstrument("admire_goat_horn"); + + public static final MusicInstrument CALL_GOAT_HORN = getInstrument("call_goat_horn"); + + public static final MusicInstrument DREAM_GOAT_HORN = getInstrument("dream_goat_horn"); + + public static final MusicInstrument FEEL_GOAT_HORN = getInstrument("feel_goat_horn"); + + public static final MusicInstrument PONDER_GOAT_HORN = getInstrument("ponder_goat_horn"); + + public static final MusicInstrument SEEK_GOAT_HORN = getInstrument("seek_goat_horn"); + + public static final MusicInstrument SING_GOAT_HORN = getInstrument("sing_goat_horn"); + + public static final MusicInstrument YEARN_GOAT_HORN = getInstrument("yearn_goat_horn"); + // Paper end - Generated/MusicInstrument + + /** + * Returns a {@link MusicInstrument} by a {@link NamespacedKey}. + * + * @param namespacedKey the key + * @return the event or null + * @deprecated Use {@link Registry#get(NamespacedKey)} instead. + */ + @Nullable + @Deprecated + public static MusicInstrument getByKey(@NotNull NamespacedKey namespacedKey) { + return Registry.INSTRUMENT.get(namespacedKey); + } + + /** + * Returns all known MusicInstruments. + * + * @return the memoryKeys + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated + public static Collection values() { + return Collections.unmodifiableCollection(Lists.newArrayList(Registry.INSTRUMENT)); + } + + @NotNull + private static MusicInstrument getInstrument(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + MusicInstrument instrument = Registry.INSTRUMENT.get(namespacedKey); + + Preconditions.checkNotNull(instrument, "No MusicInstrument found for %s. This is a bug.", namespacedKey); + + return instrument; + } + + // Paper start - deprecate getKey + /** + * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#INSTRUMENT}. MusicInstruments + * can exist without a key. + */ + @Deprecated(forRemoval = true, since = "1.20.5") + @Override + public abstract @NotNull NamespacedKey getKey(); + // Paper end - deprecate getKey + + // Paper start - translation key + @Override + public @NotNull String translationKey() { + return "instrument.minecraft." + this.getKey().value(); + } + // Paper end - translation key +} diff --git a/paper-generator/generatedApi/org/bukkit/Sound.java b/paper-generator/generatedApi/org/bukkit/Sound.java new file mode 100644 index 0000000000..02e5b8eb53 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Sound.java @@ -0,0 +1,1655 @@ +package org.bukkit; + +import org.jetbrains.annotations.NotNull; + +/** + * An Enum of Sounds the server is able to send to players. + *

+ * WARNING: At any time, sounds may be added/removed from this Enum or even + * MineCraft itself! There is no guarantee the sounds will play. There is no + * guarantee values will not be removed from this Enum. As such, you should not + * depend on the ordinal values of this class. + */ +public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Paper - implement Sound.Type + + // Paper start - Generated/Sound + // @GeneratedFrom 1.21.1 + AMBIENT_BASALT_DELTAS_ADDITIONS("ambient.basalt_deltas.additions"), + AMBIENT_BASALT_DELTAS_LOOP("ambient.basalt_deltas.loop"), + AMBIENT_BASALT_DELTAS_MOOD("ambient.basalt_deltas.mood"), + AMBIENT_CAVE("ambient.cave"), + AMBIENT_CRIMSON_FOREST_ADDITIONS("ambient.crimson_forest.additions"), + AMBIENT_CRIMSON_FOREST_LOOP("ambient.crimson_forest.loop"), + AMBIENT_CRIMSON_FOREST_MOOD("ambient.crimson_forest.mood"), + AMBIENT_NETHER_WASTES_ADDITIONS("ambient.nether_wastes.additions"), + AMBIENT_NETHER_WASTES_LOOP("ambient.nether_wastes.loop"), + AMBIENT_NETHER_WASTES_MOOD("ambient.nether_wastes.mood"), + AMBIENT_SOUL_SAND_VALLEY_ADDITIONS("ambient.soul_sand_valley.additions"), + AMBIENT_SOUL_SAND_VALLEY_LOOP("ambient.soul_sand_valley.loop"), + AMBIENT_SOUL_SAND_VALLEY_MOOD("ambient.soul_sand_valley.mood"), + AMBIENT_UNDERWATER_ENTER("ambient.underwater.enter"), + AMBIENT_UNDERWATER_EXIT("ambient.underwater.exit"), + AMBIENT_UNDERWATER_LOOP("ambient.underwater.loop"), + AMBIENT_UNDERWATER_LOOP_ADDITIONS("ambient.underwater.loop.additions"), + AMBIENT_UNDERWATER_LOOP_ADDITIONS_RARE("ambient.underwater.loop.additions.rare"), + AMBIENT_UNDERWATER_LOOP_ADDITIONS_ULTRA_RARE("ambient.underwater.loop.additions.ultra_rare"), + AMBIENT_WARPED_FOREST_ADDITIONS("ambient.warped_forest.additions"), + AMBIENT_WARPED_FOREST_LOOP("ambient.warped_forest.loop"), + AMBIENT_WARPED_FOREST_MOOD("ambient.warped_forest.mood"), + BLOCK_AMETHYST_BLOCK_BREAK("block.amethyst_block.break"), + BLOCK_AMETHYST_BLOCK_CHIME("block.amethyst_block.chime"), + BLOCK_AMETHYST_BLOCK_FALL("block.amethyst_block.fall"), + BLOCK_AMETHYST_BLOCK_HIT("block.amethyst_block.hit"), + BLOCK_AMETHYST_BLOCK_PLACE("block.amethyst_block.place"), + BLOCK_AMETHYST_BLOCK_RESONATE("block.amethyst_block.resonate"), + BLOCK_AMETHYST_BLOCK_STEP("block.amethyst_block.step"), + BLOCK_AMETHYST_CLUSTER_BREAK("block.amethyst_cluster.break"), + BLOCK_AMETHYST_CLUSTER_FALL("block.amethyst_cluster.fall"), + BLOCK_AMETHYST_CLUSTER_HIT("block.amethyst_cluster.hit"), + BLOCK_AMETHYST_CLUSTER_PLACE("block.amethyst_cluster.place"), + BLOCK_AMETHYST_CLUSTER_STEP("block.amethyst_cluster.step"), + BLOCK_ANCIENT_DEBRIS_BREAK("block.ancient_debris.break"), + BLOCK_ANCIENT_DEBRIS_FALL("block.ancient_debris.fall"), + BLOCK_ANCIENT_DEBRIS_HIT("block.ancient_debris.hit"), + BLOCK_ANCIENT_DEBRIS_PLACE("block.ancient_debris.place"), + BLOCK_ANCIENT_DEBRIS_STEP("block.ancient_debris.step"), + BLOCK_ANVIL_BREAK("block.anvil.break"), + BLOCK_ANVIL_DESTROY("block.anvil.destroy"), + BLOCK_ANVIL_FALL("block.anvil.fall"), + BLOCK_ANVIL_HIT("block.anvil.hit"), + BLOCK_ANVIL_LAND("block.anvil.land"), + BLOCK_ANVIL_PLACE("block.anvil.place"), + BLOCK_ANVIL_STEP("block.anvil.step"), + BLOCK_ANVIL_USE("block.anvil.use"), + BLOCK_AZALEA_BREAK("block.azalea.break"), + BLOCK_AZALEA_FALL("block.azalea.fall"), + BLOCK_AZALEA_HIT("block.azalea.hit"), + BLOCK_AZALEA_PLACE("block.azalea.place"), + BLOCK_AZALEA_STEP("block.azalea.step"), + BLOCK_AZALEA_LEAVES_BREAK("block.azalea_leaves.break"), + BLOCK_AZALEA_LEAVES_FALL("block.azalea_leaves.fall"), + BLOCK_AZALEA_LEAVES_HIT("block.azalea_leaves.hit"), + BLOCK_AZALEA_LEAVES_PLACE("block.azalea_leaves.place"), + BLOCK_AZALEA_LEAVES_STEP("block.azalea_leaves.step"), + BLOCK_BAMBOO_BREAK("block.bamboo.break"), + BLOCK_BAMBOO_FALL("block.bamboo.fall"), + BLOCK_BAMBOO_HIT("block.bamboo.hit"), + BLOCK_BAMBOO_PLACE("block.bamboo.place"), + BLOCK_BAMBOO_STEP("block.bamboo.step"), + BLOCK_BAMBOO_SAPLING_BREAK("block.bamboo_sapling.break"), + BLOCK_BAMBOO_SAPLING_HIT("block.bamboo_sapling.hit"), + BLOCK_BAMBOO_SAPLING_PLACE("block.bamboo_sapling.place"), + BLOCK_BAMBOO_WOOD_BREAK("block.bamboo_wood.break"), + BLOCK_BAMBOO_WOOD_FALL("block.bamboo_wood.fall"), + BLOCK_BAMBOO_WOOD_HIT("block.bamboo_wood.hit"), + BLOCK_BAMBOO_WOOD_PLACE("block.bamboo_wood.place"), + BLOCK_BAMBOO_WOOD_STEP("block.bamboo_wood.step"), + BLOCK_BAMBOO_WOOD_BUTTON_CLICK_OFF("block.bamboo_wood_button.click_off"), + BLOCK_BAMBOO_WOOD_BUTTON_CLICK_ON("block.bamboo_wood_button.click_on"), + BLOCK_BAMBOO_WOOD_DOOR_CLOSE("block.bamboo_wood_door.close"), + BLOCK_BAMBOO_WOOD_DOOR_OPEN("block.bamboo_wood_door.open"), + BLOCK_BAMBOO_WOOD_FENCE_GATE_CLOSE("block.bamboo_wood_fence_gate.close"), + BLOCK_BAMBOO_WOOD_FENCE_GATE_OPEN("block.bamboo_wood_fence_gate.open"), + BLOCK_BAMBOO_WOOD_HANGING_SIGN_BREAK("block.bamboo_wood_hanging_sign.break"), + BLOCK_BAMBOO_WOOD_HANGING_SIGN_FALL("block.bamboo_wood_hanging_sign.fall"), + BLOCK_BAMBOO_WOOD_HANGING_SIGN_HIT("block.bamboo_wood_hanging_sign.hit"), + BLOCK_BAMBOO_WOOD_HANGING_SIGN_PLACE("block.bamboo_wood_hanging_sign.place"), + BLOCK_BAMBOO_WOOD_HANGING_SIGN_STEP("block.bamboo_wood_hanging_sign.step"), + BLOCK_BAMBOO_WOOD_PRESSURE_PLATE_CLICK_OFF("block.bamboo_wood_pressure_plate.click_off"), + BLOCK_BAMBOO_WOOD_PRESSURE_PLATE_CLICK_ON("block.bamboo_wood_pressure_plate.click_on"), + BLOCK_BAMBOO_WOOD_TRAPDOOR_CLOSE("block.bamboo_wood_trapdoor.close"), + BLOCK_BAMBOO_WOOD_TRAPDOOR_OPEN("block.bamboo_wood_trapdoor.open"), + BLOCK_BARREL_CLOSE("block.barrel.close"), + BLOCK_BARREL_OPEN("block.barrel.open"), + BLOCK_BASALT_BREAK("block.basalt.break"), + BLOCK_BASALT_FALL("block.basalt.fall"), + BLOCK_BASALT_HIT("block.basalt.hit"), + BLOCK_BASALT_PLACE("block.basalt.place"), + BLOCK_BASALT_STEP("block.basalt.step"), + BLOCK_BEACON_ACTIVATE("block.beacon.activate"), + BLOCK_BEACON_AMBIENT("block.beacon.ambient"), + BLOCK_BEACON_DEACTIVATE("block.beacon.deactivate"), + BLOCK_BEACON_POWER_SELECT("block.beacon.power_select"), + BLOCK_BEEHIVE_DRIP("block.beehive.drip"), + BLOCK_BEEHIVE_ENTER("block.beehive.enter"), + BLOCK_BEEHIVE_EXIT("block.beehive.exit"), + BLOCK_BEEHIVE_SHEAR("block.beehive.shear"), + BLOCK_BEEHIVE_WORK("block.beehive.work"), + BLOCK_BELL_RESONATE("block.bell.resonate"), + BLOCK_BELL_USE("block.bell.use"), + BLOCK_BIG_DRIPLEAF_BREAK("block.big_dripleaf.break"), + BLOCK_BIG_DRIPLEAF_FALL("block.big_dripleaf.fall"), + BLOCK_BIG_DRIPLEAF_HIT("block.big_dripleaf.hit"), + BLOCK_BIG_DRIPLEAF_PLACE("block.big_dripleaf.place"), + BLOCK_BIG_DRIPLEAF_STEP("block.big_dripleaf.step"), + BLOCK_BIG_DRIPLEAF_TILT_DOWN("block.big_dripleaf.tilt_down"), + BLOCK_BIG_DRIPLEAF_TILT_UP("block.big_dripleaf.tilt_up"), + BLOCK_BLASTFURNACE_FIRE_CRACKLE("block.blastfurnace.fire_crackle"), + BLOCK_BONE_BLOCK_BREAK("block.bone_block.break"), + BLOCK_BONE_BLOCK_FALL("block.bone_block.fall"), + BLOCK_BONE_BLOCK_HIT("block.bone_block.hit"), + BLOCK_BONE_BLOCK_PLACE("block.bone_block.place"), + BLOCK_BONE_BLOCK_STEP("block.bone_block.step"), + BLOCK_BREWING_STAND_BREW("block.brewing_stand.brew"), + BLOCK_BUBBLE_COLUMN_BUBBLE_POP("block.bubble_column.bubble_pop"), + BLOCK_BUBBLE_COLUMN_UPWARDS_AMBIENT("block.bubble_column.upwards_ambient"), + BLOCK_BUBBLE_COLUMN_UPWARDS_INSIDE("block.bubble_column.upwards_inside"), + BLOCK_BUBBLE_COLUMN_WHIRLPOOL_AMBIENT("block.bubble_column.whirlpool_ambient"), + BLOCK_BUBBLE_COLUMN_WHIRLPOOL_INSIDE("block.bubble_column.whirlpool_inside"), + BLOCK_CAKE_ADD_CANDLE("block.cake.add_candle"), + BLOCK_CALCITE_BREAK("block.calcite.break"), + BLOCK_CALCITE_FALL("block.calcite.fall"), + BLOCK_CALCITE_HIT("block.calcite.hit"), + BLOCK_CALCITE_PLACE("block.calcite.place"), + BLOCK_CALCITE_STEP("block.calcite.step"), + BLOCK_CAMPFIRE_CRACKLE("block.campfire.crackle"), + BLOCK_CANDLE_AMBIENT("block.candle.ambient"), + BLOCK_CANDLE_BREAK("block.candle.break"), + BLOCK_CANDLE_EXTINGUISH("block.candle.extinguish"), + BLOCK_CANDLE_FALL("block.candle.fall"), + BLOCK_CANDLE_HIT("block.candle.hit"), + BLOCK_CANDLE_PLACE("block.candle.place"), + BLOCK_CANDLE_STEP("block.candle.step"), + BLOCK_CAVE_VINES_BREAK("block.cave_vines.break"), + BLOCK_CAVE_VINES_FALL("block.cave_vines.fall"), + BLOCK_CAVE_VINES_HIT("block.cave_vines.hit"), + BLOCK_CAVE_VINES_PICK_BERRIES("block.cave_vines.pick_berries"), + BLOCK_CAVE_VINES_PLACE("block.cave_vines.place"), + BLOCK_CAVE_VINES_STEP("block.cave_vines.step"), + BLOCK_CHAIN_BREAK("block.chain.break"), + BLOCK_CHAIN_FALL("block.chain.fall"), + BLOCK_CHAIN_HIT("block.chain.hit"), + BLOCK_CHAIN_PLACE("block.chain.place"), + BLOCK_CHAIN_STEP("block.chain.step"), + BLOCK_CHERRY_LEAVES_BREAK("block.cherry_leaves.break"), + BLOCK_CHERRY_LEAVES_FALL("block.cherry_leaves.fall"), + BLOCK_CHERRY_LEAVES_HIT("block.cherry_leaves.hit"), + BLOCK_CHERRY_LEAVES_PLACE("block.cherry_leaves.place"), + BLOCK_CHERRY_LEAVES_STEP("block.cherry_leaves.step"), + BLOCK_CHERRY_SAPLING_BREAK("block.cherry_sapling.break"), + BLOCK_CHERRY_SAPLING_FALL("block.cherry_sapling.fall"), + BLOCK_CHERRY_SAPLING_HIT("block.cherry_sapling.hit"), + BLOCK_CHERRY_SAPLING_PLACE("block.cherry_sapling.place"), + BLOCK_CHERRY_SAPLING_STEP("block.cherry_sapling.step"), + BLOCK_CHERRY_WOOD_BREAK("block.cherry_wood.break"), + BLOCK_CHERRY_WOOD_FALL("block.cherry_wood.fall"), + BLOCK_CHERRY_WOOD_HIT("block.cherry_wood.hit"), + BLOCK_CHERRY_WOOD_PLACE("block.cherry_wood.place"), + BLOCK_CHERRY_WOOD_STEP("block.cherry_wood.step"), + BLOCK_CHERRY_WOOD_BUTTON_CLICK_OFF("block.cherry_wood_button.click_off"), + BLOCK_CHERRY_WOOD_BUTTON_CLICK_ON("block.cherry_wood_button.click_on"), + BLOCK_CHERRY_WOOD_DOOR_CLOSE("block.cherry_wood_door.close"), + BLOCK_CHERRY_WOOD_DOOR_OPEN("block.cherry_wood_door.open"), + BLOCK_CHERRY_WOOD_FENCE_GATE_CLOSE("block.cherry_wood_fence_gate.close"), + BLOCK_CHERRY_WOOD_FENCE_GATE_OPEN("block.cherry_wood_fence_gate.open"), + BLOCK_CHERRY_WOOD_HANGING_SIGN_BREAK("block.cherry_wood_hanging_sign.break"), + BLOCK_CHERRY_WOOD_HANGING_SIGN_FALL("block.cherry_wood_hanging_sign.fall"), + BLOCK_CHERRY_WOOD_HANGING_SIGN_HIT("block.cherry_wood_hanging_sign.hit"), + BLOCK_CHERRY_WOOD_HANGING_SIGN_PLACE("block.cherry_wood_hanging_sign.place"), + BLOCK_CHERRY_WOOD_HANGING_SIGN_STEP("block.cherry_wood_hanging_sign.step"), + BLOCK_CHERRY_WOOD_PRESSURE_PLATE_CLICK_OFF("block.cherry_wood_pressure_plate.click_off"), + BLOCK_CHERRY_WOOD_PRESSURE_PLATE_CLICK_ON("block.cherry_wood_pressure_plate.click_on"), + BLOCK_CHERRY_WOOD_TRAPDOOR_CLOSE("block.cherry_wood_trapdoor.close"), + BLOCK_CHERRY_WOOD_TRAPDOOR_OPEN("block.cherry_wood_trapdoor.open"), + BLOCK_CHEST_CLOSE("block.chest.close"), + BLOCK_CHEST_LOCKED("block.chest.locked"), + BLOCK_CHEST_OPEN("block.chest.open"), + BLOCK_CHISELED_BOOKSHELF_BREAK("block.chiseled_bookshelf.break"), + BLOCK_CHISELED_BOOKSHELF_FALL("block.chiseled_bookshelf.fall"), + BLOCK_CHISELED_BOOKSHELF_HIT("block.chiseled_bookshelf.hit"), + BLOCK_CHISELED_BOOKSHELF_INSERT("block.chiseled_bookshelf.insert"), + BLOCK_CHISELED_BOOKSHELF_INSERT_ENCHANTED("block.chiseled_bookshelf.insert.enchanted"), + BLOCK_CHISELED_BOOKSHELF_PICKUP("block.chiseled_bookshelf.pickup"), + BLOCK_CHISELED_BOOKSHELF_PICKUP_ENCHANTED("block.chiseled_bookshelf.pickup.enchanted"), + BLOCK_CHISELED_BOOKSHELF_PLACE("block.chiseled_bookshelf.place"), + BLOCK_CHISELED_BOOKSHELF_STEP("block.chiseled_bookshelf.step"), + BLOCK_CHORUS_FLOWER_DEATH("block.chorus_flower.death"), + BLOCK_CHORUS_FLOWER_GROW("block.chorus_flower.grow"), + BLOCK_COBWEB_BREAK("block.cobweb.break"), + BLOCK_COBWEB_FALL("block.cobweb.fall"), + BLOCK_COBWEB_HIT("block.cobweb.hit"), + BLOCK_COBWEB_PLACE("block.cobweb.place"), + BLOCK_COBWEB_STEP("block.cobweb.step"), + BLOCK_COMPARATOR_CLICK("block.comparator.click"), + BLOCK_COMPOSTER_EMPTY("block.composter.empty"), + BLOCK_COMPOSTER_FILL("block.composter.fill"), + BLOCK_COMPOSTER_FILL_SUCCESS("block.composter.fill_success"), + BLOCK_COMPOSTER_READY("block.composter.ready"), + BLOCK_CONDUIT_ACTIVATE("block.conduit.activate"), + BLOCK_CONDUIT_AMBIENT("block.conduit.ambient"), + BLOCK_CONDUIT_AMBIENT_SHORT("block.conduit.ambient.short"), + BLOCK_CONDUIT_ATTACK_TARGET("block.conduit.attack.target"), + BLOCK_CONDUIT_DEACTIVATE("block.conduit.deactivate"), + BLOCK_COPPER_BREAK("block.copper.break"), + BLOCK_COPPER_FALL("block.copper.fall"), + BLOCK_COPPER_HIT("block.copper.hit"), + BLOCK_COPPER_PLACE("block.copper.place"), + BLOCK_COPPER_STEP("block.copper.step"), + BLOCK_COPPER_BULB_BREAK("block.copper_bulb.break"), + BLOCK_COPPER_BULB_FALL("block.copper_bulb.fall"), + BLOCK_COPPER_BULB_HIT("block.copper_bulb.hit"), + BLOCK_COPPER_BULB_PLACE("block.copper_bulb.place"), + BLOCK_COPPER_BULB_STEP("block.copper_bulb.step"), + BLOCK_COPPER_BULB_TURN_OFF("block.copper_bulb.turn_off"), + BLOCK_COPPER_BULB_TURN_ON("block.copper_bulb.turn_on"), + BLOCK_COPPER_DOOR_CLOSE("block.copper_door.close"), + BLOCK_COPPER_DOOR_OPEN("block.copper_door.open"), + BLOCK_COPPER_GRATE_BREAK("block.copper_grate.break"), + BLOCK_COPPER_GRATE_FALL("block.copper_grate.fall"), + BLOCK_COPPER_GRATE_HIT("block.copper_grate.hit"), + BLOCK_COPPER_GRATE_PLACE("block.copper_grate.place"), + BLOCK_COPPER_GRATE_STEP("block.copper_grate.step"), + BLOCK_COPPER_TRAPDOOR_CLOSE("block.copper_trapdoor.close"), + BLOCK_COPPER_TRAPDOOR_OPEN("block.copper_trapdoor.open"), + BLOCK_CORAL_BLOCK_BREAK("block.coral_block.break"), + BLOCK_CORAL_BLOCK_FALL("block.coral_block.fall"), + BLOCK_CORAL_BLOCK_HIT("block.coral_block.hit"), + BLOCK_CORAL_BLOCK_PLACE("block.coral_block.place"), + BLOCK_CORAL_BLOCK_STEP("block.coral_block.step"), + BLOCK_CRAFTER_CRAFT("block.crafter.craft"), + BLOCK_CRAFTER_FAIL("block.crafter.fail"), + BLOCK_CROP_BREAK("block.crop.break"), + BLOCK_DECORATED_POT_BREAK("block.decorated_pot.break"), + BLOCK_DECORATED_POT_FALL("block.decorated_pot.fall"), + BLOCK_DECORATED_POT_HIT("block.decorated_pot.hit"), + BLOCK_DECORATED_POT_INSERT("block.decorated_pot.insert"), + BLOCK_DECORATED_POT_INSERT_FAIL("block.decorated_pot.insert_fail"), + BLOCK_DECORATED_POT_PLACE("block.decorated_pot.place"), + BLOCK_DECORATED_POT_SHATTER("block.decorated_pot.shatter"), + BLOCK_DECORATED_POT_STEP("block.decorated_pot.step"), + BLOCK_DEEPSLATE_BREAK("block.deepslate.break"), + BLOCK_DEEPSLATE_FALL("block.deepslate.fall"), + BLOCK_DEEPSLATE_HIT("block.deepslate.hit"), + BLOCK_DEEPSLATE_PLACE("block.deepslate.place"), + BLOCK_DEEPSLATE_STEP("block.deepslate.step"), + BLOCK_DEEPSLATE_BRICKS_BREAK("block.deepslate_bricks.break"), + BLOCK_DEEPSLATE_BRICKS_FALL("block.deepslate_bricks.fall"), + BLOCK_DEEPSLATE_BRICKS_HIT("block.deepslate_bricks.hit"), + BLOCK_DEEPSLATE_BRICKS_PLACE("block.deepslate_bricks.place"), + BLOCK_DEEPSLATE_BRICKS_STEP("block.deepslate_bricks.step"), + BLOCK_DEEPSLATE_TILES_BREAK("block.deepslate_tiles.break"), + BLOCK_DEEPSLATE_TILES_FALL("block.deepslate_tiles.fall"), + BLOCK_DEEPSLATE_TILES_HIT("block.deepslate_tiles.hit"), + BLOCK_DEEPSLATE_TILES_PLACE("block.deepslate_tiles.place"), + BLOCK_DEEPSLATE_TILES_STEP("block.deepslate_tiles.step"), + BLOCK_DISPENSER_DISPENSE("block.dispenser.dispense"), + BLOCK_DISPENSER_FAIL("block.dispenser.fail"), + BLOCK_DISPENSER_LAUNCH("block.dispenser.launch"), + BLOCK_DRIPSTONE_BLOCK_BREAK("block.dripstone_block.break"), + BLOCK_DRIPSTONE_BLOCK_FALL("block.dripstone_block.fall"), + BLOCK_DRIPSTONE_BLOCK_HIT("block.dripstone_block.hit"), + BLOCK_DRIPSTONE_BLOCK_PLACE("block.dripstone_block.place"), + BLOCK_DRIPSTONE_BLOCK_STEP("block.dripstone_block.step"), + BLOCK_ENCHANTMENT_TABLE_USE("block.enchantment_table.use"), + BLOCK_END_GATEWAY_SPAWN("block.end_gateway.spawn"), + BLOCK_END_PORTAL_SPAWN("block.end_portal.spawn"), + BLOCK_END_PORTAL_FRAME_FILL("block.end_portal_frame.fill"), + BLOCK_ENDER_CHEST_CLOSE("block.ender_chest.close"), + BLOCK_ENDER_CHEST_OPEN("block.ender_chest.open"), + BLOCK_FENCE_GATE_CLOSE("block.fence_gate.close"), + BLOCK_FENCE_GATE_OPEN("block.fence_gate.open"), + BLOCK_FIRE_AMBIENT("block.fire.ambient"), + BLOCK_FIRE_EXTINGUISH("block.fire.extinguish"), + BLOCK_FLOWERING_AZALEA_BREAK("block.flowering_azalea.break"), + BLOCK_FLOWERING_AZALEA_FALL("block.flowering_azalea.fall"), + BLOCK_FLOWERING_AZALEA_HIT("block.flowering_azalea.hit"), + BLOCK_FLOWERING_AZALEA_PLACE("block.flowering_azalea.place"), + BLOCK_FLOWERING_AZALEA_STEP("block.flowering_azalea.step"), + BLOCK_FROGLIGHT_BREAK("block.froglight.break"), + BLOCK_FROGLIGHT_FALL("block.froglight.fall"), + BLOCK_FROGLIGHT_HIT("block.froglight.hit"), + BLOCK_FROGLIGHT_PLACE("block.froglight.place"), + BLOCK_FROGLIGHT_STEP("block.froglight.step"), + BLOCK_FROGSPAWN_BREAK("block.frogspawn.break"), + BLOCK_FROGSPAWN_FALL("block.frogspawn.fall"), + BLOCK_FROGSPAWN_HATCH("block.frogspawn.hatch"), + BLOCK_FROGSPAWN_HIT("block.frogspawn.hit"), + BLOCK_FROGSPAWN_PLACE("block.frogspawn.place"), + BLOCK_FROGSPAWN_STEP("block.frogspawn.step"), + BLOCK_FUNGUS_BREAK("block.fungus.break"), + BLOCK_FUNGUS_FALL("block.fungus.fall"), + BLOCK_FUNGUS_HIT("block.fungus.hit"), + BLOCK_FUNGUS_PLACE("block.fungus.place"), + BLOCK_FUNGUS_STEP("block.fungus.step"), + BLOCK_FURNACE_FIRE_CRACKLE("block.furnace.fire_crackle"), + BLOCK_GILDED_BLACKSTONE_BREAK("block.gilded_blackstone.break"), + BLOCK_GILDED_BLACKSTONE_FALL("block.gilded_blackstone.fall"), + BLOCK_GILDED_BLACKSTONE_HIT("block.gilded_blackstone.hit"), + BLOCK_GILDED_BLACKSTONE_PLACE("block.gilded_blackstone.place"), + BLOCK_GILDED_BLACKSTONE_STEP("block.gilded_blackstone.step"), + BLOCK_GLASS_BREAK("block.glass.break"), + BLOCK_GLASS_FALL("block.glass.fall"), + BLOCK_GLASS_HIT("block.glass.hit"), + BLOCK_GLASS_PLACE("block.glass.place"), + BLOCK_GLASS_STEP("block.glass.step"), + BLOCK_GRASS_BREAK("block.grass.break"), + BLOCK_GRASS_FALL("block.grass.fall"), + BLOCK_GRASS_HIT("block.grass.hit"), + BLOCK_GRASS_PLACE("block.grass.place"), + BLOCK_GRASS_STEP("block.grass.step"), + BLOCK_GRAVEL_BREAK("block.gravel.break"), + BLOCK_GRAVEL_FALL("block.gravel.fall"), + BLOCK_GRAVEL_HIT("block.gravel.hit"), + BLOCK_GRAVEL_PLACE("block.gravel.place"), + BLOCK_GRAVEL_STEP("block.gravel.step"), + BLOCK_GRINDSTONE_USE("block.grindstone.use"), + BLOCK_GROWING_PLANT_CROP("block.growing_plant.crop"), + BLOCK_HANGING_ROOTS_BREAK("block.hanging_roots.break"), + BLOCK_HANGING_ROOTS_FALL("block.hanging_roots.fall"), + BLOCK_HANGING_ROOTS_HIT("block.hanging_roots.hit"), + BLOCK_HANGING_ROOTS_PLACE("block.hanging_roots.place"), + BLOCK_HANGING_ROOTS_STEP("block.hanging_roots.step"), + BLOCK_HANGING_SIGN_BREAK("block.hanging_sign.break"), + BLOCK_HANGING_SIGN_FALL("block.hanging_sign.fall"), + BLOCK_HANGING_SIGN_HIT("block.hanging_sign.hit"), + BLOCK_HANGING_SIGN_PLACE("block.hanging_sign.place"), + BLOCK_HANGING_SIGN_STEP("block.hanging_sign.step"), + BLOCK_HANGING_SIGN_WAXED_INTERACT_FAIL("block.hanging_sign.waxed_interact_fail"), + BLOCK_HEAVY_CORE_BREAK("block.heavy_core.break"), + BLOCK_HEAVY_CORE_FALL("block.heavy_core.fall"), + BLOCK_HEAVY_CORE_HIT("block.heavy_core.hit"), + BLOCK_HEAVY_CORE_PLACE("block.heavy_core.place"), + BLOCK_HEAVY_CORE_STEP("block.heavy_core.step"), + BLOCK_HONEY_BLOCK_BREAK("block.honey_block.break"), + BLOCK_HONEY_BLOCK_FALL("block.honey_block.fall"), + BLOCK_HONEY_BLOCK_HIT("block.honey_block.hit"), + BLOCK_HONEY_BLOCK_PLACE("block.honey_block.place"), + BLOCK_HONEY_BLOCK_SLIDE("block.honey_block.slide"), + BLOCK_HONEY_BLOCK_STEP("block.honey_block.step"), + BLOCK_IRON_DOOR_CLOSE("block.iron_door.close"), + BLOCK_IRON_DOOR_OPEN("block.iron_door.open"), + BLOCK_IRON_TRAPDOOR_CLOSE("block.iron_trapdoor.close"), + BLOCK_IRON_TRAPDOOR_OPEN("block.iron_trapdoor.open"), + BLOCK_LADDER_BREAK("block.ladder.break"), + BLOCK_LADDER_FALL("block.ladder.fall"), + BLOCK_LADDER_HIT("block.ladder.hit"), + BLOCK_LADDER_PLACE("block.ladder.place"), + BLOCK_LADDER_STEP("block.ladder.step"), + BLOCK_LANTERN_BREAK("block.lantern.break"), + BLOCK_LANTERN_FALL("block.lantern.fall"), + BLOCK_LANTERN_HIT("block.lantern.hit"), + BLOCK_LANTERN_PLACE("block.lantern.place"), + BLOCK_LANTERN_STEP("block.lantern.step"), + BLOCK_LARGE_AMETHYST_BUD_BREAK("block.large_amethyst_bud.break"), + BLOCK_LARGE_AMETHYST_BUD_PLACE("block.large_amethyst_bud.place"), + BLOCK_LAVA_AMBIENT("block.lava.ambient"), + BLOCK_LAVA_EXTINGUISH("block.lava.extinguish"), + BLOCK_LAVA_POP("block.lava.pop"), + BLOCK_LEVER_CLICK("block.lever.click"), + BLOCK_LILY_PAD_PLACE("block.lily_pad.place"), + BLOCK_LODESTONE_BREAK("block.lodestone.break"), + BLOCK_LODESTONE_FALL("block.lodestone.fall"), + BLOCK_LODESTONE_HIT("block.lodestone.hit"), + BLOCK_LODESTONE_PLACE("block.lodestone.place"), + BLOCK_LODESTONE_STEP("block.lodestone.step"), + BLOCK_MANGROVE_ROOTS_BREAK("block.mangrove_roots.break"), + BLOCK_MANGROVE_ROOTS_FALL("block.mangrove_roots.fall"), + BLOCK_MANGROVE_ROOTS_HIT("block.mangrove_roots.hit"), + BLOCK_MANGROVE_ROOTS_PLACE("block.mangrove_roots.place"), + BLOCK_MANGROVE_ROOTS_STEP("block.mangrove_roots.step"), + BLOCK_MEDIUM_AMETHYST_BUD_BREAK("block.medium_amethyst_bud.break"), + BLOCK_MEDIUM_AMETHYST_BUD_PLACE("block.medium_amethyst_bud.place"), + BLOCK_METAL_BREAK("block.metal.break"), + BLOCK_METAL_FALL("block.metal.fall"), + BLOCK_METAL_HIT("block.metal.hit"), + BLOCK_METAL_PLACE("block.metal.place"), + BLOCK_METAL_STEP("block.metal.step"), + BLOCK_METAL_PRESSURE_PLATE_CLICK_OFF("block.metal_pressure_plate.click_off"), + BLOCK_METAL_PRESSURE_PLATE_CLICK_ON("block.metal_pressure_plate.click_on"), + BLOCK_MOSS_BREAK("block.moss.break"), + BLOCK_MOSS_FALL("block.moss.fall"), + BLOCK_MOSS_HIT("block.moss.hit"), + BLOCK_MOSS_PLACE("block.moss.place"), + BLOCK_MOSS_STEP("block.moss.step"), + BLOCK_MOSS_CARPET_BREAK("block.moss_carpet.break"), + BLOCK_MOSS_CARPET_FALL("block.moss_carpet.fall"), + BLOCK_MOSS_CARPET_HIT("block.moss_carpet.hit"), + BLOCK_MOSS_CARPET_PLACE("block.moss_carpet.place"), + BLOCK_MOSS_CARPET_STEP("block.moss_carpet.step"), + BLOCK_MUD_BREAK("block.mud.break"), + BLOCK_MUD_FALL("block.mud.fall"), + BLOCK_MUD_HIT("block.mud.hit"), + BLOCK_MUD_PLACE("block.mud.place"), + BLOCK_MUD_STEP("block.mud.step"), + BLOCK_MUD_BRICKS_BREAK("block.mud_bricks.break"), + BLOCK_MUD_BRICKS_FALL("block.mud_bricks.fall"), + BLOCK_MUD_BRICKS_HIT("block.mud_bricks.hit"), + BLOCK_MUD_BRICKS_PLACE("block.mud_bricks.place"), + BLOCK_MUD_BRICKS_STEP("block.mud_bricks.step"), + BLOCK_MUDDY_MANGROVE_ROOTS_BREAK("block.muddy_mangrove_roots.break"), + BLOCK_MUDDY_MANGROVE_ROOTS_FALL("block.muddy_mangrove_roots.fall"), + BLOCK_MUDDY_MANGROVE_ROOTS_HIT("block.muddy_mangrove_roots.hit"), + BLOCK_MUDDY_MANGROVE_ROOTS_PLACE("block.muddy_mangrove_roots.place"), + BLOCK_MUDDY_MANGROVE_ROOTS_STEP("block.muddy_mangrove_roots.step"), + BLOCK_NETHER_BRICKS_BREAK("block.nether_bricks.break"), + BLOCK_NETHER_BRICKS_FALL("block.nether_bricks.fall"), + BLOCK_NETHER_BRICKS_HIT("block.nether_bricks.hit"), + BLOCK_NETHER_BRICKS_PLACE("block.nether_bricks.place"), + BLOCK_NETHER_BRICKS_STEP("block.nether_bricks.step"), + BLOCK_NETHER_GOLD_ORE_BREAK("block.nether_gold_ore.break"), + BLOCK_NETHER_GOLD_ORE_FALL("block.nether_gold_ore.fall"), + BLOCK_NETHER_GOLD_ORE_HIT("block.nether_gold_ore.hit"), + BLOCK_NETHER_GOLD_ORE_PLACE("block.nether_gold_ore.place"), + BLOCK_NETHER_GOLD_ORE_STEP("block.nether_gold_ore.step"), + BLOCK_NETHER_ORE_BREAK("block.nether_ore.break"), + BLOCK_NETHER_ORE_FALL("block.nether_ore.fall"), + BLOCK_NETHER_ORE_HIT("block.nether_ore.hit"), + BLOCK_NETHER_ORE_PLACE("block.nether_ore.place"), + BLOCK_NETHER_ORE_STEP("block.nether_ore.step"), + BLOCK_NETHER_SPROUTS_BREAK("block.nether_sprouts.break"), + BLOCK_NETHER_SPROUTS_FALL("block.nether_sprouts.fall"), + BLOCK_NETHER_SPROUTS_HIT("block.nether_sprouts.hit"), + BLOCK_NETHER_SPROUTS_PLACE("block.nether_sprouts.place"), + BLOCK_NETHER_SPROUTS_STEP("block.nether_sprouts.step"), + BLOCK_NETHER_WART_BREAK("block.nether_wart.break"), + BLOCK_NETHER_WOOD_BREAK("block.nether_wood.break"), + BLOCK_NETHER_WOOD_FALL("block.nether_wood.fall"), + BLOCK_NETHER_WOOD_HIT("block.nether_wood.hit"), + BLOCK_NETHER_WOOD_PLACE("block.nether_wood.place"), + BLOCK_NETHER_WOOD_STEP("block.nether_wood.step"), + BLOCK_NETHER_WOOD_BUTTON_CLICK_OFF("block.nether_wood_button.click_off"), + BLOCK_NETHER_WOOD_BUTTON_CLICK_ON("block.nether_wood_button.click_on"), + BLOCK_NETHER_WOOD_DOOR_CLOSE("block.nether_wood_door.close"), + BLOCK_NETHER_WOOD_DOOR_OPEN("block.nether_wood_door.open"), + BLOCK_NETHER_WOOD_FENCE_GATE_CLOSE("block.nether_wood_fence_gate.close"), + BLOCK_NETHER_WOOD_FENCE_GATE_OPEN("block.nether_wood_fence_gate.open"), + BLOCK_NETHER_WOOD_HANGING_SIGN_BREAK("block.nether_wood_hanging_sign.break"), + BLOCK_NETHER_WOOD_HANGING_SIGN_FALL("block.nether_wood_hanging_sign.fall"), + BLOCK_NETHER_WOOD_HANGING_SIGN_HIT("block.nether_wood_hanging_sign.hit"), + BLOCK_NETHER_WOOD_HANGING_SIGN_PLACE("block.nether_wood_hanging_sign.place"), + BLOCK_NETHER_WOOD_HANGING_SIGN_STEP("block.nether_wood_hanging_sign.step"), + BLOCK_NETHER_WOOD_PRESSURE_PLATE_CLICK_OFF("block.nether_wood_pressure_plate.click_off"), + BLOCK_NETHER_WOOD_PRESSURE_PLATE_CLICK_ON("block.nether_wood_pressure_plate.click_on"), + BLOCK_NETHER_WOOD_TRAPDOOR_CLOSE("block.nether_wood_trapdoor.close"), + BLOCK_NETHER_WOOD_TRAPDOOR_OPEN("block.nether_wood_trapdoor.open"), + BLOCK_NETHERITE_BLOCK_BREAK("block.netherite_block.break"), + BLOCK_NETHERITE_BLOCK_FALL("block.netherite_block.fall"), + BLOCK_NETHERITE_BLOCK_HIT("block.netherite_block.hit"), + BLOCK_NETHERITE_BLOCK_PLACE("block.netherite_block.place"), + BLOCK_NETHERITE_BLOCK_STEP("block.netherite_block.step"), + BLOCK_NETHERRACK_BREAK("block.netherrack.break"), + BLOCK_NETHERRACK_FALL("block.netherrack.fall"), + BLOCK_NETHERRACK_HIT("block.netherrack.hit"), + BLOCK_NETHERRACK_PLACE("block.netherrack.place"), + BLOCK_NETHERRACK_STEP("block.netherrack.step"), + BLOCK_NOTE_BLOCK_BANJO("block.note_block.banjo"), + BLOCK_NOTE_BLOCK_BASEDRUM("block.note_block.basedrum"), + BLOCK_NOTE_BLOCK_BASS("block.note_block.bass"), + BLOCK_NOTE_BLOCK_BELL("block.note_block.bell"), + BLOCK_NOTE_BLOCK_BIT("block.note_block.bit"), + BLOCK_NOTE_BLOCK_CHIME("block.note_block.chime"), + BLOCK_NOTE_BLOCK_COW_BELL("block.note_block.cow_bell"), + BLOCK_NOTE_BLOCK_DIDGERIDOO("block.note_block.didgeridoo"), + BLOCK_NOTE_BLOCK_FLUTE("block.note_block.flute"), + BLOCK_NOTE_BLOCK_GUITAR("block.note_block.guitar"), + BLOCK_NOTE_BLOCK_HARP("block.note_block.harp"), + BLOCK_NOTE_BLOCK_HAT("block.note_block.hat"), + BLOCK_NOTE_BLOCK_IMITATE_CREEPER("block.note_block.imitate.creeper"), + BLOCK_NOTE_BLOCK_IMITATE_ENDER_DRAGON("block.note_block.imitate.ender_dragon"), + BLOCK_NOTE_BLOCK_IMITATE_PIGLIN("block.note_block.imitate.piglin"), + BLOCK_NOTE_BLOCK_IMITATE_SKELETON("block.note_block.imitate.skeleton"), + BLOCK_NOTE_BLOCK_IMITATE_WITHER_SKELETON("block.note_block.imitate.wither_skeleton"), + BLOCK_NOTE_BLOCK_IMITATE_ZOMBIE("block.note_block.imitate.zombie"), + BLOCK_NOTE_BLOCK_IRON_XYLOPHONE("block.note_block.iron_xylophone"), + BLOCK_NOTE_BLOCK_PLING("block.note_block.pling"), + BLOCK_NOTE_BLOCK_SNARE("block.note_block.snare"), + BLOCK_NOTE_BLOCK_XYLOPHONE("block.note_block.xylophone"), + BLOCK_NYLIUM_BREAK("block.nylium.break"), + BLOCK_NYLIUM_FALL("block.nylium.fall"), + BLOCK_NYLIUM_HIT("block.nylium.hit"), + BLOCK_NYLIUM_PLACE("block.nylium.place"), + BLOCK_NYLIUM_STEP("block.nylium.step"), + BLOCK_PACKED_MUD_BREAK("block.packed_mud.break"), + BLOCK_PACKED_MUD_FALL("block.packed_mud.fall"), + BLOCK_PACKED_MUD_HIT("block.packed_mud.hit"), + BLOCK_PACKED_MUD_PLACE("block.packed_mud.place"), + BLOCK_PACKED_MUD_STEP("block.packed_mud.step"), + BLOCK_PINK_PETALS_BREAK("block.pink_petals.break"), + BLOCK_PINK_PETALS_FALL("block.pink_petals.fall"), + BLOCK_PINK_PETALS_HIT("block.pink_petals.hit"), + BLOCK_PINK_PETALS_PLACE("block.pink_petals.place"), + BLOCK_PINK_PETALS_STEP("block.pink_petals.step"), + BLOCK_PISTON_CONTRACT("block.piston.contract"), + BLOCK_PISTON_EXTEND("block.piston.extend"), + BLOCK_POINTED_DRIPSTONE_BREAK("block.pointed_dripstone.break"), + BLOCK_POINTED_DRIPSTONE_DRIP_LAVA("block.pointed_dripstone.drip_lava"), + BLOCK_POINTED_DRIPSTONE_DRIP_LAVA_INTO_CAULDRON("block.pointed_dripstone.drip_lava_into_cauldron"), + BLOCK_POINTED_DRIPSTONE_DRIP_WATER("block.pointed_dripstone.drip_water"), + BLOCK_POINTED_DRIPSTONE_DRIP_WATER_INTO_CAULDRON("block.pointed_dripstone.drip_water_into_cauldron"), + BLOCK_POINTED_DRIPSTONE_FALL("block.pointed_dripstone.fall"), + BLOCK_POINTED_DRIPSTONE_HIT("block.pointed_dripstone.hit"), + BLOCK_POINTED_DRIPSTONE_LAND("block.pointed_dripstone.land"), + BLOCK_POINTED_DRIPSTONE_PLACE("block.pointed_dripstone.place"), + BLOCK_POINTED_DRIPSTONE_STEP("block.pointed_dripstone.step"), + BLOCK_POLISHED_DEEPSLATE_BREAK("block.polished_deepslate.break"), + BLOCK_POLISHED_DEEPSLATE_FALL("block.polished_deepslate.fall"), + BLOCK_POLISHED_DEEPSLATE_HIT("block.polished_deepslate.hit"), + BLOCK_POLISHED_DEEPSLATE_PLACE("block.polished_deepslate.place"), + BLOCK_POLISHED_DEEPSLATE_STEP("block.polished_deepslate.step"), + BLOCK_POLISHED_TUFF_BREAK("block.polished_tuff.break"), + BLOCK_POLISHED_TUFF_FALL("block.polished_tuff.fall"), + BLOCK_POLISHED_TUFF_HIT("block.polished_tuff.hit"), + BLOCK_POLISHED_TUFF_PLACE("block.polished_tuff.place"), + BLOCK_POLISHED_TUFF_STEP("block.polished_tuff.step"), + BLOCK_PORTAL_AMBIENT("block.portal.ambient"), + BLOCK_PORTAL_TRAVEL("block.portal.travel"), + BLOCK_PORTAL_TRIGGER("block.portal.trigger"), + BLOCK_POWDER_SNOW_BREAK("block.powder_snow.break"), + BLOCK_POWDER_SNOW_FALL("block.powder_snow.fall"), + BLOCK_POWDER_SNOW_HIT("block.powder_snow.hit"), + BLOCK_POWDER_SNOW_PLACE("block.powder_snow.place"), + BLOCK_POWDER_SNOW_STEP("block.powder_snow.step"), + BLOCK_PUMPKIN_CARVE("block.pumpkin.carve"), + BLOCK_REDSTONE_TORCH_BURNOUT("block.redstone_torch.burnout"), + BLOCK_RESPAWN_ANCHOR_AMBIENT("block.respawn_anchor.ambient"), + BLOCK_RESPAWN_ANCHOR_CHARGE("block.respawn_anchor.charge"), + BLOCK_RESPAWN_ANCHOR_DEPLETE("block.respawn_anchor.deplete"), + BLOCK_RESPAWN_ANCHOR_SET_SPAWN("block.respawn_anchor.set_spawn"), + BLOCK_ROOTED_DIRT_BREAK("block.rooted_dirt.break"), + BLOCK_ROOTED_DIRT_FALL("block.rooted_dirt.fall"), + BLOCK_ROOTED_DIRT_HIT("block.rooted_dirt.hit"), + BLOCK_ROOTED_DIRT_PLACE("block.rooted_dirt.place"), + BLOCK_ROOTED_DIRT_STEP("block.rooted_dirt.step"), + BLOCK_ROOTS_BREAK("block.roots.break"), + BLOCK_ROOTS_FALL("block.roots.fall"), + BLOCK_ROOTS_HIT("block.roots.hit"), + BLOCK_ROOTS_PLACE("block.roots.place"), + BLOCK_ROOTS_STEP("block.roots.step"), + BLOCK_SAND_BREAK("block.sand.break"), + BLOCK_SAND_FALL("block.sand.fall"), + BLOCK_SAND_HIT("block.sand.hit"), + BLOCK_SAND_PLACE("block.sand.place"), + BLOCK_SAND_STEP("block.sand.step"), + BLOCK_SCAFFOLDING_BREAK("block.scaffolding.break"), + BLOCK_SCAFFOLDING_FALL("block.scaffolding.fall"), + BLOCK_SCAFFOLDING_HIT("block.scaffolding.hit"), + BLOCK_SCAFFOLDING_PLACE("block.scaffolding.place"), + BLOCK_SCAFFOLDING_STEP("block.scaffolding.step"), + BLOCK_SCULK_BREAK("block.sculk.break"), + BLOCK_SCULK_CHARGE("block.sculk.charge"), + BLOCK_SCULK_FALL("block.sculk.fall"), + BLOCK_SCULK_HIT("block.sculk.hit"), + BLOCK_SCULK_PLACE("block.sculk.place"), + BLOCK_SCULK_SPREAD("block.sculk.spread"), + BLOCK_SCULK_STEP("block.sculk.step"), + BLOCK_SCULK_CATALYST_BLOOM("block.sculk_catalyst.bloom"), + BLOCK_SCULK_CATALYST_BREAK("block.sculk_catalyst.break"), + BLOCK_SCULK_CATALYST_FALL("block.sculk_catalyst.fall"), + BLOCK_SCULK_CATALYST_HIT("block.sculk_catalyst.hit"), + BLOCK_SCULK_CATALYST_PLACE("block.sculk_catalyst.place"), + BLOCK_SCULK_CATALYST_STEP("block.sculk_catalyst.step"), + BLOCK_SCULK_SENSOR_BREAK("block.sculk_sensor.break"), + BLOCK_SCULK_SENSOR_CLICKING("block.sculk_sensor.clicking"), + BLOCK_SCULK_SENSOR_CLICKING_STOP("block.sculk_sensor.clicking_stop"), + BLOCK_SCULK_SENSOR_FALL("block.sculk_sensor.fall"), + BLOCK_SCULK_SENSOR_HIT("block.sculk_sensor.hit"), + BLOCK_SCULK_SENSOR_PLACE("block.sculk_sensor.place"), + BLOCK_SCULK_SENSOR_STEP("block.sculk_sensor.step"), + BLOCK_SCULK_SHRIEKER_BREAK("block.sculk_shrieker.break"), + BLOCK_SCULK_SHRIEKER_FALL("block.sculk_shrieker.fall"), + BLOCK_SCULK_SHRIEKER_HIT("block.sculk_shrieker.hit"), + BLOCK_SCULK_SHRIEKER_PLACE("block.sculk_shrieker.place"), + BLOCK_SCULK_SHRIEKER_SHRIEK("block.sculk_shrieker.shriek"), + BLOCK_SCULK_SHRIEKER_STEP("block.sculk_shrieker.step"), + BLOCK_SCULK_VEIN_BREAK("block.sculk_vein.break"), + BLOCK_SCULK_VEIN_FALL("block.sculk_vein.fall"), + BLOCK_SCULK_VEIN_HIT("block.sculk_vein.hit"), + BLOCK_SCULK_VEIN_PLACE("block.sculk_vein.place"), + BLOCK_SCULK_VEIN_STEP("block.sculk_vein.step"), + BLOCK_SHROOMLIGHT_BREAK("block.shroomlight.break"), + BLOCK_SHROOMLIGHT_FALL("block.shroomlight.fall"), + BLOCK_SHROOMLIGHT_HIT("block.shroomlight.hit"), + BLOCK_SHROOMLIGHT_PLACE("block.shroomlight.place"), + BLOCK_SHROOMLIGHT_STEP("block.shroomlight.step"), + BLOCK_SHULKER_BOX_CLOSE("block.shulker_box.close"), + BLOCK_SHULKER_BOX_OPEN("block.shulker_box.open"), + BLOCK_SIGN_WAXED_INTERACT_FAIL("block.sign.waxed_interact_fail"), + BLOCK_SLIME_BLOCK_BREAK("block.slime_block.break"), + BLOCK_SLIME_BLOCK_FALL("block.slime_block.fall"), + BLOCK_SLIME_BLOCK_HIT("block.slime_block.hit"), + BLOCK_SLIME_BLOCK_PLACE("block.slime_block.place"), + BLOCK_SLIME_BLOCK_STEP("block.slime_block.step"), + BLOCK_SMALL_AMETHYST_BUD_BREAK("block.small_amethyst_bud.break"), + BLOCK_SMALL_AMETHYST_BUD_PLACE("block.small_amethyst_bud.place"), + BLOCK_SMALL_DRIPLEAF_BREAK("block.small_dripleaf.break"), + BLOCK_SMALL_DRIPLEAF_FALL("block.small_dripleaf.fall"), + BLOCK_SMALL_DRIPLEAF_HIT("block.small_dripleaf.hit"), + BLOCK_SMALL_DRIPLEAF_PLACE("block.small_dripleaf.place"), + BLOCK_SMALL_DRIPLEAF_STEP("block.small_dripleaf.step"), + BLOCK_SMITHING_TABLE_USE("block.smithing_table.use"), + BLOCK_SMOKER_SMOKE("block.smoker.smoke"), + BLOCK_SNIFFER_EGG_CRACK("block.sniffer_egg.crack"), + BLOCK_SNIFFER_EGG_HATCH("block.sniffer_egg.hatch"), + BLOCK_SNIFFER_EGG_PLOP("block.sniffer_egg.plop"), + BLOCK_SNOW_BREAK("block.snow.break"), + BLOCK_SNOW_FALL("block.snow.fall"), + BLOCK_SNOW_HIT("block.snow.hit"), + BLOCK_SNOW_PLACE("block.snow.place"), + BLOCK_SNOW_STEP("block.snow.step"), + BLOCK_SOUL_SAND_BREAK("block.soul_sand.break"), + BLOCK_SOUL_SAND_FALL("block.soul_sand.fall"), + BLOCK_SOUL_SAND_HIT("block.soul_sand.hit"), + BLOCK_SOUL_SAND_PLACE("block.soul_sand.place"), + BLOCK_SOUL_SAND_STEP("block.soul_sand.step"), + BLOCK_SOUL_SOIL_BREAK("block.soul_soil.break"), + BLOCK_SOUL_SOIL_FALL("block.soul_soil.fall"), + BLOCK_SOUL_SOIL_HIT("block.soul_soil.hit"), + BLOCK_SOUL_SOIL_PLACE("block.soul_soil.place"), + BLOCK_SOUL_SOIL_STEP("block.soul_soil.step"), + BLOCK_SPONGE_ABSORB("block.sponge.absorb"), + BLOCK_SPONGE_BREAK("block.sponge.break"), + BLOCK_SPONGE_FALL("block.sponge.fall"), + BLOCK_SPONGE_HIT("block.sponge.hit"), + BLOCK_SPONGE_PLACE("block.sponge.place"), + BLOCK_SPONGE_STEP("block.sponge.step"), + BLOCK_SPORE_BLOSSOM_BREAK("block.spore_blossom.break"), + BLOCK_SPORE_BLOSSOM_FALL("block.spore_blossom.fall"), + BLOCK_SPORE_BLOSSOM_HIT("block.spore_blossom.hit"), + BLOCK_SPORE_BLOSSOM_PLACE("block.spore_blossom.place"), + BLOCK_SPORE_BLOSSOM_STEP("block.spore_blossom.step"), + BLOCK_STEM_BREAK("block.stem.break"), + BLOCK_STEM_FALL("block.stem.fall"), + BLOCK_STEM_HIT("block.stem.hit"), + BLOCK_STEM_PLACE("block.stem.place"), + BLOCK_STEM_STEP("block.stem.step"), + BLOCK_STONE_BREAK("block.stone.break"), + BLOCK_STONE_FALL("block.stone.fall"), + BLOCK_STONE_HIT("block.stone.hit"), + BLOCK_STONE_PLACE("block.stone.place"), + BLOCK_STONE_STEP("block.stone.step"), + BLOCK_STONE_BUTTON_CLICK_OFF("block.stone_button.click_off"), + BLOCK_STONE_BUTTON_CLICK_ON("block.stone_button.click_on"), + BLOCK_STONE_PRESSURE_PLATE_CLICK_OFF("block.stone_pressure_plate.click_off"), + BLOCK_STONE_PRESSURE_PLATE_CLICK_ON("block.stone_pressure_plate.click_on"), + BLOCK_SUSPICIOUS_GRAVEL_BREAK("block.suspicious_gravel.break"), + BLOCK_SUSPICIOUS_GRAVEL_FALL("block.suspicious_gravel.fall"), + BLOCK_SUSPICIOUS_GRAVEL_HIT("block.suspicious_gravel.hit"), + BLOCK_SUSPICIOUS_GRAVEL_PLACE("block.suspicious_gravel.place"), + BLOCK_SUSPICIOUS_GRAVEL_STEP("block.suspicious_gravel.step"), + BLOCK_SUSPICIOUS_SAND_BREAK("block.suspicious_sand.break"), + BLOCK_SUSPICIOUS_SAND_FALL("block.suspicious_sand.fall"), + BLOCK_SUSPICIOUS_SAND_HIT("block.suspicious_sand.hit"), + BLOCK_SUSPICIOUS_SAND_PLACE("block.suspicious_sand.place"), + BLOCK_SUSPICIOUS_SAND_STEP("block.suspicious_sand.step"), + BLOCK_SWEET_BERRY_BUSH_BREAK("block.sweet_berry_bush.break"), + BLOCK_SWEET_BERRY_BUSH_PICK_BERRIES("block.sweet_berry_bush.pick_berries"), + BLOCK_SWEET_BERRY_BUSH_PLACE("block.sweet_berry_bush.place"), + BLOCK_TRIAL_SPAWNER_ABOUT_TO_SPAWN_ITEM("block.trial_spawner.about_to_spawn_item"), + BLOCK_TRIAL_SPAWNER_AMBIENT("block.trial_spawner.ambient"), + BLOCK_TRIAL_SPAWNER_AMBIENT_OMINOUS("block.trial_spawner.ambient_ominous"), + BLOCK_TRIAL_SPAWNER_BREAK("block.trial_spawner.break"), + BLOCK_TRIAL_SPAWNER_CLOSE_SHUTTER("block.trial_spawner.close_shutter"), + BLOCK_TRIAL_SPAWNER_DETECT_PLAYER("block.trial_spawner.detect_player"), + BLOCK_TRIAL_SPAWNER_EJECT_ITEM("block.trial_spawner.eject_item"), + BLOCK_TRIAL_SPAWNER_FALL("block.trial_spawner.fall"), + BLOCK_TRIAL_SPAWNER_HIT("block.trial_spawner.hit"), + BLOCK_TRIAL_SPAWNER_OMINOUS_ACTIVATE("block.trial_spawner.ominous_activate"), + BLOCK_TRIAL_SPAWNER_OPEN_SHUTTER("block.trial_spawner.open_shutter"), + BLOCK_TRIAL_SPAWNER_PLACE("block.trial_spawner.place"), + BLOCK_TRIAL_SPAWNER_SPAWN_ITEM("block.trial_spawner.spawn_item"), + BLOCK_TRIAL_SPAWNER_SPAWN_ITEM_BEGIN("block.trial_spawner.spawn_item_begin"), + BLOCK_TRIAL_SPAWNER_SPAWN_MOB("block.trial_spawner.spawn_mob"), + BLOCK_TRIAL_SPAWNER_STEP("block.trial_spawner.step"), + BLOCK_TRIPWIRE_ATTACH("block.tripwire.attach"), + BLOCK_TRIPWIRE_CLICK_OFF("block.tripwire.click_off"), + BLOCK_TRIPWIRE_CLICK_ON("block.tripwire.click_on"), + BLOCK_TRIPWIRE_DETACH("block.tripwire.detach"), + BLOCK_TUFF_BREAK("block.tuff.break"), + BLOCK_TUFF_FALL("block.tuff.fall"), + BLOCK_TUFF_HIT("block.tuff.hit"), + BLOCK_TUFF_PLACE("block.tuff.place"), + BLOCK_TUFF_STEP("block.tuff.step"), + BLOCK_TUFF_BRICKS_BREAK("block.tuff_bricks.break"), + BLOCK_TUFF_BRICKS_FALL("block.tuff_bricks.fall"), + BLOCK_TUFF_BRICKS_HIT("block.tuff_bricks.hit"), + BLOCK_TUFF_BRICKS_PLACE("block.tuff_bricks.place"), + BLOCK_TUFF_BRICKS_STEP("block.tuff_bricks.step"), + BLOCK_VAULT_ACTIVATE("block.vault.activate"), + BLOCK_VAULT_AMBIENT("block.vault.ambient"), + BLOCK_VAULT_BREAK("block.vault.break"), + BLOCK_VAULT_CLOSE_SHUTTER("block.vault.close_shutter"), + BLOCK_VAULT_DEACTIVATE("block.vault.deactivate"), + BLOCK_VAULT_EJECT_ITEM("block.vault.eject_item"), + BLOCK_VAULT_FALL("block.vault.fall"), + BLOCK_VAULT_HIT("block.vault.hit"), + BLOCK_VAULT_INSERT_ITEM("block.vault.insert_item"), + BLOCK_VAULT_INSERT_ITEM_FAIL("block.vault.insert_item_fail"), + BLOCK_VAULT_OPEN_SHUTTER("block.vault.open_shutter"), + BLOCK_VAULT_PLACE("block.vault.place"), + BLOCK_VAULT_REJECT_REWARDED_PLAYER("block.vault.reject_rewarded_player"), + BLOCK_VAULT_STEP("block.vault.step"), + BLOCK_VINE_BREAK("block.vine.break"), + BLOCK_VINE_FALL("block.vine.fall"), + BLOCK_VINE_HIT("block.vine.hit"), + BLOCK_VINE_PLACE("block.vine.place"), + BLOCK_VINE_STEP("block.vine.step"), + BLOCK_WART_BLOCK_BREAK("block.wart_block.break"), + BLOCK_WART_BLOCK_FALL("block.wart_block.fall"), + BLOCK_WART_BLOCK_HIT("block.wart_block.hit"), + BLOCK_WART_BLOCK_PLACE("block.wart_block.place"), + BLOCK_WART_BLOCK_STEP("block.wart_block.step"), + BLOCK_WATER_AMBIENT("block.water.ambient"), + BLOCK_WEEPING_VINES_BREAK("block.weeping_vines.break"), + BLOCK_WEEPING_VINES_FALL("block.weeping_vines.fall"), + BLOCK_WEEPING_VINES_HIT("block.weeping_vines.hit"), + BLOCK_WEEPING_VINES_PLACE("block.weeping_vines.place"), + BLOCK_WEEPING_VINES_STEP("block.weeping_vines.step"), + BLOCK_WET_GRASS_BREAK("block.wet_grass.break"), + BLOCK_WET_GRASS_FALL("block.wet_grass.fall"), + BLOCK_WET_GRASS_HIT("block.wet_grass.hit"), + BLOCK_WET_GRASS_PLACE("block.wet_grass.place"), + BLOCK_WET_GRASS_STEP("block.wet_grass.step"), + BLOCK_WET_SPONGE_BREAK("block.wet_sponge.break"), + BLOCK_WET_SPONGE_DRIES("block.wet_sponge.dries"), + BLOCK_WET_SPONGE_FALL("block.wet_sponge.fall"), + BLOCK_WET_SPONGE_HIT("block.wet_sponge.hit"), + BLOCK_WET_SPONGE_PLACE("block.wet_sponge.place"), + BLOCK_WET_SPONGE_STEP("block.wet_sponge.step"), + BLOCK_WOOD_BREAK("block.wood.break"), + BLOCK_WOOD_FALL("block.wood.fall"), + BLOCK_WOOD_HIT("block.wood.hit"), + BLOCK_WOOD_PLACE("block.wood.place"), + BLOCK_WOOD_STEP("block.wood.step"), + BLOCK_WOODEN_BUTTON_CLICK_OFF("block.wooden_button.click_off"), + BLOCK_WOODEN_BUTTON_CLICK_ON("block.wooden_button.click_on"), + BLOCK_WOODEN_DOOR_CLOSE("block.wooden_door.close"), + BLOCK_WOODEN_DOOR_OPEN("block.wooden_door.open"), + BLOCK_WOODEN_PRESSURE_PLATE_CLICK_OFF("block.wooden_pressure_plate.click_off"), + BLOCK_WOODEN_PRESSURE_PLATE_CLICK_ON("block.wooden_pressure_plate.click_on"), + BLOCK_WOODEN_TRAPDOOR_CLOSE("block.wooden_trapdoor.close"), + BLOCK_WOODEN_TRAPDOOR_OPEN("block.wooden_trapdoor.open"), + BLOCK_WOOL_BREAK("block.wool.break"), + BLOCK_WOOL_FALL("block.wool.fall"), + BLOCK_WOOL_HIT("block.wool.hit"), + BLOCK_WOOL_PLACE("block.wool.place"), + BLOCK_WOOL_STEP("block.wool.step"), + ENCHANT_THORNS_HIT("enchant.thorns.hit"), + ENTITY_ALLAY_AMBIENT_WITH_ITEM("entity.allay.ambient_with_item"), + ENTITY_ALLAY_AMBIENT_WITHOUT_ITEM("entity.allay.ambient_without_item"), + ENTITY_ALLAY_DEATH("entity.allay.death"), + ENTITY_ALLAY_HURT("entity.allay.hurt"), + ENTITY_ALLAY_ITEM_GIVEN("entity.allay.item_given"), + ENTITY_ALLAY_ITEM_TAKEN("entity.allay.item_taken"), + ENTITY_ALLAY_ITEM_THROWN("entity.allay.item_thrown"), + ENTITY_ARMADILLO_AMBIENT("entity.armadillo.ambient"), + ENTITY_ARMADILLO_BRUSH("entity.armadillo.brush"), + ENTITY_ARMADILLO_DEATH("entity.armadillo.death"), + ENTITY_ARMADILLO_EAT("entity.armadillo.eat"), + ENTITY_ARMADILLO_HURT("entity.armadillo.hurt"), + ENTITY_ARMADILLO_HURT_REDUCED("entity.armadillo.hurt_reduced"), + ENTITY_ARMADILLO_LAND("entity.armadillo.land"), + ENTITY_ARMADILLO_PEEK("entity.armadillo.peek"), + ENTITY_ARMADILLO_ROLL("entity.armadillo.roll"), + ENTITY_ARMADILLO_SCUTE_DROP("entity.armadillo.scute_drop"), + ENTITY_ARMADILLO_STEP("entity.armadillo.step"), + ENTITY_ARMADILLO_UNROLL_FINISH("entity.armadillo.unroll_finish"), + ENTITY_ARMADILLO_UNROLL_START("entity.armadillo.unroll_start"), + ENTITY_ARMOR_STAND_BREAK("entity.armor_stand.break"), + ENTITY_ARMOR_STAND_FALL("entity.armor_stand.fall"), + ENTITY_ARMOR_STAND_HIT("entity.armor_stand.hit"), + ENTITY_ARMOR_STAND_PLACE("entity.armor_stand.place"), + ENTITY_ARROW_HIT("entity.arrow.hit"), + ENTITY_ARROW_HIT_PLAYER("entity.arrow.hit_player"), + ENTITY_ARROW_SHOOT("entity.arrow.shoot"), + ENTITY_AXOLOTL_ATTACK("entity.axolotl.attack"), + ENTITY_AXOLOTL_DEATH("entity.axolotl.death"), + ENTITY_AXOLOTL_HURT("entity.axolotl.hurt"), + ENTITY_AXOLOTL_IDLE_AIR("entity.axolotl.idle_air"), + ENTITY_AXOLOTL_IDLE_WATER("entity.axolotl.idle_water"), + ENTITY_AXOLOTL_SPLASH("entity.axolotl.splash"), + ENTITY_AXOLOTL_SWIM("entity.axolotl.swim"), + ENTITY_BAT_AMBIENT("entity.bat.ambient"), + ENTITY_BAT_DEATH("entity.bat.death"), + ENTITY_BAT_HURT("entity.bat.hurt"), + ENTITY_BAT_LOOP("entity.bat.loop"), + ENTITY_BAT_TAKEOFF("entity.bat.takeoff"), + ENTITY_BEE_DEATH("entity.bee.death"), + ENTITY_BEE_HURT("entity.bee.hurt"), + ENTITY_BEE_LOOP("entity.bee.loop"), + ENTITY_BEE_LOOP_AGGRESSIVE("entity.bee.loop_aggressive"), + ENTITY_BEE_POLLINATE("entity.bee.pollinate"), + ENTITY_BEE_STING("entity.bee.sting"), + ENTITY_BLAZE_AMBIENT("entity.blaze.ambient"), + ENTITY_BLAZE_BURN("entity.blaze.burn"), + ENTITY_BLAZE_DEATH("entity.blaze.death"), + ENTITY_BLAZE_HURT("entity.blaze.hurt"), + ENTITY_BLAZE_SHOOT("entity.blaze.shoot"), + ENTITY_BOAT_PADDLE_LAND("entity.boat.paddle_land"), + ENTITY_BOAT_PADDLE_WATER("entity.boat.paddle_water"), + ENTITY_BOGGED_AMBIENT("entity.bogged.ambient"), + ENTITY_BOGGED_DEATH("entity.bogged.death"), + ENTITY_BOGGED_HURT("entity.bogged.hurt"), + ENTITY_BOGGED_SHEAR("entity.bogged.shear"), + ENTITY_BOGGED_STEP("entity.bogged.step"), + ENTITY_BREEZE_CHARGE("entity.breeze.charge"), + ENTITY_BREEZE_DEATH("entity.breeze.death"), + ENTITY_BREEZE_DEFLECT("entity.breeze.deflect"), + ENTITY_BREEZE_HURT("entity.breeze.hurt"), + ENTITY_BREEZE_IDLE_AIR("entity.breeze.idle_air"), + ENTITY_BREEZE_IDLE_GROUND("entity.breeze.idle_ground"), + ENTITY_BREEZE_INHALE("entity.breeze.inhale"), + ENTITY_BREEZE_JUMP("entity.breeze.jump"), + ENTITY_BREEZE_LAND("entity.breeze.land"), + ENTITY_BREEZE_SHOOT("entity.breeze.shoot"), + ENTITY_BREEZE_SLIDE("entity.breeze.slide"), + ENTITY_BREEZE_WHIRL("entity.breeze.whirl"), + ENTITY_BREEZE_WIND_BURST("entity.breeze.wind_burst"), + ENTITY_CAMEL_AMBIENT("entity.camel.ambient"), + ENTITY_CAMEL_DASH("entity.camel.dash"), + ENTITY_CAMEL_DASH_READY("entity.camel.dash_ready"), + ENTITY_CAMEL_DEATH("entity.camel.death"), + ENTITY_CAMEL_EAT("entity.camel.eat"), + ENTITY_CAMEL_HURT("entity.camel.hurt"), + ENTITY_CAMEL_SADDLE("entity.camel.saddle"), + ENTITY_CAMEL_SIT("entity.camel.sit"), + ENTITY_CAMEL_STAND("entity.camel.stand"), + ENTITY_CAMEL_STEP("entity.camel.step"), + ENTITY_CAMEL_STEP_SAND("entity.camel.step_sand"), + ENTITY_CAT_AMBIENT("entity.cat.ambient"), + ENTITY_CAT_BEG_FOR_FOOD("entity.cat.beg_for_food"), + ENTITY_CAT_DEATH("entity.cat.death"), + ENTITY_CAT_EAT("entity.cat.eat"), + ENTITY_CAT_HISS("entity.cat.hiss"), + ENTITY_CAT_HURT("entity.cat.hurt"), + ENTITY_CAT_PURR("entity.cat.purr"), + ENTITY_CAT_PURREOW("entity.cat.purreow"), + ENTITY_CAT_STRAY_AMBIENT("entity.cat.stray_ambient"), + ENTITY_CHICKEN_AMBIENT("entity.chicken.ambient"), + ENTITY_CHICKEN_DEATH("entity.chicken.death"), + ENTITY_CHICKEN_EGG("entity.chicken.egg"), + ENTITY_CHICKEN_HURT("entity.chicken.hurt"), + ENTITY_CHICKEN_STEP("entity.chicken.step"), + ENTITY_COD_AMBIENT("entity.cod.ambient"), + ENTITY_COD_DEATH("entity.cod.death"), + ENTITY_COD_FLOP("entity.cod.flop"), + ENTITY_COD_HURT("entity.cod.hurt"), + ENTITY_COW_AMBIENT("entity.cow.ambient"), + ENTITY_COW_DEATH("entity.cow.death"), + ENTITY_COW_HURT("entity.cow.hurt"), + ENTITY_COW_MILK("entity.cow.milk"), + ENTITY_COW_STEP("entity.cow.step"), + ENTITY_CREEPER_DEATH("entity.creeper.death"), + ENTITY_CREEPER_HURT("entity.creeper.hurt"), + ENTITY_CREEPER_PRIMED("entity.creeper.primed"), + ENTITY_DOLPHIN_AMBIENT("entity.dolphin.ambient"), + ENTITY_DOLPHIN_AMBIENT_WATER("entity.dolphin.ambient_water"), + ENTITY_DOLPHIN_ATTACK("entity.dolphin.attack"), + ENTITY_DOLPHIN_DEATH("entity.dolphin.death"), + ENTITY_DOLPHIN_EAT("entity.dolphin.eat"), + ENTITY_DOLPHIN_HURT("entity.dolphin.hurt"), + ENTITY_DOLPHIN_JUMP("entity.dolphin.jump"), + ENTITY_DOLPHIN_PLAY("entity.dolphin.play"), + ENTITY_DOLPHIN_SPLASH("entity.dolphin.splash"), + ENTITY_DOLPHIN_SWIM("entity.dolphin.swim"), + ENTITY_DONKEY_AMBIENT("entity.donkey.ambient"), + ENTITY_DONKEY_ANGRY("entity.donkey.angry"), + ENTITY_DONKEY_CHEST("entity.donkey.chest"), + ENTITY_DONKEY_DEATH("entity.donkey.death"), + ENTITY_DONKEY_EAT("entity.donkey.eat"), + ENTITY_DONKEY_HURT("entity.donkey.hurt"), + ENTITY_DONKEY_JUMP("entity.donkey.jump"), + ENTITY_DRAGON_FIREBALL_EXPLODE("entity.dragon_fireball.explode"), + ENTITY_DROWNED_AMBIENT("entity.drowned.ambient"), + ENTITY_DROWNED_AMBIENT_WATER("entity.drowned.ambient_water"), + ENTITY_DROWNED_DEATH("entity.drowned.death"), + ENTITY_DROWNED_DEATH_WATER("entity.drowned.death_water"), + ENTITY_DROWNED_HURT("entity.drowned.hurt"), + ENTITY_DROWNED_HURT_WATER("entity.drowned.hurt_water"), + ENTITY_DROWNED_SHOOT("entity.drowned.shoot"), + ENTITY_DROWNED_STEP("entity.drowned.step"), + ENTITY_DROWNED_SWIM("entity.drowned.swim"), + ENTITY_EGG_THROW("entity.egg.throw"), + ENTITY_ELDER_GUARDIAN_AMBIENT("entity.elder_guardian.ambient"), + ENTITY_ELDER_GUARDIAN_AMBIENT_LAND("entity.elder_guardian.ambient_land"), + ENTITY_ELDER_GUARDIAN_CURSE("entity.elder_guardian.curse"), + ENTITY_ELDER_GUARDIAN_DEATH("entity.elder_guardian.death"), + ENTITY_ELDER_GUARDIAN_DEATH_LAND("entity.elder_guardian.death_land"), + ENTITY_ELDER_GUARDIAN_FLOP("entity.elder_guardian.flop"), + ENTITY_ELDER_GUARDIAN_HURT("entity.elder_guardian.hurt"), + ENTITY_ELDER_GUARDIAN_HURT_LAND("entity.elder_guardian.hurt_land"), + ENTITY_ENDER_DRAGON_AMBIENT("entity.ender_dragon.ambient"), + ENTITY_ENDER_DRAGON_DEATH("entity.ender_dragon.death"), + ENTITY_ENDER_DRAGON_FLAP("entity.ender_dragon.flap"), + ENTITY_ENDER_DRAGON_GROWL("entity.ender_dragon.growl"), + ENTITY_ENDER_DRAGON_HURT("entity.ender_dragon.hurt"), + ENTITY_ENDER_DRAGON_SHOOT("entity.ender_dragon.shoot"), + ENTITY_ENDER_EYE_DEATH("entity.ender_eye.death"), + ENTITY_ENDER_EYE_LAUNCH("entity.ender_eye.launch"), + ENTITY_ENDER_PEARL_THROW("entity.ender_pearl.throw"), + ENTITY_ENDERMAN_AMBIENT("entity.enderman.ambient"), + ENTITY_ENDERMAN_DEATH("entity.enderman.death"), + ENTITY_ENDERMAN_HURT("entity.enderman.hurt"), + ENTITY_ENDERMAN_SCREAM("entity.enderman.scream"), + ENTITY_ENDERMAN_STARE("entity.enderman.stare"), + ENTITY_ENDERMAN_TELEPORT("entity.enderman.teleport"), + ENTITY_ENDERMITE_AMBIENT("entity.endermite.ambient"), + ENTITY_ENDERMITE_DEATH("entity.endermite.death"), + ENTITY_ENDERMITE_HURT("entity.endermite.hurt"), + ENTITY_ENDERMITE_STEP("entity.endermite.step"), + ENTITY_EVOKER_AMBIENT("entity.evoker.ambient"), + ENTITY_EVOKER_CAST_SPELL("entity.evoker.cast_spell"), + ENTITY_EVOKER_CELEBRATE("entity.evoker.celebrate"), + ENTITY_EVOKER_DEATH("entity.evoker.death"), + ENTITY_EVOKER_HURT("entity.evoker.hurt"), + ENTITY_EVOKER_PREPARE_ATTACK("entity.evoker.prepare_attack"), + ENTITY_EVOKER_PREPARE_SUMMON("entity.evoker.prepare_summon"), + ENTITY_EVOKER_PREPARE_WOLOLO("entity.evoker.prepare_wololo"), + ENTITY_EVOKER_FANGS_ATTACK("entity.evoker_fangs.attack"), + ENTITY_EXPERIENCE_BOTTLE_THROW("entity.experience_bottle.throw"), + ENTITY_EXPERIENCE_ORB_PICKUP("entity.experience_orb.pickup"), + ENTITY_FIREWORK_ROCKET_BLAST("entity.firework_rocket.blast"), + ENTITY_FIREWORK_ROCKET_BLAST_FAR("entity.firework_rocket.blast_far"), + ENTITY_FIREWORK_ROCKET_LARGE_BLAST("entity.firework_rocket.large_blast"), + ENTITY_FIREWORK_ROCKET_LARGE_BLAST_FAR("entity.firework_rocket.large_blast_far"), + ENTITY_FIREWORK_ROCKET_LAUNCH("entity.firework_rocket.launch"), + ENTITY_FIREWORK_ROCKET_SHOOT("entity.firework_rocket.shoot"), + ENTITY_FIREWORK_ROCKET_TWINKLE("entity.firework_rocket.twinkle"), + ENTITY_FIREWORK_ROCKET_TWINKLE_FAR("entity.firework_rocket.twinkle_far"), + ENTITY_FISH_SWIM("entity.fish.swim"), + ENTITY_FISHING_BOBBER_RETRIEVE("entity.fishing_bobber.retrieve"), + ENTITY_FISHING_BOBBER_SPLASH("entity.fishing_bobber.splash"), + ENTITY_FISHING_BOBBER_THROW("entity.fishing_bobber.throw"), + ENTITY_FOX_AGGRO("entity.fox.aggro"), + ENTITY_FOX_AMBIENT("entity.fox.ambient"), + ENTITY_FOX_BITE("entity.fox.bite"), + ENTITY_FOX_DEATH("entity.fox.death"), + ENTITY_FOX_EAT("entity.fox.eat"), + ENTITY_FOX_HURT("entity.fox.hurt"), + ENTITY_FOX_SCREECH("entity.fox.screech"), + ENTITY_FOX_SLEEP("entity.fox.sleep"), + ENTITY_FOX_SNIFF("entity.fox.sniff"), + ENTITY_FOX_SPIT("entity.fox.spit"), + ENTITY_FOX_TELEPORT("entity.fox.teleport"), + ENTITY_FROG_AMBIENT("entity.frog.ambient"), + ENTITY_FROG_DEATH("entity.frog.death"), + ENTITY_FROG_EAT("entity.frog.eat"), + ENTITY_FROG_HURT("entity.frog.hurt"), + ENTITY_FROG_LAY_SPAWN("entity.frog.lay_spawn"), + ENTITY_FROG_LONG_JUMP("entity.frog.long_jump"), + ENTITY_FROG_STEP("entity.frog.step"), + ENTITY_FROG_TONGUE("entity.frog.tongue"), + ENTITY_GENERIC_BIG_FALL("entity.generic.big_fall"), + ENTITY_GENERIC_BURN("entity.generic.burn"), + ENTITY_GENERIC_DEATH("entity.generic.death"), + ENTITY_GENERIC_DRINK("entity.generic.drink"), + ENTITY_GENERIC_EAT("entity.generic.eat"), + ENTITY_GENERIC_EXPLODE("entity.generic.explode"), + ENTITY_GENERIC_EXTINGUISH_FIRE("entity.generic.extinguish_fire"), + ENTITY_GENERIC_HURT("entity.generic.hurt"), + ENTITY_GENERIC_SMALL_FALL("entity.generic.small_fall"), + ENTITY_GENERIC_SPLASH("entity.generic.splash"), + ENTITY_GENERIC_SWIM("entity.generic.swim"), + ENTITY_GHAST_AMBIENT("entity.ghast.ambient"), + ENTITY_GHAST_DEATH("entity.ghast.death"), + ENTITY_GHAST_HURT("entity.ghast.hurt"), + ENTITY_GHAST_SCREAM("entity.ghast.scream"), + ENTITY_GHAST_SHOOT("entity.ghast.shoot"), + ENTITY_GHAST_WARN("entity.ghast.warn"), + ENTITY_GLOW_ITEM_FRAME_ADD_ITEM("entity.glow_item_frame.add_item"), + ENTITY_GLOW_ITEM_FRAME_BREAK("entity.glow_item_frame.break"), + ENTITY_GLOW_ITEM_FRAME_PLACE("entity.glow_item_frame.place"), + ENTITY_GLOW_ITEM_FRAME_REMOVE_ITEM("entity.glow_item_frame.remove_item"), + ENTITY_GLOW_ITEM_FRAME_ROTATE_ITEM("entity.glow_item_frame.rotate_item"), + ENTITY_GLOW_SQUID_AMBIENT("entity.glow_squid.ambient"), + ENTITY_GLOW_SQUID_DEATH("entity.glow_squid.death"), + ENTITY_GLOW_SQUID_HURT("entity.glow_squid.hurt"), + ENTITY_GLOW_SQUID_SQUIRT("entity.glow_squid.squirt"), + ENTITY_GOAT_AMBIENT("entity.goat.ambient"), + ENTITY_GOAT_DEATH("entity.goat.death"), + ENTITY_GOAT_EAT("entity.goat.eat"), + ENTITY_GOAT_HORN_BREAK("entity.goat.horn_break"), + ENTITY_GOAT_HURT("entity.goat.hurt"), + ENTITY_GOAT_LONG_JUMP("entity.goat.long_jump"), + ENTITY_GOAT_MILK("entity.goat.milk"), + ENTITY_GOAT_PREPARE_RAM("entity.goat.prepare_ram"), + ENTITY_GOAT_RAM_IMPACT("entity.goat.ram_impact"), + ENTITY_GOAT_SCREAMING_AMBIENT("entity.goat.screaming.ambient"), + ENTITY_GOAT_SCREAMING_DEATH("entity.goat.screaming.death"), + ENTITY_GOAT_SCREAMING_EAT("entity.goat.screaming.eat"), + ENTITY_GOAT_SCREAMING_HORN_BREAK("entity.goat.screaming.horn_break"), + ENTITY_GOAT_SCREAMING_HURT("entity.goat.screaming.hurt"), + ENTITY_GOAT_SCREAMING_LONG_JUMP("entity.goat.screaming.long_jump"), + ENTITY_GOAT_SCREAMING_MILK("entity.goat.screaming.milk"), + ENTITY_GOAT_SCREAMING_PREPARE_RAM("entity.goat.screaming.prepare_ram"), + ENTITY_GOAT_SCREAMING_RAM_IMPACT("entity.goat.screaming.ram_impact"), + ENTITY_GOAT_STEP("entity.goat.step"), + ENTITY_GUARDIAN_AMBIENT("entity.guardian.ambient"), + ENTITY_GUARDIAN_AMBIENT_LAND("entity.guardian.ambient_land"), + ENTITY_GUARDIAN_ATTACK("entity.guardian.attack"), + ENTITY_GUARDIAN_DEATH("entity.guardian.death"), + ENTITY_GUARDIAN_DEATH_LAND("entity.guardian.death_land"), + ENTITY_GUARDIAN_FLOP("entity.guardian.flop"), + ENTITY_GUARDIAN_HURT("entity.guardian.hurt"), + ENTITY_GUARDIAN_HURT_LAND("entity.guardian.hurt_land"), + ENTITY_HOGLIN_AMBIENT("entity.hoglin.ambient"), + ENTITY_HOGLIN_ANGRY("entity.hoglin.angry"), + ENTITY_HOGLIN_ATTACK("entity.hoglin.attack"), + ENTITY_HOGLIN_CONVERTED_TO_ZOMBIFIED("entity.hoglin.converted_to_zombified"), + ENTITY_HOGLIN_DEATH("entity.hoglin.death"), + ENTITY_HOGLIN_HURT("entity.hoglin.hurt"), + ENTITY_HOGLIN_RETREAT("entity.hoglin.retreat"), + ENTITY_HOGLIN_STEP("entity.hoglin.step"), + ENTITY_HORSE_AMBIENT("entity.horse.ambient"), + ENTITY_HORSE_ANGRY("entity.horse.angry"), + ENTITY_HORSE_ARMOR("entity.horse.armor"), + ENTITY_HORSE_BREATHE("entity.horse.breathe"), + ENTITY_HORSE_DEATH("entity.horse.death"), + ENTITY_HORSE_EAT("entity.horse.eat"), + ENTITY_HORSE_GALLOP("entity.horse.gallop"), + ENTITY_HORSE_HURT("entity.horse.hurt"), + ENTITY_HORSE_JUMP("entity.horse.jump"), + ENTITY_HORSE_LAND("entity.horse.land"), + ENTITY_HORSE_SADDLE("entity.horse.saddle"), + ENTITY_HORSE_STEP("entity.horse.step"), + ENTITY_HORSE_STEP_WOOD("entity.horse.step_wood"), + ENTITY_HOSTILE_BIG_FALL("entity.hostile.big_fall"), + ENTITY_HOSTILE_DEATH("entity.hostile.death"), + ENTITY_HOSTILE_HURT("entity.hostile.hurt"), + ENTITY_HOSTILE_SMALL_FALL("entity.hostile.small_fall"), + ENTITY_HOSTILE_SPLASH("entity.hostile.splash"), + ENTITY_HOSTILE_SWIM("entity.hostile.swim"), + ENTITY_HUSK_AMBIENT("entity.husk.ambient"), + ENTITY_HUSK_CONVERTED_TO_ZOMBIE("entity.husk.converted_to_zombie"), + ENTITY_HUSK_DEATH("entity.husk.death"), + ENTITY_HUSK_HURT("entity.husk.hurt"), + ENTITY_HUSK_STEP("entity.husk.step"), + ENTITY_ILLUSIONER_AMBIENT("entity.illusioner.ambient"), + ENTITY_ILLUSIONER_CAST_SPELL("entity.illusioner.cast_spell"), + ENTITY_ILLUSIONER_DEATH("entity.illusioner.death"), + ENTITY_ILLUSIONER_HURT("entity.illusioner.hurt"), + ENTITY_ILLUSIONER_MIRROR_MOVE("entity.illusioner.mirror_move"), + ENTITY_ILLUSIONER_PREPARE_BLINDNESS("entity.illusioner.prepare_blindness"), + ENTITY_ILLUSIONER_PREPARE_MIRROR("entity.illusioner.prepare_mirror"), + ENTITY_IRON_GOLEM_ATTACK("entity.iron_golem.attack"), + ENTITY_IRON_GOLEM_DAMAGE("entity.iron_golem.damage"), + ENTITY_IRON_GOLEM_DEATH("entity.iron_golem.death"), + ENTITY_IRON_GOLEM_HURT("entity.iron_golem.hurt"), + ENTITY_IRON_GOLEM_REPAIR("entity.iron_golem.repair"), + ENTITY_IRON_GOLEM_STEP("entity.iron_golem.step"), + ENTITY_ITEM_BREAK("entity.item.break"), + ENTITY_ITEM_PICKUP("entity.item.pickup"), + ENTITY_ITEM_FRAME_ADD_ITEM("entity.item_frame.add_item"), + ENTITY_ITEM_FRAME_BREAK("entity.item_frame.break"), + ENTITY_ITEM_FRAME_PLACE("entity.item_frame.place"), + ENTITY_ITEM_FRAME_REMOVE_ITEM("entity.item_frame.remove_item"), + ENTITY_ITEM_FRAME_ROTATE_ITEM("entity.item_frame.rotate_item"), + ENTITY_LEASH_KNOT_BREAK("entity.leash_knot.break"), + ENTITY_LEASH_KNOT_PLACE("entity.leash_knot.place"), + ENTITY_LIGHTNING_BOLT_IMPACT("entity.lightning_bolt.impact"), + ENTITY_LIGHTNING_BOLT_THUNDER("entity.lightning_bolt.thunder"), + ENTITY_LINGERING_POTION_THROW("entity.lingering_potion.throw"), + ENTITY_LLAMA_AMBIENT("entity.llama.ambient"), + ENTITY_LLAMA_ANGRY("entity.llama.angry"), + ENTITY_LLAMA_CHEST("entity.llama.chest"), + ENTITY_LLAMA_DEATH("entity.llama.death"), + ENTITY_LLAMA_EAT("entity.llama.eat"), + ENTITY_LLAMA_HURT("entity.llama.hurt"), + ENTITY_LLAMA_SPIT("entity.llama.spit"), + ENTITY_LLAMA_STEP("entity.llama.step"), + ENTITY_LLAMA_SWAG("entity.llama.swag"), + ENTITY_MAGMA_CUBE_DEATH("entity.magma_cube.death"), + ENTITY_MAGMA_CUBE_DEATH_SMALL("entity.magma_cube.death_small"), + ENTITY_MAGMA_CUBE_HURT("entity.magma_cube.hurt"), + ENTITY_MAGMA_CUBE_HURT_SMALL("entity.magma_cube.hurt_small"), + ENTITY_MAGMA_CUBE_JUMP("entity.magma_cube.jump"), + ENTITY_MAGMA_CUBE_SQUISH("entity.magma_cube.squish"), + ENTITY_MAGMA_CUBE_SQUISH_SMALL("entity.magma_cube.squish_small"), + ENTITY_MINECART_INSIDE("entity.minecart.inside"), + ENTITY_MINECART_INSIDE_UNDERWATER("entity.minecart.inside.underwater"), + ENTITY_MINECART_RIDING("entity.minecart.riding"), + ENTITY_MOOSHROOM_CONVERT("entity.mooshroom.convert"), + ENTITY_MOOSHROOM_EAT("entity.mooshroom.eat"), + ENTITY_MOOSHROOM_MILK("entity.mooshroom.milk"), + ENTITY_MOOSHROOM_SHEAR("entity.mooshroom.shear"), + ENTITY_MOOSHROOM_SUSPICIOUS_MILK("entity.mooshroom.suspicious_milk"), + ENTITY_MULE_AMBIENT("entity.mule.ambient"), + ENTITY_MULE_ANGRY("entity.mule.angry"), + ENTITY_MULE_CHEST("entity.mule.chest"), + ENTITY_MULE_DEATH("entity.mule.death"), + ENTITY_MULE_EAT("entity.mule.eat"), + ENTITY_MULE_HURT("entity.mule.hurt"), + ENTITY_MULE_JUMP("entity.mule.jump"), + ENTITY_OCELOT_AMBIENT("entity.ocelot.ambient"), + ENTITY_OCELOT_DEATH("entity.ocelot.death"), + ENTITY_OCELOT_HURT("entity.ocelot.hurt"), + ENTITY_PAINTING_BREAK("entity.painting.break"), + ENTITY_PAINTING_PLACE("entity.painting.place"), + ENTITY_PANDA_AGGRESSIVE_AMBIENT("entity.panda.aggressive_ambient"), + ENTITY_PANDA_AMBIENT("entity.panda.ambient"), + ENTITY_PANDA_BITE("entity.panda.bite"), + ENTITY_PANDA_CANT_BREED("entity.panda.cant_breed"), + ENTITY_PANDA_DEATH("entity.panda.death"), + ENTITY_PANDA_EAT("entity.panda.eat"), + ENTITY_PANDA_HURT("entity.panda.hurt"), + ENTITY_PANDA_PRE_SNEEZE("entity.panda.pre_sneeze"), + ENTITY_PANDA_SNEEZE("entity.panda.sneeze"), + ENTITY_PANDA_STEP("entity.panda.step"), + ENTITY_PANDA_WORRIED_AMBIENT("entity.panda.worried_ambient"), + ENTITY_PARROT_AMBIENT("entity.parrot.ambient"), + ENTITY_PARROT_DEATH("entity.parrot.death"), + ENTITY_PARROT_EAT("entity.parrot.eat"), + ENTITY_PARROT_FLY("entity.parrot.fly"), + ENTITY_PARROT_HURT("entity.parrot.hurt"), + ENTITY_PARROT_IMITATE_BLAZE("entity.parrot.imitate.blaze"), + ENTITY_PARROT_IMITATE_BOGGED("entity.parrot.imitate.bogged"), + ENTITY_PARROT_IMITATE_BREEZE("entity.parrot.imitate.breeze"), + ENTITY_PARROT_IMITATE_CREEPER("entity.parrot.imitate.creeper"), + ENTITY_PARROT_IMITATE_DROWNED("entity.parrot.imitate.drowned"), + ENTITY_PARROT_IMITATE_ELDER_GUARDIAN("entity.parrot.imitate.elder_guardian"), + ENTITY_PARROT_IMITATE_ENDER_DRAGON("entity.parrot.imitate.ender_dragon"), + ENTITY_PARROT_IMITATE_ENDERMITE("entity.parrot.imitate.endermite"), + ENTITY_PARROT_IMITATE_EVOKER("entity.parrot.imitate.evoker"), + ENTITY_PARROT_IMITATE_GHAST("entity.parrot.imitate.ghast"), + ENTITY_PARROT_IMITATE_GUARDIAN("entity.parrot.imitate.guardian"), + ENTITY_PARROT_IMITATE_HOGLIN("entity.parrot.imitate.hoglin"), + ENTITY_PARROT_IMITATE_HUSK("entity.parrot.imitate.husk"), + ENTITY_PARROT_IMITATE_ILLUSIONER("entity.parrot.imitate.illusioner"), + ENTITY_PARROT_IMITATE_MAGMA_CUBE("entity.parrot.imitate.magma_cube"), + ENTITY_PARROT_IMITATE_PHANTOM("entity.parrot.imitate.phantom"), + ENTITY_PARROT_IMITATE_PIGLIN("entity.parrot.imitate.piglin"), + ENTITY_PARROT_IMITATE_PIGLIN_BRUTE("entity.parrot.imitate.piglin_brute"), + ENTITY_PARROT_IMITATE_PILLAGER("entity.parrot.imitate.pillager"), + ENTITY_PARROT_IMITATE_RAVAGER("entity.parrot.imitate.ravager"), + ENTITY_PARROT_IMITATE_SHULKER("entity.parrot.imitate.shulker"), + ENTITY_PARROT_IMITATE_SILVERFISH("entity.parrot.imitate.silverfish"), + ENTITY_PARROT_IMITATE_SKELETON("entity.parrot.imitate.skeleton"), + ENTITY_PARROT_IMITATE_SLIME("entity.parrot.imitate.slime"), + ENTITY_PARROT_IMITATE_SPIDER("entity.parrot.imitate.spider"), + ENTITY_PARROT_IMITATE_STRAY("entity.parrot.imitate.stray"), + ENTITY_PARROT_IMITATE_VEX("entity.parrot.imitate.vex"), + ENTITY_PARROT_IMITATE_VINDICATOR("entity.parrot.imitate.vindicator"), + ENTITY_PARROT_IMITATE_WARDEN("entity.parrot.imitate.warden"), + ENTITY_PARROT_IMITATE_WITCH("entity.parrot.imitate.witch"), + ENTITY_PARROT_IMITATE_WITHER("entity.parrot.imitate.wither"), + ENTITY_PARROT_IMITATE_WITHER_SKELETON("entity.parrot.imitate.wither_skeleton"), + ENTITY_PARROT_IMITATE_ZOGLIN("entity.parrot.imitate.zoglin"), + ENTITY_PARROT_IMITATE_ZOMBIE("entity.parrot.imitate.zombie"), + ENTITY_PARROT_IMITATE_ZOMBIE_VILLAGER("entity.parrot.imitate.zombie_villager"), + ENTITY_PARROT_STEP("entity.parrot.step"), + ENTITY_PHANTOM_AMBIENT("entity.phantom.ambient"), + ENTITY_PHANTOM_BITE("entity.phantom.bite"), + ENTITY_PHANTOM_DEATH("entity.phantom.death"), + ENTITY_PHANTOM_FLAP("entity.phantom.flap"), + ENTITY_PHANTOM_HURT("entity.phantom.hurt"), + ENTITY_PHANTOM_SWOOP("entity.phantom.swoop"), + ENTITY_PIG_AMBIENT("entity.pig.ambient"), + ENTITY_PIG_DEATH("entity.pig.death"), + ENTITY_PIG_HURT("entity.pig.hurt"), + ENTITY_PIG_SADDLE("entity.pig.saddle"), + ENTITY_PIG_STEP("entity.pig.step"), + ENTITY_PIGLIN_ADMIRING_ITEM("entity.piglin.admiring_item"), + ENTITY_PIGLIN_AMBIENT("entity.piglin.ambient"), + ENTITY_PIGLIN_ANGRY("entity.piglin.angry"), + ENTITY_PIGLIN_CELEBRATE("entity.piglin.celebrate"), + ENTITY_PIGLIN_CONVERTED_TO_ZOMBIFIED("entity.piglin.converted_to_zombified"), + ENTITY_PIGLIN_DEATH("entity.piglin.death"), + ENTITY_PIGLIN_HURT("entity.piglin.hurt"), + ENTITY_PIGLIN_JEALOUS("entity.piglin.jealous"), + ENTITY_PIGLIN_RETREAT("entity.piglin.retreat"), + ENTITY_PIGLIN_STEP("entity.piglin.step"), + ENTITY_PIGLIN_BRUTE_AMBIENT("entity.piglin_brute.ambient"), + ENTITY_PIGLIN_BRUTE_ANGRY("entity.piglin_brute.angry"), + ENTITY_PIGLIN_BRUTE_CONVERTED_TO_ZOMBIFIED("entity.piglin_brute.converted_to_zombified"), + ENTITY_PIGLIN_BRUTE_DEATH("entity.piglin_brute.death"), + ENTITY_PIGLIN_BRUTE_HURT("entity.piglin_brute.hurt"), + ENTITY_PIGLIN_BRUTE_STEP("entity.piglin_brute.step"), + ENTITY_PILLAGER_AMBIENT("entity.pillager.ambient"), + ENTITY_PILLAGER_CELEBRATE("entity.pillager.celebrate"), + ENTITY_PILLAGER_DEATH("entity.pillager.death"), + ENTITY_PILLAGER_HURT("entity.pillager.hurt"), + ENTITY_PLAYER_ATTACK_CRIT("entity.player.attack.crit"), + ENTITY_PLAYER_ATTACK_KNOCKBACK("entity.player.attack.knockback"), + ENTITY_PLAYER_ATTACK_NODAMAGE("entity.player.attack.nodamage"), + ENTITY_PLAYER_ATTACK_STRONG("entity.player.attack.strong"), + ENTITY_PLAYER_ATTACK_SWEEP("entity.player.attack.sweep"), + ENTITY_PLAYER_ATTACK_WEAK("entity.player.attack.weak"), + ENTITY_PLAYER_BIG_FALL("entity.player.big_fall"), + ENTITY_PLAYER_BREATH("entity.player.breath"), + ENTITY_PLAYER_BURP("entity.player.burp"), + ENTITY_PLAYER_DEATH("entity.player.death"), + ENTITY_PLAYER_HURT("entity.player.hurt"), + ENTITY_PLAYER_HURT_DROWN("entity.player.hurt_drown"), + ENTITY_PLAYER_HURT_FREEZE("entity.player.hurt_freeze"), + ENTITY_PLAYER_HURT_ON_FIRE("entity.player.hurt_on_fire"), + ENTITY_PLAYER_HURT_SWEET_BERRY_BUSH("entity.player.hurt_sweet_berry_bush"), + ENTITY_PLAYER_LEVELUP("entity.player.levelup"), + ENTITY_PLAYER_SMALL_FALL("entity.player.small_fall"), + ENTITY_PLAYER_SPLASH("entity.player.splash"), + ENTITY_PLAYER_SPLASH_HIGH_SPEED("entity.player.splash.high_speed"), + ENTITY_PLAYER_SWIM("entity.player.swim"), + ENTITY_PLAYER_TELEPORT("entity.player.teleport"), + ENTITY_POLAR_BEAR_AMBIENT("entity.polar_bear.ambient"), + ENTITY_POLAR_BEAR_AMBIENT_BABY("entity.polar_bear.ambient_baby"), + ENTITY_POLAR_BEAR_DEATH("entity.polar_bear.death"), + ENTITY_POLAR_BEAR_HURT("entity.polar_bear.hurt"), + ENTITY_POLAR_BEAR_STEP("entity.polar_bear.step"), + ENTITY_POLAR_BEAR_WARNING("entity.polar_bear.warning"), + ENTITY_PUFFER_FISH_AMBIENT("entity.puffer_fish.ambient"), + ENTITY_PUFFER_FISH_BLOW_OUT("entity.puffer_fish.blow_out"), + ENTITY_PUFFER_FISH_BLOW_UP("entity.puffer_fish.blow_up"), + ENTITY_PUFFER_FISH_DEATH("entity.puffer_fish.death"), + ENTITY_PUFFER_FISH_FLOP("entity.puffer_fish.flop"), + ENTITY_PUFFER_FISH_HURT("entity.puffer_fish.hurt"), + ENTITY_PUFFER_FISH_STING("entity.puffer_fish.sting"), + ENTITY_RABBIT_AMBIENT("entity.rabbit.ambient"), + ENTITY_RABBIT_ATTACK("entity.rabbit.attack"), + ENTITY_RABBIT_DEATH("entity.rabbit.death"), + ENTITY_RABBIT_HURT("entity.rabbit.hurt"), + ENTITY_RABBIT_JUMP("entity.rabbit.jump"), + ENTITY_RAVAGER_AMBIENT("entity.ravager.ambient"), + ENTITY_RAVAGER_ATTACK("entity.ravager.attack"), + ENTITY_RAVAGER_CELEBRATE("entity.ravager.celebrate"), + ENTITY_RAVAGER_DEATH("entity.ravager.death"), + ENTITY_RAVAGER_HURT("entity.ravager.hurt"), + ENTITY_RAVAGER_ROAR("entity.ravager.roar"), + ENTITY_RAVAGER_STEP("entity.ravager.step"), + ENTITY_RAVAGER_STUNNED("entity.ravager.stunned"), + ENTITY_SALMON_AMBIENT("entity.salmon.ambient"), + ENTITY_SALMON_DEATH("entity.salmon.death"), + ENTITY_SALMON_FLOP("entity.salmon.flop"), + ENTITY_SALMON_HURT("entity.salmon.hurt"), + ENTITY_SHEEP_AMBIENT("entity.sheep.ambient"), + ENTITY_SHEEP_DEATH("entity.sheep.death"), + ENTITY_SHEEP_HURT("entity.sheep.hurt"), + ENTITY_SHEEP_SHEAR("entity.sheep.shear"), + ENTITY_SHEEP_STEP("entity.sheep.step"), + ENTITY_SHULKER_AMBIENT("entity.shulker.ambient"), + ENTITY_SHULKER_CLOSE("entity.shulker.close"), + ENTITY_SHULKER_DEATH("entity.shulker.death"), + ENTITY_SHULKER_HURT("entity.shulker.hurt"), + ENTITY_SHULKER_HURT_CLOSED("entity.shulker.hurt_closed"), + ENTITY_SHULKER_OPEN("entity.shulker.open"), + ENTITY_SHULKER_SHOOT("entity.shulker.shoot"), + ENTITY_SHULKER_TELEPORT("entity.shulker.teleport"), + ENTITY_SHULKER_BULLET_HIT("entity.shulker_bullet.hit"), + ENTITY_SHULKER_BULLET_HURT("entity.shulker_bullet.hurt"), + ENTITY_SILVERFISH_AMBIENT("entity.silverfish.ambient"), + ENTITY_SILVERFISH_DEATH("entity.silverfish.death"), + ENTITY_SILVERFISH_HURT("entity.silverfish.hurt"), + ENTITY_SILVERFISH_STEP("entity.silverfish.step"), + ENTITY_SKELETON_AMBIENT("entity.skeleton.ambient"), + ENTITY_SKELETON_CONVERTED_TO_STRAY("entity.skeleton.converted_to_stray"), + ENTITY_SKELETON_DEATH("entity.skeleton.death"), + ENTITY_SKELETON_HURT("entity.skeleton.hurt"), + ENTITY_SKELETON_SHOOT("entity.skeleton.shoot"), + ENTITY_SKELETON_STEP("entity.skeleton.step"), + ENTITY_SKELETON_HORSE_AMBIENT("entity.skeleton_horse.ambient"), + ENTITY_SKELETON_HORSE_AMBIENT_WATER("entity.skeleton_horse.ambient_water"), + ENTITY_SKELETON_HORSE_DEATH("entity.skeleton_horse.death"), + ENTITY_SKELETON_HORSE_GALLOP_WATER("entity.skeleton_horse.gallop_water"), + ENTITY_SKELETON_HORSE_HURT("entity.skeleton_horse.hurt"), + ENTITY_SKELETON_HORSE_JUMP_WATER("entity.skeleton_horse.jump_water"), + ENTITY_SKELETON_HORSE_STEP_WATER("entity.skeleton_horse.step_water"), + ENTITY_SKELETON_HORSE_SWIM("entity.skeleton_horse.swim"), + ENTITY_SLIME_ATTACK("entity.slime.attack"), + ENTITY_SLIME_DEATH("entity.slime.death"), + ENTITY_SLIME_DEATH_SMALL("entity.slime.death_small"), + ENTITY_SLIME_HURT("entity.slime.hurt"), + ENTITY_SLIME_HURT_SMALL("entity.slime.hurt_small"), + ENTITY_SLIME_JUMP("entity.slime.jump"), + ENTITY_SLIME_JUMP_SMALL("entity.slime.jump_small"), + ENTITY_SLIME_SQUISH("entity.slime.squish"), + ENTITY_SLIME_SQUISH_SMALL("entity.slime.squish_small"), + ENTITY_SNIFFER_DEATH("entity.sniffer.death"), + ENTITY_SNIFFER_DIGGING("entity.sniffer.digging"), + ENTITY_SNIFFER_DIGGING_STOP("entity.sniffer.digging_stop"), + ENTITY_SNIFFER_DROP_SEED("entity.sniffer.drop_seed"), + ENTITY_SNIFFER_EAT("entity.sniffer.eat"), + ENTITY_SNIFFER_HAPPY("entity.sniffer.happy"), + ENTITY_SNIFFER_HURT("entity.sniffer.hurt"), + ENTITY_SNIFFER_IDLE("entity.sniffer.idle"), + ENTITY_SNIFFER_SCENTING("entity.sniffer.scenting"), + ENTITY_SNIFFER_SEARCHING("entity.sniffer.searching"), + ENTITY_SNIFFER_SNIFFING("entity.sniffer.sniffing"), + ENTITY_SNIFFER_STEP("entity.sniffer.step"), + ENTITY_SNOW_GOLEM_AMBIENT("entity.snow_golem.ambient"), + ENTITY_SNOW_GOLEM_DEATH("entity.snow_golem.death"), + ENTITY_SNOW_GOLEM_HURT("entity.snow_golem.hurt"), + ENTITY_SNOW_GOLEM_SHEAR("entity.snow_golem.shear"), + ENTITY_SNOW_GOLEM_SHOOT("entity.snow_golem.shoot"), + ENTITY_SNOWBALL_THROW("entity.snowball.throw"), + ENTITY_SPIDER_AMBIENT("entity.spider.ambient"), + ENTITY_SPIDER_DEATH("entity.spider.death"), + ENTITY_SPIDER_HURT("entity.spider.hurt"), + ENTITY_SPIDER_STEP("entity.spider.step"), + ENTITY_SPLASH_POTION_BREAK("entity.splash_potion.break"), + ENTITY_SPLASH_POTION_THROW("entity.splash_potion.throw"), + ENTITY_SQUID_AMBIENT("entity.squid.ambient"), + ENTITY_SQUID_DEATH("entity.squid.death"), + ENTITY_SQUID_HURT("entity.squid.hurt"), + ENTITY_SQUID_SQUIRT("entity.squid.squirt"), + ENTITY_STRAY_AMBIENT("entity.stray.ambient"), + ENTITY_STRAY_DEATH("entity.stray.death"), + ENTITY_STRAY_HURT("entity.stray.hurt"), + ENTITY_STRAY_STEP("entity.stray.step"), + ENTITY_STRIDER_AMBIENT("entity.strider.ambient"), + ENTITY_STRIDER_DEATH("entity.strider.death"), + ENTITY_STRIDER_EAT("entity.strider.eat"), + ENTITY_STRIDER_HAPPY("entity.strider.happy"), + ENTITY_STRIDER_HURT("entity.strider.hurt"), + ENTITY_STRIDER_RETREAT("entity.strider.retreat"), + ENTITY_STRIDER_SADDLE("entity.strider.saddle"), + ENTITY_STRIDER_STEP("entity.strider.step"), + ENTITY_STRIDER_STEP_LAVA("entity.strider.step_lava"), + ENTITY_TADPOLE_DEATH("entity.tadpole.death"), + ENTITY_TADPOLE_FLOP("entity.tadpole.flop"), + ENTITY_TADPOLE_GROW_UP("entity.tadpole.grow_up"), + ENTITY_TADPOLE_HURT("entity.tadpole.hurt"), + ENTITY_TNT_PRIMED("entity.tnt.primed"), + ENTITY_TROPICAL_FISH_AMBIENT("entity.tropical_fish.ambient"), + ENTITY_TROPICAL_FISH_DEATH("entity.tropical_fish.death"), + ENTITY_TROPICAL_FISH_FLOP("entity.tropical_fish.flop"), + ENTITY_TROPICAL_FISH_HURT("entity.tropical_fish.hurt"), + ENTITY_TURTLE_AMBIENT_LAND("entity.turtle.ambient_land"), + ENTITY_TURTLE_DEATH("entity.turtle.death"), + ENTITY_TURTLE_DEATH_BABY("entity.turtle.death_baby"), + ENTITY_TURTLE_EGG_BREAK("entity.turtle.egg_break"), + ENTITY_TURTLE_EGG_CRACK("entity.turtle.egg_crack"), + ENTITY_TURTLE_EGG_HATCH("entity.turtle.egg_hatch"), + ENTITY_TURTLE_HURT("entity.turtle.hurt"), + ENTITY_TURTLE_HURT_BABY("entity.turtle.hurt_baby"), + ENTITY_TURTLE_LAY_EGG("entity.turtle.lay_egg"), + ENTITY_TURTLE_SHAMBLE("entity.turtle.shamble"), + ENTITY_TURTLE_SHAMBLE_BABY("entity.turtle.shamble_baby"), + ENTITY_TURTLE_SWIM("entity.turtle.swim"), + ENTITY_VEX_AMBIENT("entity.vex.ambient"), + ENTITY_VEX_CHARGE("entity.vex.charge"), + ENTITY_VEX_DEATH("entity.vex.death"), + ENTITY_VEX_HURT("entity.vex.hurt"), + ENTITY_VILLAGER_AMBIENT("entity.villager.ambient"), + ENTITY_VILLAGER_CELEBRATE("entity.villager.celebrate"), + ENTITY_VILLAGER_DEATH("entity.villager.death"), + ENTITY_VILLAGER_HURT("entity.villager.hurt"), + ENTITY_VILLAGER_NO("entity.villager.no"), + ENTITY_VILLAGER_TRADE("entity.villager.trade"), + ENTITY_VILLAGER_WORK_ARMORER("entity.villager.work_armorer"), + ENTITY_VILLAGER_WORK_BUTCHER("entity.villager.work_butcher"), + ENTITY_VILLAGER_WORK_CARTOGRAPHER("entity.villager.work_cartographer"), + ENTITY_VILLAGER_WORK_CLERIC("entity.villager.work_cleric"), + ENTITY_VILLAGER_WORK_FARMER("entity.villager.work_farmer"), + ENTITY_VILLAGER_WORK_FISHERMAN("entity.villager.work_fisherman"), + ENTITY_VILLAGER_WORK_FLETCHER("entity.villager.work_fletcher"), + ENTITY_VILLAGER_WORK_LEATHERWORKER("entity.villager.work_leatherworker"), + ENTITY_VILLAGER_WORK_LIBRARIAN("entity.villager.work_librarian"), + ENTITY_VILLAGER_WORK_MASON("entity.villager.work_mason"), + ENTITY_VILLAGER_WORK_SHEPHERD("entity.villager.work_shepherd"), + ENTITY_VILLAGER_WORK_TOOLSMITH("entity.villager.work_toolsmith"), + ENTITY_VILLAGER_WORK_WEAPONSMITH("entity.villager.work_weaponsmith"), + ENTITY_VILLAGER_YES("entity.villager.yes"), + ENTITY_VINDICATOR_AMBIENT("entity.vindicator.ambient"), + ENTITY_VINDICATOR_CELEBRATE("entity.vindicator.celebrate"), + ENTITY_VINDICATOR_DEATH("entity.vindicator.death"), + ENTITY_VINDICATOR_HURT("entity.vindicator.hurt"), + ENTITY_WANDERING_TRADER_AMBIENT("entity.wandering_trader.ambient"), + ENTITY_WANDERING_TRADER_DEATH("entity.wandering_trader.death"), + ENTITY_WANDERING_TRADER_DISAPPEARED("entity.wandering_trader.disappeared"), + ENTITY_WANDERING_TRADER_DRINK_MILK("entity.wandering_trader.drink_milk"), + ENTITY_WANDERING_TRADER_DRINK_POTION("entity.wandering_trader.drink_potion"), + ENTITY_WANDERING_TRADER_HURT("entity.wandering_trader.hurt"), + ENTITY_WANDERING_TRADER_NO("entity.wandering_trader.no"), + ENTITY_WANDERING_TRADER_REAPPEARED("entity.wandering_trader.reappeared"), + ENTITY_WANDERING_TRADER_TRADE("entity.wandering_trader.trade"), + ENTITY_WANDERING_TRADER_YES("entity.wandering_trader.yes"), + ENTITY_WARDEN_AGITATED("entity.warden.agitated"), + ENTITY_WARDEN_AMBIENT("entity.warden.ambient"), + ENTITY_WARDEN_ANGRY("entity.warden.angry"), + ENTITY_WARDEN_ATTACK_IMPACT("entity.warden.attack_impact"), + ENTITY_WARDEN_DEATH("entity.warden.death"), + ENTITY_WARDEN_DIG("entity.warden.dig"), + ENTITY_WARDEN_EMERGE("entity.warden.emerge"), + ENTITY_WARDEN_HEARTBEAT("entity.warden.heartbeat"), + ENTITY_WARDEN_HURT("entity.warden.hurt"), + ENTITY_WARDEN_LISTENING("entity.warden.listening"), + ENTITY_WARDEN_LISTENING_ANGRY("entity.warden.listening_angry"), + ENTITY_WARDEN_NEARBY_CLOSE("entity.warden.nearby_close"), + ENTITY_WARDEN_NEARBY_CLOSER("entity.warden.nearby_closer"), + ENTITY_WARDEN_NEARBY_CLOSEST("entity.warden.nearby_closest"), + ENTITY_WARDEN_ROAR("entity.warden.roar"), + ENTITY_WARDEN_SNIFF("entity.warden.sniff"), + ENTITY_WARDEN_SONIC_BOOM("entity.warden.sonic_boom"), + ENTITY_WARDEN_SONIC_CHARGE("entity.warden.sonic_charge"), + ENTITY_WARDEN_STEP("entity.warden.step"), + ENTITY_WARDEN_TENDRIL_CLICKS("entity.warden.tendril_clicks"), + ENTITY_WIND_CHARGE_THROW("entity.wind_charge.throw"), + ENTITY_WIND_CHARGE_WIND_BURST("entity.wind_charge.wind_burst"), + ENTITY_WITCH_AMBIENT("entity.witch.ambient"), + ENTITY_WITCH_CELEBRATE("entity.witch.celebrate"), + ENTITY_WITCH_DEATH("entity.witch.death"), + ENTITY_WITCH_DRINK("entity.witch.drink"), + ENTITY_WITCH_HURT("entity.witch.hurt"), + ENTITY_WITCH_THROW("entity.witch.throw"), + ENTITY_WITHER_AMBIENT("entity.wither.ambient"), + ENTITY_WITHER_BREAK_BLOCK("entity.wither.break_block"), + ENTITY_WITHER_DEATH("entity.wither.death"), + ENTITY_WITHER_HURT("entity.wither.hurt"), + ENTITY_WITHER_SHOOT("entity.wither.shoot"), + ENTITY_WITHER_SPAWN("entity.wither.spawn"), + ENTITY_WITHER_SKELETON_AMBIENT("entity.wither_skeleton.ambient"), + ENTITY_WITHER_SKELETON_DEATH("entity.wither_skeleton.death"), + ENTITY_WITHER_SKELETON_HURT("entity.wither_skeleton.hurt"), + ENTITY_WITHER_SKELETON_STEP("entity.wither_skeleton.step"), + ENTITY_WOLF_AMBIENT("entity.wolf.ambient"), + ENTITY_WOLF_DEATH("entity.wolf.death"), + ENTITY_WOLF_GROWL("entity.wolf.growl"), + ENTITY_WOLF_HOWL("entity.wolf.howl"), + ENTITY_WOLF_HURT("entity.wolf.hurt"), + ENTITY_WOLF_PANT("entity.wolf.pant"), + ENTITY_WOLF_SHAKE("entity.wolf.shake"), + ENTITY_WOLF_STEP("entity.wolf.step"), + ENTITY_WOLF_WHINE("entity.wolf.whine"), + ENTITY_ZOGLIN_AMBIENT("entity.zoglin.ambient"), + ENTITY_ZOGLIN_ANGRY("entity.zoglin.angry"), + ENTITY_ZOGLIN_ATTACK("entity.zoglin.attack"), + ENTITY_ZOGLIN_DEATH("entity.zoglin.death"), + ENTITY_ZOGLIN_HURT("entity.zoglin.hurt"), + ENTITY_ZOGLIN_STEP("entity.zoglin.step"), + ENTITY_ZOMBIE_AMBIENT("entity.zombie.ambient"), + ENTITY_ZOMBIE_ATTACK_IRON_DOOR("entity.zombie.attack_iron_door"), + ENTITY_ZOMBIE_ATTACK_WOODEN_DOOR("entity.zombie.attack_wooden_door"), + ENTITY_ZOMBIE_BREAK_WOODEN_DOOR("entity.zombie.break_wooden_door"), + ENTITY_ZOMBIE_CONVERTED_TO_DROWNED("entity.zombie.converted_to_drowned"), + ENTITY_ZOMBIE_DEATH("entity.zombie.death"), + ENTITY_ZOMBIE_DESTROY_EGG("entity.zombie.destroy_egg"), + ENTITY_ZOMBIE_HURT("entity.zombie.hurt"), + ENTITY_ZOMBIE_INFECT("entity.zombie.infect"), + ENTITY_ZOMBIE_STEP("entity.zombie.step"), + ENTITY_ZOMBIE_HORSE_AMBIENT("entity.zombie_horse.ambient"), + ENTITY_ZOMBIE_HORSE_DEATH("entity.zombie_horse.death"), + ENTITY_ZOMBIE_HORSE_HURT("entity.zombie_horse.hurt"), + ENTITY_ZOMBIE_VILLAGER_AMBIENT("entity.zombie_villager.ambient"), + ENTITY_ZOMBIE_VILLAGER_CONVERTED("entity.zombie_villager.converted"), + ENTITY_ZOMBIE_VILLAGER_CURE("entity.zombie_villager.cure"), + ENTITY_ZOMBIE_VILLAGER_DEATH("entity.zombie_villager.death"), + ENTITY_ZOMBIE_VILLAGER_HURT("entity.zombie_villager.hurt"), + ENTITY_ZOMBIE_VILLAGER_STEP("entity.zombie_villager.step"), + ENTITY_ZOMBIFIED_PIGLIN_AMBIENT("entity.zombified_piglin.ambient"), + ENTITY_ZOMBIFIED_PIGLIN_ANGRY("entity.zombified_piglin.angry"), + ENTITY_ZOMBIFIED_PIGLIN_DEATH("entity.zombified_piglin.death"), + ENTITY_ZOMBIFIED_PIGLIN_HURT("entity.zombified_piglin.hurt"), + EVENT_MOB_EFFECT_BAD_OMEN("event.mob_effect.bad_omen"), + EVENT_MOB_EFFECT_RAID_OMEN("event.mob_effect.raid_omen"), + EVENT_MOB_EFFECT_TRIAL_OMEN("event.mob_effect.trial_omen"), + EVENT_RAID_HORN("event.raid.horn"), + INTENTIONALLY_EMPTY("intentionally_empty"), + ITEM_ARMOR_EQUIP_CHAIN("item.armor.equip_chain"), + ITEM_ARMOR_EQUIP_DIAMOND("item.armor.equip_diamond"), + ITEM_ARMOR_EQUIP_ELYTRA("item.armor.equip_elytra"), + ITEM_ARMOR_EQUIP_GENERIC("item.armor.equip_generic"), + ITEM_ARMOR_EQUIP_GOLD("item.armor.equip_gold"), + ITEM_ARMOR_EQUIP_IRON("item.armor.equip_iron"), + ITEM_ARMOR_EQUIP_LEATHER("item.armor.equip_leather"), + ITEM_ARMOR_EQUIP_NETHERITE("item.armor.equip_netherite"), + ITEM_ARMOR_EQUIP_TURTLE("item.armor.equip_turtle"), + ITEM_ARMOR_EQUIP_WOLF("item.armor.equip_wolf"), + ITEM_ARMOR_UNEQUIP_WOLF("item.armor.unequip_wolf"), + ITEM_AXE_SCRAPE("item.axe.scrape"), + ITEM_AXE_STRIP("item.axe.strip"), + ITEM_AXE_WAX_OFF("item.axe.wax_off"), + ITEM_BONE_MEAL_USE("item.bone_meal.use"), + ITEM_BOOK_PAGE_TURN("item.book.page_turn"), + ITEM_BOOK_PUT("item.book.put"), + ITEM_BOTTLE_EMPTY("item.bottle.empty"), + ITEM_BOTTLE_FILL("item.bottle.fill"), + ITEM_BOTTLE_FILL_DRAGONBREATH("item.bottle.fill_dragonbreath"), + ITEM_BRUSH_BRUSHING_GENERIC("item.brush.brushing.generic"), + ITEM_BRUSH_BRUSHING_GRAVEL("item.brush.brushing.gravel"), + ITEM_BRUSH_BRUSHING_GRAVEL_COMPLETE("item.brush.brushing.gravel.complete"), + ITEM_BRUSH_BRUSHING_SAND("item.brush.brushing.sand"), + ITEM_BRUSH_BRUSHING_SAND_COMPLETE("item.brush.brushing.sand.complete"), + ITEM_BUCKET_EMPTY("item.bucket.empty"), + ITEM_BUCKET_EMPTY_AXOLOTL("item.bucket.empty_axolotl"), + ITEM_BUCKET_EMPTY_FISH("item.bucket.empty_fish"), + ITEM_BUCKET_EMPTY_LAVA("item.bucket.empty_lava"), + ITEM_BUCKET_EMPTY_POWDER_SNOW("item.bucket.empty_powder_snow"), + ITEM_BUCKET_EMPTY_TADPOLE("item.bucket.empty_tadpole"), + ITEM_BUCKET_FILL("item.bucket.fill"), + ITEM_BUCKET_FILL_AXOLOTL("item.bucket.fill_axolotl"), + ITEM_BUCKET_FILL_FISH("item.bucket.fill_fish"), + ITEM_BUCKET_FILL_LAVA("item.bucket.fill_lava"), + ITEM_BUCKET_FILL_POWDER_SNOW("item.bucket.fill_powder_snow"), + ITEM_BUCKET_FILL_TADPOLE("item.bucket.fill_tadpole"), + ITEM_BUNDLE_DROP_CONTENTS("item.bundle.drop_contents"), + ITEM_BUNDLE_INSERT("item.bundle.insert"), + ITEM_BUNDLE_REMOVE_ONE("item.bundle.remove_one"), + ITEM_CHORUS_FRUIT_TELEPORT("item.chorus_fruit.teleport"), + ITEM_CROP_PLANT("item.crop.plant"), + ITEM_CROSSBOW_HIT("item.crossbow.hit"), + ITEM_CROSSBOW_LOADING_END("item.crossbow.loading_end"), + ITEM_CROSSBOW_LOADING_MIDDLE("item.crossbow.loading_middle"), + ITEM_CROSSBOW_LOADING_START("item.crossbow.loading_start"), + ITEM_CROSSBOW_QUICK_CHARGE_1("item.crossbow.quick_charge_1"), + ITEM_CROSSBOW_QUICK_CHARGE_2("item.crossbow.quick_charge_2"), + ITEM_CROSSBOW_QUICK_CHARGE_3("item.crossbow.quick_charge_3"), + ITEM_CROSSBOW_SHOOT("item.crossbow.shoot"), + ITEM_DYE_USE("item.dye.use"), + ITEM_ELYTRA_FLYING("item.elytra.flying"), + ITEM_FIRECHARGE_USE("item.firecharge.use"), + ITEM_FLINTANDSTEEL_USE("item.flintandsteel.use"), + ITEM_GLOW_INK_SAC_USE("item.glow_ink_sac.use"), + ITEM_GOAT_HORN_PLAY("item.goat_horn.play"), + ITEM_GOAT_HORN_SOUND_0("item.goat_horn.sound.0"), + ITEM_GOAT_HORN_SOUND_1("item.goat_horn.sound.1"), + ITEM_GOAT_HORN_SOUND_2("item.goat_horn.sound.2"), + ITEM_GOAT_HORN_SOUND_3("item.goat_horn.sound.3"), + ITEM_GOAT_HORN_SOUND_4("item.goat_horn.sound.4"), + ITEM_GOAT_HORN_SOUND_5("item.goat_horn.sound.5"), + ITEM_GOAT_HORN_SOUND_6("item.goat_horn.sound.6"), + ITEM_GOAT_HORN_SOUND_7("item.goat_horn.sound.7"), + ITEM_HOE_TILL("item.hoe.till"), + ITEM_HONEY_BOTTLE_DRINK("item.honey_bottle.drink"), + ITEM_HONEYCOMB_WAX_ON("item.honeycomb.wax_on"), + ITEM_INK_SAC_USE("item.ink_sac.use"), + ITEM_LODESTONE_COMPASS_LOCK("item.lodestone_compass.lock"), + ITEM_MACE_SMASH_AIR("item.mace.smash_air"), + ITEM_MACE_SMASH_GROUND("item.mace.smash_ground"), + ITEM_MACE_SMASH_GROUND_HEAVY("item.mace.smash_ground_heavy"), + ITEM_NETHER_WART_PLANT("item.nether_wart.plant"), + ITEM_OMINOUS_BOTTLE_DISPOSE("item.ominous_bottle.dispose"), + ITEM_SHIELD_BLOCK("item.shield.block"), + ITEM_SHIELD_BREAK("item.shield.break"), + ITEM_SHOVEL_FLATTEN("item.shovel.flatten"), + ITEM_SPYGLASS_STOP_USING("item.spyglass.stop_using"), + ITEM_SPYGLASS_USE("item.spyglass.use"), + ITEM_TOTEM_USE("item.totem.use"), + ITEM_TRIDENT_HIT("item.trident.hit"), + ITEM_TRIDENT_HIT_GROUND("item.trident.hit_ground"), + ITEM_TRIDENT_RETURN("item.trident.return"), + ITEM_TRIDENT_RIPTIDE_1("item.trident.riptide_1"), + ITEM_TRIDENT_RIPTIDE_2("item.trident.riptide_2"), + ITEM_TRIDENT_RIPTIDE_3("item.trident.riptide_3"), + ITEM_TRIDENT_THROW("item.trident.throw"), + ITEM_TRIDENT_THUNDER("item.trident.thunder"), + ITEM_WOLF_ARMOR_BREAK("item.wolf_armor.break"), + ITEM_WOLF_ARMOR_CRACK("item.wolf_armor.crack"), + ITEM_WOLF_ARMOR_DAMAGE("item.wolf_armor.damage"), + ITEM_WOLF_ARMOR_REPAIR("item.wolf_armor.repair"), + MUSIC_CREATIVE("music.creative"), + MUSIC_CREDITS("music.credits"), + MUSIC_DRAGON("music.dragon"), + MUSIC_END("music.end"), + MUSIC_GAME("music.game"), + MUSIC_MENU("music.menu"), + MUSIC_NETHER_BASALT_DELTAS("music.nether.basalt_deltas"), + MUSIC_NETHER_CRIMSON_FOREST("music.nether.crimson_forest"), + MUSIC_NETHER_NETHER_WASTES("music.nether.nether_wastes"), + MUSIC_NETHER_SOUL_SAND_VALLEY("music.nether.soul_sand_valley"), + MUSIC_NETHER_WARPED_FOREST("music.nether.warped_forest"), + MUSIC_OVERWORLD_BADLANDS("music.overworld.badlands"), + MUSIC_OVERWORLD_BAMBOO_JUNGLE("music.overworld.bamboo_jungle"), + MUSIC_OVERWORLD_CHERRY_GROVE("music.overworld.cherry_grove"), + MUSIC_OVERWORLD_DEEP_DARK("music.overworld.deep_dark"), + MUSIC_OVERWORLD_DESERT("music.overworld.desert"), + MUSIC_OVERWORLD_DRIPSTONE_CAVES("music.overworld.dripstone_caves"), + MUSIC_OVERWORLD_FLOWER_FOREST("music.overworld.flower_forest"), + MUSIC_OVERWORLD_FOREST("music.overworld.forest"), + MUSIC_OVERWORLD_FROZEN_PEAKS("music.overworld.frozen_peaks"), + MUSIC_OVERWORLD_GROVE("music.overworld.grove"), + MUSIC_OVERWORLD_JAGGED_PEAKS("music.overworld.jagged_peaks"), + MUSIC_OVERWORLD_JUNGLE("music.overworld.jungle"), + MUSIC_OVERWORLD_LUSH_CAVES("music.overworld.lush_caves"), + MUSIC_OVERWORLD_MEADOW("music.overworld.meadow"), + MUSIC_OVERWORLD_OLD_GROWTH_TAIGA("music.overworld.old_growth_taiga"), + MUSIC_OVERWORLD_SNOWY_SLOPES("music.overworld.snowy_slopes"), + MUSIC_OVERWORLD_SPARSE_JUNGLE("music.overworld.sparse_jungle"), + MUSIC_OVERWORLD_STONY_PEAKS("music.overworld.stony_peaks"), + MUSIC_OVERWORLD_SWAMP("music.overworld.swamp"), + MUSIC_UNDER_WATER("music.under_water"), + MUSIC_DISC_11("music_disc.11"), + MUSIC_DISC_13("music_disc.13"), + MUSIC_DISC_5("music_disc.5"), + MUSIC_DISC_BLOCKS("music_disc.blocks"), + MUSIC_DISC_CAT("music_disc.cat"), + MUSIC_DISC_CHIRP("music_disc.chirp"), + MUSIC_DISC_CREATOR("music_disc.creator"), + MUSIC_DISC_CREATOR_MUSIC_BOX("music_disc.creator_music_box"), + MUSIC_DISC_FAR("music_disc.far"), + MUSIC_DISC_MALL("music_disc.mall"), + MUSIC_DISC_MELLOHI("music_disc.mellohi"), + MUSIC_DISC_OTHERSIDE("music_disc.otherside"), + MUSIC_DISC_PIGSTEP("music_disc.pigstep"), + MUSIC_DISC_PRECIPICE("music_disc.precipice"), + MUSIC_DISC_RELIC("music_disc.relic"), + MUSIC_DISC_STAL("music_disc.stal"), + MUSIC_DISC_STRAD("music_disc.strad"), + MUSIC_DISC_WAIT("music_disc.wait"), + MUSIC_DISC_WARD("music_disc.ward"), + PARTICLE_SOUL_ESCAPE("particle.soul_escape"), + UI_BUTTON_CLICK("ui.button.click"), + UI_CARTOGRAPHY_TABLE_TAKE_RESULT("ui.cartography_table.take_result"), + UI_LOOM_SELECT_PATTERN("ui.loom.select_pattern"), + UI_LOOM_TAKE_RESULT("ui.loom.take_result"), + UI_STONECUTTER_SELECT_RECIPE("ui.stonecutter.select_recipe"), + UI_STONECUTTER_TAKE_RESULT("ui.stonecutter.take_result"), + UI_TOAST_CHALLENGE_COMPLETE("ui.toast.challenge_complete"), + UI_TOAST_IN("ui.toast.in"), + UI_TOAST_OUT("ui.toast.out"), + WEATHER_RAIN("weather.rain"), + WEATHER_RAIN_ABOVE("weather.rain.above"); + // Paper end - Generated/Sound + + private final NamespacedKey key; + + private Sound(String key) { + this.key = NamespacedKey.minecraft(key); + } + + // Paper start - deprecate getKey + /** + * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#SOUNDS}. Sounds + * can exist without a key. + */ + @Deprecated(since = "1.20.5") + // Paper end - deprecate getKey + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + + // Paper start + @Override + public net.kyori.adventure.key.@NotNull Key key() { + return this.key; + } + // Paper end +} diff --git a/paper-generator/generatedApi/org/bukkit/Statistic.java b/paper-generator/generatedApi/org/bukkit/Statistic.java new file mode 100644 index 0000000000..ee79256ada --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Statistic.java @@ -0,0 +1,180 @@ +package org.bukkit; + +import java.util.Locale; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a countable statistic, which is tracked by the server. + */ +public enum Statistic implements Keyed { + // Paper start - Generated/StatisticCustom + // @GeneratedFrom 1.21.1 + ANIMALS_BRED, + AVIATE_ONE_CM, + BELL_RING, + BOAT_ONE_CM, + ARMOR_CLEANED, + BANNER_CLEANED, + CLEAN_SHULKER_BOX, + CLIMB_ONE_CM, + CROUCH_ONE_CM, + DAMAGE_ABSORBED, + DAMAGE_BLOCKED_BY_SHIELD, + DAMAGE_DEALT, + DAMAGE_DEALT_ABSORBED, + DAMAGE_DEALT_RESISTED, + DAMAGE_RESISTED, + DAMAGE_TAKEN, + DEATHS, + DROP_COUNT, + CAKE_SLICES_EATEN, + ITEM_ENCHANTED, + FALL_ONE_CM, + CAULDRON_FILLED, + FISH_CAUGHT, + FLY_ONE_CM, + HORSE_ONE_CM, + DISPENSER_INSPECTED, + DROPPER_INSPECTED, + HOPPER_INSPECTED, + INTERACT_WITH_ANVIL, + BEACON_INTERACTION, + INTERACT_WITH_BLAST_FURNACE, + BREWINGSTAND_INTERACTION, + INTERACT_WITH_CAMPFIRE, + INTERACT_WITH_CARTOGRAPHY_TABLE, + CRAFTING_TABLE_INTERACTION, + FURNACE_INTERACTION, + INTERACT_WITH_GRINDSTONE, + INTERACT_WITH_LECTERN, + INTERACT_WITH_LOOM, + INTERACT_WITH_SMITHING_TABLE, + INTERACT_WITH_SMOKER, + INTERACT_WITH_STONECUTTER, + JUMP, + LEAVE_GAME, + MINECART_ONE_CM, + MOB_KILLS, + OPEN_BARREL, + CHEST_OPENED, + ENDERCHEST_OPENED, + SHULKER_BOX_OPENED, + PIG_ONE_CM, + NOTEBLOCK_PLAYED, + RECORD_PLAYED, + PLAY_ONE_MINUTE, + PLAYER_KILLS, + FLOWER_POTTED, + RAID_TRIGGER, + RAID_WIN, + SLEEP_IN_BED, + SNEAK_TIME, + SPRINT_ONE_CM, + STRIDER_ONE_CM, + SWIM_ONE_CM, + TALKED_TO_VILLAGER, + TARGET_HIT, + TIME_SINCE_DEATH, + TIME_SINCE_REST, + TOTAL_WORLD_TIME, + TRADED_WITH_VILLAGER, + TRAPPED_CHEST_TRIGGERED, + NOTEBLOCK_TUNED, + CAULDRON_USED, + WALK_ON_WATER_ONE_CM, + WALK_ONE_CM, + WALK_UNDER_WATER_ONE_CM, + // Paper end - Generated/StatisticCustom + // Paper start - Generated/StatisticType + // @GeneratedFrom 1.21.1 + BREAK_ITEM(Type.ITEM), + CRAFT_ITEM(Type.ITEM), + DROP(Type.ITEM), + KILL_ENTITY(Type.ENTITY), + ENTITY_KILLED_BY(Type.ENTITY), + MINE_BLOCK(Type.BLOCK), + PICKUP(Type.ITEM), + USE_ITEM(Type.ITEM); + // Paper end - Generated/StatisticType + + private final Type type; + private final NamespacedKey key; + + private Statistic() { + this(Type.UNTYPED); + } + + private Statistic(/*@NotNull*/ Type type) { + this.type = type; + this.key = NamespacedKey.minecraft(name().toLowerCase(Locale.ROOT)); + } + + /** + * Gets the type of this statistic. + * + * @return the type of this statistic + */ + @NotNull + public Type getType() { + return type; + } + + /** + * Checks if this is a substatistic. + *

+ * A substatistic exists en masse for each block, item, or entitytype, depending on + * {@link #getType()}. + *

+ * This is a redundant method and equivalent to checking + * getType() != Type.UNTYPED + * + * @return true if this is a substatistic + */ + public boolean isSubstatistic() { + return type != Type.UNTYPED; + } + + /** + * Checks if this is a substatistic dealing with blocks. + *

+ * This is a redundant method and equivalent to checking + * getType() == Type.BLOCK + * + * @return true if this deals with blocks + */ + public boolean isBlock() { + return type == Type.BLOCK; + } + + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + + /** + * The type of statistic. + * + */ + public enum Type { + /** + * Statistics of this type do not require a qualifier. + */ + UNTYPED, + + /** + * Statistics of this type require an Item Material qualifier. + */ + ITEM, + + /** + * Statistics of this type require a Block Material qualifier. + */ + BLOCK, + + /** + * Statistics of this type require an EntityType qualifier. + */ + ENTITY; + } +} diff --git a/paper-generator/generatedApi/org/bukkit/Tag.java b/paper-generator/generatedApi/org/bukkit/Tag.java new file mode 100644 index 0000000000..44ac690645 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Tag.java @@ -0,0 +1,836 @@ +package org.bukkit; + +import java.util.Set; +import org.bukkit.entity.EntityType; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a tag that may be defined by the server or a resource pack to + * group like things together. + * + * Note that whilst all tags defined within this interface must be present in + * implementations, their existence is not guaranteed across future versions. + * + *

Custom tags defined by Paper are not present (as constants) in this class. + * To access them please refer to {@link com.destroystokyo.paper.MaterialTags} + * and {@link io.papermc.paper.tag.EntityTags}.

+ * + * @param the type of things grouped by this tag + */ +public interface Tag extends Keyed { + + // Paper start - Generated/Tag + // @GeneratedFrom 1.21.1 + String REGISTRY_BLOCKS = "blocks"; + + Tag ACACIA_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("acacia_logs"), Material.class); + + Tag AIR = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("air"), Material.class); + + Tag ALL_HANGING_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("all_hanging_signs"), Material.class); + + Tag ALL_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("all_signs"), Material.class); + + Tag ANCIENT_CITY_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("ancient_city_replaceable"), Material.class); + + Tag ANIMALS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("animals_spawnable_on"), Material.class); + + Tag ANVIL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("anvil"), Material.class); + + Tag ARMADILLO_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("armadillo_spawnable_on"), Material.class); + + Tag AXOLOTLS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("axolotls_spawnable_on"), Material.class); + + Tag AZALEA_GROWS_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("azalea_grows_on"), Material.class); + + Tag AZALEA_ROOT_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("azalea_root_replaceable"), Material.class); + + Tag BADLANDS_TERRACOTTA = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("badlands_terracotta"), Material.class); + + Tag BAMBOO_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("bamboo_blocks"), Material.class); + + Tag BAMBOO_PLANTABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("bamboo_plantable_on"), Material.class); + + Tag BANNERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("banners"), Material.class); + + Tag BASE_STONE_NETHER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("base_stone_nether"), Material.class); + + Tag BASE_STONE_OVERWORLD = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("base_stone_overworld"), Material.class); + + Tag BEACON_BASE_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("beacon_base_blocks"), Material.class); + + Tag BEDS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("beds"), Material.class); + + Tag BEE_GROWABLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("bee_growables"), Material.class); + + Tag BEEHIVES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("beehives"), Material.class); + + Tag BIG_DRIPLEAF_PLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("big_dripleaf_placeable"), Material.class); + + Tag BIRCH_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("birch_logs"), Material.class); + + Tag BLOCKS_WIND_CHARGE_EXPLOSIONS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("blocks_wind_charge_explosions"), Material.class); + + Tag BUTTONS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("buttons"), Material.class); + + Tag CAMEL_SAND_STEP_SOUND_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("camel_sand_step_sound_blocks"), Material.class); + + Tag CAMPFIRES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("campfires"), Material.class); + + Tag CANDLE_CAKES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("candle_cakes"), Material.class); + + Tag CANDLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("candles"), Material.class); + + Tag CAULDRONS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cauldrons"), Material.class); + + Tag CAVE_VINES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cave_vines"), Material.class); + + Tag CEILING_HANGING_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("ceiling_hanging_signs"), Material.class); + + Tag CHERRY_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cherry_logs"), Material.class); + + Tag CLIMBABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("climbable"), Material.class); + + Tag COAL_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("coal_ores"), Material.class); + + Tag COMBINATION_STEP_SOUND_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("combination_step_sound_blocks"), Material.class); + + Tag COMPLETES_FIND_TREE_TUTORIAL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("completes_find_tree_tutorial"), Material.class); + + Tag CONCRETE_POWDER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("concrete_powder"), Material.class); + + Tag CONVERTABLE_TO_MUD = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("convertable_to_mud"), Material.class); + + Tag COPPER_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("copper_ores"), Material.class); + + Tag CORAL_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("coral_blocks"), Material.class); + + Tag CORAL_PLANTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("coral_plants"), Material.class); + + Tag CORALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("corals"), Material.class); + + Tag CRIMSON_STEMS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("crimson_stems"), Material.class); + + Tag CROPS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("crops"), Material.class); + + Tag CRYSTAL_SOUND_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("crystal_sound_blocks"), Material.class); + + Tag DAMPENS_VIBRATIONS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dampens_vibrations"), Material.class); + + Tag DARK_OAK_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dark_oak_logs"), Material.class); + + Tag DEAD_BUSH_MAY_PLACE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dead_bush_may_place_on"), Material.class); + + Tag DEEPSLATE_ORE_REPLACEABLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("deepslate_ore_replaceables"), Material.class); + + Tag DIAMOND_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("diamond_ores"), Material.class); + + Tag DIRT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dirt"), Material.class); + + Tag DOES_NOT_BLOCK_HOPPERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("does_not_block_hoppers"), Material.class); + + Tag DOORS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("doors"), Material.class); + + Tag DRAGON_IMMUNE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dragon_immune"), Material.class); + + Tag DRAGON_TRANSPARENT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dragon_transparent"), Material.class); + + Tag DRIPSTONE_REPLACEABLE_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dripstone_replaceable_blocks"), Material.class); + + Tag EMERALD_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("emerald_ores"), Material.class); + + Tag ENCHANTMENT_POWER_PROVIDER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("enchantment_power_provider"), Material.class); + + Tag ENCHANTMENT_POWER_TRANSMITTER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("enchantment_power_transmitter"), Material.class); + + Tag ENDERMAN_HOLDABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("enderman_holdable"), Material.class); + + Tag FALL_DAMAGE_RESETTING = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("fall_damage_resetting"), Material.class); + + Tag FEATURES_CANNOT_REPLACE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("features_cannot_replace"), Material.class); + + Tag FENCE_GATES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("fence_gates"), Material.class); + + Tag FENCES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("fences"), Material.class); + + Tag FIRE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("fire"), Material.class); + + Tag FLOWER_POTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("flower_pots"), Material.class); + + Tag FLOWERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("flowers"), Material.class); + + Tag FOXES_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("foxes_spawnable_on"), Material.class); + + Tag FROG_PREFER_JUMP_TO = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("frog_prefer_jump_to"), Material.class); + + Tag FROGS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("frogs_spawnable_on"), Material.class); + + Tag GEODE_INVALID_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("geode_invalid_blocks"), Material.class); + + Tag GOATS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("goats_spawnable_on"), Material.class); + + Tag GOLD_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("gold_ores"), Material.class); + + Tag GUARDED_BY_PIGLINS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("guarded_by_piglins"), Material.class); + + Tag HOGLIN_REPELLENTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("hoglin_repellents"), Material.class); + + Tag ICE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("ice"), Material.class); + + Tag IMPERMEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("impermeable"), Material.class); + + Tag INCORRECT_FOR_DIAMOND_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("incorrect_for_diamond_tool"), Material.class); + + Tag INCORRECT_FOR_GOLD_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("incorrect_for_gold_tool"), Material.class); + + Tag INCORRECT_FOR_IRON_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("incorrect_for_iron_tool"), Material.class); + + Tag INCORRECT_FOR_NETHERITE_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("incorrect_for_netherite_tool"), Material.class); + + Tag INCORRECT_FOR_STONE_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("incorrect_for_stone_tool"), Material.class); + + Tag INCORRECT_FOR_WOODEN_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("incorrect_for_wooden_tool"), Material.class); + + Tag INFINIBURN_END = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("infiniburn_end"), Material.class); + + Tag INFINIBURN_NETHER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("infiniburn_nether"), Material.class); + + Tag INFINIBURN_OVERWORLD = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("infiniburn_overworld"), Material.class); + + Tag INSIDE_STEP_SOUND_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("inside_step_sound_blocks"), Material.class); + + Tag INVALID_SPAWN_INSIDE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("invalid_spawn_inside"), Material.class); + + Tag IRON_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("iron_ores"), Material.class); + + Tag JUNGLE_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("jungle_logs"), Material.class); + + Tag LAPIS_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("lapis_ores"), Material.class); + + Tag LAVA_POOL_STONE_CANNOT_REPLACE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("lava_pool_stone_cannot_replace"), Material.class); + + Tag LEAVES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("leaves"), Material.class); + + Tag LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("logs"), Material.class); + + Tag LOGS_THAT_BURN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("logs_that_burn"), Material.class); + + Tag LUSH_GROUND_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("lush_ground_replaceable"), Material.class); + + Tag MAINTAINS_FARMLAND = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("maintains_farmland"), Material.class); + + Tag MANGROVE_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mangrove_logs"), Material.class); + + Tag MANGROVE_LOGS_CAN_GROW_THROUGH = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mangrove_logs_can_grow_through"), Material.class); + + Tag MANGROVE_ROOTS_CAN_GROW_THROUGH = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mangrove_roots_can_grow_through"), Material.class); + + Tag MINEABLE_AXE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mineable/axe"), Material.class); + + Tag MINEABLE_HOE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mineable/hoe"), Material.class); + + Tag MINEABLE_PICKAXE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mineable/pickaxe"), Material.class); + + Tag MINEABLE_SHOVEL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mineable/shovel"), Material.class); + + Tag MOB_INTERACTABLE_DOORS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mob_interactable_doors"), Material.class); + + Tag MOOSHROOMS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mooshrooms_spawnable_on"), Material.class); + + Tag MOSS_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("moss_replaceable"), Material.class); + + Tag MUSHROOM_GROW_BLOCK = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mushroom_grow_block"), Material.class); + + Tag NEEDS_DIAMOND_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("needs_diamond_tool"), Material.class); + + Tag NEEDS_IRON_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("needs_iron_tool"), Material.class); + + Tag NEEDS_STONE_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("needs_stone_tool"), Material.class); + + Tag NETHER_CARVER_REPLACEABLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("nether_carver_replaceables"), Material.class); + + Tag NYLIUM = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("nylium"), Material.class); + + Tag OAK_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("oak_logs"), Material.class); + + Tag OCCLUDES_VIBRATION_SIGNALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("occludes_vibration_signals"), Material.class); + + Tag OVERWORLD_CARVER_REPLACEABLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("overworld_carver_replaceables"), Material.class); + + Tag OVERWORLD_NATURAL_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("overworld_natural_logs"), Material.class); + + Tag PARROTS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("parrots_spawnable_on"), Material.class); + + Tag PIGLIN_REPELLENTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("piglin_repellents"), Material.class); + + Tag PLANKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("planks"), Material.class); + + Tag POLAR_BEARS_SPAWNABLE_ON_ALTERNATE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("polar_bears_spawnable_on_alternate"), Material.class); + + Tag PORTALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("portals"), Material.class); + + Tag PRESSURE_PLATES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("pressure_plates"), Material.class); + + Tag PREVENT_MOB_SPAWNING_INSIDE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("prevent_mob_spawning_inside"), Material.class); + + Tag RABBITS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("rabbits_spawnable_on"), Material.class); + + Tag RAILS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("rails"), Material.class); + + Tag REDSTONE_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("redstone_ores"), Material.class); + + Tag REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("replaceable"), Material.class); + + Tag REPLACEABLE_BY_TREES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("replaceable_by_trees"), Material.class); + + Tag SAND = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("sand"), Material.class); + + Tag SAPLINGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("saplings"), Material.class); + + Tag SCULK_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("sculk_replaceable"), Material.class); + + Tag SCULK_REPLACEABLE_WORLD_GEN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("sculk_replaceable_world_gen"), Material.class); + + Tag SHULKER_BOXES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("shulker_boxes"), Material.class); + + Tag SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("signs"), Material.class); + + Tag SLABS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("slabs"), Material.class); + + Tag SMALL_DRIPLEAF_PLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("small_dripleaf_placeable"), Material.class); + + Tag SMALL_FLOWERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("small_flowers"), Material.class); + + Tag SMELTS_TO_GLASS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("smelts_to_glass"), Material.class); + + Tag SNAPS_GOAT_HORN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snaps_goat_horn"), Material.class); + + Tag SNIFFER_DIGGABLE_BLOCK = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("sniffer_diggable_block"), Material.class); + + Tag SNIFFER_EGG_HATCH_BOOST = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("sniffer_egg_hatch_boost"), Material.class); + + Tag SNOW = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snow"), Material.class); + + Tag SNOW_LAYER_CAN_SURVIVE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snow_layer_can_survive_on"), Material.class); + + Tag SNOW_LAYER_CANNOT_SURVIVE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snow_layer_cannot_survive_on"), Material.class); + + Tag SOUL_FIRE_BASE_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("soul_fire_base_blocks"), Material.class); + + Tag SOUL_SPEED_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("soul_speed_blocks"), Material.class); + + Tag SPRUCE_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("spruce_logs"), Material.class); + + Tag STAIRS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("stairs"), Material.class); + + Tag STANDING_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("standing_signs"), Material.class); + + Tag STONE_BRICKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("stone_bricks"), Material.class); + + Tag STONE_BUTTONS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("stone_buttons"), Material.class); + + Tag STONE_ORE_REPLACEABLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("stone_ore_replaceables"), Material.class); + + Tag STONE_PRESSURE_PLATES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("stone_pressure_plates"), Material.class); + + Tag STRIDER_WARM_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("strider_warm_blocks"), Material.class); + + Tag SWORD_EFFICIENT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("sword_efficient"), Material.class); + + Tag TALL_FLOWERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("tall_flowers"), Material.class); + + Tag TERRACOTTA = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("terracotta"), Material.class); + + Tag TRAIL_RUINS_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("trail_ruins_replaceable"), Material.class); + + Tag TRAPDOORS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("trapdoors"), Material.class); + + Tag UNDERWATER_BONEMEALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("underwater_bonemeals"), Material.class); + + Tag UNSTABLE_BOTTOM_CENTER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("unstable_bottom_center"), Material.class); + + Tag VALID_SPAWN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("valid_spawn"), Material.class); + + Tag VIBRATION_RESONATORS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("vibration_resonators"), Material.class); + + Tag WALL_CORALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wall_corals"), Material.class); + + Tag WALL_HANGING_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wall_hanging_signs"), Material.class); + + Tag WALL_POST_OVERRIDE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wall_post_override"), Material.class); + + Tag WALL_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wall_signs"), Material.class); + + Tag WALLS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("walls"), Material.class); + + Tag WARPED_STEMS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("warped_stems"), Material.class); + + Tag WART_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wart_blocks"), Material.class); + + Tag WITHER_IMMUNE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wither_immune"), Material.class); + + Tag WITHER_SUMMON_BASE_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wither_summon_base_blocks"), Material.class); + + Tag WOLVES_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wolves_spawnable_on"), Material.class); + + Tag WOODEN_BUTTONS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_buttons"), Material.class); + + Tag WOODEN_DOORS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_doors"), Material.class); + + Tag WOODEN_FENCES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_fences"), Material.class); + + Tag WOODEN_PRESSURE_PLATES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_pressure_plates"), Material.class); + + Tag WOODEN_SLABS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_slabs"), Material.class); + + Tag WOODEN_STAIRS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_stairs"), Material.class); + + Tag WOODEN_TRAPDOORS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_trapdoors"), Material.class); + + Tag WOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wool"), Material.class); + + Tag WOOL_CARPETS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wool_carpets"), Material.class); + + String REGISTRY_ITEMS = "items"; + + Tag ITEMS_ACACIA_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("acacia_logs"), Material.class); + + Tag ITEMS_ANVIL = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("anvil"), Material.class); + + Tag ITEMS_ARMADILLO_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("armadillo_food"), Material.class); + + Tag ITEMS_ARROWS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("arrows"), Material.class); + + Tag ITEMS_AXES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("axes"), Material.class); + + Tag ITEMS_AXOLOTL_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("axolotl_food"), Material.class); + + Tag ITEMS_BAMBOO_BLOCKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("bamboo_blocks"), Material.class); + + Tag ITEMS_BANNERS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("banners"), Material.class); + + Tag ITEMS_BEACON_PAYMENT_ITEMS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("beacon_payment_items"), Material.class); + + Tag ITEMS_BEDS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("beds"), Material.class); + + Tag ITEMS_BEE_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("bee_food"), Material.class); + + Tag ITEMS_BIRCH_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("birch_logs"), Material.class); + + Tag ITEMS_BOATS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("boats"), Material.class); + + Tag ITEMS_BOOKSHELF_BOOKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("bookshelf_books"), Material.class); + + Tag ITEMS_BREAKS_DECORATED_POTS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("breaks_decorated_pots"), Material.class); + + Tag ITEMS_BUTTONS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("buttons"), Material.class); + + Tag ITEMS_CAMEL_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("camel_food"), Material.class); + + Tag ITEMS_CANDLES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("candles"), Material.class); + + Tag ITEMS_CAT_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cat_food"), Material.class); + + Tag ITEMS_CHERRY_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cherry_logs"), Material.class); + + Tag ITEMS_CHEST_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("chest_armor"), Material.class); + + Tag ITEMS_CHEST_BOATS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("chest_boats"), Material.class); + + Tag ITEMS_CHICKEN_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("chicken_food"), Material.class); + + Tag ITEMS_CLUSTER_MAX_HARVESTABLES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cluster_max_harvestables"), Material.class); + + Tag ITEMS_COAL_ORES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("coal_ores"), Material.class); + + Tag ITEMS_COALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("coals"), Material.class); + + Tag ITEMS_COMPASSES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("compasses"), Material.class); + + Tag ITEMS_COMPLETES_FIND_TREE_TUTORIAL = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("completes_find_tree_tutorial"), Material.class); + + Tag ITEMS_COPPER_ORES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("copper_ores"), Material.class); + + Tag ITEMS_COW_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cow_food"), Material.class); + + Tag ITEMS_CREEPER_DROP_MUSIC_DISCS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("creeper_drop_music_discs"), Material.class); + + Tag ITEMS_CREEPER_IGNITERS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("creeper_igniters"), Material.class); + + Tag ITEMS_CRIMSON_STEMS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("crimson_stems"), Material.class); + + Tag ITEMS_DAMPENS_VIBRATIONS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("dampens_vibrations"), Material.class); + + Tag ITEMS_DARK_OAK_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("dark_oak_logs"), Material.class); + + Tag ITEMS_DECORATED_POT_INGREDIENTS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("decorated_pot_ingredients"), Material.class); + + Tag ITEMS_DECORATED_POT_SHERDS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("decorated_pot_sherds"), Material.class); + + Tag ITEMS_DIAMOND_ORES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("diamond_ores"), Material.class); + + Tag ITEMS_DIRT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("dirt"), Material.class); + + Tag ITEMS_DOORS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("doors"), Material.class); + + Tag ITEMS_DYEABLE = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("dyeable"), Material.class); + + Tag ITEMS_EMERALD_ORES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("emerald_ores"), Material.class); + + Tag ITEMS_ENCHANTABLE_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/armor"), Material.class); + + Tag ITEMS_ENCHANTABLE_BOW = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/bow"), Material.class); + + Tag ITEMS_ENCHANTABLE_CHEST_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/chest_armor"), Material.class); + + Tag ITEMS_ENCHANTABLE_CROSSBOW = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/crossbow"), Material.class); + + Tag ITEMS_ENCHANTABLE_DURABILITY = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/durability"), Material.class); + + Tag ITEMS_ENCHANTABLE_EQUIPPABLE = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/equippable"), Material.class); + + Tag ITEMS_ENCHANTABLE_FIRE_ASPECT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/fire_aspect"), Material.class); + + Tag ITEMS_ENCHANTABLE_FISHING = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/fishing"), Material.class); + + Tag ITEMS_ENCHANTABLE_FOOT_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/foot_armor"), Material.class); + + Tag ITEMS_ENCHANTABLE_HEAD_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/head_armor"), Material.class); + + Tag ITEMS_ENCHANTABLE_LEG_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/leg_armor"), Material.class); + + Tag ITEMS_ENCHANTABLE_MACE = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/mace"), Material.class); + + Tag ITEMS_ENCHANTABLE_MINING = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/mining"), Material.class); + + Tag ITEMS_ENCHANTABLE_MINING_LOOT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/mining_loot"), Material.class); + + Tag ITEMS_ENCHANTABLE_SHARP_WEAPON = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/sharp_weapon"), Material.class); + + Tag ITEMS_ENCHANTABLE_SWORD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/sword"), Material.class); + + Tag ITEMS_ENCHANTABLE_TRIDENT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/trident"), Material.class); + + Tag ITEMS_ENCHANTABLE_VANISHING = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/vanishing"), Material.class); + + Tag ITEMS_ENCHANTABLE_WEAPON = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/weapon"), Material.class); + + Tag ITEMS_FENCE_GATES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("fence_gates"), Material.class); + + Tag ITEMS_FENCES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("fences"), Material.class); + + Tag ITEMS_FISHES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("fishes"), Material.class); + + Tag ITEMS_FLOWERS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("flowers"), Material.class); + + Tag ITEMS_FOOT_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("foot_armor"), Material.class); + + Tag ITEMS_FOX_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("fox_food"), Material.class); + + Tag ITEMS_FREEZE_IMMUNE_WEARABLES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("freeze_immune_wearables"), Material.class); + + Tag ITEMS_FROG_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("frog_food"), Material.class); + + Tag ITEMS_GOAT_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("goat_food"), Material.class); + + Tag ITEMS_GOLD_ORES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("gold_ores"), Material.class); + + Tag ITEMS_HANGING_SIGNS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("hanging_signs"), Material.class); + + Tag ITEMS_HEAD_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("head_armor"), Material.class); + + Tag ITEMS_HOES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("hoes"), Material.class); + + Tag ITEMS_HOGLIN_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("hoglin_food"), Material.class); + + Tag ITEMS_HORSE_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("horse_food"), Material.class); + + Tag ITEMS_HORSE_TEMPT_ITEMS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("horse_tempt_items"), Material.class); + + Tag ITEMS_IGNORED_BY_PIGLIN_BABIES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("ignored_by_piglin_babies"), Material.class); + + Tag ITEMS_IRON_ORES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("iron_ores"), Material.class); + + Tag ITEMS_JUNGLE_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("jungle_logs"), Material.class); + + Tag ITEMS_LAPIS_ORES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("lapis_ores"), Material.class); + + Tag ITEMS_LEAVES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("leaves"), Material.class); + + Tag ITEMS_LECTERN_BOOKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("lectern_books"), Material.class); + + Tag ITEMS_LEG_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("leg_armor"), Material.class); + + Tag ITEMS_LLAMA_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("llama_food"), Material.class); + + Tag ITEMS_LLAMA_TEMPT_ITEMS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("llama_tempt_items"), Material.class); + + Tag ITEMS_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("logs"), Material.class); + + Tag ITEMS_LOGS_THAT_BURN = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("logs_that_burn"), Material.class); + + Tag ITEMS_MANGROVE_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("mangrove_logs"), Material.class); + + Tag ITEMS_MEAT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("meat"), Material.class); + + Tag ITEMS_NON_FLAMMABLE_WOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("non_flammable_wood"), Material.class); + + Tag ITEMS_NOTEBLOCK_TOP_INSTRUMENTS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("noteblock_top_instruments"), Material.class); + + Tag ITEMS_OAK_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("oak_logs"), Material.class); + + Tag ITEMS_OCELOT_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("ocelot_food"), Material.class); + + Tag ITEMS_PANDA_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("panda_food"), Material.class); + + Tag ITEMS_PARROT_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("parrot_food"), Material.class); + + Tag ITEMS_PARROT_POISONOUS_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("parrot_poisonous_food"), Material.class); + + Tag ITEMS_PICKAXES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("pickaxes"), Material.class); + + Tag ITEMS_PIG_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("pig_food"), Material.class); + + Tag ITEMS_PIGLIN_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("piglin_food"), Material.class); + + Tag ITEMS_PIGLIN_LOVED = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("piglin_loved"), Material.class); + + Tag ITEMS_PIGLIN_REPELLENTS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("piglin_repellents"), Material.class); + + Tag ITEMS_PLANKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("planks"), Material.class); + + Tag ITEMS_RABBIT_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("rabbit_food"), Material.class); + + Tag ITEMS_RAILS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("rails"), Material.class); + + Tag ITEMS_REDSTONE_ORES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("redstone_ores"), Material.class); + + Tag ITEMS_SAND = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("sand"), Material.class); + + Tag ITEMS_SAPLINGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("saplings"), Material.class); + + Tag ITEMS_SHEEP_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("sheep_food"), Material.class); + + Tag ITEMS_SHOVELS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("shovels"), Material.class); + + Tag ITEMS_SIGNS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("signs"), Material.class); + + Tag ITEMS_SKULLS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("skulls"), Material.class); + + Tag ITEMS_SLABS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("slabs"), Material.class); + + Tag ITEMS_SMALL_FLOWERS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("small_flowers"), Material.class); + + Tag ITEMS_SMELTS_TO_GLASS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("smelts_to_glass"), Material.class); + + Tag ITEMS_SNIFFER_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("sniffer_food"), Material.class); + + Tag ITEMS_SOUL_FIRE_BASE_BLOCKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("soul_fire_base_blocks"), Material.class); + + Tag ITEMS_SPRUCE_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("spruce_logs"), Material.class); + + Tag ITEMS_STAIRS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("stairs"), Material.class); + + Tag ITEMS_STONE_BRICKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("stone_bricks"), Material.class); + + Tag ITEMS_STONE_BUTTONS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("stone_buttons"), Material.class); + + Tag ITEMS_STONE_CRAFTING_MATERIALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("stone_crafting_materials"), Material.class); + + Tag ITEMS_STONE_TOOL_MATERIALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("stone_tool_materials"), Material.class); + + Tag ITEMS_STRIDER_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("strider_food"), Material.class); + + Tag ITEMS_STRIDER_TEMPT_ITEMS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("strider_tempt_items"), Material.class); + + Tag ITEMS_SWORDS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("swords"), Material.class); + + Tag ITEMS_TALL_FLOWERS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("tall_flowers"), Material.class); + + Tag ITEMS_TERRACOTTA = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("terracotta"), Material.class); + + Tag ITEMS_TRAPDOORS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("trapdoors"), Material.class); + + Tag ITEMS_TRIM_MATERIALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("trim_materials"), Material.class); + + Tag ITEMS_TRIM_TEMPLATES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("trim_templates"), Material.class); + + Tag ITEMS_TRIMMABLE_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("trimmable_armor"), Material.class); + + Tag ITEMS_TURTLE_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("turtle_food"), Material.class); + + Tag ITEMS_VILLAGER_PLANTABLE_SEEDS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("villager_plantable_seeds"), Material.class); + + Tag ITEMS_WALLS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("walls"), Material.class); + + Tag ITEMS_WARPED_STEMS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("warped_stems"), Material.class); + + Tag ITEMS_WART_BLOCKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wart_blocks"), Material.class); + + Tag ITEMS_WOLF_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wolf_food"), Material.class); + + Tag ITEMS_WOODEN_BUTTONS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wooden_buttons"), Material.class); + + Tag ITEMS_WOODEN_DOORS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wooden_doors"), Material.class); + + Tag ITEMS_WOODEN_FENCES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wooden_fences"), Material.class); + + Tag ITEMS_WOODEN_PRESSURE_PLATES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wooden_pressure_plates"), Material.class); + + Tag ITEMS_WOODEN_SLABS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wooden_slabs"), Material.class); + + Tag ITEMS_WOODEN_STAIRS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wooden_stairs"), Material.class); + + Tag ITEMS_WOODEN_TRAPDOORS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wooden_trapdoors"), Material.class); + + Tag ITEMS_WOOL = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wool"), Material.class); + + Tag ITEMS_WOOL_CARPETS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wool_carpets"), Material.class); + + String REGISTRY_FLUIDS = "fluids"; + + Tag FLUIDS_LAVA = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("lava"), Fluid.class); + + Tag FLUIDS_WATER = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("water"), Fluid.class); + + String REGISTRY_ENTITY_TYPES = "entity_types"; + + Tag ENTITY_TYPES_AQUATIC = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("aquatic"), EntityType.class); + + Tag ENTITY_TYPES_ARROWS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("arrows"), EntityType.class); + + Tag ENTITY_TYPES_ARTHROPOD = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("arthropod"), EntityType.class); + + Tag ENTITY_TYPES_AXOLOTL_ALWAYS_HOSTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("axolotl_always_hostiles"), EntityType.class); + + Tag ENTITY_TYPES_AXOLOTL_HUNT_TARGETS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("axolotl_hunt_targets"), EntityType.class); + + Tag ENTITY_TYPES_BEEHIVE_INHABITORS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("beehive_inhabitors"), EntityType.class); + + Tag ENTITY_TYPES_CAN_BREATHE_UNDER_WATER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_breathe_under_water"), EntityType.class); + + Tag ENTITY_TYPES_CAN_TURN_IN_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_turn_in_boats"), EntityType.class); + + Tag ENTITY_TYPES_DEFLECTS_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("deflects_projectiles"), EntityType.class); + + Tag ENTITY_TYPES_DISMOUNTS_UNDERWATER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("dismounts_underwater"), EntityType.class); + + Tag ENTITY_TYPES_FALL_DAMAGE_IMMUNE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("fall_damage_immune"), EntityType.class); + + Tag ENTITY_TYPES_FREEZE_HURTS_EXTRA_TYPES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("freeze_hurts_extra_types"), EntityType.class); + + Tag ENTITY_TYPES_FREEZE_IMMUNE_ENTITY_TYPES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("freeze_immune_entity_types"), EntityType.class); + + Tag ENTITY_TYPES_FROG_FOOD = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("frog_food"), EntityType.class); + + Tag ENTITY_TYPES_IGNORES_POISON_AND_REGEN = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("ignores_poison_and_regen"), EntityType.class); + + Tag ENTITY_TYPES_ILLAGER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("illager"), EntityType.class); + + Tag ENTITY_TYPES_ILLAGER_FRIENDS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("illager_friends"), EntityType.class); + + Tag ENTITY_TYPES_IMMUNE_TO_INFESTED = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("immune_to_infested"), EntityType.class); + + Tag ENTITY_TYPES_IMMUNE_TO_OOZING = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("immune_to_oozing"), EntityType.class); + + Tag ENTITY_TYPES_IMPACT_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("impact_projectiles"), EntityType.class); + + Tag ENTITY_TYPES_INVERTED_HEALING_AND_HARM = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("inverted_healing_and_harm"), EntityType.class); + + Tag ENTITY_TYPES_NO_ANGER_FROM_WIND_CHARGE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("no_anger_from_wind_charge"), EntityType.class); + + Tag ENTITY_TYPES_NON_CONTROLLING_RIDER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("non_controlling_rider"), EntityType.class); + + Tag ENTITY_TYPES_NOT_SCARY_FOR_PUFFERFISH = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("not_scary_for_pufferfish"), EntityType.class); + + Tag ENTITY_TYPES_POWDER_SNOW_WALKABLE_MOBS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("powder_snow_walkable_mobs"), EntityType.class); + + Tag ENTITY_TYPES_RAIDERS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("raiders"), EntityType.class); + + Tag ENTITY_TYPES_REDIRECTABLE_PROJECTILE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("redirectable_projectile"), EntityType.class); + + Tag ENTITY_TYPES_SENSITIVE_TO_BANE_OF_ARTHROPODS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("sensitive_to_bane_of_arthropods"), EntityType.class); + + Tag ENTITY_TYPES_SENSITIVE_TO_IMPALING = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("sensitive_to_impaling"), EntityType.class); + + Tag ENTITY_TYPES_SENSITIVE_TO_SMITE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("sensitive_to_smite"), EntityType.class); + + Tag ENTITY_TYPES_SKELETONS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("skeletons"), EntityType.class); + + Tag ENTITY_TYPES_UNDEAD = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("undead"), EntityType.class); + + Tag ENTITY_TYPES_WITHER_FRIENDS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("wither_friends"), EntityType.class); + + Tag ENTITY_TYPES_ZOMBIES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("zombies"), EntityType.class); + + String REGISTRY_GAME_EVENTS = "game_events"; + + Tag GAME_EVENT_ALLAY_CAN_LISTEN = Bukkit.getTag(REGISTRY_GAME_EVENTS, NamespacedKey.minecraft("allay_can_listen"), GameEvent.class); + + Tag GAME_EVENT_IGNORE_VIBRATIONS_SNEAKING = Bukkit.getTag(REGISTRY_GAME_EVENTS, NamespacedKey.minecraft("ignore_vibrations_sneaking"), GameEvent.class); + + Tag GAME_EVENT_SHRIEKER_CAN_LISTEN = Bukkit.getTag(REGISTRY_GAME_EVENTS, NamespacedKey.minecraft("shrieker_can_listen"), GameEvent.class); + + Tag GAME_EVENT_VIBRATIONS = Bukkit.getTag(REGISTRY_GAME_EVENTS, NamespacedKey.minecraft("vibrations"), GameEvent.class); + + Tag GAME_EVENT_WARDEN_CAN_LISTEN = Bukkit.getTag(REGISTRY_GAME_EVENTS, NamespacedKey.minecraft("warden_can_listen"), GameEvent.class); + // Paper end - Generated/Tag + /** + * @deprecated {@link #WOOL_CARPETS}. + */ + @Deprecated + Tag CARPETS = WOOL_CARPETS; + /** + * Vanilla item tag representing all piglin food. + * + * @deprecated use {@link #ITEMS_PIGLIN_FOOD} + */ + @Deprecated + Tag PIGLIN_FOOD = ITEMS_PIGLIN_FOOD; + /** + * Vanilla item tag representing all fox food. + * + * @deprecated use {@link #ITEMS_FOX_FOOD} + */ + @Deprecated + Tag FOX_FOOD = ITEMS_FOX_FOOD; + /** + * Vanilla item tag representing all tools. + * + * @deprecated removed in Minecraft 1.20.5. Do not use. Will be removed at a later date. Until then, + * this constant now acts as a reference to {@link #ITEMS_BREAKS_DECORATED_POTS} which largely shares + * the same contents of the old "minecraft:tools" tag. + */ + @Deprecated(forRemoval = true) + Tag ITEMS_TOOLS = ITEMS_BREAKS_DECORATED_POTS; + /** + * Vanilla item tag representing all items which tempt axolotls. + * + * @deprecated use {@link #ITEMS_AXOLOTL_FOOD} + */ + @Deprecated + Tag AXOLOTL_TEMPT_ITEMS = ITEMS_AXOLOTL_FOOD; + /** + * Vanilla tag representing entities which deflect arrows. + * @deprecated use {@link #ENTITY_TYPES_DEFLECTS_PROJECTILES} + */ + @Deprecated + Tag ENTITY_TYPES_DEFLECTS_ARROWS = ENTITY_TYPES_DEFLECTS_PROJECTILES; + + /** + * Returns whether or not this tag has an entry for the specified item. + * + * @param item to check + * @return if it is tagged + */ + boolean isTagged(@NotNull T item); + + /** + * Gets an immutable set of all tagged items. + * + * @return set of tagged items + */ + @NotNull + Set getValues(); + +} diff --git a/paper-generator/generatedApi/org/bukkit/attribute/Attribute.java b/paper-generator/generatedApi/org/bukkit/attribute/Attribute.java new file mode 100644 index 0000000000..161a498eb1 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/attribute/Attribute.java @@ -0,0 +1,74 @@ +package org.bukkit.attribute; + +import org.bukkit.Bukkit; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Translatable; +import org.jetbrains.annotations.NotNull; + +/** + * Types of attributes which may be present on an {@link Attributable}. + */ +public enum Attribute implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations + + // Paper start - Generated/Attribute + // @GeneratedFrom 1.21.1 + GENERIC_ARMOR("generic.armor"), + GENERIC_ARMOR_TOUGHNESS("generic.armor_toughness"), + GENERIC_ATTACK_DAMAGE("generic.attack_damage"), + GENERIC_ATTACK_KNOCKBACK("generic.attack_knockback"), + GENERIC_ATTACK_SPEED("generic.attack_speed"), + GENERIC_BURNING_TIME("generic.burning_time"), + GENERIC_EXPLOSION_KNOCKBACK_RESISTANCE("generic.explosion_knockback_resistance"), + GENERIC_FALL_DAMAGE_MULTIPLIER("generic.fall_damage_multiplier"), + GENERIC_FLYING_SPEED("generic.flying_speed"), + GENERIC_FOLLOW_RANGE("generic.follow_range"), + GENERIC_GRAVITY("generic.gravity"), + GENERIC_JUMP_STRENGTH("generic.jump_strength"), + GENERIC_KNOCKBACK_RESISTANCE("generic.knockback_resistance"), + GENERIC_LUCK("generic.luck"), + GENERIC_MAX_ABSORPTION("generic.max_absorption"), + GENERIC_MAX_HEALTH("generic.max_health"), + GENERIC_MOVEMENT_EFFICIENCY("generic.movement_efficiency"), + GENERIC_MOVEMENT_SPEED("generic.movement_speed"), + GENERIC_OXYGEN_BONUS("generic.oxygen_bonus"), + GENERIC_SAFE_FALL_DISTANCE("generic.safe_fall_distance"), + GENERIC_SCALE("generic.scale"), + GENERIC_STEP_HEIGHT("generic.step_height"), + GENERIC_WATER_MOVEMENT_EFFICIENCY("generic.water_movement_efficiency"), + PLAYER_BLOCK_BREAK_SPEED("player.block_break_speed"), + PLAYER_BLOCK_INTERACTION_RANGE("player.block_interaction_range"), + PLAYER_ENTITY_INTERACTION_RANGE("player.entity_interaction_range"), + PLAYER_MINING_EFFICIENCY("player.mining_efficiency"), + PLAYER_SNEAKING_SPEED("player.sneaking_speed"), + PLAYER_SUBMERGED_MINING_SPEED("player.submerged_mining_speed"), + PLAYER_SWEEPING_DAMAGE_RATIO("player.sweeping_damage_ratio"), + ZOMBIE_SPAWN_REINFORCEMENTS("zombie.spawn_reinforcements"); + // Paper end - Generated/Attribute + + private final NamespacedKey key; + + private Attribute(String key) { + this.key = NamespacedKey.minecraft(key); + } + + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + + @NotNull + @Override + public String getTranslationKey() { + return Bukkit.getUnsafe().getTranslationKey(this); + } + + // Paper start + @SuppressWarnings("deprecation") + @Override + public @NotNull String translationKey() { + return Bukkit.getUnsafe().getTranslationKey(this); + } + // Paper end +} diff --git a/paper-generator/generatedApi/org/bukkit/block/Biome.java b/paper-generator/generatedApi/org/bukkit/block/Biome.java new file mode 100644 index 0000000000..663fad16c9 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/block/Biome.java @@ -0,0 +1,102 @@ +package org.bukkit.block; + +import java.util.Locale; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; + +/** + * Holds all accepted Biomes in the default server + */ +public enum Biome implements Keyed, net.kyori.adventure.translation.Translatable { // Paper + // Paper start - Generated/Biome + // @GeneratedFrom 1.21.1 + BADLANDS, + BAMBOO_JUNGLE, + BASALT_DELTAS, + BEACH, + BIRCH_FOREST, + CHERRY_GROVE, + COLD_OCEAN, + CRIMSON_FOREST, + DARK_FOREST, + DEEP_COLD_OCEAN, + DEEP_DARK, + DEEP_FROZEN_OCEAN, + DEEP_LUKEWARM_OCEAN, + DEEP_OCEAN, + DESERT, + DRIPSTONE_CAVES, + END_BARRENS, + END_HIGHLANDS, + END_MIDLANDS, + ERODED_BADLANDS, + FLOWER_FOREST, + FOREST, + FROZEN_OCEAN, + FROZEN_PEAKS, + FROZEN_RIVER, + GROVE, + ICE_SPIKES, + JAGGED_PEAKS, + JUNGLE, + LUKEWARM_OCEAN, + LUSH_CAVES, + MANGROVE_SWAMP, + MEADOW, + MUSHROOM_FIELDS, + NETHER_WASTES, + OCEAN, + OLD_GROWTH_BIRCH_FOREST, + OLD_GROWTH_PINE_TAIGA, + OLD_GROWTH_SPRUCE_TAIGA, + PLAINS, + RIVER, + SAVANNA, + SAVANNA_PLATEAU, + SMALL_END_ISLANDS, + SNOWY_BEACH, + SNOWY_PLAINS, + SNOWY_SLOPES, + SNOWY_TAIGA, + SOUL_SAND_VALLEY, + SPARSE_JUNGLE, + STONY_PEAKS, + STONY_SHORE, + SUNFLOWER_PLAINS, + SWAMP, + TAIGA, + THE_END, + THE_VOID, + WARM_OCEAN, + WARPED_FOREST, + WINDSWEPT_FOREST, + WINDSWEPT_GRAVELLY_HILLS, + WINDSWEPT_HILLS, + WINDSWEPT_SAVANNA, + WOODED_BADLANDS, + // Paper end - Generated/Biome + /** + * Represents a custom Biome + */ + CUSTOM; + + private final NamespacedKey key; + + private Biome() { + this.key = NamespacedKey.minecraft(name().toLowerCase(Locale.ROOT)); + } + + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + + // Paper start + @Override + public @NotNull String translationKey() { + return "biome.minecraft." + this.key.getKey(); + } + // Paper end +} diff --git a/paper-generator/generatedApi/org/bukkit/block/BlockType.java b/paper-generator/generatedApi/org/bukkit/block/BlockType.java new file mode 100644 index 0000000000..13866baf0a --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/block/BlockType.java @@ -0,0 +1,2527 @@ +package org.bukkit.block; + +import com.google.common.base.Preconditions; +import java.util.function.Consumer; +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.Translatable; +import org.bukkit.World; +import org.bukkit.block.data.Ageable; +import org.bukkit.block.data.AnaloguePowerable; +import org.bukkit.block.data.Bisected; +import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.Brushable; +import org.bukkit.block.data.Directional; +import org.bukkit.block.data.Hatchable; +import org.bukkit.block.data.Levelled; +import org.bukkit.block.data.Lightable; +import org.bukkit.block.data.MultipleFacing; +import org.bukkit.block.data.Orientable; +import org.bukkit.block.data.Powerable; +import org.bukkit.block.data.Rail; +import org.bukkit.block.data.Rotatable; +import org.bukkit.block.data.Snowable; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.block.data.type.AmethystCluster; +import org.bukkit.block.data.type.Bamboo; +import org.bukkit.block.data.type.Barrel; +import org.bukkit.block.data.type.Bed; +import org.bukkit.block.data.type.Beehive; +import org.bukkit.block.data.type.Bell; +import org.bukkit.block.data.type.BigDripleaf; +import org.bukkit.block.data.type.BrewingStand; +import org.bukkit.block.data.type.BubbleColumn; +import org.bukkit.block.data.type.Cake; +import org.bukkit.block.data.type.CalibratedSculkSensor; +import org.bukkit.block.data.type.Campfire; +import org.bukkit.block.data.type.Candle; +import org.bukkit.block.data.type.CaveVines; +import org.bukkit.block.data.type.CaveVinesPlant; +import org.bukkit.block.data.type.Chain; +import org.bukkit.block.data.type.Chest; +import org.bukkit.block.data.type.ChiseledBookshelf; +import org.bukkit.block.data.type.Cocoa; +import org.bukkit.block.data.type.CommandBlock; +import org.bukkit.block.data.type.Comparator; +import org.bukkit.block.data.type.CopperBulb; +import org.bukkit.block.data.type.CoralWallFan; +import org.bukkit.block.data.type.Crafter; +import org.bukkit.block.data.type.DaylightDetector; +import org.bukkit.block.data.type.DecoratedPot; +import org.bukkit.block.data.type.Dispenser; +import org.bukkit.block.data.type.Door; +import org.bukkit.block.data.type.Dripleaf; +import org.bukkit.block.data.type.EndPortalFrame; +import org.bukkit.block.data.type.EnderChest; +import org.bukkit.block.data.type.Farmland; +import org.bukkit.block.data.type.Fence; +import org.bukkit.block.data.type.Fire; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.block.data.type.Gate; +import org.bukkit.block.data.type.GlassPane; +import org.bukkit.block.data.type.GlowLichen; +import org.bukkit.block.data.type.Grindstone; +import org.bukkit.block.data.type.HangingSign; +import org.bukkit.block.data.type.Hopper; +import org.bukkit.block.data.type.Jigsaw; +import org.bukkit.block.data.type.Jukebox; +import org.bukkit.block.data.type.Ladder; +import org.bukkit.block.data.type.Lantern; +import org.bukkit.block.data.type.Leaves; +import org.bukkit.block.data.type.Lectern; +import org.bukkit.block.data.type.Light; +import org.bukkit.block.data.type.LightningRod; +import org.bukkit.block.data.type.MangrovePropagule; +import org.bukkit.block.data.type.NoteBlock; +import org.bukkit.block.data.type.Observer; +import org.bukkit.block.data.type.PinkPetals; +import org.bukkit.block.data.type.Piston; +import org.bukkit.block.data.type.PistonHead; +import org.bukkit.block.data.type.PitcherCrop; +import org.bukkit.block.data.type.PointedDripstone; +import org.bukkit.block.data.type.RedstoneRail; +import org.bukkit.block.data.type.RedstoneWallTorch; +import org.bukkit.block.data.type.RedstoneWire; +import org.bukkit.block.data.type.Repeater; +import org.bukkit.block.data.type.RespawnAnchor; +import org.bukkit.block.data.type.Sapling; +import org.bukkit.block.data.type.Scaffolding; +import org.bukkit.block.data.type.SculkCatalyst; +import org.bukkit.block.data.type.SculkSensor; +import org.bukkit.block.data.type.SculkShrieker; +import org.bukkit.block.data.type.SculkVein; +import org.bukkit.block.data.type.SeaPickle; +import org.bukkit.block.data.type.Sign; +import org.bukkit.block.data.type.Skull; +import org.bukkit.block.data.type.Slab; +import org.bukkit.block.data.type.SmallDripleaf; +import org.bukkit.block.data.type.Snow; +import org.bukkit.block.data.type.Stairs; +import org.bukkit.block.data.type.StructureBlock; +import org.bukkit.block.data.type.Switch; +import org.bukkit.block.data.type.TNT; +import org.bukkit.block.data.type.TechnicalPiston; +import org.bukkit.block.data.type.TrapDoor; +import org.bukkit.block.data.type.TrialSpawner; +import org.bukkit.block.data.type.Tripwire; +import org.bukkit.block.data.type.TripwireHook; +import org.bukkit.block.data.type.TurtleEgg; +import org.bukkit.block.data.type.Vault; +import org.bukkit.block.data.type.Wall; +import org.bukkit.block.data.type.WallHangingSign; +import org.bukkit.block.data.type.WallSign; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.inventory.ItemType; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * While this API is in a public interface, it is not intended for use by + * plugins until further notice. The purpose of these types is to make + * {@link Material} more maintenance friendly, but will in due time be the + * official replacement for the aforementioned enum. Entirely incompatible + * changes may occur. Do not use this API in plugins. + */ +@ApiStatus.Internal +public interface BlockType extends Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - add translatable & feature flag API + + /** + * Typed represents a subtype of {@link BlockType}s that have a known block + * data type at compile time. + * + * @param the generic type of the block data that represents the block + * type. + */ + interface Typed extends BlockType { + + /** + * Gets the BlockData class of this BlockType + * + * @return the BlockData class of this BlockType + */ + @NotNull + @Override + Class getBlockDataClass(); + + /** + * Creates a new {@link BlockData} instance for this block type, with + * all properties initialized to unspecified defaults. + * + * @param consumer consumer to run on new instance before returning + * @return new data instance + */ + @NotNull + B createBlockData(@Nullable Consumer consumer); + + /** + * Creates a new {@link BlockData} instance for this block type, with all + * properties initialized to unspecified defaults. + * + * @return new data instance + */ + @NotNull + @Override + B createBlockData(); + + /** + * Creates a new {@link BlockData} instance for this block type, with all + * properties initialized to unspecified defaults, except for those provided + * in data. + * + * @param data data string + * @return new data instance + * @throws IllegalArgumentException if the specified data is not valid + */ + @NotNull + B createBlockData(@Nullable String data); + } + + // + // Paper start - Generated/BlockType + // @GeneratedFrom 1.21.1 + BlockType.Typed ACACIA_BUTTON = getBlockType("acacia_button"); + + BlockType.Typed ACACIA_DOOR = getBlockType("acacia_door"); + + BlockType.Typed ACACIA_FENCE = getBlockType("acacia_fence"); + + BlockType.Typed ACACIA_FENCE_GATE = getBlockType("acacia_fence_gate"); + + BlockType.Typed ACACIA_HANGING_SIGN = getBlockType("acacia_hanging_sign"); + + BlockType.Typed ACACIA_LEAVES = getBlockType("acacia_leaves"); + + BlockType.Typed ACACIA_LOG = getBlockType("acacia_log"); + + BlockType.Typed ACACIA_PLANKS = getBlockType("acacia_planks"); + + BlockType.Typed ACACIA_PRESSURE_PLATE = getBlockType("acacia_pressure_plate"); + + BlockType.Typed ACACIA_SAPLING = getBlockType("acacia_sapling"); + + BlockType.Typed ACACIA_SIGN = getBlockType("acacia_sign"); + + BlockType.Typed ACACIA_SLAB = getBlockType("acacia_slab"); + + BlockType.Typed ACACIA_STAIRS = getBlockType("acacia_stairs"); + + BlockType.Typed ACACIA_TRAPDOOR = getBlockType("acacia_trapdoor"); + + BlockType.Typed ACACIA_WALL_HANGING_SIGN = getBlockType("acacia_wall_hanging_sign"); + + BlockType.Typed ACACIA_WALL_SIGN = getBlockType("acacia_wall_sign"); + + BlockType.Typed ACACIA_WOOD = getBlockType("acacia_wood"); + + BlockType.Typed ACTIVATOR_RAIL = getBlockType("activator_rail"); + + BlockType.Typed AIR = getBlockType("air"); + + BlockType.Typed ALLIUM = getBlockType("allium"); + + BlockType.Typed AMETHYST_BLOCK = getBlockType("amethyst_block"); + + BlockType.Typed AMETHYST_CLUSTER = getBlockType("amethyst_cluster"); + + BlockType.Typed ANCIENT_DEBRIS = getBlockType("ancient_debris"); + + BlockType.Typed ANDESITE = getBlockType("andesite"); + + BlockType.Typed ANDESITE_SLAB = getBlockType("andesite_slab"); + + BlockType.Typed ANDESITE_STAIRS = getBlockType("andesite_stairs"); + + BlockType.Typed ANDESITE_WALL = getBlockType("andesite_wall"); + + BlockType.Typed ANVIL = getBlockType("anvil"); + + BlockType.Typed ATTACHED_MELON_STEM = getBlockType("attached_melon_stem"); + + BlockType.Typed ATTACHED_PUMPKIN_STEM = getBlockType("attached_pumpkin_stem"); + + BlockType.Typed AZALEA = getBlockType("azalea"); + + BlockType.Typed AZALEA_LEAVES = getBlockType("azalea_leaves"); + + BlockType.Typed AZURE_BLUET = getBlockType("azure_bluet"); + + BlockType.Typed BAMBOO = getBlockType("bamboo"); + + BlockType.Typed BAMBOO_BLOCK = getBlockType("bamboo_block"); + + BlockType.Typed BAMBOO_BUTTON = getBlockType("bamboo_button"); + + BlockType.Typed BAMBOO_DOOR = getBlockType("bamboo_door"); + + BlockType.Typed BAMBOO_FENCE = getBlockType("bamboo_fence"); + + BlockType.Typed BAMBOO_FENCE_GATE = getBlockType("bamboo_fence_gate"); + + BlockType.Typed BAMBOO_HANGING_SIGN = getBlockType("bamboo_hanging_sign"); + + BlockType.Typed BAMBOO_MOSAIC = getBlockType("bamboo_mosaic"); + + BlockType.Typed BAMBOO_MOSAIC_SLAB = getBlockType("bamboo_mosaic_slab"); + + BlockType.Typed BAMBOO_MOSAIC_STAIRS = getBlockType("bamboo_mosaic_stairs"); + + BlockType.Typed BAMBOO_PLANKS = getBlockType("bamboo_planks"); + + BlockType.Typed BAMBOO_PRESSURE_PLATE = getBlockType("bamboo_pressure_plate"); + + BlockType.Typed BAMBOO_SAPLING = getBlockType("bamboo_sapling"); + + BlockType.Typed BAMBOO_SIGN = getBlockType("bamboo_sign"); + + BlockType.Typed BAMBOO_SLAB = getBlockType("bamboo_slab"); + + BlockType.Typed BAMBOO_STAIRS = getBlockType("bamboo_stairs"); + + BlockType.Typed BAMBOO_TRAPDOOR = getBlockType("bamboo_trapdoor"); + + BlockType.Typed BAMBOO_WALL_HANGING_SIGN = getBlockType("bamboo_wall_hanging_sign"); + + BlockType.Typed BAMBOO_WALL_SIGN = getBlockType("bamboo_wall_sign"); + + BlockType.Typed BARREL = getBlockType("barrel"); + + BlockType.Typed BARRIER = getBlockType("barrier"); + + BlockType.Typed BASALT = getBlockType("basalt"); + + BlockType.Typed BEACON = getBlockType("beacon"); + + BlockType.Typed BEDROCK = getBlockType("bedrock"); + + BlockType.Typed BEE_NEST = getBlockType("bee_nest"); + + BlockType.Typed BEEHIVE = getBlockType("beehive"); + + BlockType.Typed BEETROOTS = getBlockType("beetroots"); + + BlockType.Typed BELL = getBlockType("bell"); + + BlockType.Typed BIG_DRIPLEAF = getBlockType("big_dripleaf"); + + BlockType.Typed BIG_DRIPLEAF_STEM = getBlockType("big_dripleaf_stem"); + + BlockType.Typed BIRCH_BUTTON = getBlockType("birch_button"); + + BlockType.Typed BIRCH_DOOR = getBlockType("birch_door"); + + BlockType.Typed BIRCH_FENCE = getBlockType("birch_fence"); + + BlockType.Typed BIRCH_FENCE_GATE = getBlockType("birch_fence_gate"); + + BlockType.Typed BIRCH_HANGING_SIGN = getBlockType("birch_hanging_sign"); + + BlockType.Typed BIRCH_LEAVES = getBlockType("birch_leaves"); + + BlockType.Typed BIRCH_LOG = getBlockType("birch_log"); + + BlockType.Typed BIRCH_PLANKS = getBlockType("birch_planks"); + + BlockType.Typed BIRCH_PRESSURE_PLATE = getBlockType("birch_pressure_plate"); + + BlockType.Typed BIRCH_SAPLING = getBlockType("birch_sapling"); + + BlockType.Typed BIRCH_SIGN = getBlockType("birch_sign"); + + BlockType.Typed BIRCH_SLAB = getBlockType("birch_slab"); + + BlockType.Typed BIRCH_STAIRS = getBlockType("birch_stairs"); + + BlockType.Typed BIRCH_TRAPDOOR = getBlockType("birch_trapdoor"); + + BlockType.Typed BIRCH_WALL_HANGING_SIGN = getBlockType("birch_wall_hanging_sign"); + + BlockType.Typed BIRCH_WALL_SIGN = getBlockType("birch_wall_sign"); + + BlockType.Typed BIRCH_WOOD = getBlockType("birch_wood"); + + BlockType.Typed BLACK_BANNER = getBlockType("black_banner"); + + BlockType.Typed BLACK_BED = getBlockType("black_bed"); + + BlockType.Typed BLACK_CANDLE = getBlockType("black_candle"); + + BlockType.Typed BLACK_CANDLE_CAKE = getBlockType("black_candle_cake"); + + BlockType.Typed BLACK_CARPET = getBlockType("black_carpet"); + + BlockType.Typed BLACK_CONCRETE = getBlockType("black_concrete"); + + BlockType.Typed BLACK_CONCRETE_POWDER = getBlockType("black_concrete_powder"); + + BlockType.Typed BLACK_GLAZED_TERRACOTTA = getBlockType("black_glazed_terracotta"); + + BlockType.Typed BLACK_SHULKER_BOX = getBlockType("black_shulker_box"); + + BlockType.Typed BLACK_STAINED_GLASS = getBlockType("black_stained_glass"); + + BlockType.Typed BLACK_STAINED_GLASS_PANE = getBlockType("black_stained_glass_pane"); + + BlockType.Typed BLACK_TERRACOTTA = getBlockType("black_terracotta"); + + BlockType.Typed BLACK_WALL_BANNER = getBlockType("black_wall_banner"); + + BlockType.Typed BLACK_WOOL = getBlockType("black_wool"); + + BlockType.Typed BLACKSTONE = getBlockType("blackstone"); + + BlockType.Typed BLACKSTONE_SLAB = getBlockType("blackstone_slab"); + + BlockType.Typed BLACKSTONE_STAIRS = getBlockType("blackstone_stairs"); + + BlockType.Typed BLACKSTONE_WALL = getBlockType("blackstone_wall"); + + BlockType.Typed BLAST_FURNACE = getBlockType("blast_furnace"); + + BlockType.Typed BLUE_BANNER = getBlockType("blue_banner"); + + BlockType.Typed BLUE_BED = getBlockType("blue_bed"); + + BlockType.Typed BLUE_CANDLE = getBlockType("blue_candle"); + + BlockType.Typed BLUE_CANDLE_CAKE = getBlockType("blue_candle_cake"); + + BlockType.Typed BLUE_CARPET = getBlockType("blue_carpet"); + + BlockType.Typed BLUE_CONCRETE = getBlockType("blue_concrete"); + + BlockType.Typed BLUE_CONCRETE_POWDER = getBlockType("blue_concrete_powder"); + + BlockType.Typed BLUE_GLAZED_TERRACOTTA = getBlockType("blue_glazed_terracotta"); + + BlockType.Typed BLUE_ICE = getBlockType("blue_ice"); + + BlockType.Typed BLUE_ORCHID = getBlockType("blue_orchid"); + + BlockType.Typed BLUE_SHULKER_BOX = getBlockType("blue_shulker_box"); + + BlockType.Typed BLUE_STAINED_GLASS = getBlockType("blue_stained_glass"); + + BlockType.Typed BLUE_STAINED_GLASS_PANE = getBlockType("blue_stained_glass_pane"); + + BlockType.Typed BLUE_TERRACOTTA = getBlockType("blue_terracotta"); + + BlockType.Typed BLUE_WALL_BANNER = getBlockType("blue_wall_banner"); + + BlockType.Typed BLUE_WOOL = getBlockType("blue_wool"); + + BlockType.Typed BONE_BLOCK = getBlockType("bone_block"); + + BlockType.Typed BOOKSHELF = getBlockType("bookshelf"); + + BlockType.Typed BRAIN_CORAL = getBlockType("brain_coral"); + + BlockType.Typed BRAIN_CORAL_BLOCK = getBlockType("brain_coral_block"); + + BlockType.Typed BRAIN_CORAL_FAN = getBlockType("brain_coral_fan"); + + BlockType.Typed BRAIN_CORAL_WALL_FAN = getBlockType("brain_coral_wall_fan"); + + BlockType.Typed BREWING_STAND = getBlockType("brewing_stand"); + + BlockType.Typed BRICK_SLAB = getBlockType("brick_slab"); + + BlockType.Typed BRICK_STAIRS = getBlockType("brick_stairs"); + + BlockType.Typed BRICK_WALL = getBlockType("brick_wall"); + + BlockType.Typed BRICKS = getBlockType("bricks"); + + BlockType.Typed BROWN_BANNER = getBlockType("brown_banner"); + + BlockType.Typed BROWN_BED = getBlockType("brown_bed"); + + BlockType.Typed BROWN_CANDLE = getBlockType("brown_candle"); + + BlockType.Typed BROWN_CANDLE_CAKE = getBlockType("brown_candle_cake"); + + BlockType.Typed BROWN_CARPET = getBlockType("brown_carpet"); + + BlockType.Typed BROWN_CONCRETE = getBlockType("brown_concrete"); + + BlockType.Typed BROWN_CONCRETE_POWDER = getBlockType("brown_concrete_powder"); + + BlockType.Typed BROWN_GLAZED_TERRACOTTA = getBlockType("brown_glazed_terracotta"); + + BlockType.Typed BROWN_MUSHROOM = getBlockType("brown_mushroom"); + + BlockType.Typed BROWN_MUSHROOM_BLOCK = getBlockType("brown_mushroom_block"); + + BlockType.Typed BROWN_SHULKER_BOX = getBlockType("brown_shulker_box"); + + BlockType.Typed BROWN_STAINED_GLASS = getBlockType("brown_stained_glass"); + + BlockType.Typed BROWN_STAINED_GLASS_PANE = getBlockType("brown_stained_glass_pane"); + + BlockType.Typed BROWN_TERRACOTTA = getBlockType("brown_terracotta"); + + BlockType.Typed BROWN_WALL_BANNER = getBlockType("brown_wall_banner"); + + BlockType.Typed BROWN_WOOL = getBlockType("brown_wool"); + + BlockType.Typed BUBBLE_COLUMN = getBlockType("bubble_column"); + + BlockType.Typed BUBBLE_CORAL = getBlockType("bubble_coral"); + + BlockType.Typed BUBBLE_CORAL_BLOCK = getBlockType("bubble_coral_block"); + + BlockType.Typed BUBBLE_CORAL_FAN = getBlockType("bubble_coral_fan"); + + BlockType.Typed BUBBLE_CORAL_WALL_FAN = getBlockType("bubble_coral_wall_fan"); + + BlockType.Typed BUDDING_AMETHYST = getBlockType("budding_amethyst"); + + BlockType.Typed CACTUS = getBlockType("cactus"); + + BlockType.Typed CAKE = getBlockType("cake"); + + BlockType.Typed CALCITE = getBlockType("calcite"); + + BlockType.Typed CALIBRATED_SCULK_SENSOR = getBlockType("calibrated_sculk_sensor"); + + BlockType.Typed CAMPFIRE = getBlockType("campfire"); + + BlockType.Typed CANDLE = getBlockType("candle"); + + BlockType.Typed CANDLE_CAKE = getBlockType("candle_cake"); + + BlockType.Typed CARROTS = getBlockType("carrots"); + + BlockType.Typed CARTOGRAPHY_TABLE = getBlockType("cartography_table"); + + BlockType.Typed CARVED_PUMPKIN = getBlockType("carved_pumpkin"); + + BlockType.Typed CAULDRON = getBlockType("cauldron"); + + BlockType.Typed CAVE_AIR = getBlockType("cave_air"); + + BlockType.Typed CAVE_VINES = getBlockType("cave_vines"); + + BlockType.Typed CAVE_VINES_PLANT = getBlockType("cave_vines_plant"); + + BlockType.Typed CHAIN = getBlockType("chain"); + + BlockType.Typed CHAIN_COMMAND_BLOCK = getBlockType("chain_command_block"); + + BlockType.Typed CHERRY_BUTTON = getBlockType("cherry_button"); + + BlockType.Typed CHERRY_DOOR = getBlockType("cherry_door"); + + BlockType.Typed CHERRY_FENCE = getBlockType("cherry_fence"); + + BlockType.Typed CHERRY_FENCE_GATE = getBlockType("cherry_fence_gate"); + + BlockType.Typed CHERRY_HANGING_SIGN = getBlockType("cherry_hanging_sign"); + + BlockType.Typed CHERRY_LEAVES = getBlockType("cherry_leaves"); + + BlockType.Typed CHERRY_LOG = getBlockType("cherry_log"); + + BlockType.Typed CHERRY_PLANKS = getBlockType("cherry_planks"); + + BlockType.Typed CHERRY_PRESSURE_PLATE = getBlockType("cherry_pressure_plate"); + + BlockType.Typed CHERRY_SAPLING = getBlockType("cherry_sapling"); + + BlockType.Typed CHERRY_SIGN = getBlockType("cherry_sign"); + + BlockType.Typed CHERRY_SLAB = getBlockType("cherry_slab"); + + BlockType.Typed CHERRY_STAIRS = getBlockType("cherry_stairs"); + + BlockType.Typed CHERRY_TRAPDOOR = getBlockType("cherry_trapdoor"); + + BlockType.Typed CHERRY_WALL_HANGING_SIGN = getBlockType("cherry_wall_hanging_sign"); + + BlockType.Typed CHERRY_WALL_SIGN = getBlockType("cherry_wall_sign"); + + BlockType.Typed CHERRY_WOOD = getBlockType("cherry_wood"); + + BlockType.Typed CHEST = getBlockType("chest"); + + BlockType.Typed CHIPPED_ANVIL = getBlockType("chipped_anvil"); + + BlockType.Typed CHISELED_BOOKSHELF = getBlockType("chiseled_bookshelf"); + + BlockType.Typed CHISELED_COPPER = getBlockType("chiseled_copper"); + + BlockType.Typed CHISELED_DEEPSLATE = getBlockType("chiseled_deepslate"); + + BlockType.Typed CHISELED_NETHER_BRICKS = getBlockType("chiseled_nether_bricks"); + + BlockType.Typed CHISELED_POLISHED_BLACKSTONE = getBlockType("chiseled_polished_blackstone"); + + BlockType.Typed CHISELED_QUARTZ_BLOCK = getBlockType("chiseled_quartz_block"); + + BlockType.Typed CHISELED_RED_SANDSTONE = getBlockType("chiseled_red_sandstone"); + + BlockType.Typed CHISELED_SANDSTONE = getBlockType("chiseled_sandstone"); + + BlockType.Typed CHISELED_STONE_BRICKS = getBlockType("chiseled_stone_bricks"); + + BlockType.Typed CHISELED_TUFF = getBlockType("chiseled_tuff"); + + BlockType.Typed CHISELED_TUFF_BRICKS = getBlockType("chiseled_tuff_bricks"); + + BlockType.Typed CHORUS_FLOWER = getBlockType("chorus_flower"); + + BlockType.Typed CHORUS_PLANT = getBlockType("chorus_plant"); + + BlockType.Typed CLAY = getBlockType("clay"); + + BlockType.Typed COAL_BLOCK = getBlockType("coal_block"); + + BlockType.Typed COAL_ORE = getBlockType("coal_ore"); + + BlockType.Typed COARSE_DIRT = getBlockType("coarse_dirt"); + + BlockType.Typed COBBLED_DEEPSLATE = getBlockType("cobbled_deepslate"); + + BlockType.Typed COBBLED_DEEPSLATE_SLAB = getBlockType("cobbled_deepslate_slab"); + + BlockType.Typed COBBLED_DEEPSLATE_STAIRS = getBlockType("cobbled_deepslate_stairs"); + + BlockType.Typed COBBLED_DEEPSLATE_WALL = getBlockType("cobbled_deepslate_wall"); + + BlockType.Typed COBBLESTONE = getBlockType("cobblestone"); + + BlockType.Typed COBBLESTONE_SLAB = getBlockType("cobblestone_slab"); + + BlockType.Typed COBBLESTONE_STAIRS = getBlockType("cobblestone_stairs"); + + BlockType.Typed COBBLESTONE_WALL = getBlockType("cobblestone_wall"); + + BlockType.Typed COBWEB = getBlockType("cobweb"); + + BlockType.Typed COCOA = getBlockType("cocoa"); + + BlockType.Typed COMMAND_BLOCK = getBlockType("command_block"); + + BlockType.Typed COMPARATOR = getBlockType("comparator"); + + BlockType.Typed COMPOSTER = getBlockType("composter"); + + BlockType.Typed CONDUIT = getBlockType("conduit"); + + BlockType.Typed COPPER_BLOCK = getBlockType("copper_block"); + + BlockType.Typed COPPER_BULB = getBlockType("copper_bulb"); + + BlockType.Typed COPPER_DOOR = getBlockType("copper_door"); + + BlockType.Typed COPPER_GRATE = getBlockType("copper_grate"); + + BlockType.Typed COPPER_ORE = getBlockType("copper_ore"); + + BlockType.Typed COPPER_TRAPDOOR = getBlockType("copper_trapdoor"); + + BlockType.Typed CORNFLOWER = getBlockType("cornflower"); + + BlockType.Typed CRACKED_DEEPSLATE_BRICKS = getBlockType("cracked_deepslate_bricks"); + + BlockType.Typed CRACKED_DEEPSLATE_TILES = getBlockType("cracked_deepslate_tiles"); + + BlockType.Typed CRACKED_NETHER_BRICKS = getBlockType("cracked_nether_bricks"); + + BlockType.Typed CRACKED_POLISHED_BLACKSTONE_BRICKS = getBlockType("cracked_polished_blackstone_bricks"); + + BlockType.Typed CRACKED_STONE_BRICKS = getBlockType("cracked_stone_bricks"); + + BlockType.Typed CRAFTER = getBlockType("crafter"); + + BlockType.Typed CRAFTING_TABLE = getBlockType("crafting_table"); + + BlockType.Typed CREEPER_HEAD = getBlockType("creeper_head"); + + BlockType.Typed CREEPER_WALL_HEAD = getBlockType("creeper_wall_head"); + + BlockType.Typed CRIMSON_BUTTON = getBlockType("crimson_button"); + + BlockType.Typed CRIMSON_DOOR = getBlockType("crimson_door"); + + BlockType.Typed CRIMSON_FENCE = getBlockType("crimson_fence"); + + BlockType.Typed CRIMSON_FENCE_GATE = getBlockType("crimson_fence_gate"); + + BlockType.Typed CRIMSON_FUNGUS = getBlockType("crimson_fungus"); + + BlockType.Typed CRIMSON_HANGING_SIGN = getBlockType("crimson_hanging_sign"); + + BlockType.Typed CRIMSON_HYPHAE = getBlockType("crimson_hyphae"); + + BlockType.Typed CRIMSON_NYLIUM = getBlockType("crimson_nylium"); + + BlockType.Typed CRIMSON_PLANKS = getBlockType("crimson_planks"); + + BlockType.Typed CRIMSON_PRESSURE_PLATE = getBlockType("crimson_pressure_plate"); + + BlockType.Typed CRIMSON_ROOTS = getBlockType("crimson_roots"); + + BlockType.Typed CRIMSON_SIGN = getBlockType("crimson_sign"); + + BlockType.Typed CRIMSON_SLAB = getBlockType("crimson_slab"); + + BlockType.Typed CRIMSON_STAIRS = getBlockType("crimson_stairs"); + + BlockType.Typed CRIMSON_STEM = getBlockType("crimson_stem"); + + BlockType.Typed CRIMSON_TRAPDOOR = getBlockType("crimson_trapdoor"); + + BlockType.Typed CRIMSON_WALL_HANGING_SIGN = getBlockType("crimson_wall_hanging_sign"); + + BlockType.Typed CRIMSON_WALL_SIGN = getBlockType("crimson_wall_sign"); + + BlockType.Typed CRYING_OBSIDIAN = getBlockType("crying_obsidian"); + + BlockType.Typed CUT_COPPER = getBlockType("cut_copper"); + + BlockType.Typed CUT_COPPER_SLAB = getBlockType("cut_copper_slab"); + + BlockType.Typed CUT_COPPER_STAIRS = getBlockType("cut_copper_stairs"); + + BlockType.Typed CUT_RED_SANDSTONE = getBlockType("cut_red_sandstone"); + + BlockType.Typed CUT_RED_SANDSTONE_SLAB = getBlockType("cut_red_sandstone_slab"); + + BlockType.Typed CUT_SANDSTONE = getBlockType("cut_sandstone"); + + BlockType.Typed CUT_SANDSTONE_SLAB = getBlockType("cut_sandstone_slab"); + + BlockType.Typed CYAN_BANNER = getBlockType("cyan_banner"); + + BlockType.Typed CYAN_BED = getBlockType("cyan_bed"); + + BlockType.Typed CYAN_CANDLE = getBlockType("cyan_candle"); + + BlockType.Typed CYAN_CANDLE_CAKE = getBlockType("cyan_candle_cake"); + + BlockType.Typed CYAN_CARPET = getBlockType("cyan_carpet"); + + BlockType.Typed CYAN_CONCRETE = getBlockType("cyan_concrete"); + + BlockType.Typed CYAN_CONCRETE_POWDER = getBlockType("cyan_concrete_powder"); + + BlockType.Typed CYAN_GLAZED_TERRACOTTA = getBlockType("cyan_glazed_terracotta"); + + BlockType.Typed CYAN_SHULKER_BOX = getBlockType("cyan_shulker_box"); + + BlockType.Typed CYAN_STAINED_GLASS = getBlockType("cyan_stained_glass"); + + BlockType.Typed CYAN_STAINED_GLASS_PANE = getBlockType("cyan_stained_glass_pane"); + + BlockType.Typed CYAN_TERRACOTTA = getBlockType("cyan_terracotta"); + + BlockType.Typed CYAN_WALL_BANNER = getBlockType("cyan_wall_banner"); + + BlockType.Typed CYAN_WOOL = getBlockType("cyan_wool"); + + BlockType.Typed DAMAGED_ANVIL = getBlockType("damaged_anvil"); + + BlockType.Typed DANDELION = getBlockType("dandelion"); + + BlockType.Typed DARK_OAK_BUTTON = getBlockType("dark_oak_button"); + + BlockType.Typed DARK_OAK_DOOR = getBlockType("dark_oak_door"); + + BlockType.Typed DARK_OAK_FENCE = getBlockType("dark_oak_fence"); + + BlockType.Typed DARK_OAK_FENCE_GATE = getBlockType("dark_oak_fence_gate"); + + BlockType.Typed DARK_OAK_HANGING_SIGN = getBlockType("dark_oak_hanging_sign"); + + BlockType.Typed DARK_OAK_LEAVES = getBlockType("dark_oak_leaves"); + + BlockType.Typed DARK_OAK_LOG = getBlockType("dark_oak_log"); + + BlockType.Typed DARK_OAK_PLANKS = getBlockType("dark_oak_planks"); + + BlockType.Typed DARK_OAK_PRESSURE_PLATE = getBlockType("dark_oak_pressure_plate"); + + BlockType.Typed DARK_OAK_SAPLING = getBlockType("dark_oak_sapling"); + + BlockType.Typed DARK_OAK_SIGN = getBlockType("dark_oak_sign"); + + BlockType.Typed DARK_OAK_SLAB = getBlockType("dark_oak_slab"); + + BlockType.Typed DARK_OAK_STAIRS = getBlockType("dark_oak_stairs"); + + BlockType.Typed DARK_OAK_TRAPDOOR = getBlockType("dark_oak_trapdoor"); + + BlockType.Typed DARK_OAK_WALL_HANGING_SIGN = getBlockType("dark_oak_wall_hanging_sign"); + + BlockType.Typed DARK_OAK_WALL_SIGN = getBlockType("dark_oak_wall_sign"); + + BlockType.Typed DARK_OAK_WOOD = getBlockType("dark_oak_wood"); + + BlockType.Typed DARK_PRISMARINE = getBlockType("dark_prismarine"); + + BlockType.Typed DARK_PRISMARINE_SLAB = getBlockType("dark_prismarine_slab"); + + BlockType.Typed DARK_PRISMARINE_STAIRS = getBlockType("dark_prismarine_stairs"); + + BlockType.Typed DAYLIGHT_DETECTOR = getBlockType("daylight_detector"); + + BlockType.Typed DEAD_BRAIN_CORAL = getBlockType("dead_brain_coral"); + + BlockType.Typed DEAD_BRAIN_CORAL_BLOCK = getBlockType("dead_brain_coral_block"); + + BlockType.Typed DEAD_BRAIN_CORAL_FAN = getBlockType("dead_brain_coral_fan"); + + BlockType.Typed DEAD_BRAIN_CORAL_WALL_FAN = getBlockType("dead_brain_coral_wall_fan"); + + BlockType.Typed DEAD_BUBBLE_CORAL = getBlockType("dead_bubble_coral"); + + BlockType.Typed DEAD_BUBBLE_CORAL_BLOCK = getBlockType("dead_bubble_coral_block"); + + BlockType.Typed DEAD_BUBBLE_CORAL_FAN = getBlockType("dead_bubble_coral_fan"); + + BlockType.Typed DEAD_BUBBLE_CORAL_WALL_FAN = getBlockType("dead_bubble_coral_wall_fan"); + + BlockType.Typed DEAD_BUSH = getBlockType("dead_bush"); + + BlockType.Typed DEAD_FIRE_CORAL = getBlockType("dead_fire_coral"); + + BlockType.Typed DEAD_FIRE_CORAL_BLOCK = getBlockType("dead_fire_coral_block"); + + BlockType.Typed DEAD_FIRE_CORAL_FAN = getBlockType("dead_fire_coral_fan"); + + BlockType.Typed DEAD_FIRE_CORAL_WALL_FAN = getBlockType("dead_fire_coral_wall_fan"); + + BlockType.Typed DEAD_HORN_CORAL = getBlockType("dead_horn_coral"); + + BlockType.Typed DEAD_HORN_CORAL_BLOCK = getBlockType("dead_horn_coral_block"); + + BlockType.Typed DEAD_HORN_CORAL_FAN = getBlockType("dead_horn_coral_fan"); + + BlockType.Typed DEAD_HORN_CORAL_WALL_FAN = getBlockType("dead_horn_coral_wall_fan"); + + BlockType.Typed DEAD_TUBE_CORAL = getBlockType("dead_tube_coral"); + + BlockType.Typed DEAD_TUBE_CORAL_BLOCK = getBlockType("dead_tube_coral_block"); + + BlockType.Typed DEAD_TUBE_CORAL_FAN = getBlockType("dead_tube_coral_fan"); + + BlockType.Typed DEAD_TUBE_CORAL_WALL_FAN = getBlockType("dead_tube_coral_wall_fan"); + + BlockType.Typed DECORATED_POT = getBlockType("decorated_pot"); + + BlockType.Typed DEEPSLATE = getBlockType("deepslate"); + + BlockType.Typed DEEPSLATE_BRICK_SLAB = getBlockType("deepslate_brick_slab"); + + BlockType.Typed DEEPSLATE_BRICK_STAIRS = getBlockType("deepslate_brick_stairs"); + + BlockType.Typed DEEPSLATE_BRICK_WALL = getBlockType("deepslate_brick_wall"); + + BlockType.Typed DEEPSLATE_BRICKS = getBlockType("deepslate_bricks"); + + BlockType.Typed DEEPSLATE_COAL_ORE = getBlockType("deepslate_coal_ore"); + + BlockType.Typed DEEPSLATE_COPPER_ORE = getBlockType("deepslate_copper_ore"); + + BlockType.Typed DEEPSLATE_DIAMOND_ORE = getBlockType("deepslate_diamond_ore"); + + BlockType.Typed DEEPSLATE_EMERALD_ORE = getBlockType("deepslate_emerald_ore"); + + BlockType.Typed DEEPSLATE_GOLD_ORE = getBlockType("deepslate_gold_ore"); + + BlockType.Typed DEEPSLATE_IRON_ORE = getBlockType("deepslate_iron_ore"); + + BlockType.Typed DEEPSLATE_LAPIS_ORE = getBlockType("deepslate_lapis_ore"); + + BlockType.Typed DEEPSLATE_REDSTONE_ORE = getBlockType("deepslate_redstone_ore"); + + BlockType.Typed DEEPSLATE_TILE_SLAB = getBlockType("deepslate_tile_slab"); + + BlockType.Typed DEEPSLATE_TILE_STAIRS = getBlockType("deepslate_tile_stairs"); + + BlockType.Typed DEEPSLATE_TILE_WALL = getBlockType("deepslate_tile_wall"); + + BlockType.Typed DEEPSLATE_TILES = getBlockType("deepslate_tiles"); + + BlockType.Typed DETECTOR_RAIL = getBlockType("detector_rail"); + + BlockType.Typed DIAMOND_BLOCK = getBlockType("diamond_block"); + + BlockType.Typed DIAMOND_ORE = getBlockType("diamond_ore"); + + BlockType.Typed DIORITE = getBlockType("diorite"); + + BlockType.Typed DIORITE_SLAB = getBlockType("diorite_slab"); + + BlockType.Typed DIORITE_STAIRS = getBlockType("diorite_stairs"); + + BlockType.Typed DIORITE_WALL = getBlockType("diorite_wall"); + + BlockType.Typed DIRT = getBlockType("dirt"); + + BlockType.Typed DIRT_PATH = getBlockType("dirt_path"); + + BlockType.Typed DISPENSER = getBlockType("dispenser"); + + BlockType.Typed DRAGON_EGG = getBlockType("dragon_egg"); + + BlockType.Typed DRAGON_HEAD = getBlockType("dragon_head"); + + BlockType.Typed DRAGON_WALL_HEAD = getBlockType("dragon_wall_head"); + + BlockType.Typed DRIED_KELP_BLOCK = getBlockType("dried_kelp_block"); + + BlockType.Typed DRIPSTONE_BLOCK = getBlockType("dripstone_block"); + + BlockType.Typed DROPPER = getBlockType("dropper"); + + BlockType.Typed EMERALD_BLOCK = getBlockType("emerald_block"); + + BlockType.Typed EMERALD_ORE = getBlockType("emerald_ore"); + + BlockType.Typed ENCHANTING_TABLE = getBlockType("enchanting_table"); + + BlockType.Typed END_GATEWAY = getBlockType("end_gateway"); + + BlockType.Typed END_PORTAL = getBlockType("end_portal"); + + BlockType.Typed END_PORTAL_FRAME = getBlockType("end_portal_frame"); + + BlockType.Typed END_ROD = getBlockType("end_rod"); + + BlockType.Typed END_STONE = getBlockType("end_stone"); + + BlockType.Typed END_STONE_BRICK_SLAB = getBlockType("end_stone_brick_slab"); + + BlockType.Typed END_STONE_BRICK_STAIRS = getBlockType("end_stone_brick_stairs"); + + BlockType.Typed END_STONE_BRICK_WALL = getBlockType("end_stone_brick_wall"); + + BlockType.Typed END_STONE_BRICKS = getBlockType("end_stone_bricks"); + + BlockType.Typed ENDER_CHEST = getBlockType("ender_chest"); + + BlockType.Typed EXPOSED_CHISELED_COPPER = getBlockType("exposed_chiseled_copper"); + + BlockType.Typed EXPOSED_COPPER = getBlockType("exposed_copper"); + + BlockType.Typed EXPOSED_COPPER_BULB = getBlockType("exposed_copper_bulb"); + + BlockType.Typed EXPOSED_COPPER_DOOR = getBlockType("exposed_copper_door"); + + BlockType.Typed EXPOSED_COPPER_GRATE = getBlockType("exposed_copper_grate"); + + BlockType.Typed EXPOSED_COPPER_TRAPDOOR = getBlockType("exposed_copper_trapdoor"); + + BlockType.Typed EXPOSED_CUT_COPPER = getBlockType("exposed_cut_copper"); + + BlockType.Typed EXPOSED_CUT_COPPER_SLAB = getBlockType("exposed_cut_copper_slab"); + + BlockType.Typed EXPOSED_CUT_COPPER_STAIRS = getBlockType("exposed_cut_copper_stairs"); + + BlockType.Typed FARMLAND = getBlockType("farmland"); + + BlockType.Typed FERN = getBlockType("fern"); + + BlockType.Typed FIRE = getBlockType("fire"); + + BlockType.Typed FIRE_CORAL = getBlockType("fire_coral"); + + BlockType.Typed FIRE_CORAL_BLOCK = getBlockType("fire_coral_block"); + + BlockType.Typed FIRE_CORAL_FAN = getBlockType("fire_coral_fan"); + + BlockType.Typed FIRE_CORAL_WALL_FAN = getBlockType("fire_coral_wall_fan"); + + BlockType.Typed FLETCHING_TABLE = getBlockType("fletching_table"); + + BlockType.Typed FLOWER_POT = getBlockType("flower_pot"); + + BlockType.Typed FLOWERING_AZALEA = getBlockType("flowering_azalea"); + + BlockType.Typed FLOWERING_AZALEA_LEAVES = getBlockType("flowering_azalea_leaves"); + + BlockType.Typed FROGSPAWN = getBlockType("frogspawn"); + + BlockType.Typed FROSTED_ICE = getBlockType("frosted_ice"); + + BlockType.Typed FURNACE = getBlockType("furnace"); + + BlockType.Typed GILDED_BLACKSTONE = getBlockType("gilded_blackstone"); + + BlockType.Typed GLASS = getBlockType("glass"); + + BlockType.Typed GLASS_PANE = getBlockType("glass_pane"); + + BlockType.Typed GLOW_LICHEN = getBlockType("glow_lichen"); + + BlockType.Typed GLOWSTONE = getBlockType("glowstone"); + + BlockType.Typed GOLD_BLOCK = getBlockType("gold_block"); + + BlockType.Typed GOLD_ORE = getBlockType("gold_ore"); + + BlockType.Typed GRANITE = getBlockType("granite"); + + BlockType.Typed GRANITE_SLAB = getBlockType("granite_slab"); + + BlockType.Typed GRANITE_STAIRS = getBlockType("granite_stairs"); + + BlockType.Typed GRANITE_WALL = getBlockType("granite_wall"); + + BlockType.Typed GRASS_BLOCK = getBlockType("grass_block"); + + BlockType.Typed GRAVEL = getBlockType("gravel"); + + BlockType.Typed GRAY_BANNER = getBlockType("gray_banner"); + + BlockType.Typed GRAY_BED = getBlockType("gray_bed"); + + BlockType.Typed GRAY_CANDLE = getBlockType("gray_candle"); + + BlockType.Typed GRAY_CANDLE_CAKE = getBlockType("gray_candle_cake"); + + BlockType.Typed GRAY_CARPET = getBlockType("gray_carpet"); + + BlockType.Typed GRAY_CONCRETE = getBlockType("gray_concrete"); + + BlockType.Typed GRAY_CONCRETE_POWDER = getBlockType("gray_concrete_powder"); + + BlockType.Typed GRAY_GLAZED_TERRACOTTA = getBlockType("gray_glazed_terracotta"); + + BlockType.Typed GRAY_SHULKER_BOX = getBlockType("gray_shulker_box"); + + BlockType.Typed GRAY_STAINED_GLASS = getBlockType("gray_stained_glass"); + + BlockType.Typed GRAY_STAINED_GLASS_PANE = getBlockType("gray_stained_glass_pane"); + + BlockType.Typed GRAY_TERRACOTTA = getBlockType("gray_terracotta"); + + BlockType.Typed GRAY_WALL_BANNER = getBlockType("gray_wall_banner"); + + BlockType.Typed GRAY_WOOL = getBlockType("gray_wool"); + + BlockType.Typed GREEN_BANNER = getBlockType("green_banner"); + + BlockType.Typed GREEN_BED = getBlockType("green_bed"); + + BlockType.Typed GREEN_CANDLE = getBlockType("green_candle"); + + BlockType.Typed GREEN_CANDLE_CAKE = getBlockType("green_candle_cake"); + + BlockType.Typed GREEN_CARPET = getBlockType("green_carpet"); + + BlockType.Typed GREEN_CONCRETE = getBlockType("green_concrete"); + + BlockType.Typed GREEN_CONCRETE_POWDER = getBlockType("green_concrete_powder"); + + BlockType.Typed GREEN_GLAZED_TERRACOTTA = getBlockType("green_glazed_terracotta"); + + BlockType.Typed GREEN_SHULKER_BOX = getBlockType("green_shulker_box"); + + BlockType.Typed GREEN_STAINED_GLASS = getBlockType("green_stained_glass"); + + BlockType.Typed GREEN_STAINED_GLASS_PANE = getBlockType("green_stained_glass_pane"); + + BlockType.Typed GREEN_TERRACOTTA = getBlockType("green_terracotta"); + + BlockType.Typed GREEN_WALL_BANNER = getBlockType("green_wall_banner"); + + BlockType.Typed GREEN_WOOL = getBlockType("green_wool"); + + BlockType.Typed GRINDSTONE = getBlockType("grindstone"); + + BlockType.Typed HANGING_ROOTS = getBlockType("hanging_roots"); + + BlockType.Typed HAY_BLOCK = getBlockType("hay_block"); + + BlockType.Typed HEAVY_CORE = getBlockType("heavy_core"); + + BlockType.Typed HEAVY_WEIGHTED_PRESSURE_PLATE = getBlockType("heavy_weighted_pressure_plate"); + + BlockType.Typed HONEY_BLOCK = getBlockType("honey_block"); + + BlockType.Typed HONEYCOMB_BLOCK = getBlockType("honeycomb_block"); + + BlockType.Typed HOPPER = getBlockType("hopper"); + + BlockType.Typed HORN_CORAL = getBlockType("horn_coral"); + + BlockType.Typed HORN_CORAL_BLOCK = getBlockType("horn_coral_block"); + + BlockType.Typed HORN_CORAL_FAN = getBlockType("horn_coral_fan"); + + BlockType.Typed HORN_CORAL_WALL_FAN = getBlockType("horn_coral_wall_fan"); + + BlockType.Typed ICE = getBlockType("ice"); + + BlockType.Typed INFESTED_CHISELED_STONE_BRICKS = getBlockType("infested_chiseled_stone_bricks"); + + BlockType.Typed INFESTED_COBBLESTONE = getBlockType("infested_cobblestone"); + + BlockType.Typed INFESTED_CRACKED_STONE_BRICKS = getBlockType("infested_cracked_stone_bricks"); + + BlockType.Typed INFESTED_DEEPSLATE = getBlockType("infested_deepslate"); + + BlockType.Typed INFESTED_MOSSY_STONE_BRICKS = getBlockType("infested_mossy_stone_bricks"); + + BlockType.Typed INFESTED_STONE = getBlockType("infested_stone"); + + BlockType.Typed INFESTED_STONE_BRICKS = getBlockType("infested_stone_bricks"); + + BlockType.Typed IRON_BARS = getBlockType("iron_bars"); + + BlockType.Typed IRON_BLOCK = getBlockType("iron_block"); + + BlockType.Typed IRON_DOOR = getBlockType("iron_door"); + + BlockType.Typed IRON_ORE = getBlockType("iron_ore"); + + BlockType.Typed IRON_TRAPDOOR = getBlockType("iron_trapdoor"); + + BlockType.Typed JACK_O_LANTERN = getBlockType("jack_o_lantern"); + + BlockType.Typed JIGSAW = getBlockType("jigsaw"); + + BlockType.Typed JUKEBOX = getBlockType("jukebox"); + + BlockType.Typed JUNGLE_BUTTON = getBlockType("jungle_button"); + + BlockType.Typed JUNGLE_DOOR = getBlockType("jungle_door"); + + BlockType.Typed JUNGLE_FENCE = getBlockType("jungle_fence"); + + BlockType.Typed JUNGLE_FENCE_GATE = getBlockType("jungle_fence_gate"); + + BlockType.Typed JUNGLE_HANGING_SIGN = getBlockType("jungle_hanging_sign"); + + BlockType.Typed JUNGLE_LEAVES = getBlockType("jungle_leaves"); + + BlockType.Typed JUNGLE_LOG = getBlockType("jungle_log"); + + BlockType.Typed JUNGLE_PLANKS = getBlockType("jungle_planks"); + + BlockType.Typed JUNGLE_PRESSURE_PLATE = getBlockType("jungle_pressure_plate"); + + BlockType.Typed JUNGLE_SAPLING = getBlockType("jungle_sapling"); + + BlockType.Typed JUNGLE_SIGN = getBlockType("jungle_sign"); + + BlockType.Typed JUNGLE_SLAB = getBlockType("jungle_slab"); + + BlockType.Typed JUNGLE_STAIRS = getBlockType("jungle_stairs"); + + BlockType.Typed JUNGLE_TRAPDOOR = getBlockType("jungle_trapdoor"); + + BlockType.Typed JUNGLE_WALL_HANGING_SIGN = getBlockType("jungle_wall_hanging_sign"); + + BlockType.Typed JUNGLE_WALL_SIGN = getBlockType("jungle_wall_sign"); + + BlockType.Typed JUNGLE_WOOD = getBlockType("jungle_wood"); + + BlockType.Typed KELP = getBlockType("kelp"); + + BlockType.Typed KELP_PLANT = getBlockType("kelp_plant"); + + BlockType.Typed LADDER = getBlockType("ladder"); + + BlockType.Typed LANTERN = getBlockType("lantern"); + + BlockType.Typed LAPIS_BLOCK = getBlockType("lapis_block"); + + BlockType.Typed LAPIS_ORE = getBlockType("lapis_ore"); + + BlockType.Typed LARGE_AMETHYST_BUD = getBlockType("large_amethyst_bud"); + + BlockType.Typed LARGE_FERN = getBlockType("large_fern"); + + BlockType.Typed LAVA = getBlockType("lava"); + + BlockType.Typed LAVA_CAULDRON = getBlockType("lava_cauldron"); + + BlockType.Typed LECTERN = getBlockType("lectern"); + + BlockType.Typed LEVER = getBlockType("lever"); + + BlockType.Typed LIGHT = getBlockType("light"); + + BlockType.Typed LIGHT_BLUE_BANNER = getBlockType("light_blue_banner"); + + BlockType.Typed LIGHT_BLUE_BED = getBlockType("light_blue_bed"); + + BlockType.Typed LIGHT_BLUE_CANDLE = getBlockType("light_blue_candle"); + + BlockType.Typed LIGHT_BLUE_CANDLE_CAKE = getBlockType("light_blue_candle_cake"); + + BlockType.Typed LIGHT_BLUE_CARPET = getBlockType("light_blue_carpet"); + + BlockType.Typed LIGHT_BLUE_CONCRETE = getBlockType("light_blue_concrete"); + + BlockType.Typed LIGHT_BLUE_CONCRETE_POWDER = getBlockType("light_blue_concrete_powder"); + + BlockType.Typed LIGHT_BLUE_GLAZED_TERRACOTTA = getBlockType("light_blue_glazed_terracotta"); + + BlockType.Typed LIGHT_BLUE_SHULKER_BOX = getBlockType("light_blue_shulker_box"); + + BlockType.Typed LIGHT_BLUE_STAINED_GLASS = getBlockType("light_blue_stained_glass"); + + BlockType.Typed LIGHT_BLUE_STAINED_GLASS_PANE = getBlockType("light_blue_stained_glass_pane"); + + BlockType.Typed LIGHT_BLUE_TERRACOTTA = getBlockType("light_blue_terracotta"); + + BlockType.Typed LIGHT_BLUE_WALL_BANNER = getBlockType("light_blue_wall_banner"); + + BlockType.Typed LIGHT_BLUE_WOOL = getBlockType("light_blue_wool"); + + BlockType.Typed LIGHT_GRAY_BANNER = getBlockType("light_gray_banner"); + + BlockType.Typed LIGHT_GRAY_BED = getBlockType("light_gray_bed"); + + BlockType.Typed LIGHT_GRAY_CANDLE = getBlockType("light_gray_candle"); + + BlockType.Typed LIGHT_GRAY_CANDLE_CAKE = getBlockType("light_gray_candle_cake"); + + BlockType.Typed LIGHT_GRAY_CARPET = getBlockType("light_gray_carpet"); + + BlockType.Typed LIGHT_GRAY_CONCRETE = getBlockType("light_gray_concrete"); + + BlockType.Typed LIGHT_GRAY_CONCRETE_POWDER = getBlockType("light_gray_concrete_powder"); + + BlockType.Typed LIGHT_GRAY_GLAZED_TERRACOTTA = getBlockType("light_gray_glazed_terracotta"); + + BlockType.Typed LIGHT_GRAY_SHULKER_BOX = getBlockType("light_gray_shulker_box"); + + BlockType.Typed LIGHT_GRAY_STAINED_GLASS = getBlockType("light_gray_stained_glass"); + + BlockType.Typed LIGHT_GRAY_STAINED_GLASS_PANE = getBlockType("light_gray_stained_glass_pane"); + + BlockType.Typed LIGHT_GRAY_TERRACOTTA = getBlockType("light_gray_terracotta"); + + BlockType.Typed LIGHT_GRAY_WALL_BANNER = getBlockType("light_gray_wall_banner"); + + BlockType.Typed LIGHT_GRAY_WOOL = getBlockType("light_gray_wool"); + + BlockType.Typed LIGHT_WEIGHTED_PRESSURE_PLATE = getBlockType("light_weighted_pressure_plate"); + + BlockType.Typed LIGHTNING_ROD = getBlockType("lightning_rod"); + + BlockType.Typed LILAC = getBlockType("lilac"); + + BlockType.Typed LILY_OF_THE_VALLEY = getBlockType("lily_of_the_valley"); + + BlockType.Typed LILY_PAD = getBlockType("lily_pad"); + + BlockType.Typed LIME_BANNER = getBlockType("lime_banner"); + + BlockType.Typed LIME_BED = getBlockType("lime_bed"); + + BlockType.Typed LIME_CANDLE = getBlockType("lime_candle"); + + BlockType.Typed LIME_CANDLE_CAKE = getBlockType("lime_candle_cake"); + + BlockType.Typed LIME_CARPET = getBlockType("lime_carpet"); + + BlockType.Typed LIME_CONCRETE = getBlockType("lime_concrete"); + + BlockType.Typed LIME_CONCRETE_POWDER = getBlockType("lime_concrete_powder"); + + BlockType.Typed LIME_GLAZED_TERRACOTTA = getBlockType("lime_glazed_terracotta"); + + BlockType.Typed LIME_SHULKER_BOX = getBlockType("lime_shulker_box"); + + BlockType.Typed LIME_STAINED_GLASS = getBlockType("lime_stained_glass"); + + BlockType.Typed LIME_STAINED_GLASS_PANE = getBlockType("lime_stained_glass_pane"); + + BlockType.Typed LIME_TERRACOTTA = getBlockType("lime_terracotta"); + + BlockType.Typed LIME_WALL_BANNER = getBlockType("lime_wall_banner"); + + BlockType.Typed LIME_WOOL = getBlockType("lime_wool"); + + BlockType.Typed LODESTONE = getBlockType("lodestone"); + + BlockType.Typed LOOM = getBlockType("loom"); + + BlockType.Typed MAGENTA_BANNER = getBlockType("magenta_banner"); + + BlockType.Typed MAGENTA_BED = getBlockType("magenta_bed"); + + BlockType.Typed MAGENTA_CANDLE = getBlockType("magenta_candle"); + + BlockType.Typed MAGENTA_CANDLE_CAKE = getBlockType("magenta_candle_cake"); + + BlockType.Typed MAGENTA_CARPET = getBlockType("magenta_carpet"); + + BlockType.Typed MAGENTA_CONCRETE = getBlockType("magenta_concrete"); + + BlockType.Typed MAGENTA_CONCRETE_POWDER = getBlockType("magenta_concrete_powder"); + + BlockType.Typed MAGENTA_GLAZED_TERRACOTTA = getBlockType("magenta_glazed_terracotta"); + + BlockType.Typed MAGENTA_SHULKER_BOX = getBlockType("magenta_shulker_box"); + + BlockType.Typed MAGENTA_STAINED_GLASS = getBlockType("magenta_stained_glass"); + + BlockType.Typed MAGENTA_STAINED_GLASS_PANE = getBlockType("magenta_stained_glass_pane"); + + BlockType.Typed MAGENTA_TERRACOTTA = getBlockType("magenta_terracotta"); + + BlockType.Typed MAGENTA_WALL_BANNER = getBlockType("magenta_wall_banner"); + + BlockType.Typed MAGENTA_WOOL = getBlockType("magenta_wool"); + + BlockType.Typed MAGMA_BLOCK = getBlockType("magma_block"); + + BlockType.Typed MANGROVE_BUTTON = getBlockType("mangrove_button"); + + BlockType.Typed MANGROVE_DOOR = getBlockType("mangrove_door"); + + BlockType.Typed MANGROVE_FENCE = getBlockType("mangrove_fence"); + + BlockType.Typed MANGROVE_FENCE_GATE = getBlockType("mangrove_fence_gate"); + + BlockType.Typed MANGROVE_HANGING_SIGN = getBlockType("mangrove_hanging_sign"); + + BlockType.Typed MANGROVE_LEAVES = getBlockType("mangrove_leaves"); + + BlockType.Typed MANGROVE_LOG = getBlockType("mangrove_log"); + + BlockType.Typed MANGROVE_PLANKS = getBlockType("mangrove_planks"); + + BlockType.Typed MANGROVE_PRESSURE_PLATE = getBlockType("mangrove_pressure_plate"); + + BlockType.Typed MANGROVE_PROPAGULE = getBlockType("mangrove_propagule"); + + BlockType.Typed MANGROVE_ROOTS = getBlockType("mangrove_roots"); + + BlockType.Typed MANGROVE_SIGN = getBlockType("mangrove_sign"); + + BlockType.Typed MANGROVE_SLAB = getBlockType("mangrove_slab"); + + BlockType.Typed MANGROVE_STAIRS = getBlockType("mangrove_stairs"); + + BlockType.Typed MANGROVE_TRAPDOOR = getBlockType("mangrove_trapdoor"); + + BlockType.Typed MANGROVE_WALL_HANGING_SIGN = getBlockType("mangrove_wall_hanging_sign"); + + BlockType.Typed MANGROVE_WALL_SIGN = getBlockType("mangrove_wall_sign"); + + BlockType.Typed MANGROVE_WOOD = getBlockType("mangrove_wood"); + + BlockType.Typed MEDIUM_AMETHYST_BUD = getBlockType("medium_amethyst_bud"); + + BlockType.Typed MELON = getBlockType("melon"); + + BlockType.Typed MELON_STEM = getBlockType("melon_stem"); + + BlockType.Typed MOSS_BLOCK = getBlockType("moss_block"); + + BlockType.Typed MOSS_CARPET = getBlockType("moss_carpet"); + + BlockType.Typed MOSSY_COBBLESTONE = getBlockType("mossy_cobblestone"); + + BlockType.Typed MOSSY_COBBLESTONE_SLAB = getBlockType("mossy_cobblestone_slab"); + + BlockType.Typed MOSSY_COBBLESTONE_STAIRS = getBlockType("mossy_cobblestone_stairs"); + + BlockType.Typed MOSSY_COBBLESTONE_WALL = getBlockType("mossy_cobblestone_wall"); + + BlockType.Typed MOSSY_STONE_BRICK_SLAB = getBlockType("mossy_stone_brick_slab"); + + BlockType.Typed MOSSY_STONE_BRICK_STAIRS = getBlockType("mossy_stone_brick_stairs"); + + BlockType.Typed MOSSY_STONE_BRICK_WALL = getBlockType("mossy_stone_brick_wall"); + + BlockType.Typed MOSSY_STONE_BRICKS = getBlockType("mossy_stone_bricks"); + + BlockType.Typed MOVING_PISTON = getBlockType("moving_piston"); + + BlockType.Typed MUD = getBlockType("mud"); + + BlockType.Typed MUD_BRICK_SLAB = getBlockType("mud_brick_slab"); + + BlockType.Typed MUD_BRICK_STAIRS = getBlockType("mud_brick_stairs"); + + BlockType.Typed MUD_BRICK_WALL = getBlockType("mud_brick_wall"); + + BlockType.Typed MUD_BRICKS = getBlockType("mud_bricks"); + + BlockType.Typed MUDDY_MANGROVE_ROOTS = getBlockType("muddy_mangrove_roots"); + + BlockType.Typed MUSHROOM_STEM = getBlockType("mushroom_stem"); + + BlockType.Typed MYCELIUM = getBlockType("mycelium"); + + BlockType.Typed NETHER_BRICK_FENCE = getBlockType("nether_brick_fence"); + + BlockType.Typed NETHER_BRICK_SLAB = getBlockType("nether_brick_slab"); + + BlockType.Typed NETHER_BRICK_STAIRS = getBlockType("nether_brick_stairs"); + + BlockType.Typed NETHER_BRICK_WALL = getBlockType("nether_brick_wall"); + + BlockType.Typed NETHER_BRICKS = getBlockType("nether_bricks"); + + BlockType.Typed NETHER_GOLD_ORE = getBlockType("nether_gold_ore"); + + BlockType.Typed NETHER_PORTAL = getBlockType("nether_portal"); + + BlockType.Typed NETHER_QUARTZ_ORE = getBlockType("nether_quartz_ore"); + + BlockType.Typed NETHER_SPROUTS = getBlockType("nether_sprouts"); + + BlockType.Typed NETHER_WART = getBlockType("nether_wart"); + + BlockType.Typed NETHER_WART_BLOCK = getBlockType("nether_wart_block"); + + BlockType.Typed NETHERITE_BLOCK = getBlockType("netherite_block"); + + BlockType.Typed NETHERRACK = getBlockType("netherrack"); + + BlockType.Typed NOTE_BLOCK = getBlockType("note_block"); + + BlockType.Typed OAK_BUTTON = getBlockType("oak_button"); + + BlockType.Typed OAK_DOOR = getBlockType("oak_door"); + + BlockType.Typed OAK_FENCE = getBlockType("oak_fence"); + + BlockType.Typed OAK_FENCE_GATE = getBlockType("oak_fence_gate"); + + BlockType.Typed OAK_HANGING_SIGN = getBlockType("oak_hanging_sign"); + + BlockType.Typed OAK_LEAVES = getBlockType("oak_leaves"); + + BlockType.Typed OAK_LOG = getBlockType("oak_log"); + + BlockType.Typed OAK_PLANKS = getBlockType("oak_planks"); + + BlockType.Typed OAK_PRESSURE_PLATE = getBlockType("oak_pressure_plate"); + + BlockType.Typed OAK_SAPLING = getBlockType("oak_sapling"); + + BlockType.Typed OAK_SIGN = getBlockType("oak_sign"); + + BlockType.Typed OAK_SLAB = getBlockType("oak_slab"); + + BlockType.Typed OAK_STAIRS = getBlockType("oak_stairs"); + + BlockType.Typed OAK_TRAPDOOR = getBlockType("oak_trapdoor"); + + BlockType.Typed OAK_WALL_HANGING_SIGN = getBlockType("oak_wall_hanging_sign"); + + BlockType.Typed OAK_WALL_SIGN = getBlockType("oak_wall_sign"); + + BlockType.Typed OAK_WOOD = getBlockType("oak_wood"); + + BlockType.Typed OBSERVER = getBlockType("observer"); + + BlockType.Typed OBSIDIAN = getBlockType("obsidian"); + + BlockType.Typed OCHRE_FROGLIGHT = getBlockType("ochre_froglight"); + + BlockType.Typed ORANGE_BANNER = getBlockType("orange_banner"); + + BlockType.Typed ORANGE_BED = getBlockType("orange_bed"); + + BlockType.Typed ORANGE_CANDLE = getBlockType("orange_candle"); + + BlockType.Typed ORANGE_CANDLE_CAKE = getBlockType("orange_candle_cake"); + + BlockType.Typed ORANGE_CARPET = getBlockType("orange_carpet"); + + BlockType.Typed ORANGE_CONCRETE = getBlockType("orange_concrete"); + + BlockType.Typed ORANGE_CONCRETE_POWDER = getBlockType("orange_concrete_powder"); + + BlockType.Typed ORANGE_GLAZED_TERRACOTTA = getBlockType("orange_glazed_terracotta"); + + BlockType.Typed ORANGE_SHULKER_BOX = getBlockType("orange_shulker_box"); + + BlockType.Typed ORANGE_STAINED_GLASS = getBlockType("orange_stained_glass"); + + BlockType.Typed ORANGE_STAINED_GLASS_PANE = getBlockType("orange_stained_glass_pane"); + + BlockType.Typed ORANGE_TERRACOTTA = getBlockType("orange_terracotta"); + + BlockType.Typed ORANGE_TULIP = getBlockType("orange_tulip"); + + BlockType.Typed ORANGE_WALL_BANNER = getBlockType("orange_wall_banner"); + + BlockType.Typed ORANGE_WOOL = getBlockType("orange_wool"); + + BlockType.Typed OXEYE_DAISY = getBlockType("oxeye_daisy"); + + BlockType.Typed OXIDIZED_CHISELED_COPPER = getBlockType("oxidized_chiseled_copper"); + + BlockType.Typed OXIDIZED_COPPER = getBlockType("oxidized_copper"); + + BlockType.Typed OXIDIZED_COPPER_BULB = getBlockType("oxidized_copper_bulb"); + + BlockType.Typed OXIDIZED_COPPER_DOOR = getBlockType("oxidized_copper_door"); + + BlockType.Typed OXIDIZED_COPPER_GRATE = getBlockType("oxidized_copper_grate"); + + BlockType.Typed OXIDIZED_COPPER_TRAPDOOR = getBlockType("oxidized_copper_trapdoor"); + + BlockType.Typed OXIDIZED_CUT_COPPER = getBlockType("oxidized_cut_copper"); + + BlockType.Typed OXIDIZED_CUT_COPPER_SLAB = getBlockType("oxidized_cut_copper_slab"); + + BlockType.Typed OXIDIZED_CUT_COPPER_STAIRS = getBlockType("oxidized_cut_copper_stairs"); + + BlockType.Typed PACKED_ICE = getBlockType("packed_ice"); + + BlockType.Typed PACKED_MUD = getBlockType("packed_mud"); + + BlockType.Typed PEARLESCENT_FROGLIGHT = getBlockType("pearlescent_froglight"); + + BlockType.Typed PEONY = getBlockType("peony"); + + BlockType.Typed PETRIFIED_OAK_SLAB = getBlockType("petrified_oak_slab"); + + BlockType.Typed PIGLIN_HEAD = getBlockType("piglin_head"); + + BlockType.Typed PIGLIN_WALL_HEAD = getBlockType("piglin_wall_head"); + + BlockType.Typed PINK_BANNER = getBlockType("pink_banner"); + + BlockType.Typed PINK_BED = getBlockType("pink_bed"); + + BlockType.Typed PINK_CANDLE = getBlockType("pink_candle"); + + BlockType.Typed PINK_CANDLE_CAKE = getBlockType("pink_candle_cake"); + + BlockType.Typed PINK_CARPET = getBlockType("pink_carpet"); + + BlockType.Typed PINK_CONCRETE = getBlockType("pink_concrete"); + + BlockType.Typed PINK_CONCRETE_POWDER = getBlockType("pink_concrete_powder"); + + BlockType.Typed PINK_GLAZED_TERRACOTTA = getBlockType("pink_glazed_terracotta"); + + BlockType.Typed PINK_PETALS = getBlockType("pink_petals"); + + BlockType.Typed PINK_SHULKER_BOX = getBlockType("pink_shulker_box"); + + BlockType.Typed PINK_STAINED_GLASS = getBlockType("pink_stained_glass"); + + BlockType.Typed PINK_STAINED_GLASS_PANE = getBlockType("pink_stained_glass_pane"); + + BlockType.Typed PINK_TERRACOTTA = getBlockType("pink_terracotta"); + + BlockType.Typed PINK_TULIP = getBlockType("pink_tulip"); + + BlockType.Typed PINK_WALL_BANNER = getBlockType("pink_wall_banner"); + + BlockType.Typed PINK_WOOL = getBlockType("pink_wool"); + + BlockType.Typed PISTON = getBlockType("piston"); + + BlockType.Typed PISTON_HEAD = getBlockType("piston_head"); + + BlockType.Typed PITCHER_CROP = getBlockType("pitcher_crop"); + + BlockType.Typed PITCHER_PLANT = getBlockType("pitcher_plant"); + + BlockType.Typed PLAYER_HEAD = getBlockType("player_head"); + + BlockType.Typed PLAYER_WALL_HEAD = getBlockType("player_wall_head"); + + BlockType.Typed PODZOL = getBlockType("podzol"); + + BlockType.Typed POINTED_DRIPSTONE = getBlockType("pointed_dripstone"); + + BlockType.Typed POLISHED_ANDESITE = getBlockType("polished_andesite"); + + BlockType.Typed POLISHED_ANDESITE_SLAB = getBlockType("polished_andesite_slab"); + + BlockType.Typed POLISHED_ANDESITE_STAIRS = getBlockType("polished_andesite_stairs"); + + BlockType.Typed POLISHED_BASALT = getBlockType("polished_basalt"); + + BlockType.Typed POLISHED_BLACKSTONE = getBlockType("polished_blackstone"); + + BlockType.Typed POLISHED_BLACKSTONE_BRICK_SLAB = getBlockType("polished_blackstone_brick_slab"); + + BlockType.Typed POLISHED_BLACKSTONE_BRICK_STAIRS = getBlockType("polished_blackstone_brick_stairs"); + + BlockType.Typed POLISHED_BLACKSTONE_BRICK_WALL = getBlockType("polished_blackstone_brick_wall"); + + BlockType.Typed POLISHED_BLACKSTONE_BRICKS = getBlockType("polished_blackstone_bricks"); + + BlockType.Typed POLISHED_BLACKSTONE_BUTTON = getBlockType("polished_blackstone_button"); + + BlockType.Typed POLISHED_BLACKSTONE_PRESSURE_PLATE = getBlockType("polished_blackstone_pressure_plate"); + + BlockType.Typed POLISHED_BLACKSTONE_SLAB = getBlockType("polished_blackstone_slab"); + + BlockType.Typed POLISHED_BLACKSTONE_STAIRS = getBlockType("polished_blackstone_stairs"); + + BlockType.Typed POLISHED_BLACKSTONE_WALL = getBlockType("polished_blackstone_wall"); + + BlockType.Typed POLISHED_DEEPSLATE = getBlockType("polished_deepslate"); + + BlockType.Typed POLISHED_DEEPSLATE_SLAB = getBlockType("polished_deepslate_slab"); + + BlockType.Typed POLISHED_DEEPSLATE_STAIRS = getBlockType("polished_deepslate_stairs"); + + BlockType.Typed POLISHED_DEEPSLATE_WALL = getBlockType("polished_deepslate_wall"); + + BlockType.Typed POLISHED_DIORITE = getBlockType("polished_diorite"); + + BlockType.Typed POLISHED_DIORITE_SLAB = getBlockType("polished_diorite_slab"); + + BlockType.Typed POLISHED_DIORITE_STAIRS = getBlockType("polished_diorite_stairs"); + + BlockType.Typed POLISHED_GRANITE = getBlockType("polished_granite"); + + BlockType.Typed POLISHED_GRANITE_SLAB = getBlockType("polished_granite_slab"); + + BlockType.Typed POLISHED_GRANITE_STAIRS = getBlockType("polished_granite_stairs"); + + BlockType.Typed POLISHED_TUFF = getBlockType("polished_tuff"); + + BlockType.Typed POLISHED_TUFF_SLAB = getBlockType("polished_tuff_slab"); + + BlockType.Typed POLISHED_TUFF_STAIRS = getBlockType("polished_tuff_stairs"); + + BlockType.Typed POLISHED_TUFF_WALL = getBlockType("polished_tuff_wall"); + + BlockType.Typed POPPY = getBlockType("poppy"); + + BlockType.Typed POTATOES = getBlockType("potatoes"); + + BlockType.Typed POTTED_ACACIA_SAPLING = getBlockType("potted_acacia_sapling"); + + BlockType.Typed POTTED_ALLIUM = getBlockType("potted_allium"); + + BlockType.Typed POTTED_AZALEA_BUSH = getBlockType("potted_azalea_bush"); + + BlockType.Typed POTTED_AZURE_BLUET = getBlockType("potted_azure_bluet"); + + BlockType.Typed POTTED_BAMBOO = getBlockType("potted_bamboo"); + + BlockType.Typed POTTED_BIRCH_SAPLING = getBlockType("potted_birch_sapling"); + + BlockType.Typed POTTED_BLUE_ORCHID = getBlockType("potted_blue_orchid"); + + BlockType.Typed POTTED_BROWN_MUSHROOM = getBlockType("potted_brown_mushroom"); + + BlockType.Typed POTTED_CACTUS = getBlockType("potted_cactus"); + + BlockType.Typed POTTED_CHERRY_SAPLING = getBlockType("potted_cherry_sapling"); + + BlockType.Typed POTTED_CORNFLOWER = getBlockType("potted_cornflower"); + + BlockType.Typed POTTED_CRIMSON_FUNGUS = getBlockType("potted_crimson_fungus"); + + BlockType.Typed POTTED_CRIMSON_ROOTS = getBlockType("potted_crimson_roots"); + + BlockType.Typed POTTED_DANDELION = getBlockType("potted_dandelion"); + + BlockType.Typed POTTED_DARK_OAK_SAPLING = getBlockType("potted_dark_oak_sapling"); + + BlockType.Typed POTTED_DEAD_BUSH = getBlockType("potted_dead_bush"); + + BlockType.Typed POTTED_FERN = getBlockType("potted_fern"); + + BlockType.Typed POTTED_FLOWERING_AZALEA_BUSH = getBlockType("potted_flowering_azalea_bush"); + + BlockType.Typed POTTED_JUNGLE_SAPLING = getBlockType("potted_jungle_sapling"); + + BlockType.Typed POTTED_LILY_OF_THE_VALLEY = getBlockType("potted_lily_of_the_valley"); + + BlockType.Typed POTTED_MANGROVE_PROPAGULE = getBlockType("potted_mangrove_propagule"); + + BlockType.Typed POTTED_OAK_SAPLING = getBlockType("potted_oak_sapling"); + + BlockType.Typed POTTED_ORANGE_TULIP = getBlockType("potted_orange_tulip"); + + BlockType.Typed POTTED_OXEYE_DAISY = getBlockType("potted_oxeye_daisy"); + + BlockType.Typed POTTED_PINK_TULIP = getBlockType("potted_pink_tulip"); + + BlockType.Typed POTTED_POPPY = getBlockType("potted_poppy"); + + BlockType.Typed POTTED_RED_MUSHROOM = getBlockType("potted_red_mushroom"); + + BlockType.Typed POTTED_RED_TULIP = getBlockType("potted_red_tulip"); + + BlockType.Typed POTTED_SPRUCE_SAPLING = getBlockType("potted_spruce_sapling"); + + BlockType.Typed POTTED_TORCHFLOWER = getBlockType("potted_torchflower"); + + BlockType.Typed POTTED_WARPED_FUNGUS = getBlockType("potted_warped_fungus"); + + BlockType.Typed POTTED_WARPED_ROOTS = getBlockType("potted_warped_roots"); + + BlockType.Typed POTTED_WHITE_TULIP = getBlockType("potted_white_tulip"); + + BlockType.Typed POTTED_WITHER_ROSE = getBlockType("potted_wither_rose"); + + BlockType.Typed POWDER_SNOW = getBlockType("powder_snow"); + + BlockType.Typed POWDER_SNOW_CAULDRON = getBlockType("powder_snow_cauldron"); + + BlockType.Typed POWERED_RAIL = getBlockType("powered_rail"); + + BlockType.Typed PRISMARINE = getBlockType("prismarine"); + + BlockType.Typed PRISMARINE_BRICK_SLAB = getBlockType("prismarine_brick_slab"); + + BlockType.Typed PRISMARINE_BRICK_STAIRS = getBlockType("prismarine_brick_stairs"); + + BlockType.Typed PRISMARINE_BRICKS = getBlockType("prismarine_bricks"); + + BlockType.Typed PRISMARINE_SLAB = getBlockType("prismarine_slab"); + + BlockType.Typed PRISMARINE_STAIRS = getBlockType("prismarine_stairs"); + + BlockType.Typed PRISMARINE_WALL = getBlockType("prismarine_wall"); + + BlockType.Typed PUMPKIN = getBlockType("pumpkin"); + + BlockType.Typed PUMPKIN_STEM = getBlockType("pumpkin_stem"); + + BlockType.Typed PURPLE_BANNER = getBlockType("purple_banner"); + + BlockType.Typed PURPLE_BED = getBlockType("purple_bed"); + + BlockType.Typed PURPLE_CANDLE = getBlockType("purple_candle"); + + BlockType.Typed PURPLE_CANDLE_CAKE = getBlockType("purple_candle_cake"); + + BlockType.Typed PURPLE_CARPET = getBlockType("purple_carpet"); + + BlockType.Typed PURPLE_CONCRETE = getBlockType("purple_concrete"); + + BlockType.Typed PURPLE_CONCRETE_POWDER = getBlockType("purple_concrete_powder"); + + BlockType.Typed PURPLE_GLAZED_TERRACOTTA = getBlockType("purple_glazed_terracotta"); + + BlockType.Typed PURPLE_SHULKER_BOX = getBlockType("purple_shulker_box"); + + BlockType.Typed PURPLE_STAINED_GLASS = getBlockType("purple_stained_glass"); + + BlockType.Typed PURPLE_STAINED_GLASS_PANE = getBlockType("purple_stained_glass_pane"); + + BlockType.Typed PURPLE_TERRACOTTA = getBlockType("purple_terracotta"); + + BlockType.Typed PURPLE_WALL_BANNER = getBlockType("purple_wall_banner"); + + BlockType.Typed PURPLE_WOOL = getBlockType("purple_wool"); + + BlockType.Typed PURPUR_BLOCK = getBlockType("purpur_block"); + + BlockType.Typed PURPUR_PILLAR = getBlockType("purpur_pillar"); + + BlockType.Typed PURPUR_SLAB = getBlockType("purpur_slab"); + + BlockType.Typed PURPUR_STAIRS = getBlockType("purpur_stairs"); + + BlockType.Typed QUARTZ_BLOCK = getBlockType("quartz_block"); + + BlockType.Typed QUARTZ_BRICKS = getBlockType("quartz_bricks"); + + BlockType.Typed QUARTZ_PILLAR = getBlockType("quartz_pillar"); + + BlockType.Typed QUARTZ_SLAB = getBlockType("quartz_slab"); + + BlockType.Typed QUARTZ_STAIRS = getBlockType("quartz_stairs"); + + BlockType.Typed RAIL = getBlockType("rail"); + + BlockType.Typed RAW_COPPER_BLOCK = getBlockType("raw_copper_block"); + + BlockType.Typed RAW_GOLD_BLOCK = getBlockType("raw_gold_block"); + + BlockType.Typed RAW_IRON_BLOCK = getBlockType("raw_iron_block"); + + BlockType.Typed RED_BANNER = getBlockType("red_banner"); + + BlockType.Typed RED_BED = getBlockType("red_bed"); + + BlockType.Typed RED_CANDLE = getBlockType("red_candle"); + + BlockType.Typed RED_CANDLE_CAKE = getBlockType("red_candle_cake"); + + BlockType.Typed RED_CARPET = getBlockType("red_carpet"); + + BlockType.Typed RED_CONCRETE = getBlockType("red_concrete"); + + BlockType.Typed RED_CONCRETE_POWDER = getBlockType("red_concrete_powder"); + + BlockType.Typed RED_GLAZED_TERRACOTTA = getBlockType("red_glazed_terracotta"); + + BlockType.Typed RED_MUSHROOM = getBlockType("red_mushroom"); + + BlockType.Typed RED_MUSHROOM_BLOCK = getBlockType("red_mushroom_block"); + + BlockType.Typed RED_NETHER_BRICK_SLAB = getBlockType("red_nether_brick_slab"); + + BlockType.Typed RED_NETHER_BRICK_STAIRS = getBlockType("red_nether_brick_stairs"); + + BlockType.Typed RED_NETHER_BRICK_WALL = getBlockType("red_nether_brick_wall"); + + BlockType.Typed RED_NETHER_BRICKS = getBlockType("red_nether_bricks"); + + BlockType.Typed RED_SAND = getBlockType("red_sand"); + + BlockType.Typed RED_SANDSTONE = getBlockType("red_sandstone"); + + BlockType.Typed RED_SANDSTONE_SLAB = getBlockType("red_sandstone_slab"); + + BlockType.Typed RED_SANDSTONE_STAIRS = getBlockType("red_sandstone_stairs"); + + BlockType.Typed RED_SANDSTONE_WALL = getBlockType("red_sandstone_wall"); + + BlockType.Typed RED_SHULKER_BOX = getBlockType("red_shulker_box"); + + BlockType.Typed RED_STAINED_GLASS = getBlockType("red_stained_glass"); + + BlockType.Typed RED_STAINED_GLASS_PANE = getBlockType("red_stained_glass_pane"); + + BlockType.Typed RED_TERRACOTTA = getBlockType("red_terracotta"); + + BlockType.Typed RED_TULIP = getBlockType("red_tulip"); + + BlockType.Typed RED_WALL_BANNER = getBlockType("red_wall_banner"); + + BlockType.Typed RED_WOOL = getBlockType("red_wool"); + + BlockType.Typed REDSTONE_BLOCK = getBlockType("redstone_block"); + + BlockType.Typed REDSTONE_LAMP = getBlockType("redstone_lamp"); + + BlockType.Typed REDSTONE_ORE = getBlockType("redstone_ore"); + + BlockType.Typed REDSTONE_TORCH = getBlockType("redstone_torch"); + + BlockType.Typed REDSTONE_WALL_TORCH = getBlockType("redstone_wall_torch"); + + BlockType.Typed REDSTONE_WIRE = getBlockType("redstone_wire"); + + BlockType.Typed REINFORCED_DEEPSLATE = getBlockType("reinforced_deepslate"); + + BlockType.Typed REPEATER = getBlockType("repeater"); + + BlockType.Typed REPEATING_COMMAND_BLOCK = getBlockType("repeating_command_block"); + + BlockType.Typed RESPAWN_ANCHOR = getBlockType("respawn_anchor"); + + BlockType.Typed ROOTED_DIRT = getBlockType("rooted_dirt"); + + BlockType.Typed ROSE_BUSH = getBlockType("rose_bush"); + + BlockType.Typed SAND = getBlockType("sand"); + + BlockType.Typed SANDSTONE = getBlockType("sandstone"); + + BlockType.Typed SANDSTONE_SLAB = getBlockType("sandstone_slab"); + + BlockType.Typed SANDSTONE_STAIRS = getBlockType("sandstone_stairs"); + + BlockType.Typed SANDSTONE_WALL = getBlockType("sandstone_wall"); + + BlockType.Typed SCAFFOLDING = getBlockType("scaffolding"); + + BlockType.Typed SCULK = getBlockType("sculk"); + + BlockType.Typed SCULK_CATALYST = getBlockType("sculk_catalyst"); + + BlockType.Typed SCULK_SENSOR = getBlockType("sculk_sensor"); + + BlockType.Typed SCULK_SHRIEKER = getBlockType("sculk_shrieker"); + + BlockType.Typed SCULK_VEIN = getBlockType("sculk_vein"); + + BlockType.Typed SEA_LANTERN = getBlockType("sea_lantern"); + + BlockType.Typed SEA_PICKLE = getBlockType("sea_pickle"); + + BlockType.Typed SEAGRASS = getBlockType("seagrass"); + + BlockType.Typed SHORT_GRASS = getBlockType("short_grass"); + + BlockType.Typed SHROOMLIGHT = getBlockType("shroomlight"); + + BlockType.Typed SHULKER_BOX = getBlockType("shulker_box"); + + BlockType.Typed SKELETON_SKULL = getBlockType("skeleton_skull"); + + BlockType.Typed SKELETON_WALL_SKULL = getBlockType("skeleton_wall_skull"); + + BlockType.Typed SLIME_BLOCK = getBlockType("slime_block"); + + BlockType.Typed SMALL_AMETHYST_BUD = getBlockType("small_amethyst_bud"); + + BlockType.Typed SMALL_DRIPLEAF = getBlockType("small_dripleaf"); + + BlockType.Typed SMITHING_TABLE = getBlockType("smithing_table"); + + BlockType.Typed SMOKER = getBlockType("smoker"); + + BlockType.Typed SMOOTH_BASALT = getBlockType("smooth_basalt"); + + BlockType.Typed SMOOTH_QUARTZ = getBlockType("smooth_quartz"); + + BlockType.Typed SMOOTH_QUARTZ_SLAB = getBlockType("smooth_quartz_slab"); + + BlockType.Typed SMOOTH_QUARTZ_STAIRS = getBlockType("smooth_quartz_stairs"); + + BlockType.Typed SMOOTH_RED_SANDSTONE = getBlockType("smooth_red_sandstone"); + + BlockType.Typed SMOOTH_RED_SANDSTONE_SLAB = getBlockType("smooth_red_sandstone_slab"); + + BlockType.Typed SMOOTH_RED_SANDSTONE_STAIRS = getBlockType("smooth_red_sandstone_stairs"); + + BlockType.Typed SMOOTH_SANDSTONE = getBlockType("smooth_sandstone"); + + BlockType.Typed SMOOTH_SANDSTONE_SLAB = getBlockType("smooth_sandstone_slab"); + + BlockType.Typed SMOOTH_SANDSTONE_STAIRS = getBlockType("smooth_sandstone_stairs"); + + BlockType.Typed SMOOTH_STONE = getBlockType("smooth_stone"); + + BlockType.Typed SMOOTH_STONE_SLAB = getBlockType("smooth_stone_slab"); + + BlockType.Typed SNIFFER_EGG = getBlockType("sniffer_egg"); + + BlockType.Typed SNOW = getBlockType("snow"); + + BlockType.Typed SNOW_BLOCK = getBlockType("snow_block"); + + BlockType.Typed SOUL_CAMPFIRE = getBlockType("soul_campfire"); + + BlockType.Typed SOUL_FIRE = getBlockType("soul_fire"); + + BlockType.Typed SOUL_LANTERN = getBlockType("soul_lantern"); + + BlockType.Typed SOUL_SAND = getBlockType("soul_sand"); + + BlockType.Typed SOUL_SOIL = getBlockType("soul_soil"); + + BlockType.Typed SOUL_TORCH = getBlockType("soul_torch"); + + BlockType.Typed SOUL_WALL_TORCH = getBlockType("soul_wall_torch"); + + BlockType.Typed SPAWNER = getBlockType("spawner"); + + BlockType.Typed SPONGE = getBlockType("sponge"); + + BlockType.Typed SPORE_BLOSSOM = getBlockType("spore_blossom"); + + BlockType.Typed SPRUCE_BUTTON = getBlockType("spruce_button"); + + BlockType.Typed SPRUCE_DOOR = getBlockType("spruce_door"); + + BlockType.Typed SPRUCE_FENCE = getBlockType("spruce_fence"); + + BlockType.Typed SPRUCE_FENCE_GATE = getBlockType("spruce_fence_gate"); + + BlockType.Typed SPRUCE_HANGING_SIGN = getBlockType("spruce_hanging_sign"); + + BlockType.Typed SPRUCE_LEAVES = getBlockType("spruce_leaves"); + + BlockType.Typed SPRUCE_LOG = getBlockType("spruce_log"); + + BlockType.Typed SPRUCE_PLANKS = getBlockType("spruce_planks"); + + BlockType.Typed SPRUCE_PRESSURE_PLATE = getBlockType("spruce_pressure_plate"); + + BlockType.Typed SPRUCE_SAPLING = getBlockType("spruce_sapling"); + + BlockType.Typed SPRUCE_SIGN = getBlockType("spruce_sign"); + + BlockType.Typed SPRUCE_SLAB = getBlockType("spruce_slab"); + + BlockType.Typed SPRUCE_STAIRS = getBlockType("spruce_stairs"); + + BlockType.Typed SPRUCE_TRAPDOOR = getBlockType("spruce_trapdoor"); + + BlockType.Typed SPRUCE_WALL_HANGING_SIGN = getBlockType("spruce_wall_hanging_sign"); + + BlockType.Typed SPRUCE_WALL_SIGN = getBlockType("spruce_wall_sign"); + + BlockType.Typed SPRUCE_WOOD = getBlockType("spruce_wood"); + + BlockType.Typed STICKY_PISTON = getBlockType("sticky_piston"); + + BlockType.Typed STONE = getBlockType("stone"); + + BlockType.Typed STONE_BRICK_SLAB = getBlockType("stone_brick_slab"); + + BlockType.Typed STONE_BRICK_STAIRS = getBlockType("stone_brick_stairs"); + + BlockType.Typed STONE_BRICK_WALL = getBlockType("stone_brick_wall"); + + BlockType.Typed STONE_BRICKS = getBlockType("stone_bricks"); + + BlockType.Typed STONE_BUTTON = getBlockType("stone_button"); + + BlockType.Typed STONE_PRESSURE_PLATE = getBlockType("stone_pressure_plate"); + + BlockType.Typed STONE_SLAB = getBlockType("stone_slab"); + + BlockType.Typed STONE_STAIRS = getBlockType("stone_stairs"); + + BlockType.Typed STONECUTTER = getBlockType("stonecutter"); + + BlockType.Typed STRIPPED_ACACIA_LOG = getBlockType("stripped_acacia_log"); + + BlockType.Typed STRIPPED_ACACIA_WOOD = getBlockType("stripped_acacia_wood"); + + BlockType.Typed STRIPPED_BAMBOO_BLOCK = getBlockType("stripped_bamboo_block"); + + BlockType.Typed STRIPPED_BIRCH_LOG = getBlockType("stripped_birch_log"); + + BlockType.Typed STRIPPED_BIRCH_WOOD = getBlockType("stripped_birch_wood"); + + BlockType.Typed STRIPPED_CHERRY_LOG = getBlockType("stripped_cherry_log"); + + BlockType.Typed STRIPPED_CHERRY_WOOD = getBlockType("stripped_cherry_wood"); + + BlockType.Typed STRIPPED_CRIMSON_HYPHAE = getBlockType("stripped_crimson_hyphae"); + + BlockType.Typed STRIPPED_CRIMSON_STEM = getBlockType("stripped_crimson_stem"); + + BlockType.Typed STRIPPED_DARK_OAK_LOG = getBlockType("stripped_dark_oak_log"); + + BlockType.Typed STRIPPED_DARK_OAK_WOOD = getBlockType("stripped_dark_oak_wood"); + + BlockType.Typed STRIPPED_JUNGLE_LOG = getBlockType("stripped_jungle_log"); + + BlockType.Typed STRIPPED_JUNGLE_WOOD = getBlockType("stripped_jungle_wood"); + + BlockType.Typed STRIPPED_MANGROVE_LOG = getBlockType("stripped_mangrove_log"); + + BlockType.Typed STRIPPED_MANGROVE_WOOD = getBlockType("stripped_mangrove_wood"); + + BlockType.Typed STRIPPED_OAK_LOG = getBlockType("stripped_oak_log"); + + BlockType.Typed STRIPPED_OAK_WOOD = getBlockType("stripped_oak_wood"); + + BlockType.Typed STRIPPED_SPRUCE_LOG = getBlockType("stripped_spruce_log"); + + BlockType.Typed STRIPPED_SPRUCE_WOOD = getBlockType("stripped_spruce_wood"); + + BlockType.Typed STRIPPED_WARPED_HYPHAE = getBlockType("stripped_warped_hyphae"); + + BlockType.Typed STRIPPED_WARPED_STEM = getBlockType("stripped_warped_stem"); + + BlockType.Typed STRUCTURE_BLOCK = getBlockType("structure_block"); + + BlockType.Typed STRUCTURE_VOID = getBlockType("structure_void"); + + BlockType.Typed SUGAR_CANE = getBlockType("sugar_cane"); + + BlockType.Typed SUNFLOWER = getBlockType("sunflower"); + + BlockType.Typed SUSPICIOUS_GRAVEL = getBlockType("suspicious_gravel"); + + BlockType.Typed SUSPICIOUS_SAND = getBlockType("suspicious_sand"); + + BlockType.Typed SWEET_BERRY_BUSH = getBlockType("sweet_berry_bush"); + + BlockType.Typed TALL_GRASS = getBlockType("tall_grass"); + + BlockType.Typed TALL_SEAGRASS = getBlockType("tall_seagrass"); + + BlockType.Typed TARGET = getBlockType("target"); + + BlockType.Typed TERRACOTTA = getBlockType("terracotta"); + + BlockType.Typed TINTED_GLASS = getBlockType("tinted_glass"); + + BlockType.Typed TNT = getBlockType("tnt"); + + BlockType.Typed TORCH = getBlockType("torch"); + + BlockType.Typed TORCHFLOWER = getBlockType("torchflower"); + + BlockType.Typed TORCHFLOWER_CROP = getBlockType("torchflower_crop"); + + BlockType.Typed TRAPPED_CHEST = getBlockType("trapped_chest"); + + BlockType.Typed TRIAL_SPAWNER = getBlockType("trial_spawner"); + + BlockType.Typed TRIPWIRE = getBlockType("tripwire"); + + BlockType.Typed TRIPWIRE_HOOK = getBlockType("tripwire_hook"); + + BlockType.Typed TUBE_CORAL = getBlockType("tube_coral"); + + BlockType.Typed TUBE_CORAL_BLOCK = getBlockType("tube_coral_block"); + + BlockType.Typed TUBE_CORAL_FAN = getBlockType("tube_coral_fan"); + + BlockType.Typed TUBE_CORAL_WALL_FAN = getBlockType("tube_coral_wall_fan"); + + BlockType.Typed TUFF = getBlockType("tuff"); + + BlockType.Typed TUFF_BRICK_SLAB = getBlockType("tuff_brick_slab"); + + BlockType.Typed TUFF_BRICK_STAIRS = getBlockType("tuff_brick_stairs"); + + BlockType.Typed TUFF_BRICK_WALL = getBlockType("tuff_brick_wall"); + + BlockType.Typed TUFF_BRICKS = getBlockType("tuff_bricks"); + + BlockType.Typed TUFF_SLAB = getBlockType("tuff_slab"); + + BlockType.Typed TUFF_STAIRS = getBlockType("tuff_stairs"); + + BlockType.Typed TUFF_WALL = getBlockType("tuff_wall"); + + BlockType.Typed TURTLE_EGG = getBlockType("turtle_egg"); + + BlockType.Typed TWISTING_VINES = getBlockType("twisting_vines"); + + BlockType.Typed TWISTING_VINES_PLANT = getBlockType("twisting_vines_plant"); + + BlockType.Typed VAULT = getBlockType("vault"); + + BlockType.Typed VERDANT_FROGLIGHT = getBlockType("verdant_froglight"); + + BlockType.Typed VINE = getBlockType("vine"); + + BlockType.Typed VOID_AIR = getBlockType("void_air"); + + BlockType.Typed WALL_TORCH = getBlockType("wall_torch"); + + BlockType.Typed WARPED_BUTTON = getBlockType("warped_button"); + + BlockType.Typed WARPED_DOOR = getBlockType("warped_door"); + + BlockType.Typed WARPED_FENCE = getBlockType("warped_fence"); + + BlockType.Typed WARPED_FENCE_GATE = getBlockType("warped_fence_gate"); + + BlockType.Typed WARPED_FUNGUS = getBlockType("warped_fungus"); + + BlockType.Typed WARPED_HANGING_SIGN = getBlockType("warped_hanging_sign"); + + BlockType.Typed WARPED_HYPHAE = getBlockType("warped_hyphae"); + + BlockType.Typed WARPED_NYLIUM = getBlockType("warped_nylium"); + + BlockType.Typed WARPED_PLANKS = getBlockType("warped_planks"); + + BlockType.Typed WARPED_PRESSURE_PLATE = getBlockType("warped_pressure_plate"); + + BlockType.Typed WARPED_ROOTS = getBlockType("warped_roots"); + + BlockType.Typed WARPED_SIGN = getBlockType("warped_sign"); + + BlockType.Typed WARPED_SLAB = getBlockType("warped_slab"); + + BlockType.Typed WARPED_STAIRS = getBlockType("warped_stairs"); + + BlockType.Typed WARPED_STEM = getBlockType("warped_stem"); + + BlockType.Typed WARPED_TRAPDOOR = getBlockType("warped_trapdoor"); + + BlockType.Typed WARPED_WALL_HANGING_SIGN = getBlockType("warped_wall_hanging_sign"); + + BlockType.Typed WARPED_WALL_SIGN = getBlockType("warped_wall_sign"); + + BlockType.Typed WARPED_WART_BLOCK = getBlockType("warped_wart_block"); + + BlockType.Typed WATER = getBlockType("water"); + + BlockType.Typed WATER_CAULDRON = getBlockType("water_cauldron"); + + BlockType.Typed WAXED_CHISELED_COPPER = getBlockType("waxed_chiseled_copper"); + + BlockType.Typed WAXED_COPPER_BLOCK = getBlockType("waxed_copper_block"); + + BlockType.Typed WAXED_COPPER_BULB = getBlockType("waxed_copper_bulb"); + + BlockType.Typed WAXED_COPPER_DOOR = getBlockType("waxed_copper_door"); + + BlockType.Typed WAXED_COPPER_GRATE = getBlockType("waxed_copper_grate"); + + BlockType.Typed WAXED_COPPER_TRAPDOOR = getBlockType("waxed_copper_trapdoor"); + + BlockType.Typed WAXED_CUT_COPPER = getBlockType("waxed_cut_copper"); + + BlockType.Typed WAXED_CUT_COPPER_SLAB = getBlockType("waxed_cut_copper_slab"); + + BlockType.Typed WAXED_CUT_COPPER_STAIRS = getBlockType("waxed_cut_copper_stairs"); + + BlockType.Typed WAXED_EXPOSED_CHISELED_COPPER = getBlockType("waxed_exposed_chiseled_copper"); + + BlockType.Typed WAXED_EXPOSED_COPPER = getBlockType("waxed_exposed_copper"); + + BlockType.Typed WAXED_EXPOSED_COPPER_BULB = getBlockType("waxed_exposed_copper_bulb"); + + BlockType.Typed WAXED_EXPOSED_COPPER_DOOR = getBlockType("waxed_exposed_copper_door"); + + BlockType.Typed WAXED_EXPOSED_COPPER_GRATE = getBlockType("waxed_exposed_copper_grate"); + + BlockType.Typed WAXED_EXPOSED_COPPER_TRAPDOOR = getBlockType("waxed_exposed_copper_trapdoor"); + + BlockType.Typed WAXED_EXPOSED_CUT_COPPER = getBlockType("waxed_exposed_cut_copper"); + + BlockType.Typed WAXED_EXPOSED_CUT_COPPER_SLAB = getBlockType("waxed_exposed_cut_copper_slab"); + + BlockType.Typed WAXED_EXPOSED_CUT_COPPER_STAIRS = getBlockType("waxed_exposed_cut_copper_stairs"); + + BlockType.Typed WAXED_OXIDIZED_CHISELED_COPPER = getBlockType("waxed_oxidized_chiseled_copper"); + + BlockType.Typed WAXED_OXIDIZED_COPPER = getBlockType("waxed_oxidized_copper"); + + BlockType.Typed WAXED_OXIDIZED_COPPER_BULB = getBlockType("waxed_oxidized_copper_bulb"); + + BlockType.Typed WAXED_OXIDIZED_COPPER_DOOR = getBlockType("waxed_oxidized_copper_door"); + + BlockType.Typed WAXED_OXIDIZED_COPPER_GRATE = getBlockType("waxed_oxidized_copper_grate"); + + BlockType.Typed WAXED_OXIDIZED_COPPER_TRAPDOOR = getBlockType("waxed_oxidized_copper_trapdoor"); + + BlockType.Typed WAXED_OXIDIZED_CUT_COPPER = getBlockType("waxed_oxidized_cut_copper"); + + BlockType.Typed WAXED_OXIDIZED_CUT_COPPER_SLAB = getBlockType("waxed_oxidized_cut_copper_slab"); + + BlockType.Typed WAXED_OXIDIZED_CUT_COPPER_STAIRS = getBlockType("waxed_oxidized_cut_copper_stairs"); + + BlockType.Typed WAXED_WEATHERED_CHISELED_COPPER = getBlockType("waxed_weathered_chiseled_copper"); + + BlockType.Typed WAXED_WEATHERED_COPPER = getBlockType("waxed_weathered_copper"); + + BlockType.Typed WAXED_WEATHERED_COPPER_BULB = getBlockType("waxed_weathered_copper_bulb"); + + BlockType.Typed WAXED_WEATHERED_COPPER_DOOR = getBlockType("waxed_weathered_copper_door"); + + BlockType.Typed WAXED_WEATHERED_COPPER_GRATE = getBlockType("waxed_weathered_copper_grate"); + + BlockType.Typed WAXED_WEATHERED_COPPER_TRAPDOOR = getBlockType("waxed_weathered_copper_trapdoor"); + + BlockType.Typed WAXED_WEATHERED_CUT_COPPER = getBlockType("waxed_weathered_cut_copper"); + + BlockType.Typed WAXED_WEATHERED_CUT_COPPER_SLAB = getBlockType("waxed_weathered_cut_copper_slab"); + + BlockType.Typed WAXED_WEATHERED_CUT_COPPER_STAIRS = getBlockType("waxed_weathered_cut_copper_stairs"); + + BlockType.Typed WEATHERED_CHISELED_COPPER = getBlockType("weathered_chiseled_copper"); + + BlockType.Typed WEATHERED_COPPER = getBlockType("weathered_copper"); + + BlockType.Typed WEATHERED_COPPER_BULB = getBlockType("weathered_copper_bulb"); + + BlockType.Typed WEATHERED_COPPER_DOOR = getBlockType("weathered_copper_door"); + + BlockType.Typed WEATHERED_COPPER_GRATE = getBlockType("weathered_copper_grate"); + + BlockType.Typed WEATHERED_COPPER_TRAPDOOR = getBlockType("weathered_copper_trapdoor"); + + BlockType.Typed WEATHERED_CUT_COPPER = getBlockType("weathered_cut_copper"); + + BlockType.Typed WEATHERED_CUT_COPPER_SLAB = getBlockType("weathered_cut_copper_slab"); + + BlockType.Typed WEATHERED_CUT_COPPER_STAIRS = getBlockType("weathered_cut_copper_stairs"); + + BlockType.Typed WEEPING_VINES = getBlockType("weeping_vines"); + + BlockType.Typed WEEPING_VINES_PLANT = getBlockType("weeping_vines_plant"); + + BlockType.Typed WET_SPONGE = getBlockType("wet_sponge"); + + BlockType.Typed WHEAT = getBlockType("wheat"); + + BlockType.Typed WHITE_BANNER = getBlockType("white_banner"); + + BlockType.Typed WHITE_BED = getBlockType("white_bed"); + + BlockType.Typed WHITE_CANDLE = getBlockType("white_candle"); + + BlockType.Typed WHITE_CANDLE_CAKE = getBlockType("white_candle_cake"); + + BlockType.Typed WHITE_CARPET = getBlockType("white_carpet"); + + BlockType.Typed WHITE_CONCRETE = getBlockType("white_concrete"); + + BlockType.Typed WHITE_CONCRETE_POWDER = getBlockType("white_concrete_powder"); + + BlockType.Typed WHITE_GLAZED_TERRACOTTA = getBlockType("white_glazed_terracotta"); + + BlockType.Typed WHITE_SHULKER_BOX = getBlockType("white_shulker_box"); + + BlockType.Typed WHITE_STAINED_GLASS = getBlockType("white_stained_glass"); + + BlockType.Typed WHITE_STAINED_GLASS_PANE = getBlockType("white_stained_glass_pane"); + + BlockType.Typed WHITE_TERRACOTTA = getBlockType("white_terracotta"); + + BlockType.Typed WHITE_TULIP = getBlockType("white_tulip"); + + BlockType.Typed WHITE_WALL_BANNER = getBlockType("white_wall_banner"); + + BlockType.Typed WHITE_WOOL = getBlockType("white_wool"); + + BlockType.Typed WITHER_ROSE = getBlockType("wither_rose"); + + BlockType.Typed WITHER_SKELETON_SKULL = getBlockType("wither_skeleton_skull"); + + BlockType.Typed WITHER_SKELETON_WALL_SKULL = getBlockType("wither_skeleton_wall_skull"); + + BlockType.Typed YELLOW_BANNER = getBlockType("yellow_banner"); + + BlockType.Typed YELLOW_BED = getBlockType("yellow_bed"); + + BlockType.Typed YELLOW_CANDLE = getBlockType("yellow_candle"); + + BlockType.Typed YELLOW_CANDLE_CAKE = getBlockType("yellow_candle_cake"); + + BlockType.Typed YELLOW_CARPET = getBlockType("yellow_carpet"); + + BlockType.Typed YELLOW_CONCRETE = getBlockType("yellow_concrete"); + + BlockType.Typed YELLOW_CONCRETE_POWDER = getBlockType("yellow_concrete_powder"); + + BlockType.Typed YELLOW_GLAZED_TERRACOTTA = getBlockType("yellow_glazed_terracotta"); + + BlockType.Typed YELLOW_SHULKER_BOX = getBlockType("yellow_shulker_box"); + + BlockType.Typed YELLOW_STAINED_GLASS = getBlockType("yellow_stained_glass"); + + BlockType.Typed YELLOW_STAINED_GLASS_PANE = getBlockType("yellow_stained_glass_pane"); + + BlockType.Typed YELLOW_TERRACOTTA = getBlockType("yellow_terracotta"); + + BlockType.Typed YELLOW_WALL_BANNER = getBlockType("yellow_wall_banner"); + + BlockType.Typed YELLOW_WOOL = getBlockType("yellow_wool"); + + BlockType.Typed ZOMBIE_HEAD = getBlockType("zombie_head"); + + BlockType.Typed ZOMBIE_WALL_HEAD = getBlockType("zombie_wall_head"); + // Paper end - Generated/BlockType + // + + @NotNull + private static B getBlockType(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + BlockType blockType = Registry.BLOCK.get(namespacedKey); + Preconditions.checkNotNull(blockType, "No BlockType found for %s. This is a bug.", namespacedKey); + // Cast instead of using BlockType#typed, since block type can be a mock during testing and would return null + return (B) blockType; + } + + /** + * Yields this block type as a typed version of itself with a plain {@link BlockData} representing it. + * + * @return the typed block type. + */ + @NotNull + BlockType.Typed typed(); + + /** + * Yields this block type as a typed version of itself with a specific {@link BlockData} representing it. + * + * @param blockDataType the class type of the {@link BlockData} to type this {@link BlockType} with. + * @param the generic type of the block data to type this block type with. + * @return the typed block type. + */ + @NotNull + BlockType.Typed typed(@NotNull Class blockDataType); + + /** + * Returns true if this BlockType has a corresponding {@link ItemType}. + * + * @return true if there is a corresponding ItemType, otherwise false + * @see #getItemType() + */ + boolean hasItemType(); + + /** + * Returns the corresponding {@link ItemType} for the given BlockType. + *

+ * If there is no corresponding {@link ItemType} an error will be thrown. + * + * @return the corresponding ItemType + * @see #hasItemType() + * @see BlockData#getPlacementMaterial() + */ + @NotNull + ItemType getItemType(); + + /** + * Gets the BlockData class of this BlockType + * + * @return the BlockData class of this BlockType + */ + @NotNull + Class getBlockDataClass(); + + /** + * Creates a new {@link BlockData} instance for this block type, with all + * properties initialized to unspecified defaults. + * + * @return new data instance + */ + @NotNull + BlockData createBlockData(); + + /** + * Creates a new {@link BlockData} instance for this block type, with all + * properties initialized to unspecified defaults, except for those provided + * in data. + * + * @param data data string + * @return new data instance + * @throws IllegalArgumentException if the specified data is not valid + */ + @NotNull + BlockData createBlockData(@Nullable String data); + + /** + * Check if the blockt type is solid (can be built upon) + * + * @return True if this block type is solid + */ + boolean isSolid(); + + /** + * Check if the block type can catch fire + * + * @return True if this block type can catch fire + */ + boolean isFlammable(); + + /** + * Check if the block type can burn away + * + * @return True if this block type can burn away + */ + boolean isBurnable(); + + /** + * Check if the block type is occludes light in the lighting engine. + *

+ * Generally speaking, most full blocks will occlude light. Non-full blocks are + * not occluding (e.g. anvils, chests, tall grass, stairs, etc.), nor are specific + * full blocks such as barriers or spawners which block light despite their texture. + *

+ * An occluding block will have the following effects: + *

    + *
  • Chests cannot be opened if an occluding block is above it. + *
  • Mobs cannot spawn inside of occluding blocks. + *
  • Only occluding blocks can be "powered" ({@link Block#isBlockPowered()}). + *
+ * This list may be inconclusive. For a full list of the side effects of an occluding + * block, see the Minecraft Wiki. + * + * @return True if this block type occludes light + */ + boolean isOccluding(); + + /** + * @return True if this block type is affected by gravity. + */ + boolean hasGravity(); + + /** + * Checks if this block type can be interacted with. + *

+ * Interactable block types include those with functionality when they are + * interacted with by a player such as chests, furnaces, etc. + *

+ * Some blocks such as piston heads and stairs are considered interactable + * though may not perform any additional functionality. + *

+ * Note that the interactability of some block types may be dependant on their + * state as well. This method will return true if there is at least one + * state in which additional interact handling is performed for the + * block type. + * + * @deprecated This method is not comprehensive and does not accurately reflect what block types are + * interactable. Many "interactions" are defined on the item not block, and many are conditional on some other world state + * checks being true. + * + * @return true if this block type can be interacted with. + */ + @Deprecated // Paper + boolean isInteractable(); + + /** + * Obtains the block's hardness level (also known as "strength"). + *
+ * This number is used to calculate the time required to break each block. + * + * @return the hardness of that block type. + */ + float getHardness(); + + /** + * Obtains the blast resistance value (also known as block "durability"). + *
+ * This value is used in explosions to calculate whether a block should be + * broken or not. + * + * @return the blast resistance of that block type. + */ + float getBlastResistance(); + + /** + * Returns a value that represents how 'slippery' the block is. + *

+ * Blocks with higher slipperiness, like {@link BlockType#ICE} can be slid on + * further by the player and other entities. + *

+ * Most blocks have a default slipperiness of {@code 0.6f}. + * + * @return the slipperiness of this block + */ + float getSlipperiness(); + + /** + * Check if the block type is an air block. + * + * @return True if this block type is an air block. + */ + boolean isAir(); + + /** + * Gets if the BlockType is enabled by the features in a world. + * + * @param world the world to check + * @return true if this BlockType can be used in this World. + * @deprecated Use {@link io.papermc.paper.world.flag.FeatureFlagSetHolder#isEnabled(io.papermc.paper.world.flag.FeatureDependant)} + */ + @Deprecated(forRemoval = true, since = "1.21.1") // Paper + boolean isEnabledByFeature(@NotNull World world); + + /** + * Tries to convert this BlockType into a Material + * + * @return the converted Material or null + * @deprecated only for internal use + */ + @Nullable + @Deprecated + Material asMaterial(); + + // Paper start - add Translatable + /** + * @deprecated use {@link #translationKey()} and {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} + */ + @Deprecated(forRemoval = true) + @Override + @NotNull String getTranslationKey(); + // Paper end - add Translatable + + // Paper start - hasCollision API + /** + * Checks if this block type has collision. + *

+ * @return false if this block never has collision, true if it might have collision + */ + boolean hasCollision(); + // Paper end - hasCollision API +} diff --git a/paper-generator/generatedApi/org/bukkit/block/banner/PatternType.java b/paper-generator/generatedApi/org/bukkit/block/banner/PatternType.java new file mode 100644 index 0000000000..d7549b323a --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/block/banner/PatternType.java @@ -0,0 +1,184 @@ +package org.bukkit.block.banner; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Locale; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.util.OldEnum; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface PatternType extends OldEnum, Keyed { + // Paper start - Generated/PatternType + // @GeneratedFrom 1.21.1 + PatternType BASE = getType("base"); + + PatternType BORDER = getType("border"); + + PatternType BRICKS = getType("bricks"); + + PatternType CIRCLE = getType("circle"); + + PatternType CREEPER = getType("creeper"); + + PatternType CROSS = getType("cross"); + + PatternType CURLY_BORDER = getType("curly_border"); + + PatternType DIAGONAL_LEFT = getType("diagonal_left"); + + PatternType DIAGONAL_RIGHT = getType("diagonal_right"); + + PatternType DIAGONAL_UP_LEFT = getType("diagonal_up_left"); + + PatternType DIAGONAL_UP_RIGHT = getType("diagonal_up_right"); + + PatternType FLOW = getType("flow"); + + PatternType FLOWER = getType("flower"); + + PatternType GLOBE = getType("globe"); + + PatternType GRADIENT = getType("gradient"); + + PatternType GRADIENT_UP = getType("gradient_up"); + + PatternType GUSTER = getType("guster"); + + PatternType HALF_HORIZONTAL = getType("half_horizontal"); + + PatternType HALF_HORIZONTAL_BOTTOM = getType("half_horizontal_bottom"); + + PatternType HALF_VERTICAL = getType("half_vertical"); + + PatternType HALF_VERTICAL_RIGHT = getType("half_vertical_right"); + + PatternType MOJANG = getType("mojang"); + + PatternType PIGLIN = getType("piglin"); + + PatternType RHOMBUS = getType("rhombus"); + + PatternType SKULL = getType("skull"); + + PatternType SMALL_STRIPES = getType("small_stripes"); + + PatternType SQUARE_BOTTOM_LEFT = getType("square_bottom_left"); + + PatternType SQUARE_BOTTOM_RIGHT = getType("square_bottom_right"); + + PatternType SQUARE_TOP_LEFT = getType("square_top_left"); + + PatternType SQUARE_TOP_RIGHT = getType("square_top_right"); + + PatternType STRAIGHT_CROSS = getType("straight_cross"); + + PatternType STRIPE_BOTTOM = getType("stripe_bottom"); + + PatternType STRIPE_CENTER = getType("stripe_center"); + + PatternType STRIPE_DOWNLEFT = getType("stripe_downleft"); + + PatternType STRIPE_DOWNRIGHT = getType("stripe_downright"); + + PatternType STRIPE_LEFT = getType("stripe_left"); + + PatternType STRIPE_MIDDLE = getType("stripe_middle"); + + PatternType STRIPE_RIGHT = getType("stripe_right"); + + PatternType STRIPE_TOP = getType("stripe_top"); + + PatternType TRIANGLE_BOTTOM = getType("triangle_bottom"); + + PatternType TRIANGLE_TOP = getType("triangle_top"); + + PatternType TRIANGLES_BOTTOM = getType("triangles_bottom"); + + PatternType TRIANGLES_TOP = getType("triangles_top"); + // Paper end - Generated/PatternType + + // Paper start - deprecate getKey + /** + * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)}, + * and {@link io.papermc.paper.registry.RegistryKey#BANNER_PATTERN}. PatternTypes can exist without a key. + */ + @Deprecated(since = "1.20.5") + // Paper end - deprecate getKey + @Override + @NotNull + public NamespacedKey getKey(); + + /** + * Returns the identifier used to represent + * this pattern type + * + * @return the pattern's identifier + * @see #getKey + * @deprecated magic value + */ + @NotNull + @Deprecated(forRemoval = true) + public String getIdentifier(); + + /** + * Returns the pattern type which matches the passed + * identifier or null if no matches are found + * + * @param identifier the identifier + * @return the matched pattern type or null + * @see Registry#BANNER_PATTERN + * @deprecated magic value, use {@link Registry#get(NamespacedKey)} instead + */ + @Contract("null -> null") + @Nullable + @Deprecated(forRemoval = true) + public static PatternType getByIdentifier(@Nullable String identifier) { + if (identifier == null) { + return null; + } + + for (PatternType type : Registry.BANNER_PATTERN) { + if (identifier.equals(type.getIdentifier())) { + return type; + } + } + + return null; + } + + @NotNull + private static PatternType getType(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + PatternType type = Registry.BANNER_PATTERN.get(namespacedKey); + + Preconditions.checkNotNull(type, "No Banner Pattern found for %s. This is a bug.", namespacedKey); + return type; + } + + /** + * @param name of the pattern type. + * @return the pattern type with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static PatternType valueOf(@NotNull String name) { + PatternType type = Registry.BANNER_PATTERN.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(type != null, "No pattern type found with the name %s", name); + return type; + } + + /** + * @return an array of all known pattern types. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static PatternType[] values() { + return Lists.newArrayList(Registry.BANNER_PATTERN).toArray(new PatternType[0]); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/damage/DamageType.java b/paper-generator/generatedApi/org/bukkit/damage/DamageType.java new file mode 100644 index 0000000000..8490fcb34c --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/damage/DamageType.java @@ -0,0 +1,169 @@ +package org.bukkit.damage; + +import com.google.common.base.Preconditions; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.Translatable; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; + +/** + * Represent a type of damage that an entity can receive. + *

+ * Constants in this class include the base types provided by the vanilla + * server. Data packs are capable of registering more types of damage which may + * be obtained through the {@link Registry#DAMAGE_TYPE}. + * + * @see Minecraft Wiki + */ +@ApiStatus.Experimental +public interface DamageType extends Keyed, Translatable { + + // Paper start - Generated/DamageType + // @GeneratedFrom 1.21.1 + DamageType ARROW = getDamageType("arrow"); + + DamageType BAD_RESPAWN_POINT = getDamageType("bad_respawn_point"); + + DamageType CACTUS = getDamageType("cactus"); + + DamageType CAMPFIRE = getDamageType("campfire"); + + DamageType CRAMMING = getDamageType("cramming"); + + DamageType DRAGON_BREATH = getDamageType("dragon_breath"); + + DamageType DROWN = getDamageType("drown"); + + DamageType DRY_OUT = getDamageType("dry_out"); + + DamageType EXPLOSION = getDamageType("explosion"); + + DamageType FALL = getDamageType("fall"); + + DamageType FALLING_ANVIL = getDamageType("falling_anvil"); + + DamageType FALLING_BLOCK = getDamageType("falling_block"); + + DamageType FALLING_STALACTITE = getDamageType("falling_stalactite"); + + DamageType FIREBALL = getDamageType("fireball"); + + DamageType FIREWORKS = getDamageType("fireworks"); + + DamageType FLY_INTO_WALL = getDamageType("fly_into_wall"); + + DamageType FREEZE = getDamageType("freeze"); + + DamageType GENERIC = getDamageType("generic"); + + DamageType GENERIC_KILL = getDamageType("generic_kill"); + + DamageType HOT_FLOOR = getDamageType("hot_floor"); + + DamageType IN_FIRE = getDamageType("in_fire"); + + DamageType IN_WALL = getDamageType("in_wall"); + + DamageType INDIRECT_MAGIC = getDamageType("indirect_magic"); + + DamageType LAVA = getDamageType("lava"); + + DamageType LIGHTNING_BOLT = getDamageType("lightning_bolt"); + + DamageType MAGIC = getDamageType("magic"); + + DamageType MOB_ATTACK = getDamageType("mob_attack"); + + DamageType MOB_ATTACK_NO_AGGRO = getDamageType("mob_attack_no_aggro"); + + DamageType MOB_PROJECTILE = getDamageType("mob_projectile"); + + DamageType ON_FIRE = getDamageType("on_fire"); + + DamageType OUT_OF_WORLD = getDamageType("out_of_world"); + + DamageType OUTSIDE_BORDER = getDamageType("outside_border"); + + DamageType PLAYER_ATTACK = getDamageType("player_attack"); + + DamageType PLAYER_EXPLOSION = getDamageType("player_explosion"); + + DamageType SONIC_BOOM = getDamageType("sonic_boom"); + + DamageType SPIT = getDamageType("spit"); + + DamageType STALAGMITE = getDamageType("stalagmite"); + + DamageType STARVE = getDamageType("starve"); + + DamageType STING = getDamageType("sting"); + + DamageType SWEET_BERRY_BUSH = getDamageType("sweet_berry_bush"); + + DamageType THORNS = getDamageType("thorns"); + + DamageType THROWN = getDamageType("thrown"); + + DamageType TRIDENT = getDamageType("trident"); + + DamageType UNATTRIBUTED_FIREBALL = getDamageType("unattributed_fireball"); + + DamageType WIND_CHARGE = getDamageType("wind_charge"); + + DamageType WITHER = getDamageType("wither"); + + DamageType WITHER_SKULL = getDamageType("wither_skull"); + // Paper end - Generated/DamageType + + @NotNull + private static DamageType getDamageType(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + return Preconditions.checkNotNull(Registry.DAMAGE_TYPE.get(namespacedKey), "No DamageType found for %s. This is a bug.", namespacedKey); + } + + /** + * {@inheritDoc} + *

+ * The returned key is that of the death message sent when this damage type + * is responsible for the death of an entity. + *

+ * Note This translation key is only used if + * {@link #getDeathMessageType()} is {@link DeathMessageType#DEFAULT} + */ + @NotNull + @Override + public String getTranslationKey(); + + /** + * Get the {@link DamageScaling} for this damage type. + * + * @return the damage scaling + */ + @NotNull + public DamageScaling getDamageScaling(); + + /** + * Get the {@link DamageEffect} for this damage type. + * + * @return the damage effect + */ + @NotNull + public DamageEffect getDamageEffect(); + + /** + * Get the {@link DeathMessageType} for this damage type. + * + * @return the death message type + */ + @NotNull + public DeathMessageType getDeathMessageType(); + + /** + * Get the amount of hunger exhaustion caused by this damage type. + * + * @return the exhaustion + */ + public float getExhaustion(); +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/Boat.java b/paper-generator/generatedApi/org/bukkit/entity/Boat.java new file mode 100644 index 0000000000..1e783d650f --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Boat.java @@ -0,0 +1,194 @@ +package org.bukkit.entity; + +import org.bukkit.Material; +import org.bukkit.TreeSpecies; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a boat entity. + */ +public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Paper - Leashable API + + /** + * Gets the wood type of the boat. + * + * @return the wood type + * @deprecated deprecated in favor of {@link #getBoatType()} + */ + @Deprecated + @NotNull + TreeSpecies getWoodType(); + + /** + * Sets the wood type of the boat. + * + * @param species the new wood type + * @deprecated deprecated in favor of {@link #setBoatType(Type)} + */ + @Deprecated + void setWoodType(@NotNull TreeSpecies species); + + /** + * Gets the type of the boat. + * + * @return the boat type + */ + @NotNull + Type getBoatType(); + + /** + * Sets the type of the boat. + * + * @param type the new type + */ + void setBoatType(@NotNull Type type); + + /** + * Gets the maximum speed of a boat. The speed is unrelated to the + * velocity. + * + * @return The max speed. + * @deprecated boats are complex and many of these methods do not work correctly across multiple versions. + */ + @Deprecated + public double getMaxSpeed(); + + /** + * Sets the maximum speed of a boat. Must be nonnegative. Default is 0.4D. + * + * @param speed The max speed. + * @deprecated boats are complex and many of these methods do not work correctly across multiple versions. + */ + @Deprecated + public void setMaxSpeed(double speed); + + /** + * Gets the deceleration rate (newSpeed = curSpeed * rate) of occupied + * boats. The default is 0.2. + * + * @return The rate of deceleration + * @deprecated boats are complex and many of these methods do not work correctly across multiple versions. + */ + @Deprecated + public double getOccupiedDeceleration(); + + /** + * Sets the deceleration rate (newSpeed = curSpeed * rate) of occupied + * boats. Setting this to a higher value allows for quicker acceleration. + * The default is 0.2. + * + * @param rate deceleration rate + * @deprecated boats are complex and many of these methods do not work correctly across multiple versions. + */ + @Deprecated + public void setOccupiedDeceleration(double rate); + + /** + * Gets the deceleration rate (newSpeed = curSpeed * rate) of unoccupied + * boats. The default is -1. Values below 0 indicate that no additional + * deceleration is imposed. + * + * @return The rate of deceleration + * @deprecated boats are complex and many of these methods do not work correctly across multiple versions. + */ + @Deprecated + public double getUnoccupiedDeceleration(); + + /** + * Sets the deceleration rate (newSpeed = curSpeed * rate) of unoccupied + * boats. Setting this to a higher value allows for quicker deceleration + * of boats when a player disembarks. The default is -1. Values below 0 + * indicate that no additional deceleration is imposed. + * + * @param rate deceleration rate + * @deprecated boats are complex and many of these methods do not work correctly across multiple versions. + */ + @Deprecated + public void setUnoccupiedDeceleration(double rate); + + /** + * Get whether boats can work on land. + * + * @return whether boats can work on land + * @deprecated boats are complex and many of these methods do not work correctly across multiple versions. + */ + @Deprecated + public boolean getWorkOnLand(); + + /** + * Set whether boats can work on land. + * + * @param workOnLand whether boats can work on land + * @deprecated boats are complex and many of these methods do not work correctly across multiple versions. + */ + @Deprecated + public void setWorkOnLand(boolean workOnLand); + + /** + * Gets the status of the boat. + * + * @return the status + */ + @NotNull + public Status getStatus(); + + /** + * Represents the type of boats. + */ + public enum Type { + // Paper start - Generated/BoatType + // @GeneratedFrom 1.21.1 + OAK(Material.OAK_PLANKS), + SPRUCE(Material.SPRUCE_PLANKS), + BIRCH(Material.BIRCH_PLANKS), + JUNGLE(Material.JUNGLE_PLANKS), + ACACIA(Material.ACACIA_PLANKS), + CHERRY(Material.CHERRY_PLANKS), + DARK_OAK(Material.DARK_OAK_PLANKS), + MANGROVE(Material.MANGROVE_PLANKS), + BAMBOO(Material.BAMBOO_PLANKS); + // Paper end - Generated/BoatType + + private final Material materialBlock; + + private Type(Material materialBlock) { + this.materialBlock = materialBlock; + } + + /** + * Gets the material of the boat type. + * + * @return a material + */ + @NotNull + public Material getMaterial() { + return this.materialBlock; + } + } + + /** + * Represents the status of the boat. + */ + public enum Status { + + NOT_IN_WORLD, // Paper + // Paper start - Generated/BoatStatus + // @GeneratedFrom 1.21.1 + IN_WATER, + UNDER_WATER, + UNDER_FLOWING_WATER, + ON_LAND, + IN_AIR; + // Paper end - Generated/BoatStatus + } + + // Paper start + /** + * Gets the {@link Material} that represents this Boat type. + * + * @return the boat material. + */ + @NotNull + public Material getBoatMaterial(); + // Paper end +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/Cat.java b/paper-generator/generatedApi/org/bukkit/entity/Cat.java new file mode 100644 index 0000000000..4d82476792 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Cat.java @@ -0,0 +1,144 @@ +package org.bukkit.entity; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Locale; +import org.bukkit.DyeColor; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.util.OldEnum; +import org.jetbrains.annotations.NotNull; + +/** + * Meow. + */ +public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarColorable { // Paper - CollarColorable + + /** + * Gets the current type of this cat. + * + * @return Type of the cat. + */ + @NotNull + public Type getCatType(); + + /** + * Sets the current type of this cat. + * + * @param type New type of this cat. + */ + public void setCatType(@NotNull Type type); + + /** + * Get the collar color of this cat + * + * @return the color of the collar + */ + @NotNull + @Override // Paper + public DyeColor getCollarColor(); + + /** + * Set the collar color of this cat + * + * @param color the color to apply + */ + @Override // Paper + public void setCollarColor(@NotNull DyeColor color); + + /** + * Represents the various different cat types there are. + */ + interface Type extends OldEnum, Keyed { + + // Paper start - Generated/CatType + // @GeneratedFrom 1.21.1 + Type ALL_BLACK = getType("all_black"); + + Type BLACK = getType("black"); + + Type BRITISH_SHORTHAIR = getType("british_shorthair"); + + Type CALICO = getType("calico"); + + Type JELLIE = getType("jellie"); + + Type PERSIAN = getType("persian"); + + Type RAGDOLL = getType("ragdoll"); + + Type RED = getType("red"); + + Type SIAMESE = getType("siamese"); + + Type TABBY = getType("tabby"); + + Type WHITE = getType("white"); + // Paper end - Generated/CatType + + @NotNull + private static Type getType(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + Type type = Registry.CAT_VARIANT.get(namespacedKey); + + Preconditions.checkNotNull(type, "No cat type found for %s. This is a bug.", namespacedKey); + return type; + } + + /** + * @param name of the cat type. + * @return the cat type with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Type valueOf(@NotNull String name) { + Type type = Registry.CAT_VARIANT.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(type != null, "No cat type found with the name %s", name); + return type; + } + + /** + * @return an array of all known cat types. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Type[] values() { + return Lists.newArrayList(Registry.CAT_VARIANT).toArray(new Type[0]); + } + } + + // Paper start - More cat api + /** + * Sets if the cat is lying down. + * This is visual and does not affect the behaviour of the cat. + * + * @param lyingDown whether the cat should lie down + */ + public void setLyingDown(boolean lyingDown); + + /** + * Gets if the cat is lying down. + * + * @return whether the cat is lying down + */ + public boolean isLyingDown(); + + /** + * Sets if the cat has its head up. + * This is visual and does not affect the behaviour of the cat. + * + * @param headUp head is up + */ + public void setHeadUp(boolean headUp); + + /** + * Gets if the cat has its head up. + * + * @return head is up + */ + public boolean isHeadUp(); + // Paper end - More cat api +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/EntityType.java b/paper-generator/generatedApi/org/bukkit/entity/EntityType.java new file mode 100644 index 0000000000..9bcfa4f079 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/EntityType.java @@ -0,0 +1,332 @@ +package org.bukkit.entity; + +import com.google.common.base.Preconditions; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import org.bukkit.Bukkit; +import org.bukkit.Keyed; +import org.bukkit.Location; +import org.bukkit.NamespacedKey; +import org.bukkit.Translatable; +import org.bukkit.World; +import org.bukkit.entity.minecart.CommandMinecart; +import org.bukkit.entity.minecart.ExplosiveMinecart; +import org.bukkit.entity.minecart.HopperMinecart; +import org.bukkit.entity.minecart.PoweredMinecart; +import org.bukkit.entity.minecart.RideableMinecart; +import org.bukkit.entity.minecart.SpawnerMinecart; +import org.bukkit.entity.minecart.StorageMinecart; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffectType; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public enum EntityType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - translatable + + // These strings MUST match the strings in nms.EntityTypes and are case sensitive. + // Paper start - Generated/EntityType + // @GeneratedFrom 1.21.1 + ALLAY("allay", Allay.class, -1), + AREA_EFFECT_CLOUD("area_effect_cloud", AreaEffectCloud.class, 3), + ARMADILLO("armadillo", Armadillo.class, -1), + ARMOR_STAND("armor_stand", ArmorStand.class, 30), + ARROW("arrow", Arrow.class, 10), + AXOLOTL("axolotl", Axolotl.class, -1), + BAT("bat", Bat.class, 65), + BEE("bee", Bee.class, -1), + BLAZE("blaze", Blaze.class, 61), + BLOCK_DISPLAY("block_display", BlockDisplay.class, -1), + BOAT("boat", Boat.class, 41), + BOGGED("bogged", Bogged.class, -1), + BREEZE("breeze", Breeze.class, -1), + BREEZE_WIND_CHARGE("breeze_wind_charge", BreezeWindCharge.class, -1), + CAMEL("camel", Camel.class, -1), + CAT("cat", Cat.class, -1), + CAVE_SPIDER("cave_spider", CaveSpider.class, 59), + CHEST_BOAT("chest_boat", ChestBoat.class, -1), + CHEST_MINECART("chest_minecart", StorageMinecart.class, 43), + CHICKEN("chicken", Chicken.class, 93), + COD("cod", Cod.class, -1), + COMMAND_BLOCK_MINECART("command_block_minecart", CommandMinecart.class, 40), + COW("cow", Cow.class, 92), + CREEPER("creeper", Creeper.class, 50), + DOLPHIN("dolphin", Dolphin.class, -1), + DONKEY("donkey", Donkey.class, 31), + DRAGON_FIREBALL("dragon_fireball", DragonFireball.class, 26), + DROWNED("drowned", Drowned.class, -1), + EGG("egg", Egg.class, 7), + ELDER_GUARDIAN("elder_guardian", ElderGuardian.class, 4), + END_CRYSTAL("end_crystal", EnderCrystal.class, 200), + ENDER_DRAGON("ender_dragon", EnderDragon.class, 63), + ENDER_PEARL("ender_pearl", EnderPearl.class, 14), + ENDERMAN("enderman", Enderman.class, 58), + ENDERMITE("endermite", Endermite.class, 67), + EVOKER("evoker", Evoker.class, 34), + EVOKER_FANGS("evoker_fangs", EvokerFangs.class, 33), + EXPERIENCE_BOTTLE("experience_bottle", ThrownExpBottle.class, 17), + EXPERIENCE_ORB("experience_orb", ExperienceOrb.class, 2), + EYE_OF_ENDER("eye_of_ender", EnderSignal.class, 15), + FALLING_BLOCK("falling_block", FallingBlock.class, 21), + FIREBALL("fireball", Fireball.class, 12), + FIREWORK_ROCKET("firework_rocket", Firework.class, 22), + FISHING_BOBBER("fishing_bobber", FishHook.class, -1, false), + FOX("fox", Fox.class, -1), + FROG("frog", Frog.class, -1), + FURNACE_MINECART("furnace_minecart", PoweredMinecart.class, 44), + GHAST("ghast", Ghast.class, 56), + GIANT("giant", Giant.class, 53), + GLOW_ITEM_FRAME("glow_item_frame", GlowItemFrame.class, -1), + GLOW_SQUID("glow_squid", GlowSquid.class, -1), + GOAT("goat", Goat.class, -1), + GUARDIAN("guardian", Guardian.class, 68), + HOGLIN("hoglin", Hoglin.class, -1), + HOPPER_MINECART("hopper_minecart", HopperMinecart.class, 46), + HORSE("horse", Horse.class, 100), + HUSK("husk", Husk.class, 23), + ILLUSIONER("illusioner", Illusioner.class, 37), + INTERACTION("interaction", Interaction.class, -1), + IRON_GOLEM("iron_golem", IronGolem.class, 99), + ITEM("item", Item.class, 1), + ITEM_DISPLAY("item_display", ItemDisplay.class, -1), + ITEM_FRAME("item_frame", ItemFrame.class, 18), + LEASH_KNOT("leash_knot", LeashHitch.class, 8), + LIGHTNING_BOLT("lightning_bolt", LightningStrike.class, -1), + LLAMA("llama", Llama.class, 103), + LLAMA_SPIT("llama_spit", LlamaSpit.class, 104), + MAGMA_CUBE("magma_cube", MagmaCube.class, 62), + MARKER("marker", Marker.class, -1), + MINECART("minecart", Minecart.class, 42), + MOOSHROOM("mooshroom", MushroomCow.class, 96), + MULE("mule", Mule.class, 32), + OCELOT("ocelot", Ocelot.class, 98), + OMINOUS_ITEM_SPAWNER("ominous_item_spawner", OminousItemSpawner.class, -1), + PAINTING("painting", Painting.class, 9), + PANDA("panda", Panda.class, -1), + PARROT("parrot", Parrot.class, 105), + PHANTOM("phantom", Phantom.class, -1), + PIG("pig", Pig.class, 90), + PIGLIN("piglin", Piglin.class, -1), + PIGLIN_BRUTE("piglin_brute", PiglinBrute.class, -1), + PILLAGER("pillager", Pillager.class, -1), + PLAYER("player", Player.class, -1, false), + POLAR_BEAR("polar_bear", PolarBear.class, 102), + POTION("potion", ThrownPotion.class, 16), + PUFFERFISH("pufferfish", PufferFish.class, -1), + RABBIT("rabbit", Rabbit.class, 101), + RAVAGER("ravager", Ravager.class, -1), + SALMON("salmon", Salmon.class, -1), + SHEEP("sheep", Sheep.class, 91), + SHULKER("shulker", Shulker.class, 69), + SHULKER_BULLET("shulker_bullet", ShulkerBullet.class, 25), + SILVERFISH("silverfish", Silverfish.class, 60), + SKELETON("skeleton", Skeleton.class, 51), + SKELETON_HORSE("skeleton_horse", SkeletonHorse.class, 28), + SLIME("slime", Slime.class, 55), + SMALL_FIREBALL("small_fireball", SmallFireball.class, 13), + SNIFFER("sniffer", Sniffer.class, -1), + SNOW_GOLEM("snow_golem", Snowman.class, 97), + SNOWBALL("snowball", Snowball.class, 11), + SPAWNER_MINECART("spawner_minecart", SpawnerMinecart.class, 47), + SPECTRAL_ARROW("spectral_arrow", SpectralArrow.class, 24), + SPIDER("spider", Spider.class, 52), + SQUID("squid", Squid.class, 94), + STRAY("stray", Stray.class, 6), + STRIDER("strider", Strider.class, -1), + TADPOLE("tadpole", Tadpole.class, -1), + TEXT_DISPLAY("text_display", TextDisplay.class, -1), + TNT("tnt", TNTPrimed.class, 20), + TNT_MINECART("tnt_minecart", ExplosiveMinecart.class, 45), + TRADER_LLAMA("trader_llama", TraderLlama.class, -1), + TRIDENT("trident", Trident.class, -1), + TROPICAL_FISH("tropical_fish", TropicalFish.class, -1), + TURTLE("turtle", Turtle.class, -1), + VEX("vex", Vex.class, 35), + VILLAGER("villager", Villager.class, 120), + VINDICATOR("vindicator", Vindicator.class, 36), + WANDERING_TRADER("wandering_trader", WanderingTrader.class, -1), + WARDEN("warden", Warden.class, -1), + WIND_CHARGE("wind_charge", WindCharge.class, -1), + WITCH("witch", Witch.class, 66), + WITHER("wither", Wither.class, 64), + WITHER_SKELETON("wither_skeleton", WitherSkeleton.class, 5), + WITHER_SKULL("wither_skull", WitherSkull.class, 19), + WOLF("wolf", Wolf.class, 95), + ZOGLIN("zoglin", Zoglin.class, -1), + ZOMBIE("zombie", Zombie.class, 54), + ZOMBIE_HORSE("zombie_horse", ZombieHorse.class, 29), + ZOMBIE_VILLAGER("zombie_villager", ZombieVillager.class, 27), + ZOMBIFIED_PIGLIN("zombified_piglin", PigZombie.class, 57), + // Paper end - Generated/EntityType + /** + * An unknown entity without an Entity Class + */ + UNKNOWN(null, null, -1, false); + + private final String name; + private final Class clazz; + private final short typeId; + private final boolean independent, living; + private final NamespacedKey key; + + private static final Map NAME_MAP = new HashMap(); + private static final Map ID_MAP = new HashMap(); + + static { + for (EntityType type : values()) { + if (type.name != null) { + NAME_MAP.put(type.name.toLowerCase(Locale.ROOT), type); + } + if (type.typeId > 0) { + ID_MAP.put(type.typeId, type); + } + } + } + + private EntityType(/*@Nullable*/ String name, /*@Nullable*/ Class clazz, int typeId) { + this(name, clazz, typeId, true); + } + + private EntityType(/*@Nullable*/ String name, /*@Nullable*/ Class clazz, int typeId, boolean independent) { + this.name = name; + this.clazz = clazz; + this.typeId = (short) typeId; + this.independent = independent; + this.living = clazz != null && LivingEntity.class.isAssignableFrom(clazz); + this.key = (name == null) ? null : NamespacedKey.minecraft(name); + } + + /** + * Gets the entity type name. + * + * @return the entity type's name + * @deprecated Magic value + */ + @Deprecated + @Nullable + public String getName() { + return name; + } + + @NotNull + @Override + public NamespacedKey getKey() { + Preconditions.checkArgument(key != null, "EntityType doesn't have key! Is it UNKNOWN?"); + + return key; + } + + @Nullable + public Class getEntityClass() { + return clazz; + } + + /** + * Gets the entity type id. + * + * @return the raw type id + * @deprecated Magic value + */ + @Deprecated + public short getTypeId() { + return typeId; + } + + /** + * Gets an entity type from its name. + * + * @param name the entity type's name + * @return the matching entity type or null + * @apiNote Internal Use Only + */ + @org.jetbrains.annotations.ApiStatus.Internal // Paper + @Contract("null -> null") + @Nullable + public static EntityType fromName(@Nullable String name) { + if (name == null) { + return null; + } + return NAME_MAP.get(name.toLowerCase(Locale.ROOT)); + } + + /** + * Gets an entity from its id. + * + * @param id the raw type id + * @return the matching entity type or null + * @deprecated Magic value + */ + @Deprecated + @Nullable + public static EntityType fromId(int id) { + if (id > Short.MAX_VALUE) { + return null; + } + return ID_MAP.get((short) id); + } + + /** + * Some entities cannot be spawned using {@link + * World#spawnEntity(Location, EntityType)} or {@link + * World#spawn(Location, Class)}, usually because they require additional + * information in order to spawn. + * + * @return False if the entity type cannot be spawned + */ + public boolean isSpawnable() { + return independent; + } + + public boolean isAlive() { + return living; + } + + @Override + @NotNull + @Deprecated(forRemoval = true) // Paper + public String getTranslationKey() { + return Bukkit.getUnsafe().getTranslationKey(this); + } + + // Paper start + /** + * @throws IllegalArgumentException if the entity does not have a translation key (is probably a custom entity) + */ + @Override + public @NotNull String translationKey() { + Preconditions.checkArgument(this != UNKNOWN, "UNKNOWN entities do not have translation keys"); + return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this); + } + + /** + * Checks if the entity has default attributes. + * + * @return true if it has default attributes + */ + public boolean hasDefaultAttributes() { + return org.bukkit.Bukkit.getUnsafe().hasDefaultEntityAttributes(this.key); + } + + /** + * Gets the default attributes for the entity. + * + * @return an unmodifiable instance of Attributable for reading default attributes. + * @throws IllegalArgumentException if the entity does not exist of have default attributes (use {@link #hasDefaultAttributes()} first) + */ + public @NotNull org.bukkit.attribute.Attributable getDefaultAttributes() { + return org.bukkit.Bukkit.getUnsafe().getDefaultEntityAttributes(this.key); + } + // Paper end + + /** + * Gets if this EntityType is enabled by feature in a world. + * + * @param world the world to check + * @return true if this EntityType can be used to spawn an Entity for this World. + */ + @Deprecated(forRemoval = true, since = "1.20") // Paper + public boolean isEnabledByFeature(@NotNull World world) { + return Bukkit.getDataPackManager().isEnabledByFeature(this, world); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/Fox.java b/paper-generator/generatedApi/org/bukkit/entity/Fox.java new file mode 100644 index 0000000000..86865a940f --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Fox.java @@ -0,0 +1,149 @@ +package org.bukkit.entity; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * What does the fox say? + */ +public interface Fox extends Animals, Sittable { + + /** + * Gets the current type of this fox. + * + * @return Type of the fox. + */ + @NotNull + public Type getFoxType(); + + /** + * Sets the current type of this fox. + * + * @param type New type of this fox. + */ + public void setFoxType(@NotNull Type type); + + /** + * Checks if this animal is crouching + * + * @return true if crouching + */ + boolean isCrouching(); + + /** + * Sets if this animal is crouching. + * + * @param crouching true if crouching + */ + void setCrouching(boolean crouching); + + /** + * Sets if this animal is sleeping. + * + * @param sleeping true if sleeping + */ + void setSleeping(boolean sleeping); + + /** + * Gets the first trusted player. + * + * @return the owning AnimalTamer, or null if not owned + */ + @Nullable + public AnimalTamer getFirstTrustedPlayer(); + + /** + * Set the first trusted player. + *

+ * The first trusted player may only be removed after the second. + * + * @param player the AnimalTamer to be trusted + */ + public void setFirstTrustedPlayer(@Nullable AnimalTamer player); + + /** + * Gets the second trusted player. + * + * @return the owning AnimalTamer, or null if not owned + */ + @Nullable + public AnimalTamer getSecondTrustedPlayer(); + + /** + * Set the second trusted player. + *

+ * The second trusted player may only be added after the first. + * + * @param player the AnimalTamer to be trusted + */ + public void setSecondTrustedPlayer(@Nullable AnimalTamer player); + + /** + * Gets whether the fox is faceplanting the ground + * + * @return Whether the fox is faceplanting the ground + */ + boolean isFaceplanted(); + + /** + * Represents the various different fox types there are. + */ + public enum Type { + // Paper start - Generated/FoxType + // @GeneratedFrom 1.21.1 + RED, + SNOW; + // Paper end - Generated/FoxType + } + + // Paper start - Add more fox behavior API + /** + * Sets if the fox is interested. + * + * @param interested is interested + */ + public void setInterested(boolean interested); + + /** + * Gets if the fox is interested. + * + * @return fox is interested + */ + public boolean isInterested(); + + /** + * Sets if the fox is leaping. + * + * @param leaping is leaping + */ + public void setLeaping(boolean leaping); + + /** + * Gets if the fox is leaping. + * + * @return fox is leaping + */ + public boolean isLeaping(); + + /** + * Sets if the fox is defending. + * + * @param defending is defending + */ + public void setDefending(boolean defending); + + /** + * Gets if the fox is defending. + * + * @return fox is defending + */ + public boolean isDefending(); + + /** + * Sets if the fox face planted. + * + * @param faceplanted face planted + */ + public void setFaceplanted(boolean faceplanted); + // Paper end - Add more fox behavior API +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/Frog.java b/paper-generator/generatedApi/org/bukkit/entity/Frog.java new file mode 100644 index 0000000000..1e3d36c57b --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Frog.java @@ -0,0 +1,94 @@ +package org.bukkit.entity; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Locale; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.util.OldEnum; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * A Frog. + */ +public interface Frog extends Animals { + + /** + * Gets the tongue target of this frog. + * + * @return tongue target or null if not set + */ + @Nullable + Entity getTongueTarget(); + + /** + * Sets the tongue target of this frog. + * + * @param target tongue target or null to clear + */ + void setTongueTarget(@Nullable Entity target); + + /** + * Get the variant of this frog. + * + * @return frog variant + */ + @NotNull + Variant getVariant(); + + /** + * Set the variant of this frog. + * + * @param variant frog variant + */ + void setVariant(@NotNull Variant variant); + + /** + * Represents the variant of a frog - ie its color. + */ + interface Variant extends OldEnum, Keyed { + + // Paper start - Generated/FrogVariant + // @GeneratedFrom 1.21.1 + Variant COLD = getVariant("cold"); + + Variant TEMPERATE = getVariant("temperate"); + + Variant WARM = getVariant("warm"); + // Paper end - Generated/FrogVariant + + @NotNull + private static Variant getVariant(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + Variant variant = Registry.FROG_VARIANT.get(namespacedKey); + + Preconditions.checkNotNull(variant, "No frog variant found for %s. This is a bug.", namespacedKey); + return variant; + } + + /** + * @param name of the frog variant. + * @return the frog variant with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Variant valueOf(@NotNull String name) { + Variant variant = Registry.FROG_VARIANT.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(variant != null, "No frog variant found with the name %s", name); + return variant; + } + + /** + * @return an array of all known frog variants. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Variant[] values() { + return Lists.newArrayList(Registry.FROG_VARIANT).toArray(new Variant[0]); + } + } +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/Panda.java b/paper-generator/generatedApi/org/bukkit/entity/Panda.java new file mode 100644 index 0000000000..0e705ebe9b --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Panda.java @@ -0,0 +1,231 @@ +package org.bukkit.entity; + +import org.jetbrains.annotations.NotNull; + +/** + * Panda entity. + */ +public interface Panda extends Animals, Sittable { + + /** + * Gets this Panda's main gene. + * + * @return main gene + */ + @NotNull + Gene getMainGene(); + + /** + * Sets this Panda's main gene. + * + * @param gene main gene + */ + void setMainGene(@NotNull Gene gene); + + /** + * Gets this Panda's hidden gene. + * + * @return hidden gene + */ + @NotNull + Gene getHiddenGene(); + + /** + * Sets this Panda's hidden gene. + * + * @param gene hidden gene + */ + void setHiddenGene(@NotNull Gene gene); + + /** + * Gets whether the Panda is rolling + * + * @return Whether the Panda is rolling + */ + boolean isRolling(); + + /** + * Sets whether the Panda is rolling + * + * @param flag Whether the Panda is rolling + */ + void setRolling(boolean flag); + + /** + * Gets whether the Panda is sneezing + * + * @return Whether the Panda is sneezing + */ + boolean isSneezing(); + + /** + * Sets whether the Panda is sneezing + * + * @param flag Whether the Panda is sneezing + */ + void setSneezing(boolean flag); + + /** + * Gets whether the Panda is on its back + * + * @return Whether the Panda is on its back + */ + boolean isOnBack(); + + /** + * Sets whether the Panda is on its back + * + * @param flag Whether the Panda is on its back + */ + void setOnBack(boolean flag); + + /** + * Gets whether the Panda is eating + * + * @return Whether the Panda is eating + */ + boolean isEating(); + + /** + * Sets the Panda's eating status. The panda must be holding food for this to work + * + * @param flag Whether the Panda is eating + */ + void setEating(boolean flag); + + /** + * Gets whether the Panda is scared + * + * @return Whether the Panda is scared + */ + boolean isScared(); + + /** + * Gets how many ticks the panda will be unhappy for + * + * @return The number of ticks the panda will be unhappy for + */ + int getUnhappyTicks(); + + // Paper start - Panda API + /** + * Sets the sneeze progress in this animation. + * This value counts up only if {@link Panda#isSneezing()} is true + * + * @param ticks sneeze progress + */ + void setSneezeTicks(int ticks); + + /** + * Gets the current sneeze progress, or how many ticks this panda will sneeze for. + * + * @return sneeze progress + */ + int getSneezeTicks(); + + /** + * Sets the eating ticks for this panda. + *

+ * + * This starts counting up as long as it is greater than 0. + * + * @param ticks eating ticks + */ + void setEatingTicks(int ticks); + + /** + * Gets the current eating progress, or how many ticks this panda has been eating for. + * + * @return eating progress + */ + int getEatingTicks(); + + /** + * Sets the number of ticks this panda will be unhappy for. + *

+ * This value counts down. + * + * @param ticks unhappy ticks + */ + void setUnhappyTicks(int ticks); + + /** + * Sets if this panda is currently on its back. + * + * @param onBack is on its back + * @deprecated use {@link #setOnBack(boolean)} + */ + @Deprecated(forRemoval = true, since = "1.19") + default void setIsOnBack(boolean onBack) { + this.setOnBack(onBack); + } + + /** + * Sets if this panda is currently sitting. + * + * @param sitting is currently sitting + * @deprecated use {@link #setSitting(boolean)} + */ + @Deprecated(forRemoval = true, since = "1.19") + default void setIsSitting(boolean sitting) { + this.setSitting(sitting); + } + + /** + * Sets if this panda is currently sitting. + * + * @param sitting is currently sitting + */ + @Override + void setSitting(boolean sitting); + + /** + * Gets if this panda is sitting. + * + * @return is sitting + */ + @Override + boolean isSitting(); + + /** + * Gets this Panda's combined gene. + *

+ * The combined gene can be modified using + * {@link #setMainGene(Gene)} or {@link #setHiddenGene(Gene)}. + * + * @return combined gene + */ + @NotNull + Gene getCombinedGene(); + // Paper end - Panda API + + public enum Gene { + + // Paper start - Generated/PandaGene + // @GeneratedFrom 1.21.1 + NORMAL(false), + LAZY(false), + WORRIED(false), + PLAYFUL(false), + BROWN(true), + WEAK(true), + AGGRESSIVE(false); + // Paper end - Generated/PandaGene + + private final boolean recessive; + + private Gene(boolean recessive) { + this.recessive = recessive; + } + + /** + * Gets whether this gene is recessive, i.e. required in both parents to + * propagate to children. + * + * @return recessive status + */ + public boolean isRecessive() { + return recessive; + } + } +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/Sniffer.java b/paper-generator/generatedApi/org/bukkit/entity/Sniffer.java new file mode 100644 index 0000000000..11bd8d1d60 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Sniffer.java @@ -0,0 +1,88 @@ +package org.bukkit.entity; + +import java.util.Collection; +import org.bukkit.Location; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a Sniffer. + */ +public interface Sniffer extends Animals { + + /** + * Gets the locations explored by the sniffer. + * + * @return a collection of locations + */ + @NotNull + public Collection getExploredLocations(); + + /** + * Remove a location of the explored locations. + * + * @param location the location to remove + * @see #getExploredLocations() + */ + public void removeExploredLocation(@NotNull Location location); + + /** + * Add a location to the explored locations. + *
+ * Note: the location must be in the sniffer's current world for this + * method to have any effect. + * + * @param location the location to add + * @see #getExploredLocations() + */ + public void addExploredLocation(@NotNull Location location); + + /** + * Get the current state of the sniffer. + * + * @return the state of the sniffer + */ + @NotNull + public Sniffer.State getState(); + + /** + * Set a new state for the sniffer. + *
+ * This will also make the sniffer make the transition to the new state. + * + * @param state the new state + */ + public void setState(@NotNull Sniffer.State state); + + /** + * Try to get a possible location where the sniffer can dig. + * + * @return a {@link Location} if found or null + */ + @Nullable + public Location findPossibleDigLocation(); + + /** + * Gets whether the sniffer can dig in the current {@link Location} below + * its head. + * + * @return {@code true} if can dig or {@code false} otherwise + */ + public boolean canDig(); + + /** + * Represents the current state of the Sniffer. + */ + public enum State { + // Paper start - Generated/SnifferState + // @GeneratedFrom 1.21.1 + IDLING, + FEELING_HAPPY, + SCENTING, + SNIFFING, + SEARCHING, + DIGGING, + RISING; + // Paper end - Generated/SnifferState + } +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/TropicalFish.java b/paper-generator/generatedApi/org/bukkit/entity/TropicalFish.java new file mode 100644 index 0000000000..677979ca5b --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/TropicalFish.java @@ -0,0 +1,79 @@ +package org.bukkit.entity; + +import org.bukkit.DyeColor; +import org.jetbrains.annotations.NotNull; + +/** + * Tropical fish. + */ +public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { // Paper - Schooling Fish API + + /** + * Gets the color of the fish's pattern. + * + * @return pattern color + */ + @NotNull + DyeColor getPatternColor(); + + /** + * Sets the color of the fish's pattern + * + * @param color pattern color + */ + void setPatternColor(@NotNull DyeColor color); + + /** + * Gets the color of the fish's body. + * + * @return pattern color + */ + @NotNull + DyeColor getBodyColor(); + + /** + * Sets the color of the fish's body + * + * @param color body color + */ + void setBodyColor(@NotNull DyeColor color); + + /** + * Gets the fish's pattern. + * + * @return pattern + */ + @NotNull + Pattern getPattern(); + + /** + * Sets the fish's pattern + * + * @param pattern new pattern + */ + void setPattern(@NotNull Pattern pattern); + + /** + * Enumeration of all different fish patterns. Refer to the + * Minecraft Wiki + * for pictures. + */ + public static enum Pattern { + + // Paper start - Generated/TropicalFishPattern + // @GeneratedFrom 1.21.1 + KOB, + SUNSTREAK, + SNOOPER, + DASHER, + BRINELY, + SPOTTY, + FLOPPER, + STRIPEY, + GLITTER, + BLOCKFISH, + BETTY, + CLAYFISH; + // Paper end - Generated/TropicalFishPattern + } +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/Villager.java b/paper-generator/generatedApi/org/bukkit/entity/Villager.java new file mode 100644 index 0000000000..3aa27b7651 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Villager.java @@ -0,0 +1,404 @@ +package org.bukkit.entity; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Locale; +import java.util.Map; // Paper +import java.util.UUID; // Paper +import org.bukkit.Keyed; +import org.bukkit.Location; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.util.OldEnum; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a villager NPC + */ +public interface Villager extends AbstractVillager { + + /** + * Gets the current profession of this villager. + * + * @return Current profession. + */ + @NotNull + public Profession getProfession(); + + /** + * Sets the new profession of this villager. + * + * @param profession New profession. + */ + public void setProfession(@NotNull Profession profession); + + /** + * Gets the current type of this villager. + * + * @return Current type. + */ + @NotNull + public Type getVillagerType(); + + /** + * Sets the new type of this villager. + * + * @param type New type. + */ + public void setVillagerType(@NotNull Type type); + + /** + * Gets the level of this villager. + * + * A villager with a level of 1 and no experience is liable to lose its + * profession. + * + * @return this villager's level + */ + public int getVillagerLevel(); + + /** + * Sets the level of this villager. + * + * A villager with a level of 1 and no experience is liable to lose its + * profession. + * + * This doesn't update the trades of this villager. + * + * @param level the new level + * @throws IllegalArgumentException if level not between [1, 5] + * @see #increaseLevel(int) + */ + public void setVillagerLevel(int level); + + /** + * Gets the trading experience of this villager. + * + * @return trading experience + */ + public int getVillagerExperience(); + + /** + * Sets the trading experience of this villager. + * + * @param experience new experience + * @throws IllegalArgumentException if experience < 0 + */ + public void setVillagerExperience(int experience); + + // Paper start + /** + * Increases the level of this villager. + * The villager will also unlock new recipes unlike the raw + * method {@link #setVillagerLevel(int)}. + *

+ * A villager with a level of 1 and no experience is liable to lose its + * profession. + *

+ * A master villager has a level of 5 in its profession and + * will unlock 10 trades (2 per level). + * + * @param amount The amount of level + * @return Whether trades are unlocked + * @throws IllegalArgumentException if current level plus the amount + * isn't between [1, 5] or the amount isn't positive + * @see #setVillagerLevel(int) + */ + boolean increaseLevel(int amount); + + /** + * Gives to this villager some potential new trades + * based to its profession and level. + * @param amount The amount of trades to give + * @return Whether trades are added + * @throws IllegalArgumentException if the amount isn't positive + */ + boolean addTrades(int amount); + + /** + * Gets the amount of times a villager has restocked their trades today + * @return The amount of trade restocks. + */ + public int getRestocksToday(); + + /** + * Sets the amount of times a villager has restocked their trades today + * @param restocksToday new restock count + */ + public void setRestocksToday(int restocksToday); + // Paper end + + /** + * Attempts to make this villager sleep at the given location. + *
+ * The location must be in the current world and have a bed placed at the + * location. The villager will put its head on the specified block while + * sleeping. + * + * @param location the location of the bed + * @return whether the sleep was successful + */ + public boolean sleep(@NotNull Location location); + + /** + * Causes this villager to wake up if he's currently sleeping. + * + * @throws IllegalStateException if not sleeping + */ + public void wakeup(); + + /** + * Causes this villager to shake his head. + */ + public void shakeHead(); + + /** + * Convert this Villager into a ZombieVillager as if it was killed by a + * Zombie. + * + * Note: this will fire a EntityTransformEvent + * + * @return the converted entity {@link ZombieVillager} or null if the + * conversion its cancelled + */ + @Nullable + public ZombieVillager zombify(); + + /** + * Represents Villager type, usually corresponding to what biome they spawn + * in. + */ + interface Type extends OldEnum, Keyed { + + // Paper start - Generated/VillagerType + // @GeneratedFrom 1.21.1 + Type DESERT = getType("desert"); + + Type JUNGLE = getType("jungle"); + + Type PLAINS = getType("plains"); + + Type SAVANNA = getType("savanna"); + + Type SNOW = getType("snow"); + + Type SWAMP = getType("swamp"); + + Type TAIGA = getType("taiga"); + // Paper end - Generated/VillagerType + + @NotNull + private static Type getType(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + Type type = Registry.VILLAGER_TYPE.get(namespacedKey); + + Preconditions.checkNotNull(type, "No villager type found for %s. This is a bug.", namespacedKey); + return type; + } + + /** + * @param name of the villager type. + * @return the villager type with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Type valueOf(@NotNull String name) { + Type type = Registry.VILLAGER_TYPE.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(type != null, "No villager type found with the name %s", name); + return type; + } + + /** + * @return an array of all known villager types. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Type[] values() { + return Lists.newArrayList(Registry.VILLAGER_TYPE).toArray(new Type[0]); + } + } + + /** + * Represents the various different Villager professions there may be. + * Villagers have different trading options depending on their profession, + */ + interface Profession extends OldEnum, Keyed, net.kyori.adventure.translation.Translatable { + + // Paper start - Generated/VillagerProfession + // @GeneratedFrom 1.21.1 + /** + * Armorer profession. Wears a black apron. Armorers primarily trade for + * iron armor, chainmail armor, and sometimes diamond armor. + */ + Profession ARMORER = getProfession("armorer"); + + /** + * Butcher profession. Wears a white apron. Butchers primarily trade for + * raw and cooked food. + */ + Profession BUTCHER = getProfession("butcher"); + + /** + * Cartographer profession. Wears a white robe. Cartographers primarily + * trade for explorer maps and some paper. + */ + Profession CARTOGRAPHER = getProfession("cartographer"); + + /** + * Cleric profession. Wears a purple robe. Clerics primarily trade for + * rotten flesh, gold ingot, redstone, lapis, ender pearl, glowstone, + * and bottle o' enchanting. + */ + Profession CLERIC = getProfession("cleric"); + + /** + * Farmer profession. Wears a brown robe. Farmers primarily trade for + * food-related items. + */ + Profession FARMER = getProfession("farmer"); + + /** + * Fisherman profession. Wears a brown robe. Fisherman primarily trade + * for fish, as well as possibly selling string and/or coal. + */ + Profession FISHERMAN = getProfession("fisherman"); + + /** + * Fletcher profession. Wears a brown robe. Fletchers primarily trade + * for string, bows, and arrows. + */ + Profession FLETCHER = getProfession("fletcher"); + + /** + * Leatherworker profession. Wears a white apron. Leatherworkers + * primarily trade for leather, and leather armor, as well as saddles. + */ + Profession LEATHERWORKER = getProfession("leatherworker"); + + /** + * Librarian profession. Wears a white robe. Librarians primarily trade + * for paper, books, and enchanted books. + */ + Profession LIBRARIAN = getProfession("librarian"); + + /** + * Mason profession. + */ + Profession MASON = getProfession("mason"); + + /** + * Nitwit profession. Wears a green apron, cannot trade. Nitwit + * villagers do not do anything. They do not have any trades by default. + */ + Profession NITWIT = getProfession("nitwit"); + + Profession NONE = getProfession("none"); + + /** + * Shepherd profession. Wears a brown robe. Shepherds primarily trade for + * wool items, and shears. + */ + Profession SHEPHERD = getProfession("shepherd"); + + /** + * Toolsmith profession. Wears a black apron. Tool smiths primarily + * trade for iron and diamond tools. + */ + Profession TOOLSMITH = getProfession("toolsmith"); + + /** + * Weaponsmith profession. Wears a black apron. Weapon smiths primarily + * trade for iron and diamond weapons, sometimes enchanted. + */ + Profession WEAPONSMITH = getProfession("weaponsmith"); + // Paper end - Generated/VillagerProfession + + @NotNull + private static Profession getProfession(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + Profession profession = Registry.VILLAGER_PROFESSION.get(namespacedKey); + + Preconditions.checkNotNull(profession, "No villager profession found for %s. This is a bug.", namespacedKey); + return profession; + } + + /** + * @param name of the villager profession. + * @return the villager profession with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Profession valueOf(@NotNull String name) { + Profession profession = Registry.VILLAGER_PROFESSION.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(profession != null, "No villager profession found with the name %s", name); + return profession; + } + + /** + * @return an array of all known villager professions. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Profession[] values() { + return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]); + } + + // Paper start + @Override + default @NotNull String translationKey() { + return "entity.minecraft.villager." + this.getKey().getKey(); + } + // Paper end + } + + // Paper start - Add villager reputation API + /** + * Get the {@link com.destroystokyo.paper.entity.villager.Reputation reputation} + * for a specific player by {@link UUID}. + * + * @param uniqueId The {@link UUID} of the player to get the reputation of. + * @return The player's copied reputation with this villager. + */ + @NotNull + public com.destroystokyo.paper.entity.villager.Reputation getReputation(@NotNull UUID uniqueId); + + /** + * Get all {@link com.destroystokyo.paper.entity.villager.Reputation reputations} + * for all players mapped by their {@link UUID unique IDs}. + * + * @return All {@link com.destroystokyo.paper.entity.villager.Reputation reputations} for all players + * in a copied map. + */ + @NotNull + public Map getReputations(); + + /** + * Set the {@link com.destroystokyo.paper.entity.villager.Reputation reputation} + * for a specific player by {@link UUID}. + * + * @param uniqueId The {@link UUID} of the player to set the reputation of. + * @param reputation The {@link com.destroystokyo.paper.entity.villager.Reputation reputation} to set. + */ + public void setReputation(@NotNull UUID uniqueId, @NotNull com.destroystokyo.paper.entity.villager.Reputation reputation); + + /** + * Set all {@link com.destroystokyo.paper.entity.villager.Reputation reputations} + * for all players mapped by their {@link UUID unique IDs}. + * + * @param reputations All {@link com.destroystokyo.paper.entity.villager.Reputation reputations} + * for all players mapped by their {@link UUID unique IDs}. + */ + public void setReputations(@NotNull Map reputations); + + /** + * Clear all reputations from this villager. This removes every single + * reputation regardless of its impact and the player associated. + */ + public void clearReputations(); + // Paper end +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/Wolf.java b/paper-generator/generatedApi/org/bukkit/entity/Wolf.java new file mode 100644 index 0000000000..b05ac05b60 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Wolf.java @@ -0,0 +1,126 @@ +package org.bukkit.entity; + +import com.google.common.base.Preconditions; +import org.bukkit.DyeColor; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a Wolf + */ +public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.CollarColorable { // Paper - CollarColorable + + /** + * Checks if this wolf is angry + * + * @return Anger true if angry + */ + public boolean isAngry(); + + /** + * Sets the anger of this wolf. + *

+ * An angry wolf can not be fed or tamed. + * + * @param angry true if angry + * @see #setTarget(org.bukkit.entity.LivingEntity) + */ + public void setAngry(boolean angry); + + /** + * Get the collar color of this wolf + * + * @return the color of the collar + */ + @NotNull + @Override // Paper + public DyeColor getCollarColor(); + + /** + * Set the collar color of this wolf + * + * @param color the color to apply + */ + @Override // Paper + public void setCollarColor(@NotNull DyeColor color); + + /** + * Gets whether the wolf is wet + * + * @return Whether the wolf is wet + */ + public boolean isWet(); + + /** + * Gets the wolf's tail angle in radians + * + * @return The angle of the wolf's tail in radians + */ + public float getTailAngle(); + + /** + * Gets if the wolf is interested + * + * @return Whether the wolf is interested + */ + public boolean isInterested(); + + /** + * Set wolf to be interested + * + * @param interested Whether the wolf is interested + */ + public void setInterested(boolean interested); + + /** + * Get the variant of this wolf. + * + * @return wolf variant + */ + @NotNull + Variant getVariant(); + + /** + * Set the variant of this wolf. + * + * @param variant wolf variant + */ + void setVariant(@NotNull Variant variant); + + /** + * Represents the variant of a wolf. + */ + interface Variant extends Keyed { + + // Paper start - Generated/WolfVariant + // @GeneratedFrom 1.21.1 + Variant ASHEN = getVariant("ashen"); + + Variant BLACK = getVariant("black"); + + Variant CHESTNUT = getVariant("chestnut"); + + Variant PALE = getVariant("pale"); + + Variant RUSTY = getVariant("rusty"); + + Variant SNOWY = getVariant("snowy"); + + Variant SPOTTED = getVariant("spotted"); + + Variant STRIPED = getVariant("striped"); + + Variant WOODS = getVariant("woods"); + // Paper end - Generated/WolfVariant + + @NotNull + private static Variant getVariant(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + Variant variant = Registry.WOLF_VARIANT.get(namespacedKey); + Preconditions.checkNotNull(variant, "No Wolf Variant found for %s. This is a bug.", namespacedKey); + return variant; + } + } +} diff --git a/paper-generator/generatedApi/org/bukkit/entity/memory/MemoryKey.java b/paper-generator/generatedApi/org/bukkit/entity/memory/MemoryKey.java new file mode 100644 index 0000000000..80f287c5a1 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/memory/MemoryKey.java @@ -0,0 +1,161 @@ +package org.bukkit.entity.memory; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import org.bukkit.Keyed; +import org.bukkit.Location; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a key used for accessing memory values of a + * {@link org.bukkit.entity.LivingEntity}. + * + * @param the class type of the memory value + */ +public final class MemoryKey implements Keyed { + + private final NamespacedKey namespacedKey; + private final Class tClass; + + private MemoryKey(NamespacedKey namespacedKey, Class tClass) { + this.namespacedKey = namespacedKey; + this.tClass = tClass; + MEMORY_KEYS.put(namespacedKey, this); + } + + @NotNull + @Override + public NamespacedKey getKey() { + return namespacedKey; + } + + /** + * Gets the class of values associated with this memory. + * + * @return the class of value objects + */ + @NotNull + public Class getMemoryClass() { + return tClass; + } + + private static final Map> MEMORY_KEYS = new HashMap<>(); + // + // Paper start - Generated/MemoryKey + // @GeneratedFrom 1.21.1 + public static final MemoryKey ADMIRING_DISABLED = new MemoryKey<>(NamespacedKey.minecraft("admiring_disabled"), Boolean.class); + + public static final MemoryKey ADMIRING_ITEM = new MemoryKey<>(NamespacedKey.minecraft("admiring_item"), Boolean.class); + + public static final MemoryKey ANGRY_AT = new MemoryKey<>(NamespacedKey.minecraft("angry_at"), UUID.class); + + public static final MemoryKey ATE_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("ate_recently"), Boolean.class); + + public static final MemoryKey ATTACK_COOLING_DOWN = new MemoryKey<>(NamespacedKey.minecraft("attack_cooling_down"), Boolean.class); + + public static final MemoryKey CANT_REACH_WALK_TARGET_SINCE = new MemoryKey<>(NamespacedKey.minecraft("cant_reach_walk_target_since"), Long.class); + + public static final MemoryKey DANCING = new MemoryKey<>(NamespacedKey.minecraft("dancing"), Boolean.class); + + public static final MemoryKey DANGER_DETECTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("danger_detected_recently"), Boolean.class); + + public static final MemoryKey DISABLE_WALK_TO_ADMIRE_ITEM = new MemoryKey<>(NamespacedKey.minecraft("disable_walk_to_admire_item"), Boolean.class); + + public static final MemoryKey GAZE_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("gaze_cooldown_ticks"), Integer.class); + + public static final MemoryKey GOLEM_DETECTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("golem_detected_recently"), Boolean.class); + + public static final MemoryKey HAS_HUNTING_COOLDOWN = new MemoryKey<>(NamespacedKey.minecraft("has_hunting_cooldown"), Boolean.class); + + public static final MemoryKey HEARD_BELL_TIME = new MemoryKey<>(NamespacedKey.minecraft("heard_bell_time"), Long.class); + + public static final MemoryKey HIDING_PLACE = new MemoryKey<>(NamespacedKey.minecraft("hiding_place"), Location.class); + + public static final MemoryKey HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class); + + public static final MemoryKey HUNTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("hunted_recently"), Boolean.class); + + public static final MemoryKey IS_PANICKING = new MemoryKey<>(NamespacedKey.minecraft("is_panicking"), Boolean.class); + + public static final MemoryKey IS_TEMPTED = new MemoryKey<>(NamespacedKey.minecraft("is_tempted"), Boolean.class); + + public static final MemoryKey ITEM_PICKUP_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("item_pickup_cooldown_ticks"), Integer.class); + + public static final MemoryKey JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("job_site"), Location.class); + + public static final MemoryKey LAST_SLEPT = new MemoryKey<>(NamespacedKey.minecraft("last_slept"), Long.class); + + public static final MemoryKey LAST_WOKEN = new MemoryKey<>(NamespacedKey.minecraft("last_woken"), Long.class); + + public static final MemoryKey LAST_WORKED_AT_POI = new MemoryKey<>(NamespacedKey.minecraft("last_worked_at_poi"), Long.class); + + public static final MemoryKey LIKED_NOTEBLOCK_POSITION = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock"), Location.class); + + public static final MemoryKey LIKED_NOTEBLOCK_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock_cooldown_ticks"), Integer.class); + + public static final MemoryKey LIKED_PLAYER = new MemoryKey<>(NamespacedKey.minecraft("liked_player"), UUID.class); + + public static final MemoryKey LONG_JUMP_COOLING_DOWN = new MemoryKey<>(NamespacedKey.minecraft("long_jump_cooling_down"), Integer.class); + + public static final MemoryKey LONG_JUMP_MID_JUMP = new MemoryKey<>(NamespacedKey.minecraft("long_jump_mid_jump"), Boolean.class); + + public static final MemoryKey MEETING_POINT = new MemoryKey<>(NamespacedKey.minecraft("meeting_point"), Location.class); + + public static final MemoryKey PACIFIED = new MemoryKey<>(NamespacedKey.minecraft("pacified"), Boolean.class); + + public static final MemoryKey PLAY_DEAD_TICKS = new MemoryKey<>(NamespacedKey.minecraft("play_dead_ticks"), Integer.class); + + public static final MemoryKey POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class); + + public static final MemoryKey RAM_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("ram_cooldown_ticks"), Integer.class); + + public static final MemoryKey SNIFFER_DIGGING = new MemoryKey<>(NamespacedKey.minecraft("sniffer_digging"), Boolean.class); + + public static final MemoryKey SNIFFER_HAPPY = new MemoryKey<>(NamespacedKey.minecraft("sniffer_happy"), Boolean.class); + + public static final MemoryKey TEMPTATION_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("temptation_cooldown_ticks"), Integer.class); + + public static final MemoryKey TIME_TRYING_TO_REACH_ADMIRE_ITEM = new MemoryKey<>(NamespacedKey.minecraft("time_trying_to_reach_admire_item"), Integer.class); + + public static final MemoryKey UNIVERSAL_ANGER = new MemoryKey<>(NamespacedKey.minecraft("universal_anger"), Boolean.class); + + public static final MemoryKey VISIBLE_ADULT_HOGLIN_COUNT = new MemoryKey<>(NamespacedKey.minecraft("visible_adult_hoglin_count"), Integer.class); + + public static final MemoryKey VISIBLE_ADULT_PIGLIN_COUNT = new MemoryKey<>(NamespacedKey.minecraft("visible_adult_piglin_count"), Integer.class); + // Paper end - Generated/MemoryKey + /** + * @deprecated this constant uses the wrong generic type, the sniffer now stores different positions + * from possibly different worlds. Use the relevant methods in {@link org.bukkit.entity.Sniffer} directly + * for now. + */ + @Deprecated // Paper + public static final MemoryKey SNIFFER_EXPLORED_POSITIONS = new MemoryKey<>(NamespacedKey.minecraft("sniffer_explored_positions"), Location.class); + + /** + * Returns a {@link MemoryKey} by a {@link NamespacedKey}. + * + * @param namespacedKey the {@link NamespacedKey} referencing a + * {@link MemoryKey} + * @return the {@link MemoryKey} or null when no {@link MemoryKey} is + * available under that key + */ + @Nullable + public static MemoryKey getByKey(@NotNull NamespacedKey namespacedKey) { + return MEMORY_KEYS.get(namespacedKey); + } + + /** + * Returns the set of all MemoryKeys. + * + * @return the memoryKeys + */ + @NotNull + public static Set> values() { + return new HashSet<>(MEMORY_KEYS.values()); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/generator/structure/Structure.java b/paper-generator/generatedApi/org/bukkit/generator/structure/Structure.java new file mode 100644 index 0000000000..dd4d38549f --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/generator/structure/Structure.java @@ -0,0 +1,108 @@ +package org.bukkit.generator.structure; + +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.jetbrains.annotations.NotNull; + +/** + * Represent a Structure from the world. + * + * Listed structures are present in the default server. Depending on the server + * there might be additional structures present (for example structures added by + * data packs), which can be received via {@link Registry#STRUCTURE}. + */ +public abstract class Structure implements Keyed { + + // Paper start - Generated/Structure + // @GeneratedFrom 1.21.1 + public static final Structure ANCIENT_CITY = getStructure("ancient_city"); + + public static final Structure BASTION_REMNANT = getStructure("bastion_remnant"); + + public static final Structure BURIED_TREASURE = getStructure("buried_treasure"); + + public static final Structure DESERT_PYRAMID = getStructure("desert_pyramid"); + + public static final Structure END_CITY = getStructure("end_city"); + + public static final Structure FORTRESS = getStructure("fortress"); + + public static final Structure IGLOO = getStructure("igloo"); + + public static final Structure JUNGLE_PYRAMID = getStructure("jungle_pyramid"); + + public static final Structure MANSION = getStructure("mansion"); + + public static final Structure MINESHAFT = getStructure("mineshaft"); + + public static final Structure MINESHAFT_MESA = getStructure("mineshaft_mesa"); + + public static final Structure MONUMENT = getStructure("monument"); + + public static final Structure NETHER_FOSSIL = getStructure("nether_fossil"); + + public static final Structure OCEAN_RUIN_COLD = getStructure("ocean_ruin_cold"); + + public static final Structure OCEAN_RUIN_WARM = getStructure("ocean_ruin_warm"); + + public static final Structure PILLAGER_OUTPOST = getStructure("pillager_outpost"); + + public static final Structure RUINED_PORTAL = getStructure("ruined_portal"); + + public static final Structure RUINED_PORTAL_DESERT = getStructure("ruined_portal_desert"); + + public static final Structure RUINED_PORTAL_JUNGLE = getStructure("ruined_portal_jungle"); + + public static final Structure RUINED_PORTAL_MOUNTAIN = getStructure("ruined_portal_mountain"); + + public static final Structure RUINED_PORTAL_NETHER = getStructure("ruined_portal_nether"); + + public static final Structure RUINED_PORTAL_OCEAN = getStructure("ruined_portal_ocean"); + + public static final Structure RUINED_PORTAL_SWAMP = getStructure("ruined_portal_swamp"); + + public static final Structure SHIPWRECK = getStructure("shipwreck"); + + public static final Structure SHIPWRECK_BEACHED = getStructure("shipwreck_beached"); + + public static final Structure STRONGHOLD = getStructure("stronghold"); + + public static final Structure SWAMP_HUT = getStructure("swamp_hut"); + + public static final Structure TRAIL_RUINS = getStructure("trail_ruins"); + + public static final Structure TRIAL_CHAMBERS = getStructure("trial_chambers"); + + public static final Structure VILLAGE_DESERT = getStructure("village_desert"); + + public static final Structure VILLAGE_PLAINS = getStructure("village_plains"); + + public static final Structure VILLAGE_SAVANNA = getStructure("village_savanna"); + + public static final Structure VILLAGE_SNOWY = getStructure("village_snowy"); + + public static final Structure VILLAGE_TAIGA = getStructure("village_taiga"); + // Paper end - Generated/Structure + + private static Structure getStructure(String name) { + return Registry.STRUCTURE.get(NamespacedKey.minecraft(name)); + } + + /** + * Returns the type of the structure. + * + * @return the type of structure + */ + @NotNull + public abstract StructureType getStructureType(); + // Paper start - deprecate getKey + /** + * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#STRUCTURE}. Structures + * can exist without a key. + */ + @Override + @Deprecated(since = "1.20.4") + public abstract @NotNull NamespacedKey getKey(); + // Paper end - deprecate getKey +} diff --git a/paper-generator/generatedApi/org/bukkit/generator/structure/StructureType.java b/paper-generator/generatedApi/org/bukkit/generator/structure/StructureType.java new file mode 100644 index 0000000000..cde2bcda23 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/generator/structure/StructureType.java @@ -0,0 +1,55 @@ +package org.bukkit.generator.structure; + +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; + +/** + * Represent a StructureType of a {@link Structure}. + * + * Listed structure types are present in the default server. Depending on the + * server there might be additional structure types present (for example + * structure types added by data packs), which can be received via + * {@link Registry#STRUCTURE_TYPE}. + */ +public abstract class StructureType implements Keyed { + + // Paper start - Generated/StructureType + // @GeneratedFrom 1.21.1 + public static final StructureType BURIED_TREASURE = getStructureType("buried_treasure"); + + public static final StructureType DESERT_PYRAMID = getStructureType("desert_pyramid"); + + public static final StructureType END_CITY = getStructureType("end_city"); + + public static final StructureType FORTRESS = getStructureType("fortress"); + + public static final StructureType IGLOO = getStructureType("igloo"); + + public static final StructureType JIGSAW = getStructureType("jigsaw"); + + public static final StructureType JUNGLE_TEMPLE = getStructureType("jungle_temple"); + + public static final StructureType MINESHAFT = getStructureType("mineshaft"); + + public static final StructureType NETHER_FOSSIL = getStructureType("nether_fossil"); + + public static final StructureType OCEAN_MONUMENT = getStructureType("ocean_monument"); + + public static final StructureType OCEAN_RUIN = getStructureType("ocean_ruin"); + + public static final StructureType RUINED_PORTAL = getStructureType("ruined_portal"); + + public static final StructureType SHIPWRECK = getStructureType("shipwreck"); + + public static final StructureType STRONGHOLD = getStructureType("stronghold"); + + public static final StructureType SWAMP_HUT = getStructureType("swamp_hut"); + + public static final StructureType WOODLAND_MANSION = getStructureType("woodland_mansion"); + // Paper end - Generated/StructureType + + private static StructureType getStructureType(String name) { + return Registry.STRUCTURE_TYPE.get(NamespacedKey.minecraft(name)); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/inventory/ItemRarity.java b/paper-generator/generatedApi/org/bukkit/inventory/ItemRarity.java new file mode 100644 index 0000000000..548fa6fb2d --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/ItemRarity.java @@ -0,0 +1,31 @@ +package org.bukkit.inventory; + +/** + * A item's rarity determines the default color of its name. This enum is + * ordered from least rare to most rare. + */ +public enum ItemRarity { + + // Paper start - Generated/ItemRarity + // @GeneratedFrom 1.21.1 + COMMON(net.kyori.adventure.text.format.NamedTextColor.WHITE), + UNCOMMON(net.kyori.adventure.text.format.NamedTextColor.YELLOW), + RARE(net.kyori.adventure.text.format.NamedTextColor.AQUA), + EPIC(net.kyori.adventure.text.format.NamedTextColor.LIGHT_PURPLE); + // Paper end - Generated/ItemRarity + // Paper start - improve ItemRarity + private final net.kyori.adventure.text.format.NamedTextColor color; + ItemRarity(final net.kyori.adventure.text.format.NamedTextColor color) { + this.color = color; + } + + /** + * Gets the color formatting associated with this rarity. + * + * @return the color + */ + public net.kyori.adventure.text.format.@org.jetbrains.annotations.NotNull TextColor color() { + return this.color; + } + // Paper end +} diff --git a/paper-generator/generatedApi/org/bukkit/inventory/ItemType.java b/paper-generator/generatedApi/org/bukkit/inventory/ItemType.java new file mode 100644 index 0000000000..10665755a6 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/ItemType.java @@ -0,0 +1,2989 @@ +package org.bukkit.inventory; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Multimap; +import java.util.function.Consumer; +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.Translatable; +import org.bukkit.World; +import org.bukkit.attribute.Attribute; +import org.bukkit.attribute.AttributeModifier; +import org.bukkit.block.BlockType; +import org.bukkit.inventory.meta.ArmorMeta; +import org.bukkit.inventory.meta.AxolotlBucketMeta; +import org.bukkit.inventory.meta.BannerMeta; +import org.bukkit.inventory.meta.BlockStateMeta; +import org.bukkit.inventory.meta.BookMeta; +import org.bukkit.inventory.meta.BundleMeta; +import org.bukkit.inventory.meta.ColorableArmorMeta; +import org.bukkit.inventory.meta.CompassMeta; +import org.bukkit.inventory.meta.CrossbowMeta; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; +import org.bukkit.inventory.meta.FireworkEffectMeta; +import org.bukkit.inventory.meta.FireworkMeta; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.KnowledgeBookMeta; +import org.bukkit.inventory.meta.LeatherArmorMeta; +import org.bukkit.inventory.meta.MapMeta; +import org.bukkit.inventory.meta.MusicInstrumentMeta; +import org.bukkit.inventory.meta.OminousBottleMeta; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.inventory.meta.ShieldMeta; +import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.inventory.meta.SpawnEggMeta; +import org.bukkit.inventory.meta.SuspiciousStewMeta; +import org.bukkit.inventory.meta.TropicalFishBucketMeta; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * While this API is in a public interface, it is not intended for use by + * plugins until further notice. The purpose of these types is to make + * {@link Material} more maintenance friendly, but will in due time be the + * official replacement for the aforementioned enum. Entirely incompatible + * changes may occur. Do not use this API in plugins. + */ +@ApiStatus.Experimental // Paper - already required for registry builders +public interface ItemType extends Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - add Translatable & feature flag API + + /** + * Typed represents a subtype of {@link ItemType}s that have a known item meta type + * at compile time. + * + * @param the generic type of the item meta that represents the item type. + */ + interface Typed extends ItemType { + + /** + * Gets the ItemMeta class of this ItemType + * + * @return the ItemMeta class of this ItemType + */ + @Override + @NotNull + Class getItemMetaClass(); + + /** + * Constructs a new item stack with this item type with the amount 1. + * + * @param metaConfigurator an optional consumer of the items {@link ItemMeta} that is called. + * May be null if no intent exists to mutate the item meta at this point. + * @return the created and configured item stack. + */ + @NotNull + ItemStack createItemStack(@Nullable Consumer metaConfigurator); + + /** + * Constructs a new item stack with this item type. + * + * @param amount the amount of itemstack. + * @param metaConfigurator an optional consumer of the items {@link ItemMeta} that is called. + * May be null if no intent exists to mutate the item meta at this point. + * @return the created and configured item stack. + */ + @NotNull + ItemStack createItemStack(int amount, @Nullable Consumer metaConfigurator); + } + + // + // Paper start - Generated/ItemType + // @GeneratedFrom 1.21.1 + ItemType.Typed ACACIA_BOAT = getItemType("acacia_boat"); + + ItemType.Typed ACACIA_BUTTON = getItemType("acacia_button"); + + ItemType.Typed ACACIA_CHEST_BOAT = getItemType("acacia_chest_boat"); + + ItemType.Typed ACACIA_DOOR = getItemType("acacia_door"); + + ItemType.Typed ACACIA_FENCE = getItemType("acacia_fence"); + + ItemType.Typed ACACIA_FENCE_GATE = getItemType("acacia_fence_gate"); + + ItemType.Typed ACACIA_HANGING_SIGN = getItemType("acacia_hanging_sign"); + + ItemType.Typed ACACIA_LEAVES = getItemType("acacia_leaves"); + + ItemType.Typed ACACIA_LOG = getItemType("acacia_log"); + + ItemType.Typed ACACIA_PLANKS = getItemType("acacia_planks"); + + ItemType.Typed ACACIA_PRESSURE_PLATE = getItemType("acacia_pressure_plate"); + + ItemType.Typed ACACIA_SAPLING = getItemType("acacia_sapling"); + + ItemType.Typed ACACIA_SIGN = getItemType("acacia_sign"); + + ItemType.Typed ACACIA_SLAB = getItemType("acacia_slab"); + + ItemType.Typed ACACIA_STAIRS = getItemType("acacia_stairs"); + + ItemType.Typed ACACIA_TRAPDOOR = getItemType("acacia_trapdoor"); + + ItemType.Typed ACACIA_WOOD = getItemType("acacia_wood"); + + ItemType.Typed ACTIVATOR_RAIL = getItemType("activator_rail"); + + ItemType AIR = getItemType("air"); + + ItemType.Typed ALLAY_SPAWN_EGG = getItemType("allay_spawn_egg"); + + ItemType.Typed ALLIUM = getItemType("allium"); + + ItemType.Typed AMETHYST_BLOCK = getItemType("amethyst_block"); + + ItemType.Typed AMETHYST_CLUSTER = getItemType("amethyst_cluster"); + + ItemType.Typed AMETHYST_SHARD = getItemType("amethyst_shard"); + + ItemType.Typed ANCIENT_DEBRIS = getItemType("ancient_debris"); + + ItemType.Typed ANDESITE = getItemType("andesite"); + + ItemType.Typed ANDESITE_SLAB = getItemType("andesite_slab"); + + ItemType.Typed ANDESITE_STAIRS = getItemType("andesite_stairs"); + + ItemType.Typed ANDESITE_WALL = getItemType("andesite_wall"); + + ItemType.Typed ANGLER_POTTERY_SHERD = getItemType("angler_pottery_sherd"); + + ItemType.Typed ANVIL = getItemType("anvil"); + + ItemType.Typed APPLE = getItemType("apple"); + + ItemType.Typed ARCHER_POTTERY_SHERD = getItemType("archer_pottery_sherd"); + + ItemType.Typed ARMADILLO_SCUTE = getItemType("armadillo_scute"); + + ItemType.Typed ARMADILLO_SPAWN_EGG = getItemType("armadillo_spawn_egg"); + + ItemType.Typed ARMOR_STAND = getItemType("armor_stand"); + + ItemType.Typed ARMS_UP_POTTERY_SHERD = getItemType("arms_up_pottery_sherd"); + + ItemType.Typed ARROW = getItemType("arrow"); + + ItemType.Typed AXOLOTL_BUCKET = getItemType("axolotl_bucket"); + + ItemType.Typed AXOLOTL_SPAWN_EGG = getItemType("axolotl_spawn_egg"); + + ItemType.Typed AZALEA = getItemType("azalea"); + + ItemType.Typed AZALEA_LEAVES = getItemType("azalea_leaves"); + + ItemType.Typed AZURE_BLUET = getItemType("azure_bluet"); + + ItemType.Typed BAKED_POTATO = getItemType("baked_potato"); + + ItemType.Typed BAMBOO = getItemType("bamboo"); + + ItemType.Typed BAMBOO_BLOCK = getItemType("bamboo_block"); + + ItemType.Typed BAMBOO_BUTTON = getItemType("bamboo_button"); + + ItemType.Typed BAMBOO_CHEST_RAFT = getItemType("bamboo_chest_raft"); + + ItemType.Typed BAMBOO_DOOR = getItemType("bamboo_door"); + + ItemType.Typed BAMBOO_FENCE = getItemType("bamboo_fence"); + + ItemType.Typed BAMBOO_FENCE_GATE = getItemType("bamboo_fence_gate"); + + ItemType.Typed BAMBOO_HANGING_SIGN = getItemType("bamboo_hanging_sign"); + + ItemType.Typed BAMBOO_MOSAIC = getItemType("bamboo_mosaic"); + + ItemType.Typed BAMBOO_MOSAIC_SLAB = getItemType("bamboo_mosaic_slab"); + + ItemType.Typed BAMBOO_MOSAIC_STAIRS = getItemType("bamboo_mosaic_stairs"); + + ItemType.Typed BAMBOO_PLANKS = getItemType("bamboo_planks"); + + ItemType.Typed BAMBOO_PRESSURE_PLATE = getItemType("bamboo_pressure_plate"); + + ItemType.Typed BAMBOO_RAFT = getItemType("bamboo_raft"); + + ItemType.Typed BAMBOO_SIGN = getItemType("bamboo_sign"); + + ItemType.Typed BAMBOO_SLAB = getItemType("bamboo_slab"); + + ItemType.Typed BAMBOO_STAIRS = getItemType("bamboo_stairs"); + + ItemType.Typed BAMBOO_TRAPDOOR = getItemType("bamboo_trapdoor"); + + ItemType.Typed BARREL = getItemType("barrel"); + + ItemType.Typed BARRIER = getItemType("barrier"); + + ItemType.Typed BASALT = getItemType("basalt"); + + ItemType.Typed BAT_SPAWN_EGG = getItemType("bat_spawn_egg"); + + ItemType.Typed BEACON = getItemType("beacon"); + + ItemType.Typed BEDROCK = getItemType("bedrock"); + + ItemType.Typed BEE_NEST = getItemType("bee_nest"); + + ItemType.Typed BEE_SPAWN_EGG = getItemType("bee_spawn_egg"); + + ItemType.Typed BEEF = getItemType("beef"); + + ItemType.Typed BEEHIVE = getItemType("beehive"); + + ItemType.Typed BEETROOT = getItemType("beetroot"); + + ItemType.Typed BEETROOT_SEEDS = getItemType("beetroot_seeds"); + + ItemType.Typed BEETROOT_SOUP = getItemType("beetroot_soup"); + + ItemType.Typed BELL = getItemType("bell"); + + ItemType.Typed BIG_DRIPLEAF = getItemType("big_dripleaf"); + + ItemType.Typed BIRCH_BOAT = getItemType("birch_boat"); + + ItemType.Typed BIRCH_BUTTON = getItemType("birch_button"); + + ItemType.Typed BIRCH_CHEST_BOAT = getItemType("birch_chest_boat"); + + ItemType.Typed BIRCH_DOOR = getItemType("birch_door"); + + ItemType.Typed BIRCH_FENCE = getItemType("birch_fence"); + + ItemType.Typed BIRCH_FENCE_GATE = getItemType("birch_fence_gate"); + + ItemType.Typed BIRCH_HANGING_SIGN = getItemType("birch_hanging_sign"); + + ItemType.Typed BIRCH_LEAVES = getItemType("birch_leaves"); + + ItemType.Typed BIRCH_LOG = getItemType("birch_log"); + + ItemType.Typed BIRCH_PLANKS = getItemType("birch_planks"); + + ItemType.Typed BIRCH_PRESSURE_PLATE = getItemType("birch_pressure_plate"); + + ItemType.Typed BIRCH_SAPLING = getItemType("birch_sapling"); + + ItemType.Typed BIRCH_SIGN = getItemType("birch_sign"); + + ItemType.Typed BIRCH_SLAB = getItemType("birch_slab"); + + ItemType.Typed BIRCH_STAIRS = getItemType("birch_stairs"); + + ItemType.Typed BIRCH_TRAPDOOR = getItemType("birch_trapdoor"); + + ItemType.Typed BIRCH_WOOD = getItemType("birch_wood"); + + ItemType.Typed BLACK_BANNER = getItemType("black_banner"); + + ItemType.Typed BLACK_BED = getItemType("black_bed"); + + ItemType.Typed BLACK_CANDLE = getItemType("black_candle"); + + ItemType.Typed BLACK_CARPET = getItemType("black_carpet"); + + ItemType.Typed BLACK_CONCRETE = getItemType("black_concrete"); + + ItemType.Typed BLACK_CONCRETE_POWDER = getItemType("black_concrete_powder"); + + ItemType.Typed BLACK_DYE = getItemType("black_dye"); + + ItemType.Typed BLACK_GLAZED_TERRACOTTA = getItemType("black_glazed_terracotta"); + + ItemType.Typed BLACK_SHULKER_BOX = getItemType("black_shulker_box"); + + ItemType.Typed BLACK_STAINED_GLASS = getItemType("black_stained_glass"); + + ItemType.Typed BLACK_STAINED_GLASS_PANE = getItemType("black_stained_glass_pane"); + + ItemType.Typed BLACK_TERRACOTTA = getItemType("black_terracotta"); + + ItemType.Typed BLACK_WOOL = getItemType("black_wool"); + + ItemType.Typed BLACKSTONE = getItemType("blackstone"); + + ItemType.Typed BLACKSTONE_SLAB = getItemType("blackstone_slab"); + + ItemType.Typed BLACKSTONE_STAIRS = getItemType("blackstone_stairs"); + + ItemType.Typed BLACKSTONE_WALL = getItemType("blackstone_wall"); + + ItemType.Typed BLADE_POTTERY_SHERD = getItemType("blade_pottery_sherd"); + + ItemType.Typed BLAST_FURNACE = getItemType("blast_furnace"); + + ItemType.Typed BLAZE_POWDER = getItemType("blaze_powder"); + + ItemType.Typed BLAZE_ROD = getItemType("blaze_rod"); + + ItemType.Typed BLAZE_SPAWN_EGG = getItemType("blaze_spawn_egg"); + + ItemType.Typed BLUE_BANNER = getItemType("blue_banner"); + + ItemType.Typed BLUE_BED = getItemType("blue_bed"); + + ItemType.Typed BLUE_CANDLE = getItemType("blue_candle"); + + ItemType.Typed BLUE_CARPET = getItemType("blue_carpet"); + + ItemType.Typed BLUE_CONCRETE = getItemType("blue_concrete"); + + ItemType.Typed BLUE_CONCRETE_POWDER = getItemType("blue_concrete_powder"); + + ItemType.Typed BLUE_DYE = getItemType("blue_dye"); + + ItemType.Typed BLUE_GLAZED_TERRACOTTA = getItemType("blue_glazed_terracotta"); + + ItemType.Typed BLUE_ICE = getItemType("blue_ice"); + + ItemType.Typed BLUE_ORCHID = getItemType("blue_orchid"); + + ItemType.Typed BLUE_SHULKER_BOX = getItemType("blue_shulker_box"); + + ItemType.Typed BLUE_STAINED_GLASS = getItemType("blue_stained_glass"); + + ItemType.Typed BLUE_STAINED_GLASS_PANE = getItemType("blue_stained_glass_pane"); + + ItemType.Typed BLUE_TERRACOTTA = getItemType("blue_terracotta"); + + ItemType.Typed BLUE_WOOL = getItemType("blue_wool"); + + ItemType.Typed BOGGED_SPAWN_EGG = getItemType("bogged_spawn_egg"); + + ItemType.Typed BOLT_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("bolt_armor_trim_smithing_template"); + + ItemType.Typed BONE = getItemType("bone"); + + ItemType.Typed BONE_BLOCK = getItemType("bone_block"); + + ItemType.Typed BONE_MEAL = getItemType("bone_meal"); + + ItemType.Typed BOOK = getItemType("book"); + + ItemType.Typed BOOKSHELF = getItemType("bookshelf"); + + ItemType.Typed BOW = getItemType("bow"); + + ItemType.Typed BOWL = getItemType("bowl"); + + ItemType.Typed BRAIN_CORAL = getItemType("brain_coral"); + + ItemType.Typed BRAIN_CORAL_BLOCK = getItemType("brain_coral_block"); + + ItemType.Typed BRAIN_CORAL_FAN = getItemType("brain_coral_fan"); + + ItemType.Typed BREAD = getItemType("bread"); + + ItemType.Typed BREEZE_ROD = getItemType("breeze_rod"); + + ItemType.Typed BREEZE_SPAWN_EGG = getItemType("breeze_spawn_egg"); + + ItemType.Typed BREWER_POTTERY_SHERD = getItemType("brewer_pottery_sherd"); + + ItemType.Typed BREWING_STAND = getItemType("brewing_stand"); + + ItemType.Typed BRICK = getItemType("brick"); + + ItemType.Typed BRICK_SLAB = getItemType("brick_slab"); + + ItemType.Typed BRICK_STAIRS = getItemType("brick_stairs"); + + ItemType.Typed BRICK_WALL = getItemType("brick_wall"); + + ItemType.Typed BRICKS = getItemType("bricks"); + + ItemType.Typed BROWN_BANNER = getItemType("brown_banner"); + + ItemType.Typed BROWN_BED = getItemType("brown_bed"); + + ItemType.Typed BROWN_CANDLE = getItemType("brown_candle"); + + ItemType.Typed BROWN_CARPET = getItemType("brown_carpet"); + + ItemType.Typed BROWN_CONCRETE = getItemType("brown_concrete"); + + ItemType.Typed BROWN_CONCRETE_POWDER = getItemType("brown_concrete_powder"); + + ItemType.Typed BROWN_DYE = getItemType("brown_dye"); + + ItemType.Typed BROWN_GLAZED_TERRACOTTA = getItemType("brown_glazed_terracotta"); + + ItemType.Typed BROWN_MUSHROOM = getItemType("brown_mushroom"); + + ItemType.Typed BROWN_MUSHROOM_BLOCK = getItemType("brown_mushroom_block"); + + ItemType.Typed BROWN_SHULKER_BOX = getItemType("brown_shulker_box"); + + ItemType.Typed BROWN_STAINED_GLASS = getItemType("brown_stained_glass"); + + ItemType.Typed BROWN_STAINED_GLASS_PANE = getItemType("brown_stained_glass_pane"); + + ItemType.Typed BROWN_TERRACOTTA = getItemType("brown_terracotta"); + + ItemType.Typed BROWN_WOOL = getItemType("brown_wool"); + + ItemType.Typed BRUSH = getItemType("brush"); + + ItemType.Typed BUBBLE_CORAL = getItemType("bubble_coral"); + + ItemType.Typed BUBBLE_CORAL_BLOCK = getItemType("bubble_coral_block"); + + ItemType.Typed BUBBLE_CORAL_FAN = getItemType("bubble_coral_fan"); + + ItemType.Typed BUCKET = getItemType("bucket"); + + ItemType.Typed BUDDING_AMETHYST = getItemType("budding_amethyst"); + + @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.BUNDLE) + @ApiStatus.Experimental + ItemType.Typed BUNDLE = getItemType("bundle"); + + ItemType.Typed BURN_POTTERY_SHERD = getItemType("burn_pottery_sherd"); + + ItemType.Typed CACTUS = getItemType("cactus"); + + ItemType.Typed CAKE = getItemType("cake"); + + ItemType.Typed CALCITE = getItemType("calcite"); + + ItemType.Typed CALIBRATED_SCULK_SENSOR = getItemType("calibrated_sculk_sensor"); + + ItemType.Typed CAMEL_SPAWN_EGG = getItemType("camel_spawn_egg"); + + ItemType.Typed CAMPFIRE = getItemType("campfire"); + + ItemType.Typed CANDLE = getItemType("candle"); + + ItemType.Typed CARROT = getItemType("carrot"); + + ItemType.Typed CARROT_ON_A_STICK = getItemType("carrot_on_a_stick"); + + ItemType.Typed CARTOGRAPHY_TABLE = getItemType("cartography_table"); + + ItemType.Typed CARVED_PUMPKIN = getItemType("carved_pumpkin"); + + ItemType.Typed CAT_SPAWN_EGG = getItemType("cat_spawn_egg"); + + ItemType.Typed CAULDRON = getItemType("cauldron"); + + ItemType.Typed CAVE_SPIDER_SPAWN_EGG = getItemType("cave_spider_spawn_egg"); + + ItemType.Typed CHAIN = getItemType("chain"); + + ItemType.Typed CHAIN_COMMAND_BLOCK = getItemType("chain_command_block"); + + ItemType.Typed CHAINMAIL_BOOTS = getItemType("chainmail_boots"); + + ItemType.Typed CHAINMAIL_CHESTPLATE = getItemType("chainmail_chestplate"); + + ItemType.Typed CHAINMAIL_HELMET = getItemType("chainmail_helmet"); + + ItemType.Typed CHAINMAIL_LEGGINGS = getItemType("chainmail_leggings"); + + ItemType.Typed CHARCOAL = getItemType("charcoal"); + + ItemType.Typed CHERRY_BOAT = getItemType("cherry_boat"); + + ItemType.Typed CHERRY_BUTTON = getItemType("cherry_button"); + + ItemType.Typed CHERRY_CHEST_BOAT = getItemType("cherry_chest_boat"); + + ItemType.Typed CHERRY_DOOR = getItemType("cherry_door"); + + ItemType.Typed CHERRY_FENCE = getItemType("cherry_fence"); + + ItemType.Typed CHERRY_FENCE_GATE = getItemType("cherry_fence_gate"); + + ItemType.Typed CHERRY_HANGING_SIGN = getItemType("cherry_hanging_sign"); + + ItemType.Typed CHERRY_LEAVES = getItemType("cherry_leaves"); + + ItemType.Typed CHERRY_LOG = getItemType("cherry_log"); + + ItemType.Typed CHERRY_PLANKS = getItemType("cherry_planks"); + + ItemType.Typed CHERRY_PRESSURE_PLATE = getItemType("cherry_pressure_plate"); + + ItemType.Typed CHERRY_SAPLING = getItemType("cherry_sapling"); + + ItemType.Typed CHERRY_SIGN = getItemType("cherry_sign"); + + ItemType.Typed CHERRY_SLAB = getItemType("cherry_slab"); + + ItemType.Typed CHERRY_STAIRS = getItemType("cherry_stairs"); + + ItemType.Typed CHERRY_TRAPDOOR = getItemType("cherry_trapdoor"); + + ItemType.Typed CHERRY_WOOD = getItemType("cherry_wood"); + + ItemType.Typed CHEST = getItemType("chest"); + + ItemType.Typed CHEST_MINECART = getItemType("chest_minecart"); + + ItemType.Typed CHICKEN = getItemType("chicken"); + + ItemType.Typed CHICKEN_SPAWN_EGG = getItemType("chicken_spawn_egg"); + + ItemType.Typed CHIPPED_ANVIL = getItemType("chipped_anvil"); + + ItemType.Typed CHISELED_BOOKSHELF = getItemType("chiseled_bookshelf"); + + ItemType.Typed CHISELED_COPPER = getItemType("chiseled_copper"); + + ItemType.Typed CHISELED_DEEPSLATE = getItemType("chiseled_deepslate"); + + ItemType.Typed CHISELED_NETHER_BRICKS = getItemType("chiseled_nether_bricks"); + + ItemType.Typed CHISELED_POLISHED_BLACKSTONE = getItemType("chiseled_polished_blackstone"); + + ItemType.Typed CHISELED_QUARTZ_BLOCK = getItemType("chiseled_quartz_block"); + + ItemType.Typed CHISELED_RED_SANDSTONE = getItemType("chiseled_red_sandstone"); + + ItemType.Typed CHISELED_SANDSTONE = getItemType("chiseled_sandstone"); + + ItemType.Typed CHISELED_STONE_BRICKS = getItemType("chiseled_stone_bricks"); + + ItemType.Typed CHISELED_TUFF = getItemType("chiseled_tuff"); + + ItemType.Typed CHISELED_TUFF_BRICKS = getItemType("chiseled_tuff_bricks"); + + ItemType.Typed CHORUS_FLOWER = getItemType("chorus_flower"); + + ItemType.Typed CHORUS_FRUIT = getItemType("chorus_fruit"); + + ItemType.Typed CHORUS_PLANT = getItemType("chorus_plant"); + + ItemType.Typed CLAY = getItemType("clay"); + + ItemType.Typed CLAY_BALL = getItemType("clay_ball"); + + ItemType.Typed CLOCK = getItemType("clock"); + + ItemType.Typed COAL = getItemType("coal"); + + ItemType.Typed COAL_BLOCK = getItemType("coal_block"); + + ItemType.Typed COAL_ORE = getItemType("coal_ore"); + + ItemType.Typed COARSE_DIRT = getItemType("coarse_dirt"); + + ItemType.Typed COAST_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("coast_armor_trim_smithing_template"); + + ItemType.Typed COBBLED_DEEPSLATE = getItemType("cobbled_deepslate"); + + ItemType.Typed COBBLED_DEEPSLATE_SLAB = getItemType("cobbled_deepslate_slab"); + + ItemType.Typed COBBLED_DEEPSLATE_STAIRS = getItemType("cobbled_deepslate_stairs"); + + ItemType.Typed COBBLED_DEEPSLATE_WALL = getItemType("cobbled_deepslate_wall"); + + ItemType.Typed COBBLESTONE = getItemType("cobblestone"); + + ItemType.Typed COBBLESTONE_SLAB = getItemType("cobblestone_slab"); + + ItemType.Typed COBBLESTONE_STAIRS = getItemType("cobblestone_stairs"); + + ItemType.Typed COBBLESTONE_WALL = getItemType("cobblestone_wall"); + + ItemType.Typed COBWEB = getItemType("cobweb"); + + ItemType.Typed COCOA_BEANS = getItemType("cocoa_beans"); + + ItemType.Typed COD = getItemType("cod"); + + ItemType.Typed COD_BUCKET = getItemType("cod_bucket"); + + ItemType.Typed COD_SPAWN_EGG = getItemType("cod_spawn_egg"); + + ItemType.Typed COMMAND_BLOCK = getItemType("command_block"); + + ItemType.Typed COMMAND_BLOCK_MINECART = getItemType("command_block_minecart"); + + ItemType.Typed COMPARATOR = getItemType("comparator"); + + ItemType.Typed COMPASS = getItemType("compass"); + + ItemType.Typed COMPOSTER = getItemType("composter"); + + ItemType.Typed CONDUIT = getItemType("conduit"); + + ItemType.Typed COOKED_BEEF = getItemType("cooked_beef"); + + ItemType.Typed COOKED_CHICKEN = getItemType("cooked_chicken"); + + ItemType.Typed COOKED_COD = getItemType("cooked_cod"); + + ItemType.Typed COOKED_MUTTON = getItemType("cooked_mutton"); + + ItemType.Typed COOKED_PORKCHOP = getItemType("cooked_porkchop"); + + ItemType.Typed COOKED_RABBIT = getItemType("cooked_rabbit"); + + ItemType.Typed COOKED_SALMON = getItemType("cooked_salmon"); + + ItemType.Typed COOKIE = getItemType("cookie"); + + ItemType.Typed COPPER_BLOCK = getItemType("copper_block"); + + ItemType.Typed COPPER_BULB = getItemType("copper_bulb"); + + ItemType.Typed COPPER_DOOR = getItemType("copper_door"); + + ItemType.Typed COPPER_GRATE = getItemType("copper_grate"); + + ItemType.Typed COPPER_INGOT = getItemType("copper_ingot"); + + ItemType.Typed COPPER_ORE = getItemType("copper_ore"); + + ItemType.Typed COPPER_TRAPDOOR = getItemType("copper_trapdoor"); + + ItemType.Typed CORNFLOWER = getItemType("cornflower"); + + ItemType.Typed COW_SPAWN_EGG = getItemType("cow_spawn_egg"); + + ItemType.Typed CRACKED_DEEPSLATE_BRICKS = getItemType("cracked_deepslate_bricks"); + + ItemType.Typed CRACKED_DEEPSLATE_TILES = getItemType("cracked_deepslate_tiles"); + + ItemType.Typed CRACKED_NETHER_BRICKS = getItemType("cracked_nether_bricks"); + + ItemType.Typed CRACKED_POLISHED_BLACKSTONE_BRICKS = getItemType("cracked_polished_blackstone_bricks"); + + ItemType.Typed CRACKED_STONE_BRICKS = getItemType("cracked_stone_bricks"); + + ItemType.Typed CRAFTER = getItemType("crafter"); + + ItemType.Typed CRAFTING_TABLE = getItemType("crafting_table"); + + ItemType.Typed CREEPER_BANNER_PATTERN = getItemType("creeper_banner_pattern"); + + ItemType.Typed CREEPER_HEAD = getItemType("creeper_head"); + + ItemType.Typed CREEPER_SPAWN_EGG = getItemType("creeper_spawn_egg"); + + ItemType.Typed CRIMSON_BUTTON = getItemType("crimson_button"); + + ItemType.Typed CRIMSON_DOOR = getItemType("crimson_door"); + + ItemType.Typed CRIMSON_FENCE = getItemType("crimson_fence"); + + ItemType.Typed CRIMSON_FENCE_GATE = getItemType("crimson_fence_gate"); + + ItemType.Typed CRIMSON_FUNGUS = getItemType("crimson_fungus"); + + ItemType.Typed CRIMSON_HANGING_SIGN = getItemType("crimson_hanging_sign"); + + ItemType.Typed CRIMSON_HYPHAE = getItemType("crimson_hyphae"); + + ItemType.Typed CRIMSON_NYLIUM = getItemType("crimson_nylium"); + + ItemType.Typed CRIMSON_PLANKS = getItemType("crimson_planks"); + + ItemType.Typed CRIMSON_PRESSURE_PLATE = getItemType("crimson_pressure_plate"); + + ItemType.Typed CRIMSON_ROOTS = getItemType("crimson_roots"); + + ItemType.Typed CRIMSON_SIGN = getItemType("crimson_sign"); + + ItemType.Typed CRIMSON_SLAB = getItemType("crimson_slab"); + + ItemType.Typed CRIMSON_STAIRS = getItemType("crimson_stairs"); + + ItemType.Typed CRIMSON_STEM = getItemType("crimson_stem"); + + ItemType.Typed CRIMSON_TRAPDOOR = getItemType("crimson_trapdoor"); + + ItemType.Typed CROSSBOW = getItemType("crossbow"); + + ItemType.Typed CRYING_OBSIDIAN = getItemType("crying_obsidian"); + + ItemType.Typed CUT_COPPER = getItemType("cut_copper"); + + ItemType.Typed CUT_COPPER_SLAB = getItemType("cut_copper_slab"); + + ItemType.Typed CUT_COPPER_STAIRS = getItemType("cut_copper_stairs"); + + ItemType.Typed CUT_RED_SANDSTONE = getItemType("cut_red_sandstone"); + + ItemType.Typed CUT_RED_SANDSTONE_SLAB = getItemType("cut_red_sandstone_slab"); + + ItemType.Typed CUT_SANDSTONE = getItemType("cut_sandstone"); + + ItemType.Typed CUT_SANDSTONE_SLAB = getItemType("cut_sandstone_slab"); + + ItemType.Typed CYAN_BANNER = getItemType("cyan_banner"); + + ItemType.Typed CYAN_BED = getItemType("cyan_bed"); + + ItemType.Typed CYAN_CANDLE = getItemType("cyan_candle"); + + ItemType.Typed CYAN_CARPET = getItemType("cyan_carpet"); + + ItemType.Typed CYAN_CONCRETE = getItemType("cyan_concrete"); + + ItemType.Typed CYAN_CONCRETE_POWDER = getItemType("cyan_concrete_powder"); + + ItemType.Typed CYAN_DYE = getItemType("cyan_dye"); + + ItemType.Typed CYAN_GLAZED_TERRACOTTA = getItemType("cyan_glazed_terracotta"); + + ItemType.Typed CYAN_SHULKER_BOX = getItemType("cyan_shulker_box"); + + ItemType.Typed CYAN_STAINED_GLASS = getItemType("cyan_stained_glass"); + + ItemType.Typed CYAN_STAINED_GLASS_PANE = getItemType("cyan_stained_glass_pane"); + + ItemType.Typed CYAN_TERRACOTTA = getItemType("cyan_terracotta"); + + ItemType.Typed CYAN_WOOL = getItemType("cyan_wool"); + + ItemType.Typed DAMAGED_ANVIL = getItemType("damaged_anvil"); + + ItemType.Typed DANDELION = getItemType("dandelion"); + + ItemType.Typed DANGER_POTTERY_SHERD = getItemType("danger_pottery_sherd"); + + ItemType.Typed DARK_OAK_BOAT = getItemType("dark_oak_boat"); + + ItemType.Typed DARK_OAK_BUTTON = getItemType("dark_oak_button"); + + ItemType.Typed DARK_OAK_CHEST_BOAT = getItemType("dark_oak_chest_boat"); + + ItemType.Typed DARK_OAK_DOOR = getItemType("dark_oak_door"); + + ItemType.Typed DARK_OAK_FENCE = getItemType("dark_oak_fence"); + + ItemType.Typed DARK_OAK_FENCE_GATE = getItemType("dark_oak_fence_gate"); + + ItemType.Typed DARK_OAK_HANGING_SIGN = getItemType("dark_oak_hanging_sign"); + + ItemType.Typed DARK_OAK_LEAVES = getItemType("dark_oak_leaves"); + + ItemType.Typed DARK_OAK_LOG = getItemType("dark_oak_log"); + + ItemType.Typed DARK_OAK_PLANKS = getItemType("dark_oak_planks"); + + ItemType.Typed DARK_OAK_PRESSURE_PLATE = getItemType("dark_oak_pressure_plate"); + + ItemType.Typed DARK_OAK_SAPLING = getItemType("dark_oak_sapling"); + + ItemType.Typed DARK_OAK_SIGN = getItemType("dark_oak_sign"); + + ItemType.Typed DARK_OAK_SLAB = getItemType("dark_oak_slab"); + + ItemType.Typed DARK_OAK_STAIRS = getItemType("dark_oak_stairs"); + + ItemType.Typed DARK_OAK_TRAPDOOR = getItemType("dark_oak_trapdoor"); + + ItemType.Typed DARK_OAK_WOOD = getItemType("dark_oak_wood"); + + ItemType.Typed DARK_PRISMARINE = getItemType("dark_prismarine"); + + ItemType.Typed DARK_PRISMARINE_SLAB = getItemType("dark_prismarine_slab"); + + ItemType.Typed DARK_PRISMARINE_STAIRS = getItemType("dark_prismarine_stairs"); + + ItemType.Typed DAYLIGHT_DETECTOR = getItemType("daylight_detector"); + + ItemType.Typed DEAD_BRAIN_CORAL = getItemType("dead_brain_coral"); + + ItemType.Typed DEAD_BRAIN_CORAL_BLOCK = getItemType("dead_brain_coral_block"); + + ItemType.Typed DEAD_BRAIN_CORAL_FAN = getItemType("dead_brain_coral_fan"); + + ItemType.Typed DEAD_BUBBLE_CORAL = getItemType("dead_bubble_coral"); + + ItemType.Typed DEAD_BUBBLE_CORAL_BLOCK = getItemType("dead_bubble_coral_block"); + + ItemType.Typed DEAD_BUBBLE_CORAL_FAN = getItemType("dead_bubble_coral_fan"); + + ItemType.Typed DEAD_BUSH = getItemType("dead_bush"); + + ItemType.Typed DEAD_FIRE_CORAL = getItemType("dead_fire_coral"); + + ItemType.Typed DEAD_FIRE_CORAL_BLOCK = getItemType("dead_fire_coral_block"); + + ItemType.Typed DEAD_FIRE_CORAL_FAN = getItemType("dead_fire_coral_fan"); + + ItemType.Typed DEAD_HORN_CORAL = getItemType("dead_horn_coral"); + + ItemType.Typed DEAD_HORN_CORAL_BLOCK = getItemType("dead_horn_coral_block"); + + ItemType.Typed DEAD_HORN_CORAL_FAN = getItemType("dead_horn_coral_fan"); + + ItemType.Typed DEAD_TUBE_CORAL = getItemType("dead_tube_coral"); + + ItemType.Typed DEAD_TUBE_CORAL_BLOCK = getItemType("dead_tube_coral_block"); + + ItemType.Typed DEAD_TUBE_CORAL_FAN = getItemType("dead_tube_coral_fan"); + + ItemType.Typed DEBUG_STICK = getItemType("debug_stick"); + + ItemType.Typed DECORATED_POT = getItemType("decorated_pot"); + + ItemType.Typed DEEPSLATE = getItemType("deepslate"); + + ItemType.Typed DEEPSLATE_BRICK_SLAB = getItemType("deepslate_brick_slab"); + + ItemType.Typed DEEPSLATE_BRICK_STAIRS = getItemType("deepslate_brick_stairs"); + + ItemType.Typed DEEPSLATE_BRICK_WALL = getItemType("deepslate_brick_wall"); + + ItemType.Typed DEEPSLATE_BRICKS = getItemType("deepslate_bricks"); + + ItemType.Typed DEEPSLATE_COAL_ORE = getItemType("deepslate_coal_ore"); + + ItemType.Typed DEEPSLATE_COPPER_ORE = getItemType("deepslate_copper_ore"); + + ItemType.Typed DEEPSLATE_DIAMOND_ORE = getItemType("deepslate_diamond_ore"); + + ItemType.Typed DEEPSLATE_EMERALD_ORE = getItemType("deepslate_emerald_ore"); + + ItemType.Typed DEEPSLATE_GOLD_ORE = getItemType("deepslate_gold_ore"); + + ItemType.Typed DEEPSLATE_IRON_ORE = getItemType("deepslate_iron_ore"); + + ItemType.Typed DEEPSLATE_LAPIS_ORE = getItemType("deepslate_lapis_ore"); + + ItemType.Typed DEEPSLATE_REDSTONE_ORE = getItemType("deepslate_redstone_ore"); + + ItemType.Typed DEEPSLATE_TILE_SLAB = getItemType("deepslate_tile_slab"); + + ItemType.Typed DEEPSLATE_TILE_STAIRS = getItemType("deepslate_tile_stairs"); + + ItemType.Typed DEEPSLATE_TILE_WALL = getItemType("deepslate_tile_wall"); + + ItemType.Typed DEEPSLATE_TILES = getItemType("deepslate_tiles"); + + ItemType.Typed DETECTOR_RAIL = getItemType("detector_rail"); + + ItemType.Typed DIAMOND = getItemType("diamond"); + + ItemType.Typed DIAMOND_AXE = getItemType("diamond_axe"); + + ItemType.Typed DIAMOND_BLOCK = getItemType("diamond_block"); + + ItemType.Typed DIAMOND_BOOTS = getItemType("diamond_boots"); + + ItemType.Typed DIAMOND_CHESTPLATE = getItemType("diamond_chestplate"); + + ItemType.Typed DIAMOND_HELMET = getItemType("diamond_helmet"); + + ItemType.Typed DIAMOND_HOE = getItemType("diamond_hoe"); + + ItemType.Typed DIAMOND_HORSE_ARMOR = getItemType("diamond_horse_armor"); + + ItemType.Typed DIAMOND_LEGGINGS = getItemType("diamond_leggings"); + + ItemType.Typed DIAMOND_ORE = getItemType("diamond_ore"); + + ItemType.Typed DIAMOND_PICKAXE = getItemType("diamond_pickaxe"); + + ItemType.Typed DIAMOND_SHOVEL = getItemType("diamond_shovel"); + + ItemType.Typed DIAMOND_SWORD = getItemType("diamond_sword"); + + ItemType.Typed DIORITE = getItemType("diorite"); + + ItemType.Typed DIORITE_SLAB = getItemType("diorite_slab"); + + ItemType.Typed DIORITE_STAIRS = getItemType("diorite_stairs"); + + ItemType.Typed DIORITE_WALL = getItemType("diorite_wall"); + + ItemType.Typed DIRT = getItemType("dirt"); + + ItemType.Typed DIRT_PATH = getItemType("dirt_path"); + + ItemType.Typed DOLPHIN_SPAWN_EGG = getItemType("dolphin_spawn_egg"); + + ItemType.Typed DONKEY_SPAWN_EGG = getItemType("donkey_spawn_egg"); + + ItemType.Typed DRAGON_BREATH = getItemType("dragon_breath"); + + ItemType.Typed DRAGON_HEAD = getItemType("dragon_head"); + + ItemType.Typed DROWNED_SPAWN_EGG = getItemType("drowned_spawn_egg"); + + ItemType.Typed ELDER_GUARDIAN_SPAWN_EGG = getItemType("elder_guardian_spawn_egg"); + + ItemType.Typed ENCHANTED_BOOK = getItemType("enchanted_book"); + + ItemType.Typed END_CRYSTAL = getItemType("end_crystal"); + + ItemType.Typed ENDER_DRAGON_SPAWN_EGG = getItemType("ender_dragon_spawn_egg"); + + ItemType.Typed ENDERMAN_SPAWN_EGG = getItemType("enderman_spawn_egg"); + + ItemType.Typed ENDERMITE_SPAWN_EGG = getItemType("endermite_spawn_egg"); + + ItemType.Typed EVOKER_SPAWN_EGG = getItemType("evoker_spawn_egg"); + + ItemType.Typed EXPERIENCE_BOTTLE = getItemType("experience_bottle"); + + ItemType.Typed FIRE_CHARGE = getItemType("fire_charge"); + + ItemType.Typed FIREWORK_ROCKET = getItemType("firework_rocket"); + + ItemType.Typed FIREWORK_STAR = getItemType("firework_star"); + + ItemType.Typed FLOWER_POT = getItemType("flower_pot"); + + ItemType.Typed FOX_SPAWN_EGG = getItemType("fox_spawn_egg"); + + ItemType.Typed FROG_SPAWN_EGG = getItemType("frog_spawn_egg"); + + ItemType.Typed GHAST_SPAWN_EGG = getItemType("ghast_spawn_egg"); + + ItemType.Typed GLOW_ITEM_FRAME = getItemType("glow_item_frame"); + + ItemType.Typed GLOW_SQUID_SPAWN_EGG = getItemType("glow_squid_spawn_egg"); + + ItemType.Typed GOAT_SPAWN_EGG = getItemType("goat_spawn_egg"); + + ItemType.Typed GOLDEN_CARROT = getItemType("golden_carrot"); + + ItemType.Typed GOLDEN_HORSE_ARMOR = getItemType("golden_horse_armor"); + + ItemType.Typed GRAY_BANNER = getItemType("gray_banner"); + + ItemType.Typed GREEN_BANNER = getItemType("green_banner"); + + ItemType.Typed GUARDIAN_SPAWN_EGG = getItemType("guardian_spawn_egg"); + + ItemType.Typed HOGLIN_SPAWN_EGG = getItemType("hoglin_spawn_egg"); + + ItemType.Typed HORSE_SPAWN_EGG = getItemType("horse_spawn_egg"); + + ItemType.Typed HUSK_SPAWN_EGG = getItemType("husk_spawn_egg"); + + ItemType.Typed IRON_GOLEM_SPAWN_EGG = getItemType("iron_golem_spawn_egg"); + + ItemType.Typed IRON_HORSE_ARMOR = getItemType("iron_horse_armor"); + + ItemType.Typed IRON_NUGGET = getItemType("iron_nugget"); + + ItemType.Typed ITEM_FRAME = getItemType("item_frame"); + + ItemType.Typed KNOWLEDGE_BOOK = getItemType("knowledge_book"); + + ItemType.Typed LEAD = getItemType("lead"); + + ItemType.Typed LEATHER_HORSE_ARMOR = getItemType("leather_horse_armor"); + + ItemType.Typed LIGHT_BLUE_BANNER = getItemType("light_blue_banner"); + + ItemType.Typed LIGHT_GRAY_BANNER = getItemType("light_gray_banner"); + + ItemType.Typed LIME_BANNER = getItemType("lime_banner"); + + ItemType.Typed LINGERING_POTION = getItemType("lingering_potion"); + + ItemType.Typed LLAMA_SPAWN_EGG = getItemType("llama_spawn_egg"); + + ItemType.Typed MACE = getItemType("mace"); + + ItemType.Typed MAGENTA_BANNER = getItemType("magenta_banner"); + + ItemType.Typed MAGMA_CUBE_SPAWN_EGG = getItemType("magma_cube_spawn_egg"); + + ItemType.Typed MAP = getItemType("map"); + + ItemType.Typed MOOSHROOM_SPAWN_EGG = getItemType("mooshroom_spawn_egg"); + + ItemType.Typed MULE_SPAWN_EGG = getItemType("mule_spawn_egg"); + + ItemType.Typed MUSIC_DISC_5 = getItemType("music_disc_5"); + + ItemType.Typed DISC_FRAGMENT_5 = getItemType("disc_fragment_5"); + + ItemType.Typed DISPENSER = getItemType("dispenser"); + + ItemType.Typed DRAGON_EGG = getItemType("dragon_egg"); + + ItemType.Typed DRIED_KELP = getItemType("dried_kelp"); + + ItemType.Typed DRIED_KELP_BLOCK = getItemType("dried_kelp_block"); + + ItemType.Typed DRIPSTONE_BLOCK = getItemType("dripstone_block"); + + ItemType.Typed DROPPER = getItemType("dropper"); + + ItemType.Typed DUNE_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("dune_armor_trim_smithing_template"); + + ItemType.Typed ECHO_SHARD = getItemType("echo_shard"); + + ItemType.Typed EGG = getItemType("egg"); + + ItemType.Typed ELYTRA = getItemType("elytra"); + + ItemType.Typed EMERALD = getItemType("emerald"); + + ItemType.Typed EMERALD_BLOCK = getItemType("emerald_block"); + + ItemType.Typed EMERALD_ORE = getItemType("emerald_ore"); + + ItemType.Typed ENCHANTED_GOLDEN_APPLE = getItemType("enchanted_golden_apple"); + + ItemType.Typed ENCHANTING_TABLE = getItemType("enchanting_table"); + + ItemType.Typed END_PORTAL_FRAME = getItemType("end_portal_frame"); + + ItemType.Typed END_ROD = getItemType("end_rod"); + + ItemType.Typed END_STONE = getItemType("end_stone"); + + ItemType.Typed END_STONE_BRICK_SLAB = getItemType("end_stone_brick_slab"); + + ItemType.Typed END_STONE_BRICK_STAIRS = getItemType("end_stone_brick_stairs"); + + ItemType.Typed END_STONE_BRICK_WALL = getItemType("end_stone_brick_wall"); + + ItemType.Typed END_STONE_BRICKS = getItemType("end_stone_bricks"); + + ItemType.Typed ENDER_CHEST = getItemType("ender_chest"); + + ItemType.Typed ENDER_EYE = getItemType("ender_eye"); + + ItemType.Typed ENDER_PEARL = getItemType("ender_pearl"); + + ItemType.Typed EXPLORER_POTTERY_SHERD = getItemType("explorer_pottery_sherd"); + + ItemType.Typed EXPOSED_CHISELED_COPPER = getItemType("exposed_chiseled_copper"); + + ItemType.Typed EXPOSED_COPPER = getItemType("exposed_copper"); + + ItemType.Typed EXPOSED_COPPER_BULB = getItemType("exposed_copper_bulb"); + + ItemType.Typed EXPOSED_COPPER_DOOR = getItemType("exposed_copper_door"); + + ItemType.Typed EXPOSED_COPPER_GRATE = getItemType("exposed_copper_grate"); + + ItemType.Typed EXPOSED_COPPER_TRAPDOOR = getItemType("exposed_copper_trapdoor"); + + ItemType.Typed EXPOSED_CUT_COPPER = getItemType("exposed_cut_copper"); + + ItemType.Typed EXPOSED_CUT_COPPER_SLAB = getItemType("exposed_cut_copper_slab"); + + ItemType.Typed EXPOSED_CUT_COPPER_STAIRS = getItemType("exposed_cut_copper_stairs"); + + ItemType.Typed EYE_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("eye_armor_trim_smithing_template"); + + ItemType.Typed FARMLAND = getItemType("farmland"); + + ItemType.Typed FEATHER = getItemType("feather"); + + ItemType.Typed FERMENTED_SPIDER_EYE = getItemType("fermented_spider_eye"); + + ItemType.Typed FERN = getItemType("fern"); + + ItemType.Typed FILLED_MAP = getItemType("filled_map"); + + ItemType.Typed FIRE_CORAL = getItemType("fire_coral"); + + ItemType.Typed FIRE_CORAL_BLOCK = getItemType("fire_coral_block"); + + ItemType.Typed FIRE_CORAL_FAN = getItemType("fire_coral_fan"); + + ItemType.Typed FISHING_ROD = getItemType("fishing_rod"); + + ItemType.Typed FLETCHING_TABLE = getItemType("fletching_table"); + + ItemType.Typed FLINT = getItemType("flint"); + + ItemType.Typed FLINT_AND_STEEL = getItemType("flint_and_steel"); + + ItemType.Typed FLOW_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("flow_armor_trim_smithing_template"); + + ItemType.Typed FLOW_BANNER_PATTERN = getItemType("flow_banner_pattern"); + + ItemType.Typed FLOW_POTTERY_SHERD = getItemType("flow_pottery_sherd"); + + ItemType.Typed FLOWER_BANNER_PATTERN = getItemType("flower_banner_pattern"); + + ItemType.Typed FLOWERING_AZALEA = getItemType("flowering_azalea"); + + ItemType.Typed FLOWERING_AZALEA_LEAVES = getItemType("flowering_azalea_leaves"); + + ItemType.Typed FRIEND_POTTERY_SHERD = getItemType("friend_pottery_sherd"); + + ItemType.Typed FROGSPAWN = getItemType("frogspawn"); + + ItemType.Typed FURNACE = getItemType("furnace"); + + ItemType.Typed FURNACE_MINECART = getItemType("furnace_minecart"); + + ItemType.Typed GHAST_TEAR = getItemType("ghast_tear"); + + ItemType.Typed GILDED_BLACKSTONE = getItemType("gilded_blackstone"); + + ItemType.Typed GLASS = getItemType("glass"); + + ItemType.Typed GLASS_BOTTLE = getItemType("glass_bottle"); + + ItemType.Typed GLASS_PANE = getItemType("glass_pane"); + + ItemType.Typed GLISTERING_MELON_SLICE = getItemType("glistering_melon_slice"); + + ItemType.Typed GLOBE_BANNER_PATTERN = getItemType("globe_banner_pattern"); + + ItemType.Typed GLOW_BERRIES = getItemType("glow_berries"); + + ItemType.Typed GLOW_INK_SAC = getItemType("glow_ink_sac"); + + ItemType.Typed GLOW_LICHEN = getItemType("glow_lichen"); + + ItemType.Typed GLOWSTONE = getItemType("glowstone"); + + ItemType.Typed GLOWSTONE_DUST = getItemType("glowstone_dust"); + + ItemType.Typed GOAT_HORN = getItemType("goat_horn"); + + ItemType.Typed GOLD_BLOCK = getItemType("gold_block"); + + ItemType.Typed GOLD_INGOT = getItemType("gold_ingot"); + + ItemType.Typed GOLD_NUGGET = getItemType("gold_nugget"); + + ItemType.Typed GOLD_ORE = getItemType("gold_ore"); + + ItemType.Typed GOLDEN_APPLE = getItemType("golden_apple"); + + ItemType.Typed GOLDEN_AXE = getItemType("golden_axe"); + + ItemType.Typed GOLDEN_BOOTS = getItemType("golden_boots"); + + ItemType.Typed GOLDEN_CHESTPLATE = getItemType("golden_chestplate"); + + ItemType.Typed GOLDEN_HELMET = getItemType("golden_helmet"); + + ItemType.Typed GOLDEN_HOE = getItemType("golden_hoe"); + + ItemType.Typed GOLDEN_LEGGINGS = getItemType("golden_leggings"); + + ItemType.Typed GOLDEN_PICKAXE = getItemType("golden_pickaxe"); + + ItemType.Typed GOLDEN_SHOVEL = getItemType("golden_shovel"); + + ItemType.Typed GOLDEN_SWORD = getItemType("golden_sword"); + + ItemType.Typed GRANITE = getItemType("granite"); + + ItemType.Typed GRANITE_SLAB = getItemType("granite_slab"); + + ItemType.Typed GRANITE_STAIRS = getItemType("granite_stairs"); + + ItemType.Typed GRANITE_WALL = getItemType("granite_wall"); + + ItemType.Typed GRASS_BLOCK = getItemType("grass_block"); + + ItemType.Typed GRAVEL = getItemType("gravel"); + + ItemType.Typed GRAY_BED = getItemType("gray_bed"); + + ItemType.Typed GRAY_CANDLE = getItemType("gray_candle"); + + ItemType.Typed GRAY_CARPET = getItemType("gray_carpet"); + + ItemType.Typed GRAY_CONCRETE = getItemType("gray_concrete"); + + ItemType.Typed GRAY_CONCRETE_POWDER = getItemType("gray_concrete_powder"); + + ItemType.Typed GRAY_DYE = getItemType("gray_dye"); + + ItemType.Typed GRAY_GLAZED_TERRACOTTA = getItemType("gray_glazed_terracotta"); + + ItemType.Typed GRAY_SHULKER_BOX = getItemType("gray_shulker_box"); + + ItemType.Typed GRAY_STAINED_GLASS = getItemType("gray_stained_glass"); + + ItemType.Typed GRAY_STAINED_GLASS_PANE = getItemType("gray_stained_glass_pane"); + + ItemType.Typed GRAY_TERRACOTTA = getItemType("gray_terracotta"); + + ItemType.Typed GRAY_WOOL = getItemType("gray_wool"); + + ItemType.Typed GREEN_BED = getItemType("green_bed"); + + ItemType.Typed GREEN_CANDLE = getItemType("green_candle"); + + ItemType.Typed GREEN_CARPET = getItemType("green_carpet"); + + ItemType.Typed GREEN_CONCRETE = getItemType("green_concrete"); + + ItemType.Typed GREEN_CONCRETE_POWDER = getItemType("green_concrete_powder"); + + ItemType.Typed GREEN_DYE = getItemType("green_dye"); + + ItemType.Typed GREEN_GLAZED_TERRACOTTA = getItemType("green_glazed_terracotta"); + + ItemType.Typed GREEN_SHULKER_BOX = getItemType("green_shulker_box"); + + ItemType.Typed GREEN_STAINED_GLASS = getItemType("green_stained_glass"); + + ItemType.Typed GREEN_STAINED_GLASS_PANE = getItemType("green_stained_glass_pane"); + + ItemType.Typed GREEN_TERRACOTTA = getItemType("green_terracotta"); + + ItemType.Typed GREEN_WOOL = getItemType("green_wool"); + + ItemType.Typed GRINDSTONE = getItemType("grindstone"); + + ItemType.Typed GUNPOWDER = getItemType("gunpowder"); + + ItemType.Typed GUSTER_BANNER_PATTERN = getItemType("guster_banner_pattern"); + + ItemType.Typed GUSTER_POTTERY_SHERD = getItemType("guster_pottery_sherd"); + + ItemType.Typed HANGING_ROOTS = getItemType("hanging_roots"); + + ItemType.Typed HAY_BLOCK = getItemType("hay_block"); + + ItemType.Typed HEART_OF_THE_SEA = getItemType("heart_of_the_sea"); + + ItemType.Typed HEART_POTTERY_SHERD = getItemType("heart_pottery_sherd"); + + ItemType.Typed HEARTBREAK_POTTERY_SHERD = getItemType("heartbreak_pottery_sherd"); + + ItemType.Typed HEAVY_CORE = getItemType("heavy_core"); + + ItemType.Typed HEAVY_WEIGHTED_PRESSURE_PLATE = getItemType("heavy_weighted_pressure_plate"); + + ItemType.Typed HONEY_BLOCK = getItemType("honey_block"); + + ItemType.Typed HONEY_BOTTLE = getItemType("honey_bottle"); + + ItemType.Typed HONEYCOMB = getItemType("honeycomb"); + + ItemType.Typed HONEYCOMB_BLOCK = getItemType("honeycomb_block"); + + ItemType.Typed HOPPER = getItemType("hopper"); + + ItemType.Typed HOPPER_MINECART = getItemType("hopper_minecart"); + + ItemType.Typed HORN_CORAL = getItemType("horn_coral"); + + ItemType.Typed HORN_CORAL_BLOCK = getItemType("horn_coral_block"); + + ItemType.Typed HORN_CORAL_FAN = getItemType("horn_coral_fan"); + + ItemType.Typed HOST_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("host_armor_trim_smithing_template"); + + ItemType.Typed HOWL_POTTERY_SHERD = getItemType("howl_pottery_sherd"); + + ItemType.Typed ICE = getItemType("ice"); + + ItemType.Typed INFESTED_CHISELED_STONE_BRICKS = getItemType("infested_chiseled_stone_bricks"); + + ItemType.Typed INFESTED_COBBLESTONE = getItemType("infested_cobblestone"); + + ItemType.Typed INFESTED_CRACKED_STONE_BRICKS = getItemType("infested_cracked_stone_bricks"); + + ItemType.Typed INFESTED_DEEPSLATE = getItemType("infested_deepslate"); + + ItemType.Typed INFESTED_MOSSY_STONE_BRICKS = getItemType("infested_mossy_stone_bricks"); + + ItemType.Typed INFESTED_STONE = getItemType("infested_stone"); + + ItemType.Typed INFESTED_STONE_BRICKS = getItemType("infested_stone_bricks"); + + ItemType.Typed INK_SAC = getItemType("ink_sac"); + + ItemType.Typed IRON_AXE = getItemType("iron_axe"); + + ItemType.Typed IRON_BARS = getItemType("iron_bars"); + + ItemType.Typed IRON_BLOCK = getItemType("iron_block"); + + ItemType.Typed IRON_BOOTS = getItemType("iron_boots"); + + ItemType.Typed IRON_CHESTPLATE = getItemType("iron_chestplate"); + + ItemType.Typed IRON_DOOR = getItemType("iron_door"); + + ItemType.Typed IRON_HELMET = getItemType("iron_helmet"); + + ItemType.Typed IRON_HOE = getItemType("iron_hoe"); + + ItemType.Typed IRON_INGOT = getItemType("iron_ingot"); + + ItemType.Typed IRON_LEGGINGS = getItemType("iron_leggings"); + + ItemType.Typed IRON_ORE = getItemType("iron_ore"); + + ItemType.Typed IRON_PICKAXE = getItemType("iron_pickaxe"); + + ItemType.Typed IRON_SHOVEL = getItemType("iron_shovel"); + + ItemType.Typed IRON_SWORD = getItemType("iron_sword"); + + ItemType.Typed IRON_TRAPDOOR = getItemType("iron_trapdoor"); + + ItemType.Typed JACK_O_LANTERN = getItemType("jack_o_lantern"); + + ItemType.Typed JIGSAW = getItemType("jigsaw"); + + ItemType.Typed JUKEBOX = getItemType("jukebox"); + + ItemType.Typed JUNGLE_BOAT = getItemType("jungle_boat"); + + ItemType.Typed JUNGLE_BUTTON = getItemType("jungle_button"); + + ItemType.Typed JUNGLE_CHEST_BOAT = getItemType("jungle_chest_boat"); + + ItemType.Typed JUNGLE_DOOR = getItemType("jungle_door"); + + ItemType.Typed JUNGLE_FENCE = getItemType("jungle_fence"); + + ItemType.Typed JUNGLE_FENCE_GATE = getItemType("jungle_fence_gate"); + + ItemType.Typed JUNGLE_HANGING_SIGN = getItemType("jungle_hanging_sign"); + + ItemType.Typed JUNGLE_LEAVES = getItemType("jungle_leaves"); + + ItemType.Typed JUNGLE_LOG = getItemType("jungle_log"); + + ItemType.Typed JUNGLE_PLANKS = getItemType("jungle_planks"); + + ItemType.Typed JUNGLE_PRESSURE_PLATE = getItemType("jungle_pressure_plate"); + + ItemType.Typed JUNGLE_SAPLING = getItemType("jungle_sapling"); + + ItemType.Typed JUNGLE_SIGN = getItemType("jungle_sign"); + + ItemType.Typed JUNGLE_SLAB = getItemType("jungle_slab"); + + ItemType.Typed JUNGLE_STAIRS = getItemType("jungle_stairs"); + + ItemType.Typed JUNGLE_TRAPDOOR = getItemType("jungle_trapdoor"); + + ItemType.Typed JUNGLE_WOOD = getItemType("jungle_wood"); + + ItemType.Typed KELP = getItemType("kelp"); + + ItemType.Typed LADDER = getItemType("ladder"); + + ItemType.Typed LANTERN = getItemType("lantern"); + + ItemType.Typed LAPIS_BLOCK = getItemType("lapis_block"); + + ItemType.Typed LAPIS_LAZULI = getItemType("lapis_lazuli"); + + ItemType.Typed LAPIS_ORE = getItemType("lapis_ore"); + + ItemType.Typed LARGE_AMETHYST_BUD = getItemType("large_amethyst_bud"); + + ItemType.Typed LARGE_FERN = getItemType("large_fern"); + + ItemType.Typed LAVA_BUCKET = getItemType("lava_bucket"); + + ItemType.Typed LEATHER = getItemType("leather"); + + ItemType.Typed LEATHER_BOOTS = getItemType("leather_boots"); + + ItemType.Typed LEATHER_CHESTPLATE = getItemType("leather_chestplate"); + + ItemType.Typed LEATHER_HELMET = getItemType("leather_helmet"); + + ItemType.Typed LEATHER_LEGGINGS = getItemType("leather_leggings"); + + ItemType.Typed LECTERN = getItemType("lectern"); + + ItemType.Typed LEVER = getItemType("lever"); + + ItemType.Typed LIGHT = getItemType("light"); + + ItemType.Typed LIGHT_BLUE_BED = getItemType("light_blue_bed"); + + ItemType.Typed LIGHT_BLUE_CANDLE = getItemType("light_blue_candle"); + + ItemType.Typed LIGHT_BLUE_CARPET = getItemType("light_blue_carpet"); + + ItemType.Typed LIGHT_BLUE_CONCRETE = getItemType("light_blue_concrete"); + + ItemType.Typed LIGHT_BLUE_CONCRETE_POWDER = getItemType("light_blue_concrete_powder"); + + ItemType.Typed LIGHT_BLUE_DYE = getItemType("light_blue_dye"); + + ItemType.Typed LIGHT_BLUE_GLAZED_TERRACOTTA = getItemType("light_blue_glazed_terracotta"); + + ItemType.Typed LIGHT_BLUE_SHULKER_BOX = getItemType("light_blue_shulker_box"); + + ItemType.Typed LIGHT_BLUE_STAINED_GLASS = getItemType("light_blue_stained_glass"); + + ItemType.Typed LIGHT_BLUE_STAINED_GLASS_PANE = getItemType("light_blue_stained_glass_pane"); + + ItemType.Typed LIGHT_BLUE_TERRACOTTA = getItemType("light_blue_terracotta"); + + ItemType.Typed LIGHT_BLUE_WOOL = getItemType("light_blue_wool"); + + ItemType.Typed LIGHT_GRAY_BED = getItemType("light_gray_bed"); + + ItemType.Typed LIGHT_GRAY_CANDLE = getItemType("light_gray_candle"); + + ItemType.Typed LIGHT_GRAY_CARPET = getItemType("light_gray_carpet"); + + ItemType.Typed LIGHT_GRAY_CONCRETE = getItemType("light_gray_concrete"); + + ItemType.Typed LIGHT_GRAY_CONCRETE_POWDER = getItemType("light_gray_concrete_powder"); + + ItemType.Typed LIGHT_GRAY_DYE = getItemType("light_gray_dye"); + + ItemType.Typed LIGHT_GRAY_GLAZED_TERRACOTTA = getItemType("light_gray_glazed_terracotta"); + + ItemType.Typed LIGHT_GRAY_SHULKER_BOX = getItemType("light_gray_shulker_box"); + + ItemType.Typed LIGHT_GRAY_STAINED_GLASS = getItemType("light_gray_stained_glass"); + + ItemType.Typed LIGHT_GRAY_STAINED_GLASS_PANE = getItemType("light_gray_stained_glass_pane"); + + ItemType.Typed LIGHT_GRAY_TERRACOTTA = getItemType("light_gray_terracotta"); + + ItemType.Typed LIGHT_GRAY_WOOL = getItemType("light_gray_wool"); + + ItemType.Typed LIGHT_WEIGHTED_PRESSURE_PLATE = getItemType("light_weighted_pressure_plate"); + + ItemType.Typed LIGHTNING_ROD = getItemType("lightning_rod"); + + ItemType.Typed LILAC = getItemType("lilac"); + + ItemType.Typed LILY_OF_THE_VALLEY = getItemType("lily_of_the_valley"); + + ItemType.Typed LILY_PAD = getItemType("lily_pad"); + + ItemType.Typed LIME_BED = getItemType("lime_bed"); + + ItemType.Typed LIME_CANDLE = getItemType("lime_candle"); + + ItemType.Typed LIME_CARPET = getItemType("lime_carpet"); + + ItemType.Typed LIME_CONCRETE = getItemType("lime_concrete"); + + ItemType.Typed LIME_CONCRETE_POWDER = getItemType("lime_concrete_powder"); + + ItemType.Typed LIME_DYE = getItemType("lime_dye"); + + ItemType.Typed LIME_GLAZED_TERRACOTTA = getItemType("lime_glazed_terracotta"); + + ItemType.Typed LIME_SHULKER_BOX = getItemType("lime_shulker_box"); + + ItemType.Typed LIME_STAINED_GLASS = getItemType("lime_stained_glass"); + + ItemType.Typed LIME_STAINED_GLASS_PANE = getItemType("lime_stained_glass_pane"); + + ItemType.Typed LIME_TERRACOTTA = getItemType("lime_terracotta"); + + ItemType.Typed LIME_WOOL = getItemType("lime_wool"); + + ItemType.Typed LODESTONE = getItemType("lodestone"); + + ItemType.Typed LOOM = getItemType("loom"); + + ItemType.Typed MAGENTA_BED = getItemType("magenta_bed"); + + ItemType.Typed MAGENTA_CANDLE = getItemType("magenta_candle"); + + ItemType.Typed MAGENTA_CARPET = getItemType("magenta_carpet"); + + ItemType.Typed MAGENTA_CONCRETE = getItemType("magenta_concrete"); + + ItemType.Typed MAGENTA_CONCRETE_POWDER = getItemType("magenta_concrete_powder"); + + ItemType.Typed MAGENTA_DYE = getItemType("magenta_dye"); + + ItemType.Typed MAGENTA_GLAZED_TERRACOTTA = getItemType("magenta_glazed_terracotta"); + + ItemType.Typed MAGENTA_SHULKER_BOX = getItemType("magenta_shulker_box"); + + ItemType.Typed MAGENTA_STAINED_GLASS = getItemType("magenta_stained_glass"); + + ItemType.Typed MAGENTA_STAINED_GLASS_PANE = getItemType("magenta_stained_glass_pane"); + + ItemType.Typed MAGENTA_TERRACOTTA = getItemType("magenta_terracotta"); + + ItemType.Typed MAGENTA_WOOL = getItemType("magenta_wool"); + + ItemType.Typed MAGMA_BLOCK = getItemType("magma_block"); + + ItemType.Typed MAGMA_CREAM = getItemType("magma_cream"); + + ItemType.Typed MANGROVE_BOAT = getItemType("mangrove_boat"); + + ItemType.Typed MANGROVE_BUTTON = getItemType("mangrove_button"); + + ItemType.Typed MANGROVE_CHEST_BOAT = getItemType("mangrove_chest_boat"); + + ItemType.Typed MANGROVE_DOOR = getItemType("mangrove_door"); + + ItemType.Typed MANGROVE_FENCE = getItemType("mangrove_fence"); + + ItemType.Typed MANGROVE_FENCE_GATE = getItemType("mangrove_fence_gate"); + + ItemType.Typed MANGROVE_HANGING_SIGN = getItemType("mangrove_hanging_sign"); + + ItemType.Typed MANGROVE_LEAVES = getItemType("mangrove_leaves"); + + ItemType.Typed MANGROVE_LOG = getItemType("mangrove_log"); + + ItemType.Typed MANGROVE_PLANKS = getItemType("mangrove_planks"); + + ItemType.Typed MANGROVE_PRESSURE_PLATE = getItemType("mangrove_pressure_plate"); + + ItemType.Typed MANGROVE_PROPAGULE = getItemType("mangrove_propagule"); + + ItemType.Typed MANGROVE_ROOTS = getItemType("mangrove_roots"); + + ItemType.Typed MANGROVE_SIGN = getItemType("mangrove_sign"); + + ItemType.Typed MANGROVE_SLAB = getItemType("mangrove_slab"); + + ItemType.Typed MANGROVE_STAIRS = getItemType("mangrove_stairs"); + + ItemType.Typed MANGROVE_TRAPDOOR = getItemType("mangrove_trapdoor"); + + ItemType.Typed MANGROVE_WOOD = getItemType("mangrove_wood"); + + ItemType.Typed MEDIUM_AMETHYST_BUD = getItemType("medium_amethyst_bud"); + + ItemType.Typed MELON = getItemType("melon"); + + ItemType.Typed MELON_SEEDS = getItemType("melon_seeds"); + + ItemType.Typed MELON_SLICE = getItemType("melon_slice"); + + ItemType.Typed MILK_BUCKET = getItemType("milk_bucket"); + + ItemType.Typed MINECART = getItemType("minecart"); + + ItemType.Typed MINER_POTTERY_SHERD = getItemType("miner_pottery_sherd"); + + ItemType.Typed MOJANG_BANNER_PATTERN = getItemType("mojang_banner_pattern"); + + ItemType.Typed MOSS_BLOCK = getItemType("moss_block"); + + ItemType.Typed MOSS_CARPET = getItemType("moss_carpet"); + + ItemType.Typed MOSSY_COBBLESTONE = getItemType("mossy_cobblestone"); + + ItemType.Typed MOSSY_COBBLESTONE_SLAB = getItemType("mossy_cobblestone_slab"); + + ItemType.Typed MOSSY_COBBLESTONE_STAIRS = getItemType("mossy_cobblestone_stairs"); + + ItemType.Typed MOSSY_COBBLESTONE_WALL = getItemType("mossy_cobblestone_wall"); + + ItemType.Typed MOSSY_STONE_BRICK_SLAB = getItemType("mossy_stone_brick_slab"); + + ItemType.Typed MOSSY_STONE_BRICK_STAIRS = getItemType("mossy_stone_brick_stairs"); + + ItemType.Typed MOSSY_STONE_BRICK_WALL = getItemType("mossy_stone_brick_wall"); + + ItemType.Typed MOSSY_STONE_BRICKS = getItemType("mossy_stone_bricks"); + + ItemType.Typed MOURNER_POTTERY_SHERD = getItemType("mourner_pottery_sherd"); + + ItemType.Typed MUD = getItemType("mud"); + + ItemType.Typed MUD_BRICK_SLAB = getItemType("mud_brick_slab"); + + ItemType.Typed MUD_BRICK_STAIRS = getItemType("mud_brick_stairs"); + + ItemType.Typed MUD_BRICK_WALL = getItemType("mud_brick_wall"); + + ItemType.Typed MUD_BRICKS = getItemType("mud_bricks"); + + ItemType.Typed MUDDY_MANGROVE_ROOTS = getItemType("muddy_mangrove_roots"); + + ItemType.Typed MUSHROOM_STEM = getItemType("mushroom_stem"); + + ItemType.Typed MUSHROOM_STEW = getItemType("mushroom_stew"); + + ItemType.Typed MUSIC_DISC_11 = getItemType("music_disc_11"); + + ItemType.Typed MUSIC_DISC_13 = getItemType("music_disc_13"); + + ItemType.Typed MUSIC_DISC_BLOCKS = getItemType("music_disc_blocks"); + + ItemType.Typed MUSIC_DISC_CAT = getItemType("music_disc_cat"); + + ItemType.Typed MUSIC_DISC_CHIRP = getItemType("music_disc_chirp"); + + ItemType.Typed MUSIC_DISC_CREATOR = getItemType("music_disc_creator"); + + ItemType.Typed MUSIC_DISC_CREATOR_MUSIC_BOX = getItemType("music_disc_creator_music_box"); + + ItemType.Typed MUSIC_DISC_FAR = getItemType("music_disc_far"); + + ItemType.Typed MUSIC_DISC_MALL = getItemType("music_disc_mall"); + + ItemType.Typed MUSIC_DISC_MELLOHI = getItemType("music_disc_mellohi"); + + ItemType.Typed MUSIC_DISC_OTHERSIDE = getItemType("music_disc_otherside"); + + ItemType.Typed MUSIC_DISC_PIGSTEP = getItemType("music_disc_pigstep"); + + ItemType.Typed MUSIC_DISC_PRECIPICE = getItemType("music_disc_precipice"); + + ItemType.Typed MUSIC_DISC_RELIC = getItemType("music_disc_relic"); + + ItemType.Typed MUSIC_DISC_STAL = getItemType("music_disc_stal"); + + ItemType.Typed MUSIC_DISC_STRAD = getItemType("music_disc_strad"); + + ItemType.Typed MUSIC_DISC_WAIT = getItemType("music_disc_wait"); + + ItemType.Typed MUSIC_DISC_WARD = getItemType("music_disc_ward"); + + ItemType.Typed MUTTON = getItemType("mutton"); + + ItemType.Typed MYCELIUM = getItemType("mycelium"); + + ItemType.Typed NAME_TAG = getItemType("name_tag"); + + ItemType.Typed NAUTILUS_SHELL = getItemType("nautilus_shell"); + + ItemType.Typed NETHER_BRICK = getItemType("nether_brick"); + + ItemType.Typed NETHER_BRICK_FENCE = getItemType("nether_brick_fence"); + + ItemType.Typed NETHER_BRICK_SLAB = getItemType("nether_brick_slab"); + + ItemType.Typed NETHER_BRICK_STAIRS = getItemType("nether_brick_stairs"); + + ItemType.Typed NETHER_BRICK_WALL = getItemType("nether_brick_wall"); + + ItemType.Typed NETHER_BRICKS = getItemType("nether_bricks"); + + ItemType.Typed NETHER_GOLD_ORE = getItemType("nether_gold_ore"); + + ItemType.Typed NETHER_QUARTZ_ORE = getItemType("nether_quartz_ore"); + + ItemType.Typed NETHER_SPROUTS = getItemType("nether_sprouts"); + + ItemType.Typed NETHER_STAR = getItemType("nether_star"); + + ItemType.Typed NETHER_WART = getItemType("nether_wart"); + + ItemType.Typed NETHER_WART_BLOCK = getItemType("nether_wart_block"); + + ItemType.Typed NETHERITE_AXE = getItemType("netherite_axe"); + + ItemType.Typed NETHERITE_BLOCK = getItemType("netherite_block"); + + ItemType.Typed NETHERITE_BOOTS = getItemType("netherite_boots"); + + ItemType.Typed NETHERITE_CHESTPLATE = getItemType("netherite_chestplate"); + + ItemType.Typed NETHERITE_HELMET = getItemType("netherite_helmet"); + + ItemType.Typed NETHERITE_HOE = getItemType("netherite_hoe"); + + ItemType.Typed NETHERITE_INGOT = getItemType("netherite_ingot"); + + ItemType.Typed NETHERITE_LEGGINGS = getItemType("netherite_leggings"); + + ItemType.Typed NETHERITE_PICKAXE = getItemType("netherite_pickaxe"); + + ItemType.Typed NETHERITE_SCRAP = getItemType("netherite_scrap"); + + ItemType.Typed NETHERITE_SHOVEL = getItemType("netherite_shovel"); + + ItemType.Typed NETHERITE_SWORD = getItemType("netherite_sword"); + + ItemType.Typed NETHERITE_UPGRADE_SMITHING_TEMPLATE = getItemType("netherite_upgrade_smithing_template"); + + ItemType.Typed NETHERRACK = getItemType("netherrack"); + + ItemType.Typed NOTE_BLOCK = getItemType("note_block"); + + ItemType.Typed OAK_BOAT = getItemType("oak_boat"); + + ItemType.Typed OAK_BUTTON = getItemType("oak_button"); + + ItemType.Typed OAK_CHEST_BOAT = getItemType("oak_chest_boat"); + + ItemType.Typed OAK_DOOR = getItemType("oak_door"); + + ItemType.Typed OAK_FENCE = getItemType("oak_fence"); + + ItemType.Typed OAK_FENCE_GATE = getItemType("oak_fence_gate"); + + ItemType.Typed OAK_HANGING_SIGN = getItemType("oak_hanging_sign"); + + ItemType.Typed OAK_LEAVES = getItemType("oak_leaves"); + + ItemType.Typed OAK_LOG = getItemType("oak_log"); + + ItemType.Typed OAK_PLANKS = getItemType("oak_planks"); + + ItemType.Typed OAK_PRESSURE_PLATE = getItemType("oak_pressure_plate"); + + ItemType.Typed OAK_SAPLING = getItemType("oak_sapling"); + + ItemType.Typed OAK_SIGN = getItemType("oak_sign"); + + ItemType.Typed OAK_SLAB = getItemType("oak_slab"); + + ItemType.Typed OAK_STAIRS = getItemType("oak_stairs"); + + ItemType.Typed OAK_TRAPDOOR = getItemType("oak_trapdoor"); + + ItemType.Typed OAK_WOOD = getItemType("oak_wood"); + + ItemType.Typed OBSERVER = getItemType("observer"); + + ItemType.Typed OBSIDIAN = getItemType("obsidian"); + + ItemType.Typed OCELOT_SPAWN_EGG = getItemType("ocelot_spawn_egg"); + + ItemType.Typed OCHRE_FROGLIGHT = getItemType("ochre_froglight"); + + ItemType.Typed OMINOUS_BOTTLE = getItemType("ominous_bottle"); + + ItemType.Typed OMINOUS_TRIAL_KEY = getItemType("ominous_trial_key"); + + ItemType.Typed ORANGE_BANNER = getItemType("orange_banner"); + + ItemType.Typed ORANGE_BED = getItemType("orange_bed"); + + ItemType.Typed ORANGE_CANDLE = getItemType("orange_candle"); + + ItemType.Typed ORANGE_CARPET = getItemType("orange_carpet"); + + ItemType.Typed ORANGE_CONCRETE = getItemType("orange_concrete"); + + ItemType.Typed ORANGE_CONCRETE_POWDER = getItemType("orange_concrete_powder"); + + ItemType.Typed ORANGE_DYE = getItemType("orange_dye"); + + ItemType.Typed ORANGE_GLAZED_TERRACOTTA = getItemType("orange_glazed_terracotta"); + + ItemType.Typed ORANGE_SHULKER_BOX = getItemType("orange_shulker_box"); + + ItemType.Typed ORANGE_STAINED_GLASS = getItemType("orange_stained_glass"); + + ItemType.Typed ORANGE_STAINED_GLASS_PANE = getItemType("orange_stained_glass_pane"); + + ItemType.Typed ORANGE_TERRACOTTA = getItemType("orange_terracotta"); + + ItemType.Typed ORANGE_TULIP = getItemType("orange_tulip"); + + ItemType.Typed ORANGE_WOOL = getItemType("orange_wool"); + + ItemType.Typed OXEYE_DAISY = getItemType("oxeye_daisy"); + + ItemType.Typed OXIDIZED_CHISELED_COPPER = getItemType("oxidized_chiseled_copper"); + + ItemType.Typed OXIDIZED_COPPER = getItemType("oxidized_copper"); + + ItemType.Typed OXIDIZED_COPPER_BULB = getItemType("oxidized_copper_bulb"); + + ItemType.Typed OXIDIZED_COPPER_DOOR = getItemType("oxidized_copper_door"); + + ItemType.Typed OXIDIZED_COPPER_GRATE = getItemType("oxidized_copper_grate"); + + ItemType.Typed OXIDIZED_COPPER_TRAPDOOR = getItemType("oxidized_copper_trapdoor"); + + ItemType.Typed OXIDIZED_CUT_COPPER = getItemType("oxidized_cut_copper"); + + ItemType.Typed OXIDIZED_CUT_COPPER_SLAB = getItemType("oxidized_cut_copper_slab"); + + ItemType.Typed OXIDIZED_CUT_COPPER_STAIRS = getItemType("oxidized_cut_copper_stairs"); + + ItemType.Typed PACKED_ICE = getItemType("packed_ice"); + + ItemType.Typed PACKED_MUD = getItemType("packed_mud"); + + ItemType.Typed PAINTING = getItemType("painting"); + + ItemType.Typed PANDA_SPAWN_EGG = getItemType("panda_spawn_egg"); + + ItemType.Typed PAPER = getItemType("paper"); + + ItemType.Typed PARROT_SPAWN_EGG = getItemType("parrot_spawn_egg"); + + ItemType.Typed PEARLESCENT_FROGLIGHT = getItemType("pearlescent_froglight"); + + ItemType.Typed PEONY = getItemType("peony"); + + ItemType.Typed PETRIFIED_OAK_SLAB = getItemType("petrified_oak_slab"); + + ItemType.Typed PHANTOM_MEMBRANE = getItemType("phantom_membrane"); + + ItemType.Typed PHANTOM_SPAWN_EGG = getItemType("phantom_spawn_egg"); + + ItemType.Typed PIG_SPAWN_EGG = getItemType("pig_spawn_egg"); + + ItemType.Typed PIGLIN_BANNER_PATTERN = getItemType("piglin_banner_pattern"); + + ItemType.Typed PIGLIN_BRUTE_SPAWN_EGG = getItemType("piglin_brute_spawn_egg"); + + ItemType.Typed PIGLIN_HEAD = getItemType("piglin_head"); + + ItemType.Typed PIGLIN_SPAWN_EGG = getItemType("piglin_spawn_egg"); + + ItemType.Typed PILLAGER_SPAWN_EGG = getItemType("pillager_spawn_egg"); + + ItemType.Typed PINK_BANNER = getItemType("pink_banner"); + + ItemType.Typed PINK_BED = getItemType("pink_bed"); + + ItemType.Typed PINK_CANDLE = getItemType("pink_candle"); + + ItemType.Typed PINK_CARPET = getItemType("pink_carpet"); + + ItemType.Typed PINK_CONCRETE = getItemType("pink_concrete"); + + ItemType.Typed PINK_CONCRETE_POWDER = getItemType("pink_concrete_powder"); + + ItemType.Typed PINK_DYE = getItemType("pink_dye"); + + ItemType.Typed PINK_GLAZED_TERRACOTTA = getItemType("pink_glazed_terracotta"); + + ItemType.Typed PINK_PETALS = getItemType("pink_petals"); + + ItemType.Typed PINK_SHULKER_BOX = getItemType("pink_shulker_box"); + + ItemType.Typed PINK_STAINED_GLASS = getItemType("pink_stained_glass"); + + ItemType.Typed PINK_STAINED_GLASS_PANE = getItemType("pink_stained_glass_pane"); + + ItemType.Typed PINK_TERRACOTTA = getItemType("pink_terracotta"); + + ItemType.Typed PINK_TULIP = getItemType("pink_tulip"); + + ItemType.Typed PINK_WOOL = getItemType("pink_wool"); + + ItemType.Typed PISTON = getItemType("piston"); + + ItemType.Typed PITCHER_PLANT = getItemType("pitcher_plant"); + + ItemType.Typed PITCHER_POD = getItemType("pitcher_pod"); + + ItemType.Typed PLAYER_HEAD = getItemType("player_head"); + + ItemType.Typed PLENTY_POTTERY_SHERD = getItemType("plenty_pottery_sherd"); + + ItemType.Typed PODZOL = getItemType("podzol"); + + ItemType.Typed POINTED_DRIPSTONE = getItemType("pointed_dripstone"); + + ItemType.Typed POISONOUS_POTATO = getItemType("poisonous_potato"); + + ItemType.Typed POLAR_BEAR_SPAWN_EGG = getItemType("polar_bear_spawn_egg"); + + ItemType.Typed POLISHED_ANDESITE = getItemType("polished_andesite"); + + ItemType.Typed POLISHED_ANDESITE_SLAB = getItemType("polished_andesite_slab"); + + ItemType.Typed POLISHED_ANDESITE_STAIRS = getItemType("polished_andesite_stairs"); + + ItemType.Typed POLISHED_BASALT = getItemType("polished_basalt"); + + ItemType.Typed POLISHED_BLACKSTONE = getItemType("polished_blackstone"); + + ItemType.Typed POLISHED_BLACKSTONE_BRICK_SLAB = getItemType("polished_blackstone_brick_slab"); + + ItemType.Typed POLISHED_BLACKSTONE_BRICK_STAIRS = getItemType("polished_blackstone_brick_stairs"); + + ItemType.Typed POLISHED_BLACKSTONE_BRICK_WALL = getItemType("polished_blackstone_brick_wall"); + + ItemType.Typed POLISHED_BLACKSTONE_BRICKS = getItemType("polished_blackstone_bricks"); + + ItemType.Typed POLISHED_BLACKSTONE_BUTTON = getItemType("polished_blackstone_button"); + + ItemType.Typed POLISHED_BLACKSTONE_PRESSURE_PLATE = getItemType("polished_blackstone_pressure_plate"); + + ItemType.Typed POLISHED_BLACKSTONE_SLAB = getItemType("polished_blackstone_slab"); + + ItemType.Typed POLISHED_BLACKSTONE_STAIRS = getItemType("polished_blackstone_stairs"); + + ItemType.Typed POLISHED_BLACKSTONE_WALL = getItemType("polished_blackstone_wall"); + + ItemType.Typed POLISHED_DEEPSLATE = getItemType("polished_deepslate"); + + ItemType.Typed POLISHED_DEEPSLATE_SLAB = getItemType("polished_deepslate_slab"); + + ItemType.Typed POLISHED_DEEPSLATE_STAIRS = getItemType("polished_deepslate_stairs"); + + ItemType.Typed POLISHED_DEEPSLATE_WALL = getItemType("polished_deepslate_wall"); + + ItemType.Typed POLISHED_DIORITE = getItemType("polished_diorite"); + + ItemType.Typed POLISHED_DIORITE_SLAB = getItemType("polished_diorite_slab"); + + ItemType.Typed POLISHED_DIORITE_STAIRS = getItemType("polished_diorite_stairs"); + + ItemType.Typed POLISHED_GRANITE = getItemType("polished_granite"); + + ItemType.Typed POLISHED_GRANITE_SLAB = getItemType("polished_granite_slab"); + + ItemType.Typed POLISHED_GRANITE_STAIRS = getItemType("polished_granite_stairs"); + + ItemType.Typed POLISHED_TUFF = getItemType("polished_tuff"); + + ItemType.Typed POLISHED_TUFF_SLAB = getItemType("polished_tuff_slab"); + + ItemType.Typed POLISHED_TUFF_STAIRS = getItemType("polished_tuff_stairs"); + + ItemType.Typed POLISHED_TUFF_WALL = getItemType("polished_tuff_wall"); + + ItemType.Typed POPPED_CHORUS_FRUIT = getItemType("popped_chorus_fruit"); + + ItemType.Typed POPPY = getItemType("poppy"); + + ItemType.Typed PORKCHOP = getItemType("porkchop"); + + ItemType.Typed POTATO = getItemType("potato"); + + ItemType.Typed POTION = getItemType("potion"); + + ItemType.Typed POWDER_SNOW_BUCKET = getItemType("powder_snow_bucket"); + + ItemType.Typed POWERED_RAIL = getItemType("powered_rail"); + + ItemType.Typed PRISMARINE = getItemType("prismarine"); + + ItemType.Typed PRISMARINE_BRICK_SLAB = getItemType("prismarine_brick_slab"); + + ItemType.Typed PRISMARINE_BRICK_STAIRS = getItemType("prismarine_brick_stairs"); + + ItemType.Typed PRISMARINE_BRICKS = getItemType("prismarine_bricks"); + + ItemType.Typed PRISMARINE_CRYSTALS = getItemType("prismarine_crystals"); + + ItemType.Typed PRISMARINE_SHARD = getItemType("prismarine_shard"); + + ItemType.Typed PRISMARINE_SLAB = getItemType("prismarine_slab"); + + ItemType.Typed PRISMARINE_STAIRS = getItemType("prismarine_stairs"); + + ItemType.Typed PRISMARINE_WALL = getItemType("prismarine_wall"); + + ItemType.Typed PRIZE_POTTERY_SHERD = getItemType("prize_pottery_sherd"); + + ItemType.Typed PUFFERFISH = getItemType("pufferfish"); + + ItemType.Typed PUFFERFISH_BUCKET = getItemType("pufferfish_bucket"); + + ItemType.Typed PUFFERFISH_SPAWN_EGG = getItemType("pufferfish_spawn_egg"); + + ItemType.Typed PUMPKIN = getItemType("pumpkin"); + + ItemType.Typed PUMPKIN_PIE = getItemType("pumpkin_pie"); + + ItemType.Typed PUMPKIN_SEEDS = getItemType("pumpkin_seeds"); + + ItemType.Typed PURPLE_BANNER = getItemType("purple_banner"); + + ItemType.Typed PURPLE_BED = getItemType("purple_bed"); + + ItemType.Typed PURPLE_CANDLE = getItemType("purple_candle"); + + ItemType.Typed PURPLE_CARPET = getItemType("purple_carpet"); + + ItemType.Typed PURPLE_CONCRETE = getItemType("purple_concrete"); + + ItemType.Typed PURPLE_CONCRETE_POWDER = getItemType("purple_concrete_powder"); + + ItemType.Typed PURPLE_DYE = getItemType("purple_dye"); + + ItemType.Typed PURPLE_GLAZED_TERRACOTTA = getItemType("purple_glazed_terracotta"); + + ItemType.Typed PURPLE_SHULKER_BOX = getItemType("purple_shulker_box"); + + ItemType.Typed PURPLE_STAINED_GLASS = getItemType("purple_stained_glass"); + + ItemType.Typed PURPLE_STAINED_GLASS_PANE = getItemType("purple_stained_glass_pane"); + + ItemType.Typed PURPLE_TERRACOTTA = getItemType("purple_terracotta"); + + ItemType.Typed PURPLE_WOOL = getItemType("purple_wool"); + + ItemType.Typed PURPUR_BLOCK = getItemType("purpur_block"); + + ItemType.Typed PURPUR_PILLAR = getItemType("purpur_pillar"); + + ItemType.Typed PURPUR_SLAB = getItemType("purpur_slab"); + + ItemType.Typed PURPUR_STAIRS = getItemType("purpur_stairs"); + + ItemType.Typed QUARTZ = getItemType("quartz"); + + ItemType.Typed QUARTZ_BLOCK = getItemType("quartz_block"); + + ItemType.Typed QUARTZ_BRICKS = getItemType("quartz_bricks"); + + ItemType.Typed QUARTZ_PILLAR = getItemType("quartz_pillar"); + + ItemType.Typed QUARTZ_SLAB = getItemType("quartz_slab"); + + ItemType.Typed QUARTZ_STAIRS = getItemType("quartz_stairs"); + + ItemType.Typed RABBIT = getItemType("rabbit"); + + ItemType.Typed RABBIT_FOOT = getItemType("rabbit_foot"); + + ItemType.Typed RABBIT_HIDE = getItemType("rabbit_hide"); + + ItemType.Typed RABBIT_SPAWN_EGG = getItemType("rabbit_spawn_egg"); + + ItemType.Typed RABBIT_STEW = getItemType("rabbit_stew"); + + ItemType.Typed RAIL = getItemType("rail"); + + ItemType.Typed RAISER_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("raiser_armor_trim_smithing_template"); + + ItemType.Typed RAVAGER_SPAWN_EGG = getItemType("ravager_spawn_egg"); + + ItemType.Typed RAW_COPPER = getItemType("raw_copper"); + + ItemType.Typed RAW_COPPER_BLOCK = getItemType("raw_copper_block"); + + ItemType.Typed RAW_GOLD = getItemType("raw_gold"); + + ItemType.Typed RAW_GOLD_BLOCK = getItemType("raw_gold_block"); + + ItemType.Typed RAW_IRON = getItemType("raw_iron"); + + ItemType.Typed RAW_IRON_BLOCK = getItemType("raw_iron_block"); + + ItemType.Typed RECOVERY_COMPASS = getItemType("recovery_compass"); + + ItemType.Typed RED_BANNER = getItemType("red_banner"); + + ItemType.Typed RED_BED = getItemType("red_bed"); + + ItemType.Typed RED_CANDLE = getItemType("red_candle"); + + ItemType.Typed RED_CARPET = getItemType("red_carpet"); + + ItemType.Typed RED_CONCRETE = getItemType("red_concrete"); + + ItemType.Typed RED_CONCRETE_POWDER = getItemType("red_concrete_powder"); + + ItemType.Typed RED_DYE = getItemType("red_dye"); + + ItemType.Typed RED_GLAZED_TERRACOTTA = getItemType("red_glazed_terracotta"); + + ItemType.Typed RED_MUSHROOM = getItemType("red_mushroom"); + + ItemType.Typed RED_MUSHROOM_BLOCK = getItemType("red_mushroom_block"); + + ItemType.Typed RED_NETHER_BRICK_SLAB = getItemType("red_nether_brick_slab"); + + ItemType.Typed RED_NETHER_BRICK_STAIRS = getItemType("red_nether_brick_stairs"); + + ItemType.Typed RED_NETHER_BRICK_WALL = getItemType("red_nether_brick_wall"); + + ItemType.Typed RED_NETHER_BRICKS = getItemType("red_nether_bricks"); + + ItemType.Typed RED_SAND = getItemType("red_sand"); + + ItemType.Typed RED_SANDSTONE = getItemType("red_sandstone"); + + ItemType.Typed RED_SANDSTONE_SLAB = getItemType("red_sandstone_slab"); + + ItemType.Typed RED_SANDSTONE_STAIRS = getItemType("red_sandstone_stairs"); + + ItemType.Typed RED_SANDSTONE_WALL = getItemType("red_sandstone_wall"); + + ItemType.Typed RED_SHULKER_BOX = getItemType("red_shulker_box"); + + ItemType.Typed RED_STAINED_GLASS = getItemType("red_stained_glass"); + + ItemType.Typed RED_STAINED_GLASS_PANE = getItemType("red_stained_glass_pane"); + + ItemType.Typed RED_TERRACOTTA = getItemType("red_terracotta"); + + ItemType.Typed RED_TULIP = getItemType("red_tulip"); + + ItemType.Typed RED_WOOL = getItemType("red_wool"); + + ItemType.Typed REDSTONE = getItemType("redstone"); + + ItemType.Typed REDSTONE_BLOCK = getItemType("redstone_block"); + + ItemType.Typed REDSTONE_LAMP = getItemType("redstone_lamp"); + + ItemType.Typed REDSTONE_ORE = getItemType("redstone_ore"); + + ItemType.Typed REDSTONE_TORCH = getItemType("redstone_torch"); + + ItemType.Typed REINFORCED_DEEPSLATE = getItemType("reinforced_deepslate"); + + ItemType.Typed REPEATER = getItemType("repeater"); + + ItemType.Typed REPEATING_COMMAND_BLOCK = getItemType("repeating_command_block"); + + ItemType.Typed RESPAWN_ANCHOR = getItemType("respawn_anchor"); + + ItemType.Typed RIB_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("rib_armor_trim_smithing_template"); + + ItemType.Typed ROOTED_DIRT = getItemType("rooted_dirt"); + + ItemType.Typed ROSE_BUSH = getItemType("rose_bush"); + + ItemType.Typed ROTTEN_FLESH = getItemType("rotten_flesh"); + + ItemType.Typed SADDLE = getItemType("saddle"); + + ItemType.Typed SALMON = getItemType("salmon"); + + ItemType.Typed SALMON_BUCKET = getItemType("salmon_bucket"); + + ItemType.Typed SALMON_SPAWN_EGG = getItemType("salmon_spawn_egg"); + + ItemType.Typed SAND = getItemType("sand"); + + ItemType.Typed SANDSTONE = getItemType("sandstone"); + + ItemType.Typed SANDSTONE_SLAB = getItemType("sandstone_slab"); + + ItemType.Typed SANDSTONE_STAIRS = getItemType("sandstone_stairs"); + + ItemType.Typed SANDSTONE_WALL = getItemType("sandstone_wall"); + + ItemType.Typed SCAFFOLDING = getItemType("scaffolding"); + + ItemType.Typed SCRAPE_POTTERY_SHERD = getItemType("scrape_pottery_sherd"); + + ItemType.Typed SCULK = getItemType("sculk"); + + ItemType.Typed SCULK_CATALYST = getItemType("sculk_catalyst"); + + ItemType.Typed SCULK_SENSOR = getItemType("sculk_sensor"); + + ItemType.Typed SCULK_SHRIEKER = getItemType("sculk_shrieker"); + + ItemType.Typed SCULK_VEIN = getItemType("sculk_vein"); + + ItemType.Typed SEA_LANTERN = getItemType("sea_lantern"); + + ItemType.Typed SEA_PICKLE = getItemType("sea_pickle"); + + ItemType.Typed SEAGRASS = getItemType("seagrass"); + + ItemType.Typed SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("sentry_armor_trim_smithing_template"); + + ItemType.Typed SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("shaper_armor_trim_smithing_template"); + + ItemType.Typed SHEAF_POTTERY_SHERD = getItemType("sheaf_pottery_sherd"); + + ItemType.Typed SHEARS = getItemType("shears"); + + ItemType.Typed SHEEP_SPAWN_EGG = getItemType("sheep_spawn_egg"); + + ItemType.Typed SHELTER_POTTERY_SHERD = getItemType("shelter_pottery_sherd"); + + ItemType.Typed SHIELD = getItemType("shield"); + + ItemType.Typed SHORT_GRASS = getItemType("short_grass"); + + ItemType.Typed SHROOMLIGHT = getItemType("shroomlight"); + + ItemType.Typed SHULKER_BOX = getItemType("shulker_box"); + + ItemType.Typed SHULKER_SHELL = getItemType("shulker_shell"); + + ItemType.Typed SHULKER_SPAWN_EGG = getItemType("shulker_spawn_egg"); + + ItemType.Typed SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("silence_armor_trim_smithing_template"); + + ItemType.Typed SILVERFISH_SPAWN_EGG = getItemType("silverfish_spawn_egg"); + + ItemType.Typed SKELETON_HORSE_SPAWN_EGG = getItemType("skeleton_horse_spawn_egg"); + + ItemType.Typed SKELETON_SKULL = getItemType("skeleton_skull"); + + ItemType.Typed SKELETON_SPAWN_EGG = getItemType("skeleton_spawn_egg"); + + ItemType.Typed SKULL_BANNER_PATTERN = getItemType("skull_banner_pattern"); + + ItemType.Typed SKULL_POTTERY_SHERD = getItemType("skull_pottery_sherd"); + + ItemType.Typed SLIME_BALL = getItemType("slime_ball"); + + ItemType.Typed SLIME_BLOCK = getItemType("slime_block"); + + ItemType.Typed SLIME_SPAWN_EGG = getItemType("slime_spawn_egg"); + + ItemType.Typed SMALL_AMETHYST_BUD = getItemType("small_amethyst_bud"); + + ItemType.Typed SMALL_DRIPLEAF = getItemType("small_dripleaf"); + + ItemType.Typed SMITHING_TABLE = getItemType("smithing_table"); + + ItemType.Typed SMOKER = getItemType("smoker"); + + ItemType.Typed SMOOTH_BASALT = getItemType("smooth_basalt"); + + ItemType.Typed SMOOTH_QUARTZ = getItemType("smooth_quartz"); + + ItemType.Typed SMOOTH_QUARTZ_SLAB = getItemType("smooth_quartz_slab"); + + ItemType.Typed SMOOTH_QUARTZ_STAIRS = getItemType("smooth_quartz_stairs"); + + ItemType.Typed SMOOTH_RED_SANDSTONE = getItemType("smooth_red_sandstone"); + + ItemType.Typed SMOOTH_RED_SANDSTONE_SLAB = getItemType("smooth_red_sandstone_slab"); + + ItemType.Typed SMOOTH_RED_SANDSTONE_STAIRS = getItemType("smooth_red_sandstone_stairs"); + + ItemType.Typed SMOOTH_SANDSTONE = getItemType("smooth_sandstone"); + + ItemType.Typed SMOOTH_SANDSTONE_SLAB = getItemType("smooth_sandstone_slab"); + + ItemType.Typed SMOOTH_SANDSTONE_STAIRS = getItemType("smooth_sandstone_stairs"); + + ItemType.Typed SMOOTH_STONE = getItemType("smooth_stone"); + + ItemType.Typed SMOOTH_STONE_SLAB = getItemType("smooth_stone_slab"); + + ItemType.Typed SNIFFER_EGG = getItemType("sniffer_egg"); + + ItemType.Typed SNIFFER_SPAWN_EGG = getItemType("sniffer_spawn_egg"); + + ItemType.Typed SNORT_POTTERY_SHERD = getItemType("snort_pottery_sherd"); + + ItemType.Typed SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("snout_armor_trim_smithing_template"); + + ItemType.Typed SNOW = getItemType("snow"); + + ItemType.Typed SNOW_BLOCK = getItemType("snow_block"); + + ItemType.Typed SNOW_GOLEM_SPAWN_EGG = getItemType("snow_golem_spawn_egg"); + + ItemType.Typed SNOWBALL = getItemType("snowball"); + + ItemType.Typed SOUL_CAMPFIRE = getItemType("soul_campfire"); + + ItemType.Typed SOUL_LANTERN = getItemType("soul_lantern"); + + ItemType.Typed SOUL_SAND = getItemType("soul_sand"); + + ItemType.Typed SOUL_SOIL = getItemType("soul_soil"); + + ItemType.Typed SOUL_TORCH = getItemType("soul_torch"); + + ItemType.Typed SPAWNER = getItemType("spawner"); + + ItemType.Typed SPECTRAL_ARROW = getItemType("spectral_arrow"); + + ItemType.Typed SPIDER_EYE = getItemType("spider_eye"); + + ItemType.Typed SPIDER_SPAWN_EGG = getItemType("spider_spawn_egg"); + + ItemType.Typed SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("spire_armor_trim_smithing_template"); + + ItemType.Typed SPLASH_POTION = getItemType("splash_potion"); + + ItemType.Typed SPONGE = getItemType("sponge"); + + ItemType.Typed SPORE_BLOSSOM = getItemType("spore_blossom"); + + ItemType.Typed SPRUCE_BOAT = getItemType("spruce_boat"); + + ItemType.Typed SPRUCE_BUTTON = getItemType("spruce_button"); + + ItemType.Typed SPRUCE_CHEST_BOAT = getItemType("spruce_chest_boat"); + + ItemType.Typed SPRUCE_DOOR = getItemType("spruce_door"); + + ItemType.Typed SPRUCE_FENCE = getItemType("spruce_fence"); + + ItemType.Typed SPRUCE_FENCE_GATE = getItemType("spruce_fence_gate"); + + ItemType.Typed SPRUCE_HANGING_SIGN = getItemType("spruce_hanging_sign"); + + ItemType.Typed SPRUCE_LEAVES = getItemType("spruce_leaves"); + + ItemType.Typed SPRUCE_LOG = getItemType("spruce_log"); + + ItemType.Typed SPRUCE_PLANKS = getItemType("spruce_planks"); + + ItemType.Typed SPRUCE_PRESSURE_PLATE = getItemType("spruce_pressure_plate"); + + ItemType.Typed SPRUCE_SAPLING = getItemType("spruce_sapling"); + + ItemType.Typed SPRUCE_SIGN = getItemType("spruce_sign"); + + ItemType.Typed SPRUCE_SLAB = getItemType("spruce_slab"); + + ItemType.Typed SPRUCE_STAIRS = getItemType("spruce_stairs"); + + ItemType.Typed SPRUCE_TRAPDOOR = getItemType("spruce_trapdoor"); + + ItemType.Typed SPRUCE_WOOD = getItemType("spruce_wood"); + + ItemType.Typed SPYGLASS = getItemType("spyglass"); + + ItemType.Typed SQUID_SPAWN_EGG = getItemType("squid_spawn_egg"); + + ItemType.Typed STICK = getItemType("stick"); + + ItemType.Typed STICKY_PISTON = getItemType("sticky_piston"); + + ItemType.Typed STONE = getItemType("stone"); + + ItemType.Typed STONE_AXE = getItemType("stone_axe"); + + ItemType.Typed STONE_BRICK_SLAB = getItemType("stone_brick_slab"); + + ItemType.Typed STONE_BRICK_STAIRS = getItemType("stone_brick_stairs"); + + ItemType.Typed STONE_BRICK_WALL = getItemType("stone_brick_wall"); + + ItemType.Typed STONE_BRICKS = getItemType("stone_bricks"); + + ItemType.Typed STONE_BUTTON = getItemType("stone_button"); + + ItemType.Typed STONE_HOE = getItemType("stone_hoe"); + + ItemType.Typed STONE_PICKAXE = getItemType("stone_pickaxe"); + + ItemType.Typed STONE_PRESSURE_PLATE = getItemType("stone_pressure_plate"); + + ItemType.Typed STONE_SHOVEL = getItemType("stone_shovel"); + + ItemType.Typed STONE_SLAB = getItemType("stone_slab"); + + ItemType.Typed STONE_STAIRS = getItemType("stone_stairs"); + + ItemType.Typed STONE_SWORD = getItemType("stone_sword"); + + ItemType.Typed STONECUTTER = getItemType("stonecutter"); + + ItemType.Typed STRAY_SPAWN_EGG = getItemType("stray_spawn_egg"); + + ItemType.Typed STRIDER_SPAWN_EGG = getItemType("strider_spawn_egg"); + + ItemType.Typed STRING = getItemType("string"); + + ItemType.Typed STRIPPED_ACACIA_LOG = getItemType("stripped_acacia_log"); + + ItemType.Typed STRIPPED_ACACIA_WOOD = getItemType("stripped_acacia_wood"); + + ItemType.Typed STRIPPED_BAMBOO_BLOCK = getItemType("stripped_bamboo_block"); + + ItemType.Typed STRIPPED_BIRCH_LOG = getItemType("stripped_birch_log"); + + ItemType.Typed STRIPPED_BIRCH_WOOD = getItemType("stripped_birch_wood"); + + ItemType.Typed STRIPPED_CHERRY_LOG = getItemType("stripped_cherry_log"); + + ItemType.Typed STRIPPED_CHERRY_WOOD = getItemType("stripped_cherry_wood"); + + ItemType.Typed STRIPPED_CRIMSON_HYPHAE = getItemType("stripped_crimson_hyphae"); + + ItemType.Typed STRIPPED_CRIMSON_STEM = getItemType("stripped_crimson_stem"); + + ItemType.Typed STRIPPED_DARK_OAK_LOG = getItemType("stripped_dark_oak_log"); + + ItemType.Typed STRIPPED_DARK_OAK_WOOD = getItemType("stripped_dark_oak_wood"); + + ItemType.Typed STRIPPED_JUNGLE_LOG = getItemType("stripped_jungle_log"); + + ItemType.Typed STRIPPED_JUNGLE_WOOD = getItemType("stripped_jungle_wood"); + + ItemType.Typed STRIPPED_MANGROVE_LOG = getItemType("stripped_mangrove_log"); + + ItemType.Typed STRIPPED_MANGROVE_WOOD = getItemType("stripped_mangrove_wood"); + + ItemType.Typed STRIPPED_OAK_LOG = getItemType("stripped_oak_log"); + + ItemType.Typed STRIPPED_OAK_WOOD = getItemType("stripped_oak_wood"); + + ItemType.Typed STRIPPED_SPRUCE_LOG = getItemType("stripped_spruce_log"); + + ItemType.Typed STRIPPED_SPRUCE_WOOD = getItemType("stripped_spruce_wood"); + + ItemType.Typed STRIPPED_WARPED_HYPHAE = getItemType("stripped_warped_hyphae"); + + ItemType.Typed STRIPPED_WARPED_STEM = getItemType("stripped_warped_stem"); + + ItemType.Typed STRUCTURE_BLOCK = getItemType("structure_block"); + + ItemType.Typed STRUCTURE_VOID = getItemType("structure_void"); + + ItemType.Typed SUGAR = getItemType("sugar"); + + ItemType.Typed SUGAR_CANE = getItemType("sugar_cane"); + + ItemType.Typed SUNFLOWER = getItemType("sunflower"); + + ItemType.Typed SUSPICIOUS_GRAVEL = getItemType("suspicious_gravel"); + + ItemType.Typed SUSPICIOUS_SAND = getItemType("suspicious_sand"); + + ItemType.Typed SUSPICIOUS_STEW = getItemType("suspicious_stew"); + + ItemType.Typed SWEET_BERRIES = getItemType("sweet_berries"); + + ItemType.Typed TADPOLE_BUCKET = getItemType("tadpole_bucket"); + + ItemType.Typed TADPOLE_SPAWN_EGG = getItemType("tadpole_spawn_egg"); + + ItemType.Typed TALL_GRASS = getItemType("tall_grass"); + + ItemType.Typed TARGET = getItemType("target"); + + ItemType.Typed TERRACOTTA = getItemType("terracotta"); + + ItemType.Typed TIDE_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("tide_armor_trim_smithing_template"); + + ItemType.Typed TINTED_GLASS = getItemType("tinted_glass"); + + ItemType.Typed TIPPED_ARROW = getItemType("tipped_arrow"); + + ItemType.Typed TNT = getItemType("tnt"); + + ItemType.Typed TNT_MINECART = getItemType("tnt_minecart"); + + ItemType.Typed TORCH = getItemType("torch"); + + ItemType.Typed TORCHFLOWER = getItemType("torchflower"); + + ItemType.Typed TORCHFLOWER_SEEDS = getItemType("torchflower_seeds"); + + ItemType.Typed TOTEM_OF_UNDYING = getItemType("totem_of_undying"); + + ItemType.Typed TRADER_LLAMA_SPAWN_EGG = getItemType("trader_llama_spawn_egg"); + + ItemType.Typed TRAPPED_CHEST = getItemType("trapped_chest"); + + ItemType.Typed TRIAL_KEY = getItemType("trial_key"); + + ItemType.Typed TRIAL_SPAWNER = getItemType("trial_spawner"); + + ItemType.Typed TRIDENT = getItemType("trident"); + + ItemType.Typed TRIPWIRE_HOOK = getItemType("tripwire_hook"); + + ItemType.Typed TROPICAL_FISH = getItemType("tropical_fish"); + + ItemType.Typed TROPICAL_FISH_BUCKET = getItemType("tropical_fish_bucket"); + + ItemType.Typed TROPICAL_FISH_SPAWN_EGG = getItemType("tropical_fish_spawn_egg"); + + ItemType.Typed TUBE_CORAL = getItemType("tube_coral"); + + ItemType.Typed TUBE_CORAL_BLOCK = getItemType("tube_coral_block"); + + ItemType.Typed TUBE_CORAL_FAN = getItemType("tube_coral_fan"); + + ItemType.Typed TUFF = getItemType("tuff"); + + ItemType.Typed TUFF_BRICK_SLAB = getItemType("tuff_brick_slab"); + + ItemType.Typed TUFF_BRICK_STAIRS = getItemType("tuff_brick_stairs"); + + ItemType.Typed TUFF_BRICK_WALL = getItemType("tuff_brick_wall"); + + ItemType.Typed TUFF_BRICKS = getItemType("tuff_bricks"); + + ItemType.Typed TUFF_SLAB = getItemType("tuff_slab"); + + ItemType.Typed TUFF_STAIRS = getItemType("tuff_stairs"); + + ItemType.Typed TUFF_WALL = getItemType("tuff_wall"); + + ItemType.Typed TURTLE_EGG = getItemType("turtle_egg"); + + ItemType.Typed TURTLE_HELMET = getItemType("turtle_helmet"); + + ItemType.Typed TURTLE_SCUTE = getItemType("turtle_scute"); + + ItemType.Typed TURTLE_SPAWN_EGG = getItemType("turtle_spawn_egg"); + + ItemType.Typed TWISTING_VINES = getItemType("twisting_vines"); + + ItemType.Typed VAULT = getItemType("vault"); + + ItemType.Typed VERDANT_FROGLIGHT = getItemType("verdant_froglight"); + + ItemType.Typed VEX_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("vex_armor_trim_smithing_template"); + + ItemType.Typed VEX_SPAWN_EGG = getItemType("vex_spawn_egg"); + + ItemType.Typed VILLAGER_SPAWN_EGG = getItemType("villager_spawn_egg"); + + ItemType.Typed VINDICATOR_SPAWN_EGG = getItemType("vindicator_spawn_egg"); + + ItemType.Typed VINE = getItemType("vine"); + + ItemType.Typed WANDERING_TRADER_SPAWN_EGG = getItemType("wandering_trader_spawn_egg"); + + ItemType.Typed WARD_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("ward_armor_trim_smithing_template"); + + ItemType.Typed WARDEN_SPAWN_EGG = getItemType("warden_spawn_egg"); + + ItemType.Typed WARPED_BUTTON = getItemType("warped_button"); + + ItemType.Typed WARPED_DOOR = getItemType("warped_door"); + + ItemType.Typed WARPED_FENCE = getItemType("warped_fence"); + + ItemType.Typed WARPED_FENCE_GATE = getItemType("warped_fence_gate"); + + ItemType.Typed WARPED_FUNGUS = getItemType("warped_fungus"); + + ItemType.Typed WARPED_FUNGUS_ON_A_STICK = getItemType("warped_fungus_on_a_stick"); + + ItemType.Typed WARPED_HANGING_SIGN = getItemType("warped_hanging_sign"); + + ItemType.Typed WARPED_HYPHAE = getItemType("warped_hyphae"); + + ItemType.Typed WARPED_NYLIUM = getItemType("warped_nylium"); + + ItemType.Typed WARPED_PLANKS = getItemType("warped_planks"); + + ItemType.Typed WARPED_PRESSURE_PLATE = getItemType("warped_pressure_plate"); + + ItemType.Typed WARPED_ROOTS = getItemType("warped_roots"); + + ItemType.Typed WARPED_SIGN = getItemType("warped_sign"); + + ItemType.Typed WARPED_SLAB = getItemType("warped_slab"); + + ItemType.Typed WARPED_STAIRS = getItemType("warped_stairs"); + + ItemType.Typed WARPED_STEM = getItemType("warped_stem"); + + ItemType.Typed WARPED_TRAPDOOR = getItemType("warped_trapdoor"); + + ItemType.Typed WARPED_WART_BLOCK = getItemType("warped_wart_block"); + + ItemType.Typed WATER_BUCKET = getItemType("water_bucket"); + + ItemType.Typed WAXED_CHISELED_COPPER = getItemType("waxed_chiseled_copper"); + + ItemType.Typed WAXED_COPPER_BLOCK = getItemType("waxed_copper_block"); + + ItemType.Typed WAXED_COPPER_BULB = getItemType("waxed_copper_bulb"); + + ItemType.Typed WAXED_COPPER_DOOR = getItemType("waxed_copper_door"); + + ItemType.Typed WAXED_COPPER_GRATE = getItemType("waxed_copper_grate"); + + ItemType.Typed WAXED_COPPER_TRAPDOOR = getItemType("waxed_copper_trapdoor"); + + ItemType.Typed WAXED_CUT_COPPER = getItemType("waxed_cut_copper"); + + ItemType.Typed WAXED_CUT_COPPER_SLAB = getItemType("waxed_cut_copper_slab"); + + ItemType.Typed WAXED_CUT_COPPER_STAIRS = getItemType("waxed_cut_copper_stairs"); + + ItemType.Typed WAXED_EXPOSED_CHISELED_COPPER = getItemType("waxed_exposed_chiseled_copper"); + + ItemType.Typed WAXED_EXPOSED_COPPER = getItemType("waxed_exposed_copper"); + + ItemType.Typed WAXED_EXPOSED_COPPER_BULB = getItemType("waxed_exposed_copper_bulb"); + + ItemType.Typed WAXED_EXPOSED_COPPER_DOOR = getItemType("waxed_exposed_copper_door"); + + ItemType.Typed WAXED_EXPOSED_COPPER_GRATE = getItemType("waxed_exposed_copper_grate"); + + ItemType.Typed WAXED_EXPOSED_COPPER_TRAPDOOR = getItemType("waxed_exposed_copper_trapdoor"); + + ItemType.Typed WAXED_EXPOSED_CUT_COPPER = getItemType("waxed_exposed_cut_copper"); + + ItemType.Typed WAXED_EXPOSED_CUT_COPPER_SLAB = getItemType("waxed_exposed_cut_copper_slab"); + + ItemType.Typed WAXED_EXPOSED_CUT_COPPER_STAIRS = getItemType("waxed_exposed_cut_copper_stairs"); + + ItemType.Typed WAXED_OXIDIZED_CHISELED_COPPER = getItemType("waxed_oxidized_chiseled_copper"); + + ItemType.Typed WAXED_OXIDIZED_COPPER = getItemType("waxed_oxidized_copper"); + + ItemType.Typed WAXED_OXIDIZED_COPPER_BULB = getItemType("waxed_oxidized_copper_bulb"); + + ItemType.Typed WAXED_OXIDIZED_COPPER_DOOR = getItemType("waxed_oxidized_copper_door"); + + ItemType.Typed WAXED_OXIDIZED_COPPER_GRATE = getItemType("waxed_oxidized_copper_grate"); + + ItemType.Typed WAXED_OXIDIZED_COPPER_TRAPDOOR = getItemType("waxed_oxidized_copper_trapdoor"); + + ItemType.Typed WAXED_OXIDIZED_CUT_COPPER = getItemType("waxed_oxidized_cut_copper"); + + ItemType.Typed WAXED_OXIDIZED_CUT_COPPER_SLAB = getItemType("waxed_oxidized_cut_copper_slab"); + + ItemType.Typed WAXED_OXIDIZED_CUT_COPPER_STAIRS = getItemType("waxed_oxidized_cut_copper_stairs"); + + ItemType.Typed WAXED_WEATHERED_CHISELED_COPPER = getItemType("waxed_weathered_chiseled_copper"); + + ItemType.Typed WAXED_WEATHERED_COPPER = getItemType("waxed_weathered_copper"); + + ItemType.Typed WAXED_WEATHERED_COPPER_BULB = getItemType("waxed_weathered_copper_bulb"); + + ItemType.Typed WAXED_WEATHERED_COPPER_DOOR = getItemType("waxed_weathered_copper_door"); + + ItemType.Typed WAXED_WEATHERED_COPPER_GRATE = getItemType("waxed_weathered_copper_grate"); + + ItemType.Typed WAXED_WEATHERED_COPPER_TRAPDOOR = getItemType("waxed_weathered_copper_trapdoor"); + + ItemType.Typed WAXED_WEATHERED_CUT_COPPER = getItemType("waxed_weathered_cut_copper"); + + ItemType.Typed WAXED_WEATHERED_CUT_COPPER_SLAB = getItemType("waxed_weathered_cut_copper_slab"); + + ItemType.Typed WAXED_WEATHERED_CUT_COPPER_STAIRS = getItemType("waxed_weathered_cut_copper_stairs"); + + ItemType.Typed WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("wayfinder_armor_trim_smithing_template"); + + ItemType.Typed WEATHERED_CHISELED_COPPER = getItemType("weathered_chiseled_copper"); + + ItemType.Typed WEATHERED_COPPER = getItemType("weathered_copper"); + + ItemType.Typed WEATHERED_COPPER_BULB = getItemType("weathered_copper_bulb"); + + ItemType.Typed WEATHERED_COPPER_DOOR = getItemType("weathered_copper_door"); + + ItemType.Typed WEATHERED_COPPER_GRATE = getItemType("weathered_copper_grate"); + + ItemType.Typed WEATHERED_COPPER_TRAPDOOR = getItemType("weathered_copper_trapdoor"); + + ItemType.Typed WEATHERED_CUT_COPPER = getItemType("weathered_cut_copper"); + + ItemType.Typed WEATHERED_CUT_COPPER_SLAB = getItemType("weathered_cut_copper_slab"); + + ItemType.Typed WEATHERED_CUT_COPPER_STAIRS = getItemType("weathered_cut_copper_stairs"); + + ItemType.Typed WEEPING_VINES = getItemType("weeping_vines"); + + ItemType.Typed WET_SPONGE = getItemType("wet_sponge"); + + ItemType.Typed WHEAT = getItemType("wheat"); + + ItemType.Typed WHEAT_SEEDS = getItemType("wheat_seeds"); + + ItemType.Typed WHITE_BANNER = getItemType("white_banner"); + + ItemType.Typed WHITE_BED = getItemType("white_bed"); + + ItemType.Typed WHITE_CANDLE = getItemType("white_candle"); + + ItemType.Typed WHITE_CARPET = getItemType("white_carpet"); + + ItemType.Typed WHITE_CONCRETE = getItemType("white_concrete"); + + ItemType.Typed WHITE_CONCRETE_POWDER = getItemType("white_concrete_powder"); + + ItemType.Typed WHITE_DYE = getItemType("white_dye"); + + ItemType.Typed WHITE_GLAZED_TERRACOTTA = getItemType("white_glazed_terracotta"); + + ItemType.Typed WHITE_SHULKER_BOX = getItemType("white_shulker_box"); + + ItemType.Typed WHITE_STAINED_GLASS = getItemType("white_stained_glass"); + + ItemType.Typed WHITE_STAINED_GLASS_PANE = getItemType("white_stained_glass_pane"); + + ItemType.Typed WHITE_TERRACOTTA = getItemType("white_terracotta"); + + ItemType.Typed WHITE_TULIP = getItemType("white_tulip"); + + ItemType.Typed WHITE_WOOL = getItemType("white_wool"); + + ItemType.Typed WILD_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("wild_armor_trim_smithing_template"); + + ItemType.Typed WIND_CHARGE = getItemType("wind_charge"); + + ItemType.Typed WITCH_SPAWN_EGG = getItemType("witch_spawn_egg"); + + ItemType.Typed WITHER_ROSE = getItemType("wither_rose"); + + ItemType.Typed WITHER_SKELETON_SKULL = getItemType("wither_skeleton_skull"); + + ItemType.Typed WITHER_SKELETON_SPAWN_EGG = getItemType("wither_skeleton_spawn_egg"); + + ItemType.Typed WITHER_SPAWN_EGG = getItemType("wither_spawn_egg"); + + ItemType.Typed WOLF_ARMOR = getItemType("wolf_armor"); + + ItemType.Typed WOLF_SPAWN_EGG = getItemType("wolf_spawn_egg"); + + ItemType.Typed WOODEN_AXE = getItemType("wooden_axe"); + + ItemType.Typed WOODEN_HOE = getItemType("wooden_hoe"); + + ItemType.Typed WOODEN_PICKAXE = getItemType("wooden_pickaxe"); + + ItemType.Typed WOODEN_SHOVEL = getItemType("wooden_shovel"); + + ItemType.Typed WOODEN_SWORD = getItemType("wooden_sword"); + + ItemType.Typed WRITABLE_BOOK = getItemType("writable_book"); + + ItemType.Typed WRITTEN_BOOK = getItemType("written_book"); + + ItemType.Typed YELLOW_BANNER = getItemType("yellow_banner"); + + ItemType.Typed YELLOW_BED = getItemType("yellow_bed"); + + ItemType.Typed YELLOW_CANDLE = getItemType("yellow_candle"); + + ItemType.Typed YELLOW_CARPET = getItemType("yellow_carpet"); + + ItemType.Typed YELLOW_CONCRETE = getItemType("yellow_concrete"); + + ItemType.Typed YELLOW_CONCRETE_POWDER = getItemType("yellow_concrete_powder"); + + ItemType.Typed YELLOW_DYE = getItemType("yellow_dye"); + + ItemType.Typed YELLOW_GLAZED_TERRACOTTA = getItemType("yellow_glazed_terracotta"); + + ItemType.Typed YELLOW_SHULKER_BOX = getItemType("yellow_shulker_box"); + + ItemType.Typed YELLOW_STAINED_GLASS = getItemType("yellow_stained_glass"); + + ItemType.Typed YELLOW_STAINED_GLASS_PANE = getItemType("yellow_stained_glass_pane"); + + ItemType.Typed YELLOW_TERRACOTTA = getItemType("yellow_terracotta"); + + ItemType.Typed YELLOW_WOOL = getItemType("yellow_wool"); + + ItemType.Typed ZOGLIN_SPAWN_EGG = getItemType("zoglin_spawn_egg"); + + ItemType.Typed ZOMBIE_HEAD = getItemType("zombie_head"); + + ItemType.Typed ZOMBIE_HORSE_SPAWN_EGG = getItemType("zombie_horse_spawn_egg"); + + ItemType.Typed ZOMBIE_SPAWN_EGG = getItemType("zombie_spawn_egg"); + + ItemType.Typed ZOMBIE_VILLAGER_SPAWN_EGG = getItemType("zombie_villager_spawn_egg"); + + ItemType.Typed ZOMBIFIED_PIGLIN_SPAWN_EGG = getItemType("zombified_piglin_spawn_egg"); + // Paper end - Generated/ItemType + // + + @NotNull + private static M getItemType(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + ItemType itemType = Registry.ITEM.get(namespacedKey); + Preconditions.checkNotNull(itemType, "No ItemType found for %s. This is a bug.", namespacedKey); + // Cast instead of using ItemType#typed, since item type can be a mock during testing and would return null + return (M) itemType; + } + + /** + * Yields this item type as a typed version of itself with a plain {@link ItemMeta} representing it. + * + * @return the typed item type. + */ + @NotNull + Typed typed(); + + /** + * Yields this item type as a typed version of itself with a plain {@link ItemMeta} representing it. + * + * @param itemMetaType the class type of the {@link ItemMeta} to type this {@link ItemType} with. + * @param the generic type of the item meta to type this item type with. + * @return the typed item type. + */ + @NotNull + Typed typed(@NotNull Class itemMetaType); + + /** + * Constructs a new itemstack with this item type that has the amount 1. + * + * @return the constructed item stack. + */ + @NotNull + ItemStack createItemStack(); + + /** + * Constructs a new itemstack with this item type. + * + * @param amount the amount of the item stack. + * @return the constructed item stack. + */ + @NotNull + ItemStack createItemStack(int amount); + + /** + * Returns true if this ItemType has a corresponding {@link BlockType}. + * + * @return true if there is a corresponding BlockType, otherwise false + * @see #getBlockType() + */ + boolean hasBlockType(); + + /** + * Returns the corresponding {@link BlockType} for the given ItemType. + *

+ * If there is no corresponding {@link BlockType} an error will be thrown. + * + * @return the corresponding BlockType + * @see #hasBlockType() + */ + @NotNull + BlockType getBlockType(); + + /** + * Gets the ItemMeta class of this ItemType + * + * @return the ItemMeta class of this ItemType + */ + @NotNull + Class getItemMetaClass(); + + /** + * Gets the maximum amount of this item type that can be held in a stack + * + * @return Maximum stack size for this item type + */ + int getMaxStackSize(); + + /** + * Gets the maximum durability of this item type + * + * @return Maximum durability for this item type + */ + short getMaxDurability(); + + /** + * Checks if this item type is edible. + * + * @return true if this item type is edible. + */ + boolean isEdible(); + + /** + * @return True if this item type represents a playable music disk. + */ + boolean isRecord(); + + /** + * Checks if this item type can be used as fuel in a Furnace + * + * @return true if this item type can be used as fuel. + */ + boolean isFuel(); + + /** + * Checks whether this item type is compostable (can be inserted into a + * composter). + * + * @return true if this item type is compostable + * @see #getCompostChance() + */ + boolean isCompostable(); + + /** + * Get the chance that this item type will successfully compost. The + * returned value is between 0 and 1 (inclusive). + * + * Items with a compost chance of 1 will always raise the composter's level, + * while items with a compost chance of 0 will never raise it. + * + * Plugins should check that {@link #isCompostable} returns true before + * calling this method. + * + * @return the chance that this item type will successfully compost + * @throws IllegalArgumentException if this item type is not compostable + * @see #isCompostable() + */ + float getCompostChance(); + + /** + * Determines the remaining item in a crafting grid after crafting with this + * ingredient. + * + * @return the item left behind when crafting, or null if nothing is. + */ + @Nullable + ItemType getCraftingRemainingItem(); + +// /** +// * Get the best suitable slot for this item type. +// * +// * For most items this will be {@link EquipmentSlot#HAND}. +// * +// * @return the best EquipmentSlot for this item type +// */ +// @NotNull +// EquipmentSlot getEquipmentSlot(); + + // Paper start - improve default item attribute API + /** + * Return an immutable copy of all default {@link Attribute}s and their + * {@link AttributeModifier}s. + *

+ * Default attributes are those that are always preset on some items, unless + * they are specifically overridden on that {@link ItemStack}. Examples include + * the attack damage on weapons or the armor value on armor. + * + * @return the immutable {@link Multimap} with the respective default + * Attributes and modifiers, or an empty map if no attributes are set. + */ + @NotNull @org.jetbrains.annotations.Unmodifiable Multimap getDefaultAttributeModifiers(); + // Paper end - improve default item attribute API + + /** + * Return an immutable copy of all default {@link Attribute}s and their + * {@link AttributeModifier}s for a given {@link EquipmentSlot}. + * + * Default attributes are those that are always preset on some items, such + * as the attack damage on weapons or the armor value on armor. + * + * @param slot the {@link EquipmentSlot} to check + * @return the immutable {@link Multimap} with the respective default + * Attributes and modifiers, or an empty map if no attributes are set. + */ + @NotNull + Multimap getDefaultAttributeModifiers(@NotNull EquipmentSlot slot); + + /** + * Get the {@link CreativeCategory} to which this item type belongs. + * + * @return the creative category. null if does not belong to a category + * @deprecated creative categories no longer exist on the server + */ + @Nullable + @Deprecated + CreativeCategory getCreativeCategory(); + + /** + * Gets if the ItemType is enabled by the features in a world. + * + * @param world the world to check + * @return true if this ItemType can be used in this World. + * @deprecated use {@link io.papermc.paper.world.flag.FeatureFlagSetHolder#isEnabled(io.papermc.paper.world.flag.FeatureDependant)} + */ + @Deprecated(forRemoval = true, since = "1.21.1") // Paper + boolean isEnabledByFeature(@NotNull World world); + + /** + * Tries to convert this ItemType into a Material + * + * @return the converted Material or null + * @deprecated only for internal use + */ + @Nullable + @Deprecated + Material asMaterial(); + + // Paper start - add Translatable + /** + * @deprecated use {@link #translationKey()} and {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} + */ + @Deprecated(forRemoval = true) + @Override + @NotNull String getTranslationKey(); + // Paper end - add Translatable + + // Paper start - expand ItemRarity API + /** + * Returns the item rarity for the item. + * + * @return the item rarity (or null if none is set) + */ + @Nullable ItemRarity getItemRarity(); + // Paper end - expand ItemRarity API +} diff --git a/paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimMaterial.java b/paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimMaterial.java new file mode 100644 index 0000000000..308a461a9f --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimMaterial.java @@ -0,0 +1,68 @@ +package org.bukkit.inventory.meta.trim; + +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.Translatable; + +/** + * Represents a material that may be used in an {@link ArmorTrim}. + */ +public interface TrimMaterial extends Keyed, Translatable { + + // Paper start - Generated/TrimMaterial + // @GeneratedFrom 1.21.1 + TrimMaterial AMETHYST = getTrimMaterial("amethyst"); + + TrimMaterial COPPER = getTrimMaterial("copper"); + + TrimMaterial DIAMOND = getTrimMaterial("diamond"); + + TrimMaterial EMERALD = getTrimMaterial("emerald"); + + TrimMaterial GOLD = getTrimMaterial("gold"); + + TrimMaterial IRON = getTrimMaterial("iron"); + + TrimMaterial LAPIS = getTrimMaterial("lapis"); + + TrimMaterial NETHERITE = getTrimMaterial("netherite"); + + TrimMaterial QUARTZ = getTrimMaterial("quartz"); + + TrimMaterial REDSTONE = getTrimMaterial("redstone"); + // Paper end - Generated/TrimMaterial + + private static TrimMaterial getTrimMaterial(String name) { + NamespacedKey key = NamespacedKey.minecraft(name); + return io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.TRIM_MATERIAL).get(key); + } + + // Paper start - adventure + /** + * Get the description of this {@link TrimMaterial}. + * + * @return the description + */ + net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component description(); + + /** + * @deprecated this method assumes that {@link #description()} will + * always be a translatable component which is not guaranteed. + */ + @Override + @Deprecated(forRemoval = true) + @org.jetbrains.annotations.NotNull String getTranslationKey(); + // Paper end - adventure + + // Paper start - Registry#getKey + /** + * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)}, + * and {@link io.papermc.paper.registry.RegistryKey#TRIM_MATERIAL}. TrimMaterials can exist without a key. + */ + @Deprecated(forRemoval = true, since = "1.20.4") + @Override + org.bukkit.@org.jetbrains.annotations.NotNull NamespacedKey getKey(); + // Paper end - Registry#getKey +} diff --git a/paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimPattern.java b/paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimPattern.java new file mode 100644 index 0000000000..eeb55e4dac --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimPattern.java @@ -0,0 +1,84 @@ +package org.bukkit.inventory.meta.trim; + +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.Translatable; + +/** + * Represents a pattern that may be used in an {@link ArmorTrim}. + */ +public interface TrimPattern extends Keyed, Translatable { + + // Paper start - Generated/TrimPattern + // @GeneratedFrom 1.21.1 + TrimPattern BOLT = getTrimPattern("bolt"); + + TrimPattern COAST = getTrimPattern("coast"); + + TrimPattern DUNE = getTrimPattern("dune"); + + TrimPattern EYE = getTrimPattern("eye"); + + TrimPattern FLOW = getTrimPattern("flow"); + + TrimPattern HOST = getTrimPattern("host"); + + TrimPattern RAISER = getTrimPattern("raiser"); + + TrimPattern RIB = getTrimPattern("rib"); + + TrimPattern SENTRY = getTrimPattern("sentry"); + + TrimPattern SHAPER = getTrimPattern("shaper"); + + TrimPattern SILENCE = getTrimPattern("silence"); + + TrimPattern SNOUT = getTrimPattern("snout"); + + TrimPattern SPIRE = getTrimPattern("spire"); + + TrimPattern TIDE = getTrimPattern("tide"); + + TrimPattern VEX = getTrimPattern("vex"); + + TrimPattern WARD = getTrimPattern("ward"); + + TrimPattern WAYFINDER = getTrimPattern("wayfinder"); + + TrimPattern WILD = getTrimPattern("wild"); + // Paper end - Generated/TrimPattern + + private static TrimPattern getTrimPattern(String name) { + NamespacedKey key = NamespacedKey.minecraft(name); + return io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.TRIM_PATTERN).get(key); + } + + // Paper start - adventure + /** + * Get the description of this {@link TrimPattern}. + * + * @return the description + */ + net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component description(); + + /** + * @deprecated this method assumes that {@link #description()} will + * always be a translatable component which is not guaranteed. + */ + @Override + @Deprecated(forRemoval = true) + @org.jetbrains.annotations.NotNull String getTranslationKey(); + // Paper end - adventure + + // Paper start - Registry#getKey + /** + * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)}, + * and {@link io.papermc.paper.registry.RegistryKey#TRIM_PATTERN}. TrimPatterns can exist without a key. + */ + @Deprecated(forRemoval = true, since = "1.20.4") + @Override + org.bukkit.@org.jetbrains.annotations.NotNull NamespacedKey getKey(); + // Paper end - Registry#getKey +} diff --git a/paper-generator/generatedApi/org/bukkit/inventory/recipe/CookingBookCategory.java b/paper-generator/generatedApi/org/bukkit/inventory/recipe/CookingBookCategory.java new file mode 100644 index 0000000000..dbf15cfed9 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/recipe/CookingBookCategory.java @@ -0,0 +1,14 @@ +package org.bukkit.inventory.recipe; + +/** + * Represents categories within the cooking recipe book. + */ +public enum CookingBookCategory { + + // Paper start - Generated/CookingBookCategory + // @GeneratedFrom 1.21.1 + FOOD, + BLOCKS, + MISC; + // Paper end - Generated/CookingBookCategory +} diff --git a/paper-generator/generatedApi/org/bukkit/inventory/recipe/CraftingBookCategory.java b/paper-generator/generatedApi/org/bukkit/inventory/recipe/CraftingBookCategory.java new file mode 100644 index 0000000000..63ec2b8b49 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/recipe/CraftingBookCategory.java @@ -0,0 +1,15 @@ +package org.bukkit.inventory.recipe; + +/** + * Represents categories within the crafting recipe book. + */ +public enum CraftingBookCategory { + + // Paper start - Generated/CraftingBookCategory + // @GeneratedFrom 1.21.1 + BUILDING, + REDSTONE, + EQUIPMENT, + MISC; + // Paper end - Generated/CraftingBookCategory +} diff --git a/paper-generator/generatedApi/org/bukkit/map/MapCursor.java b/paper-generator/generatedApi/org/bukkit/map/MapCursor.java new file mode 100644 index 0000000000..ca2ecc51e1 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/map/MapCursor.java @@ -0,0 +1,421 @@ +package org.bukkit.map; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Locale; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.util.OldEnum; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a cursor on a map. + */ +public final class MapCursor { + private byte x, y; + private byte direction; + private boolean visible; + private net.kyori.adventure.text.Component caption; // Paper + private Type type; + + /** + * Initialize the map cursor. + * + * @param x The x coordinate, from -128 to 127. + * @param y The y coordinate, from -128 to 127. + * @param direction The facing of the cursor, from 0 to 15. + * @param type The type (color/style) of the map cursor. + * @param visible Whether the cursor is visible by default. + * @deprecated Magic value + */ + @Deprecated + public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) { + this(x, y, direction, type, visible, (String) null); // Paper + } + + /** + * Initialize the map cursor. + * + * @param x The x coordinate, from -128 to 127. + * @param y The y coordinate, from -128 to 127. + * @param direction The facing of the cursor, from 0 to 15. + * @param type The type (color/style) of the map cursor. + * @param visible Whether the cursor is visible by default. + */ + public MapCursor(byte x, byte y, byte direction, @NotNull Type type, boolean visible) { + this(x, y, direction, type, visible, (String) null); // Paper + } + + /** + * Initialize the map cursor. + * + * @param x The x coordinate, from -128 to 127. + * @param y The y coordinate, from -128 to 127. + * @param direction The facing of the cursor, from 0 to 15. + * @param type The type (color/style) of the map cursor. + * @param visible Whether the cursor is visible by default. + * @param caption cursor caption + * @deprecated Magic value. Use {@link #MapCursor(byte, byte, byte, Type, boolean, net.kyori.adventure.text.Component)} + */ + @Deprecated + public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable String caption) { + this.x = x; + this.y = y; + setDirection(direction); + setRawType(type); + this.visible = visible; + this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper + } + // Paper start + /** + * Initialize the map cursor. + * + * @param x The x coordinate, from -128 to 127. + * @param y The y coordinate, from -128 to 127. + * @param direction The facing of the cursor, from 0 to 15. + * @param type The type (color/style) of the map cursor. + * @param visible Whether the cursor is visible by default. + * @param caption cursor caption + * @deprecated Magic value + */ + @Deprecated + public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, net.kyori.adventure.text.@Nullable Component caption) { + this.x = x; this.y = y; this.visible = visible; this.caption = caption; + setDirection(direction); + setRawType(type); + } + /** + * Initialize the map cursor. + * + * @param x The x coordinate, from -128 to 127. + * @param y The y coordinate, from -128 to 127. + * @param direction The facing of the cursor, from 0 to 15. + * @param type The type (color/style) of the map cursor. + * @param visible Whether the cursor is visible by default. + * @param caption cursor caption + */ + public MapCursor(byte x, byte y, byte direction, @NotNull Type type, boolean visible, net.kyori.adventure.text.@Nullable Component caption) { + this.x = x; this.y = y; this.visible = visible; this.caption = caption; + setDirection(direction); + setType(type); + } + // Paper end + + /** + * Initialize the map cursor. + * + * @param x The x coordinate, from -128 to 127. + * @param y The y coordinate, from -128 to 127. + * @param direction The facing of the cursor, from 0 to 15. + * @param type The type (color/style) of the map cursor. + * @param visible Whether the cursor is visible by default. + * @param caption cursor caption + */ + public MapCursor(byte x, byte y, byte direction, @NotNull Type type, boolean visible, @Nullable String caption) { + this.x = x; + this.y = y; + setDirection(direction); + this.type = type; + this.visible = visible; + this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper + } + + /** + * Get the X position of this cursor. + * + * @return The X coordinate. + */ + public byte getX() { + return x; + } + + /** + * Get the Y position of this cursor. + * + * @return The Y coordinate. + */ + public byte getY() { + return y; + } + + /** + * Get the direction of this cursor. + * + * @return The facing of the cursor, from 0 to 15. + */ + public byte getDirection() { + return direction; + } + + /** + * Get the type of this cursor. + * + * @return The type (color/style) of the map cursor. + */ + @NotNull + public Type getType() { + return type; + } + + /** + * Get the type of this cursor. + * + * @return The type (color/style) of the map cursor. + * @apiNote Internal Use Only + */ + @org.jetbrains.annotations.ApiStatus.Internal // Paper + public byte getRawType() { + return type.getValue(); + } + + /** + * Get the visibility status of this cursor. + * + * @return True if visible, false otherwise. + */ + public boolean isVisible() { + return visible; + } + + /** + * Set the X position of this cursor. + * + * @param x The X coordinate. + */ + public void setX(byte x) { + this.x = x; + } + + /** + * Set the Y position of this cursor. + * + * @param y The Y coordinate. + */ + public void setY(byte y) { + this.y = y; + } + + /** + * Set the direction of this cursor. + * + * @param direction The facing of the cursor, from 0 to 15. + */ + public void setDirection(byte direction) { + Preconditions.checkArgument(direction >= 0 && direction <= 15, "direction must be between 0 and 15 but is %s", direction); + this.direction = direction; + } + + /** + * Set the type of this cursor. + * + * @param type The type (color/style) of the map cursor. + */ + public void setType(@NotNull Type type) { + this.type = type; + } + + /** + * Set the type of this cursor. + * + * @param type The type (color/style) of the map cursor. + * @deprecated use {@link #setType(Type)} + */ + @Deprecated(forRemoval = true, since = "1.20.2") // Paper + public void setRawType(byte type) { + Type enumType = Type.byValue(type); + Preconditions.checkArgument(enumType != null, "Unknown type by id %s", type); + this.type = enumType; + } + + /** + * Set the visibility status of this cursor. + * + * @param visible True if visible. + */ + public void setVisible(boolean visible) { + this.visible = visible; + } + + // Paper start + /** + * Gets the caption on this cursor. + * + * @return caption + */ + public net.kyori.adventure.text.@Nullable Component caption() { + return this.caption; + } + /** + * Sets the caption on this cursor. + * + * @param caption new caption + */ + public void caption(net.kyori.adventure.text.@Nullable Component caption) { + this.caption = caption; + } + // Paper end + /** + * Gets the caption on this cursor. + * + * @return caption + * @deprecated in favour of {@link #caption()} + */ + @Nullable + @Deprecated // Paper + public String getCaption() { + return this.caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.caption); // Paper + } + + /** + * Sets the caption on this cursor. + * + * @param caption new caption + * @deprecated in favour of {@link #caption(net.kyori.adventure.text.Component)} + */ + @Deprecated // Paper + public void setCaption(@Nullable String caption) { + this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper + } + + /** + * Represents the standard types of map cursors. More may be made + * available by resource packs - the value is used by the client as an + * index in the file './assets/minecraft/textures/map/map_icons.png' from minecraft.jar or from a + * resource pack. + */ + public interface Type extends OldEnum, Keyed { + + // Paper start - Generated/MapCursorType + // @GeneratedFrom 1.21.1 + Type BANNER_BLACK = getType("banner_black"); + + Type BANNER_BLUE = getType("banner_blue"); + + Type BANNER_BROWN = getType("banner_brown"); + + Type BANNER_CYAN = getType("banner_cyan"); + + Type BANNER_GRAY = getType("banner_gray"); + + Type BANNER_GREEN = getType("banner_green"); + + Type BANNER_LIGHT_BLUE = getType("banner_light_blue"); + + Type BANNER_LIGHT_GRAY = getType("banner_light_gray"); + + Type BANNER_LIME = getType("banner_lime"); + + Type BANNER_MAGENTA = getType("banner_magenta"); + + Type BANNER_ORANGE = getType("banner_orange"); + + Type BANNER_PINK = getType("banner_pink"); + + Type BANNER_PURPLE = getType("banner_purple"); + + Type BANNER_RED = getType("banner_red"); + + Type BANNER_WHITE = getType("banner_white"); + + Type BANNER_YELLOW = getType("banner_yellow"); + + Type BLUE_MARKER = getType("blue_marker"); + + Type FRAME = getType("frame"); + + Type JUNGLE_TEMPLE = getType("jungle_temple"); + + Type MANSION = getType("mansion"); + + Type MONUMENT = getType("monument"); + + Type PLAYER = getType("player"); + + Type PLAYER_OFF_LIMITS = getType("player_off_limits"); + + Type PLAYER_OFF_MAP = getType("player_off_map"); + + Type RED_MARKER = getType("red_marker"); + + Type RED_X = getType("red_x"); + + Type SWAMP_HUT = getType("swamp_hut"); + + Type TARGET_POINT = getType("target_point"); + + Type TARGET_X = getType("target_x"); + + Type TRIAL_CHAMBERS = getType("trial_chambers"); + + Type VILLAGE_DESERT = getType("village_desert"); + + Type VILLAGE_PLAINS = getType("village_plains"); + + Type VILLAGE_SAVANNA = getType("village_savanna"); + + Type VILLAGE_SNOWY = getType("village_snowy"); + + Type VILLAGE_TAIGA = getType("village_taiga"); + // Paper end - Generated/MapCursorType + + @NotNull + private static Type getType(@NotNull String key) { + NamespacedKey namespacedKey = NamespacedKey.minecraft(key); + Type type = Registry.MAP_DECORATION_TYPE.get(namespacedKey); + + Preconditions.checkNotNull(type, "No type found for %s. This is a bug.", namespacedKey); + return type; + } + + /** + * Gets the internal value of the cursor. + * + * @return the value + * @apiNote Internal Use Only + */ + @org.jetbrains.annotations.ApiStatus.Internal // Paper + byte getValue(); + + /** + * Get a cursor by its internal value. + * + * @param value the value + * @return the matching type + * @apiNote Internal Use Only + */ + @org.jetbrains.annotations.ApiStatus.Internal // Paper + @Nullable + static Type byValue(byte value) { + for (Type t : values()) { + if (t.getValue() == value) return t; + } + return null; + } + + /** + * @param name of the type. + * @return the type with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Type valueOf(@NotNull String name) { + Type type = Registry.MAP_DECORATION_TYPE.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(type != null, "No Type found with the name %s", name); + return type; + } + + /** + * @return an array of all known map cursor types. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Type[] values() { + return Lists.newArrayList(Registry.MAP_DECORATION_TYPE).toArray(new Type[0]); + } + } + +} diff --git a/paper-generator/generatedApi/org/bukkit/map/MapPalette.java b/paper-generator/generatedApi/org/bukkit/map/MapPalette.java new file mode 100644 index 0000000000..98fcda0890 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/map/MapPalette.java @@ -0,0 +1,508 @@ +package org.bukkit.map; + +import com.google.common.base.Preconditions; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.image.BufferedImage; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents the palette that map items use. + *

+ * These fields are hee base color ranges. Each entry corresponds to four + * colors of varying shades with values entry to entry + 3. + */ +public final class MapPalette { + // Internal mechanisms + private MapPalette() {} + + @NotNull + private static Color c(int r, int g, int b) { + return new Color(r, g, b); + } + + @NotNull + private static Color c(int r, int g, int b, int a) { + return new Color(r, g, b, a); + } + + private static double getDistance(@NotNull Color c1, @NotNull Color c2) { + double rmean = (c1.getRed() + c2.getRed()) / 2.0; + double r = c1.getRed() - c2.getRed(); + double g = c1.getGreen() - c2.getGreen(); + int b = c1.getBlue() - c2.getBlue(); + double weightR = 2 + rmean / 256.0; + double weightG = 4.0; + double weightB = 2 + (255 - rmean) / 256.0; + return weightR * r * r + weightG * g * g + weightB * b * b; + } + + @NotNull + static final Color[] colors = { + // Paper start - Generated/MapPalette#colors + // @GeneratedFrom 1.21.1 + new Color(0, 0, 0, 0), + new Color(0, 0, 0, 0), + new Color(0, 0, 0, 0), + new Color(0, 0, 0, 0), + new Color(89, 125, 39), + new Color(109, 153, 48), + new Color(127, 178, 56), + new Color(67, 94, 29), + new Color(174, 164, 115), + new Color(213, 201, 140), + new Color(247, 233, 163), + new Color(130, 123, 86), + new Color(140, 140, 140), + new Color(171, 171, 171), + new Color(199, 199, 199), + new Color(105, 105, 105), + new Color(180, 0, 0), + new Color(220, 0, 0), + new Color(255, 0, 0), + new Color(135, 0, 0), + new Color(112, 112, 180), + new Color(138, 138, 220), + new Color(160, 160, 255), + new Color(84, 84, 135), + new Color(117, 117, 117), + new Color(144, 144, 144), + new Color(167, 167, 167), + new Color(88, 88, 88), + new Color(0, 87, 0), + new Color(0, 106, 0), + new Color(0, 124, 0), + new Color(0, 65, 0), + new Color(180, 180, 180), + new Color(220, 220, 220), + new Color(255, 255, 255), + new Color(135, 135, 135), + new Color(115, 118, 129), + new Color(141, 144, 158), + new Color(164, 168, 184), + new Color(86, 88, 97), + new Color(106, 76, 54), + new Color(130, 94, 66), + new Color(151, 109, 77), + new Color(79, 57, 40), + new Color(79, 79, 79), + new Color(96, 96, 96), + new Color(112, 112, 112), + new Color(59, 59, 59), + new Color(45, 45, 180), + new Color(55, 55, 220), + new Color(64, 64, 255), + new Color(33, 33, 135), + new Color(100, 84, 50), + new Color(123, 102, 62), + new Color(143, 119, 72), + new Color(75, 63, 38), + new Color(180, 177, 172), + new Color(220, 217, 211), + new Color(255, 252, 245), + new Color(135, 133, 129), + new Color(152, 89, 36), + new Color(186, 109, 44), + new Color(216, 127, 51), + new Color(114, 67, 27), + new Color(125, 53, 152), + new Color(153, 65, 186), + new Color(178, 76, 216), + new Color(94, 40, 114), + new Color(72, 108, 152), + new Color(88, 132, 186), + new Color(102, 153, 216), + new Color(54, 81, 114), + new Color(161, 161, 36), + new Color(197, 197, 44), + new Color(229, 229, 51), + new Color(121, 121, 27), + new Color(89, 144, 17), + new Color(109, 176, 21), + new Color(127, 204, 25), + new Color(67, 108, 13), + new Color(170, 89, 116), + new Color(208, 109, 142), + new Color(242, 127, 165), + new Color(128, 67, 87), + new Color(53, 53, 53), + new Color(65, 65, 65), + new Color(76, 76, 76), + new Color(40, 40, 40), + new Color(108, 108, 108), + new Color(132, 132, 132), + new Color(153, 153, 153), + new Color(81, 81, 81), + new Color(53, 89, 108), + new Color(65, 109, 132), + new Color(76, 127, 153), + new Color(40, 67, 81), + new Color(89, 44, 125), + new Color(109, 54, 153), + new Color(127, 63, 178), + new Color(67, 33, 94), + new Color(36, 53, 125), + new Color(44, 65, 153), + new Color(51, 76, 178), + new Color(27, 40, 94), + new Color(72, 53, 36), + new Color(88, 65, 44), + new Color(102, 76, 51), + new Color(54, 40, 27), + new Color(72, 89, 36), + new Color(88, 109, 44), + new Color(102, 127, 51), + new Color(54, 67, 27), + new Color(108, 36, 36), + new Color(132, 44, 44), + new Color(153, 51, 51), + new Color(81, 27, 27), + new Color(17, 17, 17), + new Color(21, 21, 21), + new Color(25, 25, 25), + new Color(13, 13, 13), + new Color(176, 168, 54), + new Color(215, 205, 66), + new Color(250, 238, 77), + new Color(132, 126, 40), + new Color(64, 154, 150), + new Color(79, 188, 183), + new Color(92, 219, 213), + new Color(48, 115, 112), + new Color(52, 90, 180), + new Color(63, 110, 220), + new Color(74, 128, 255), + new Color(39, 67, 135), + new Color(0, 153, 40), + new Color(0, 187, 50), + new Color(0, 217, 58), + new Color(0, 114, 30), + new Color(91, 60, 34), + new Color(111, 74, 42), + new Color(129, 86, 49), + new Color(68, 45, 25), + new Color(79, 1, 0), + new Color(96, 1, 0), + new Color(112, 2, 0), + new Color(59, 1, 0), + new Color(147, 124, 113), + new Color(180, 152, 138), + new Color(209, 177, 161), + new Color(110, 93, 85), + new Color(112, 57, 25), + new Color(137, 70, 31), + new Color(159, 82, 36), + new Color(84, 43, 19), + new Color(105, 61, 76), + new Color(128, 75, 93), + new Color(149, 87, 108), + new Color(78, 46, 57), + new Color(79, 76, 97), + new Color(96, 93, 119), + new Color(112, 108, 138), + new Color(59, 57, 73), + new Color(131, 93, 25), + new Color(160, 114, 31), + new Color(186, 133, 36), + new Color(98, 70, 19), + new Color(72, 82, 37), + new Color(88, 100, 45), + new Color(103, 117, 53), + new Color(54, 61, 28), + new Color(112, 54, 55), + new Color(138, 66, 67), + new Color(160, 77, 78), + new Color(84, 40, 41), + new Color(40, 28, 24), + new Color(49, 35, 30), + new Color(57, 41, 35), + new Color(30, 21, 18), + new Color(95, 75, 69), + new Color(116, 92, 84), + new Color(135, 107, 98), + new Color(71, 56, 51), + new Color(61, 64, 64), + new Color(75, 79, 79), + new Color(87, 92, 92), + new Color(46, 48, 48), + new Color(86, 51, 62), + new Color(105, 62, 75), + new Color(122, 73, 88), + new Color(64, 38, 46), + new Color(53, 43, 64), + new Color(65, 53, 79), + new Color(76, 62, 92), + new Color(40, 32, 48), + new Color(53, 35, 24), + new Color(65, 43, 30), + new Color(76, 50, 35), + new Color(40, 26, 18), + new Color(53, 57, 29), + new Color(65, 70, 36), + new Color(76, 82, 42), + new Color(40, 43, 22), + new Color(100, 42, 32), + new Color(122, 51, 39), + new Color(142, 60, 46), + new Color(75, 31, 24), + new Color(26, 15, 11), + new Color(31, 18, 13), + new Color(37, 22, 16), + new Color(19, 11, 8), + new Color(133, 33, 34), + new Color(163, 41, 42), + new Color(189, 48, 49), + new Color(100, 25, 25), + new Color(104, 44, 68), + new Color(127, 54, 83), + new Color(148, 63, 97), + new Color(78, 33, 51), + new Color(64, 17, 20), + new Color(79, 21, 25), + new Color(92, 25, 29), + new Color(48, 13, 15), + new Color(15, 88, 94), + new Color(18, 108, 115), + new Color(22, 126, 134), + new Color(11, 66, 70), + new Color(40, 100, 98), + new Color(50, 122, 120), + new Color(58, 142, 140), + new Color(30, 75, 74), + new Color(60, 31, 43), + new Color(74, 37, 53), + new Color(86, 44, 62), + new Color(45, 23, 32), + new Color(14, 127, 93), + new Color(17, 155, 114), + new Color(20, 180, 133), + new Color(10, 95, 70), + new Color(70, 70, 70), + new Color(86, 86, 86), + new Color(100, 100, 100), + new Color(52, 52, 52), + new Color(152, 123, 103), + new Color(186, 150, 126), + new Color(216, 175, 147), + new Color(114, 92, 77), + new Color(89, 117, 105), + new Color(109, 144, 129), + new Color(127, 167, 150), + new Color(67, 88, 79), + // Paper end - Generated/MapPalette#colors + }; + + // Interface + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte TRANSPARENT = 0; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte LIGHT_GREEN = 4; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte LIGHT_BROWN = 8; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte GRAY_1 = 12; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte RED = 16; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte PALE_BLUE = 20; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte GRAY_2 = 24; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte DARK_GREEN = 28; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte WHITE = 32; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte LIGHT_GRAY = 36; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte BROWN = 40; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte DARK_GRAY = 44; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte BLUE = 48; + /** + * @deprecated Magic value + */ + @Deprecated + public static final byte DARK_BROWN = 52; + + /** + * Resize an image to 128x128. + * + * @param image The image to resize. + * @return The resized image. + */ + @NotNull + public static BufferedImage resizeImage(@Nullable Image image) { + BufferedImage result = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics = result.createGraphics(); + graphics.drawImage(image, 0, 0, 128, 128, null); + graphics.dispose(); + return result; + } + + /** + * Convert an Image to a byte[] using the palette. + * + * @param image The image to convert. + * @return A byte[] containing the pixels of the image. + * @deprecated use color-related methods + */ + @Deprecated(forRemoval = true, since = "1.20.2") // Paper + @NotNull + public static byte[] imageToBytes(@NotNull Image image) { + BufferedImage temp = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB); + Graphics2D graphics = temp.createGraphics(); + graphics.drawImage(image, 0, 0, null); + graphics.dispose(); + + int[] pixels = new int[temp.getWidth() * temp.getHeight()]; + temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth()); + + byte[] result = new byte[temp.getWidth() * temp.getHeight()]; + for (int i = 0; i < pixels.length; i++) { + result[i] = matchColor(new Color(pixels[i], true)); + } + return result; + } + + /** + * Get the index of the closest matching color in the palette to the given + * color. + * + * @param r The red component of the color. + * @param b The blue component of the color. + * @param g The green component of the color. + * @return The index in the palette. + * @deprecated use color-related methods + */ + @Deprecated(forRemoval = true, since = "1.20.2") // Paper + public static byte matchColor(int r, int g, int b) { + return matchColor(new Color(r, g, b)); + } + + /** + * Get the index of the closest matching color in the palette to the given + * color. + * + * @param color The Color to match. + * @return The index in the palette. + * @deprecated use color-related methods + */ + @Deprecated(forRemoval = true, since = "1.20.2") // Paper + public static byte matchColor(@NotNull Color color) { + if (color.getAlpha() < 128) return 0; + + if (mapColorCache != null && mapColorCache.isCached()) { + return mapColorCache.matchColor(color); + } + + int index = 0; + double best = -1; + + for (int i = 4; i < colors.length; i++) { + double distance = getDistance(color, colors[i]); + if (distance < best || best == -1) { + best = distance; + index = i; + } + } + + // Minecraft has 143 colors, some of which have negative byte representations + return (byte) (index < 128 ? index : -129 + (index - 127)); + } + + /** + * Get the value of the given color in the palette. + * + * @param index The index in the palette. + * @return The Color of the palette entry. + * @deprecated use color directly + */ + @Deprecated(forRemoval = true, since = "1.20.2") // Paper + @NotNull + public static Color getColor(byte index) { + // Minecraft has 143 colors, some of which have negative byte representations + return colors[index >= 0 ? index : index + 256]; + } + + private static MapColorCache mapColorCache; + + /** + * Sets the given MapColorCache. + * + * @param mapColorCache The map color cache to set + */ + public static void setMapColorCache(@NotNull MapColorCache mapColorCache) { + Preconditions.checkState(MapPalette.mapColorCache == null, "Map color cache already set"); + + MapPalette.mapColorCache = mapColorCache; + } + + /** + * Holds cached information for matching map colors of a given RBG color. + */ + public interface MapColorCache { + + /** + * Returns true if the MapColorCache has values cached, if not it will + * return false. + * A case where it might return false is when the cache is not build jet. + * + * @return true if this MapColorCache has values cached otherwise false + */ + boolean isCached(); + + /** + * Get the cached index of the closest matching color in the palette to the given + * color. + * + * @param color The Color to match. + * @return The index in the palette. + * @throws IllegalStateException if {@link #isCached()} returns false + * @apiNote Internal Use Only + */ + @org.jetbrains.annotations.ApiStatus.Internal // Paper + byte matchColor(@NotNull Color color); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/potion/PotionType.java b/paper-generator/generatedApi/org/bukkit/potion/PotionType.java new file mode 100644 index 0000000000..4a9b1218cc --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/potion/PotionType.java @@ -0,0 +1,171 @@ +package org.bukkit.potion; + +import com.google.common.base.Suppliers; +import java.util.List; +import java.util.function.Supplier; +import org.bukkit.Bukkit; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * This enum reflects and matches each potion state that can be obtained from + * the Creative mode inventory + */ +public enum PotionType implements Keyed, io.papermc.paper.world.flag.FeatureDependant { // Paper - feature flag API + // Paper start - Generated/PotionType + // @GeneratedFrom 1.21.1 + AWKWARD("awkward"), + FIRE_RESISTANCE("fire_resistance"), + HARMING("harming"), + HEALING("healing"), + INFESTED("infested"), + INVISIBILITY("invisibility"), + LEAPING("leaping"), + LONG_FIRE_RESISTANCE("long_fire_resistance"), + LONG_INVISIBILITY("long_invisibility"), + LONG_LEAPING("long_leaping"), + LONG_NIGHT_VISION("long_night_vision"), + LONG_POISON("long_poison"), + LONG_REGENERATION("long_regeneration"), + LONG_SLOW_FALLING("long_slow_falling"), + LONG_SLOWNESS("long_slowness"), + LONG_STRENGTH("long_strength"), + LONG_SWIFTNESS("long_swiftness"), + LONG_TURTLE_MASTER("long_turtle_master"), + LONG_WATER_BREATHING("long_water_breathing"), + LONG_WEAKNESS("long_weakness"), + LUCK("luck"), + MUNDANE("mundane"), + NIGHT_VISION("night_vision"), + OOZING("oozing"), + POISON("poison"), + REGENERATION("regeneration"), + SLOW_FALLING("slow_falling"), + SLOWNESS("slowness"), + STRENGTH("strength"), + STRONG_HARMING("strong_harming"), + STRONG_HEALING("strong_healing"), + STRONG_LEAPING("strong_leaping"), + STRONG_POISON("strong_poison"), + STRONG_REGENERATION("strong_regeneration"), + STRONG_SLOWNESS("strong_slowness"), + STRONG_STRENGTH("strong_strength"), + STRONG_SWIFTNESS("strong_swiftness"), + STRONG_TURTLE_MASTER("strong_turtle_master"), + SWIFTNESS("swiftness"), + THICK("thick"), + TURTLE_MASTER("turtle_master"), + WATER("water"), + WATER_BREATHING("water_breathing"), + WEAKNESS("weakness"), + WEAVING("weaving"), + WIND_CHARGED("wind_charged"); + // Paper end - Generated/PotionType + + private final NamespacedKey key; + private final Supplier internalPotionDataSupplier; + + PotionType(String key) { + this.key = NamespacedKey.minecraft(key); + this.internalPotionDataSupplier = Suppliers.memoize(() -> Bukkit.getUnsafe().getInternalPotionData(this.key)); + } + + /** + * @return the potion effect type of this potion type + * @deprecated Potions can have multiple effects use {@link #getPotionEffects()} + */ + @Nullable + @Deprecated + public PotionEffectType getEffectType() { + return internalPotionDataSupplier.get().getEffectType(); + } + + /** + * @return a list of all effects this potion type has + */ + @NotNull + public List getPotionEffects() { + return internalPotionDataSupplier.get().getPotionEffects(); + } + + /** + * @return if this potion type is instant + * @deprecated PotionType can have multiple effects, some of which can be instant and others not. + * Use {@link PotionEffectType#isInstant()} in combination with {@link #getPotionEffects()} and {@link PotionEffect#getType()} + */ + @Deprecated + public boolean isInstant() { + return internalPotionDataSupplier.get().isInstant(); + } + + /** + * Checks if the potion type has an upgraded state. + * This refers to whether or not the potion type can be Tier 2, + * such as Potion of Fire Resistance II. + * + * @return true if the potion type can be upgraded; + */ + public boolean isUpgradeable() { + return internalPotionDataSupplier.get().isUpgradeable(); + } + + /** + * Checks if the potion type has an extended state. + * This refers to the extended duration potions + * + * @return true if the potion type can be extended + */ + public boolean isExtendable() { + return internalPotionDataSupplier.get().isExtendable(); + } + + public int getMaxLevel() { + return internalPotionDataSupplier.get().getMaxLevel(); + } + + /** + * @param effectType the effect to get by + * @return the matching potion type + * @deprecated Misleading + */ + @Deprecated + @Nullable + public static PotionType getByEffect(@Nullable PotionEffectType effectType) { + if (effectType == null) + return WATER; + for (PotionType type : PotionType.values()) { + if (effectType.equals(type.getEffectType())) + return type; + } + return null; + } + + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + + /** + * @deprecated Do not use, interface will get removed, and the plugin won't run + */ + @Deprecated + @ApiStatus.Internal + public interface InternalPotionData { + + PotionEffectType getEffectType(); + + List getPotionEffects(); + + boolean isInstant(); + + boolean isUpgradeable(); + + boolean isExtendable(); + + int getMaxLevel(); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/scoreboard/DisplaySlot.java b/paper-generator/generatedApi/org/bukkit/scoreboard/DisplaySlot.java new file mode 100644 index 0000000000..f27704ea98 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/scoreboard/DisplaySlot.java @@ -0,0 +1,58 @@ +package org.bukkit.scoreboard; + +import net.kyori.adventure.text.format.NamedTextColor; // Paper +/** + * Locations for displaying objectives to the player + */ +public enum DisplaySlot { + // Paper start + // Paper start - Generated/DisplaySlot + // @GeneratedFrom 1.21.1 + PLAYER_LIST("list"), + SIDEBAR("sidebar"), + BELOW_NAME("below_name"), + SIDEBAR_TEAM_BLACK("sidebar.team.black"), + SIDEBAR_TEAM_DARK_BLUE("sidebar.team.dark_blue"), + SIDEBAR_TEAM_DARK_GREEN("sidebar.team.dark_green"), + SIDEBAR_TEAM_DARK_AQUA("sidebar.team.dark_aqua"), + SIDEBAR_TEAM_DARK_RED("sidebar.team.dark_red"), + SIDEBAR_TEAM_DARK_PURPLE("sidebar.team.dark_purple"), + SIDEBAR_TEAM_GOLD("sidebar.team.gold"), + SIDEBAR_TEAM_GRAY("sidebar.team.gray"), + SIDEBAR_TEAM_DARK_GRAY("sidebar.team.dark_gray"), + SIDEBAR_TEAM_BLUE("sidebar.team.blue"), + SIDEBAR_TEAM_GREEN("sidebar.team.green"), + SIDEBAR_TEAM_AQUA("sidebar.team.aqua"), + SIDEBAR_TEAM_RED("sidebar.team.red"), + SIDEBAR_TEAM_LIGHT_PURPLE("sidebar.team.light_purple"), + SIDEBAR_TEAM_YELLOW("sidebar.team.yellow"), + SIDEBAR_TEAM_WHITE("sidebar.team.white"); + // Paper end - Generated/DisplaySlot + + public static final net.kyori.adventure.util.Index NAMES = net.kyori.adventure.util.Index.create(DisplaySlot.class, DisplaySlot::getId); + + private final String id; + + DisplaySlot(@org.jetbrains.annotations.NotNull String id) { + this.id = id; + } + + DisplaySlot(@org.jetbrains.annotations.NotNull NamedTextColor color) { + this.id = "sidebar.team." + color; + } + + /** + * Get the string id of this display slot. + * + * @return the string id + */ + public @org.jetbrains.annotations.NotNull String getId() { + return id; + } + + @Override + public String toString() { + return this.id; + } + // Paper end +} diff --git a/paper-generator/generatedServer/io/papermc/paper/registry/PaperRegistries.java b/paper-generator/generatedServer/io/papermc/paper/registry/PaperRegistries.java new file mode 100644 index 0000000000..1092f2db39 --- /dev/null +++ b/paper-generator/generatedServer/io/papermc/paper/registry/PaperRegistries.java @@ -0,0 +1,162 @@ +package io.papermc.paper.registry; + +import io.papermc.paper.adventure.PaperAdventure; +import io.papermc.paper.registry.data.PaperEnchantmentRegistryEntry; +import io.papermc.paper.registry.data.PaperGameEventRegistryEntry; +import io.papermc.paper.registry.entry.RegistryEntry; +import io.papermc.paper.registry.tag.TagKey; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import org.bukkit.GameEvent; +import org.bukkit.JukeboxSong; +import org.bukkit.Keyed; +import org.bukkit.MusicInstrument; +import org.bukkit.block.BlockType; +import org.bukkit.block.banner.PatternType; +import org.bukkit.craftbukkit.CraftGameEvent; +import org.bukkit.craftbukkit.CraftJukeboxSong; +import org.bukkit.craftbukkit.CraftMusicInstrument; +import org.bukkit.craftbukkit.block.CraftBlockType; +import org.bukkit.craftbukkit.block.banner.CraftPatternType; +import org.bukkit.craftbukkit.damage.CraftDamageType; +import org.bukkit.craftbukkit.enchantments.CraftEnchantment; +import org.bukkit.craftbukkit.entity.CraftCat; +import org.bukkit.craftbukkit.entity.CraftFrog; +import org.bukkit.craftbukkit.entity.CraftVillager; +import org.bukkit.craftbukkit.entity.CraftWolf; +import org.bukkit.craftbukkit.generator.structure.CraftStructure; +import org.bukkit.craftbukkit.generator.structure.CraftStructureType; +import org.bukkit.craftbukkit.inventory.CraftItemType; +import org.bukkit.craftbukkit.inventory.CraftMenuType; +import org.bukkit.craftbukkit.inventory.trim.CraftTrimMaterial; +import org.bukkit.craftbukkit.inventory.trim.CraftTrimPattern; +import org.bukkit.craftbukkit.legacy.FieldRename; +import org.bukkit.craftbukkit.map.CraftMapCursor; +import org.bukkit.craftbukkit.potion.CraftPotionEffectType; +import org.bukkit.craftbukkit.util.CraftNamespacedKey; +import org.bukkit.damage.DamageType; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Cat; +import org.bukkit.entity.Frog; +import org.bukkit.entity.Villager; +import org.bukkit.entity.Wolf; +import org.bukkit.entity.memory.MemoryKey; +import org.bukkit.generator.structure.Structure; +import org.bukkit.generator.structure.StructureType; +import org.bukkit.inventory.ItemType; +import org.bukkit.inventory.MenuType; +import org.bukkit.inventory.meta.trim.TrimMaterial; +import org.bukkit.inventory.meta.trim.TrimPattern; +import org.bukkit.map.MapCursor; +import org.bukkit.potion.PotionEffectType; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.checkerframework.framework.qual.DefaultQualifier; + +import static io.papermc.paper.registry.entry.RegistryEntry.apiOnly; +import static io.papermc.paper.registry.entry.RegistryEntry.entry; +import static io.papermc.paper.registry.entry.RegistryEntry.writable; + +@DefaultQualifier(NonNull.class) +public final class PaperRegistries { + + static final List> REGISTRY_ENTRIES; + private static final Map, RegistryEntry> BY_REGISTRY_KEY; + private static final Map, RegistryEntry> BY_RESOURCE_KEY; + static { + REGISTRY_ENTRIES = List.of( + // Paper start - Generated/RegistryDefinitions + // @GeneratedFrom 1.21.1 + // built-in + writable(Registries.GAME_EVENT, RegistryKey.GAME_EVENT, GameEvent.class, CraftGameEvent::new, PaperGameEventRegistryEntry.PaperBuilder::new), + entry(Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, StructureType.class, CraftStructureType::new), + entry(Registries.INSTRUMENT, RegistryKey.INSTRUMENT, MusicInstrument.class, CraftMusicInstrument::new), + entry(Registries.MOB_EFFECT, RegistryKey.MOB_EFFECT, PotionEffectType.class, CraftPotionEffectType::new), + entry(Registries.BLOCK, RegistryKey.BLOCK, BlockType.class, CraftBlockType::new), + entry(Registries.ITEM, RegistryKey.ITEM, ItemType.class, CraftItemType::new), + entry(Registries.CAT_VARIANT, RegistryKey.CAT_VARIANT, Cat.Type.class, CraftCat.CraftType::new), + entry(Registries.FROG_VARIANT, RegistryKey.FROG_VARIANT, Frog.Variant.class, CraftFrog.CraftVariant::new), + entry(Registries.VILLAGER_PROFESSION, RegistryKey.VILLAGER_PROFESSION, Villager.Profession.class, CraftVillager.CraftProfession::new), + entry(Registries.VILLAGER_TYPE, RegistryKey.VILLAGER_TYPE, Villager.Type.class, CraftVillager.CraftType::new), + entry(Registries.MAP_DECORATION_TYPE, RegistryKey.MAP_DECORATION_TYPE, MapCursor.Type.class, CraftMapCursor.CraftType::new), + entry(Registries.MENU, RegistryKey.MENU, MenuType.class, CraftMenuType::new), + + // data-driven + entry(Registries.STRUCTURE, RegistryKey.STRUCTURE, Structure.class, CraftStructure::new).delayed(), + entry(Registries.TRIM_MATERIAL, RegistryKey.TRIM_MATERIAL, TrimMaterial.class, CraftTrimMaterial::new).delayed(), + entry(Registries.TRIM_PATTERN, RegistryKey.TRIM_PATTERN, TrimPattern.class, CraftTrimPattern::new).delayed(), + entry(Registries.DAMAGE_TYPE, RegistryKey.DAMAGE_TYPE, DamageType.class, CraftDamageType::new).delayed(), + entry(Registries.WOLF_VARIANT, RegistryKey.WOLF_VARIANT, Wolf.Variant.class, CraftWolf.CraftVariant::new).delayed(), + writable(Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT, Enchantment.class, CraftEnchantment::new, PaperEnchantmentRegistryEntry.PaperBuilder::new).withSerializationUpdater(FieldRename.ENCHANTMENT_RENAME).delayed(), + entry(Registries.JUKEBOX_SONG, RegistryKey.JUKEBOX_SONG, JukeboxSong.class, CraftJukeboxSong::new).delayed(), + entry(Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN, PatternType.class, CraftPatternType::new).delayed(), + + // api-only + apiOnly(Registries.BIOME, RegistryKey.BIOME, () -> org.bukkit.Registry.BIOME), + apiOnly(Registries.PAINTING_VARIANT, RegistryKey.PAINTING_VARIANT, () -> org.bukkit.Registry.ART), + apiOnly(Registries.ATTRIBUTE, RegistryKey.ATTRIBUTE, () -> org.bukkit.Registry.ATTRIBUTE), + apiOnly(Registries.ENTITY_TYPE, RegistryKey.ENTITY_TYPE, () -> org.bukkit.Registry.ENTITY_TYPE), + apiOnly(Registries.PARTICLE_TYPE, RegistryKey.PARTICLE_TYPE, () -> org.bukkit.Registry.PARTICLE_TYPE), + apiOnly(Registries.POTION, RegistryKey.POTION, () -> org.bukkit.Registry.POTION), + apiOnly(Registries.SOUND_EVENT, RegistryKey.SOUND_EVENT, () -> org.bukkit.Registry.SOUNDS), + apiOnly(Registries.MEMORY_MODULE_TYPE, RegistryKey.MEMORY_MODULE_TYPE, () -> org.bukkit.Registry.MEMORY_MODULE_TYPE), + apiOnly(Registries.FLUID, RegistryKey.FLUID, () -> org.bukkit.Registry.FLUID) + // Paper end - Generated/RegistryDefinitions + ); + final Map, RegistryEntry> byRegistryKey = new IdentityHashMap<>(REGISTRY_ENTRIES.size()); + final Map, RegistryEntry> byResourceKey = new IdentityHashMap<>(REGISTRY_ENTRIES.size()); + for (final RegistryEntry entry : REGISTRY_ENTRIES) { + byRegistryKey.put(entry.apiKey(), entry); + byResourceKey.put(entry.mcKey(), entry); + } + BY_REGISTRY_KEY = Collections.unmodifiableMap(byRegistryKey); + BY_RESOURCE_KEY = Collections.unmodifiableMap(byResourceKey); + } + + @SuppressWarnings("unchecked") + public static @Nullable RegistryEntry getEntry(final ResourceKey> resourceKey) { + return (RegistryEntry) BY_RESOURCE_KEY.get(resourceKey); + } + + @SuppressWarnings("unchecked") + public static @Nullable RegistryEntry getEntry(final RegistryKey registryKey) { + return (RegistryEntry) BY_REGISTRY_KEY.get(registryKey); + } + + @SuppressWarnings("unchecked") + public static RegistryKey registryFromNms(final ResourceKey> registryResourceKey) { + return (RegistryKey) Objects.requireNonNull(BY_RESOURCE_KEY.get(registryResourceKey), registryResourceKey + " doesn't have an api RegistryKey").apiKey(); + } + + @SuppressWarnings("unchecked") + public static ResourceKey> registryToNms(final RegistryKey registryKey) { + return (ResourceKey>) Objects.requireNonNull(BY_REGISTRY_KEY.get(registryKey), registryKey + " doesn't have an mc registry ResourceKey").mcKey(); + } + + public static TypedKey fromNms(final ResourceKey resourceKey) { + return TypedKey.create(registryFromNms(resourceKey.registryKey()), CraftNamespacedKey.fromMinecraft(resourceKey.location())); + } + + @SuppressWarnings({"unchecked", "RedundantCast"}) + public static ResourceKey toNms(final TypedKey typedKey) { + return ResourceKey.create((ResourceKey>) PaperRegistries.registryToNms(typedKey.registryKey()), PaperAdventure.asVanilla(typedKey.key())); + } + + public static TagKey fromNms(final net.minecraft.tags.TagKey tagKey) { + return TagKey.create(registryFromNms(tagKey.registry()), CraftNamespacedKey.fromMinecraft(tagKey.location())); + } + + @SuppressWarnings({"unchecked", "RedundantCast"}) + public static net.minecraft.tags.TagKey toNms(final TagKey tagKey) { + return net.minecraft.tags.TagKey.create((ResourceKey>) registryToNms(tagKey.registryKey()), PaperAdventure.asVanilla(tagKey.key())); + } + + private PaperRegistries() { + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/CraftStatistic.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/CraftStatistic.java new file mode 100644 index 0000000000..4d83069e82 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/CraftStatistic.java @@ -0,0 +1,335 @@ +package org.bukkit.craftbukkit; + +import com.google.common.base.Preconditions; +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableBiMap; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.stats.ServerStatsCounter; +import net.minecraft.stats.Stats; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import org.bukkit.Material; +import org.bukkit.Statistic; +import org.bukkit.Statistic.Type; +import org.bukkit.craftbukkit.block.CraftBlockType; +import org.bukkit.craftbukkit.entity.CraftEntityType; +import org.bukkit.craftbukkit.inventory.CraftItemType; +import org.bukkit.entity.EntityType; + +public enum CraftStatistic { + // Paper start - Generated/CraftStatisticCustom + // @GeneratedFrom 1.21.1 + ANIMALS_BRED(Stats.ANIMALS_BRED), + AVIATE_ONE_CM(Stats.AVIATE_ONE_CM), + BELL_RING(Stats.BELL_RING), + BOAT_ONE_CM(Stats.BOAT_ONE_CM), + ARMOR_CLEANED(Stats.CLEAN_ARMOR), + BANNER_CLEANED(Stats.CLEAN_BANNER), + CLEAN_SHULKER_BOX(Stats.CLEAN_SHULKER_BOX), + CLIMB_ONE_CM(Stats.CLIMB_ONE_CM), + CROUCH_ONE_CM(Stats.CROUCH_ONE_CM), + DAMAGE_ABSORBED(Stats.DAMAGE_ABSORBED), + DAMAGE_BLOCKED_BY_SHIELD(Stats.DAMAGE_BLOCKED_BY_SHIELD), + DAMAGE_DEALT(Stats.DAMAGE_DEALT), + DAMAGE_DEALT_ABSORBED(Stats.DAMAGE_DEALT_ABSORBED), + DAMAGE_DEALT_RESISTED(Stats.DAMAGE_DEALT_RESISTED), + DAMAGE_RESISTED(Stats.DAMAGE_RESISTED), + DAMAGE_TAKEN(Stats.DAMAGE_TAKEN), + DEATHS(Stats.DEATHS), + DROP_COUNT(Stats.DROP), + CAKE_SLICES_EATEN(Stats.EAT_CAKE_SLICE), + ITEM_ENCHANTED(Stats.ENCHANT_ITEM), + FALL_ONE_CM(Stats.FALL_ONE_CM), + CAULDRON_FILLED(Stats.FILL_CAULDRON), + FISH_CAUGHT(Stats.FISH_CAUGHT), + FLY_ONE_CM(Stats.FLY_ONE_CM), + HORSE_ONE_CM(Stats.HORSE_ONE_CM), + DISPENSER_INSPECTED(Stats.INSPECT_DISPENSER), + DROPPER_INSPECTED(Stats.INSPECT_DROPPER), + HOPPER_INSPECTED(Stats.INSPECT_HOPPER), + INTERACT_WITH_ANVIL(Stats.INTERACT_WITH_ANVIL), + BEACON_INTERACTION(Stats.INTERACT_WITH_BEACON), + INTERACT_WITH_BLAST_FURNACE(Stats.INTERACT_WITH_BLAST_FURNACE), + BREWINGSTAND_INTERACTION(Stats.INTERACT_WITH_BREWINGSTAND), + INTERACT_WITH_CAMPFIRE(Stats.INTERACT_WITH_CAMPFIRE), + INTERACT_WITH_CARTOGRAPHY_TABLE(Stats.INTERACT_WITH_CARTOGRAPHY_TABLE), + CRAFTING_TABLE_INTERACTION(Stats.INTERACT_WITH_CRAFTING_TABLE), + FURNACE_INTERACTION(Stats.INTERACT_WITH_FURNACE), + INTERACT_WITH_GRINDSTONE(Stats.INTERACT_WITH_GRINDSTONE), + INTERACT_WITH_LECTERN(Stats.INTERACT_WITH_LECTERN), + INTERACT_WITH_LOOM(Stats.INTERACT_WITH_LOOM), + INTERACT_WITH_SMITHING_TABLE(Stats.INTERACT_WITH_SMITHING_TABLE), + INTERACT_WITH_SMOKER(Stats.INTERACT_WITH_SMOKER), + INTERACT_WITH_STONECUTTER(Stats.INTERACT_WITH_STONECUTTER), + JUMP(Stats.JUMP), + LEAVE_GAME(Stats.LEAVE_GAME), + MINECART_ONE_CM(Stats.MINECART_ONE_CM), + MOB_KILLS(Stats.MOB_KILLS), + OPEN_BARREL(Stats.OPEN_BARREL), + CHEST_OPENED(Stats.OPEN_CHEST), + ENDERCHEST_OPENED(Stats.OPEN_ENDERCHEST), + SHULKER_BOX_OPENED(Stats.OPEN_SHULKER_BOX), + PIG_ONE_CM(Stats.PIG_ONE_CM), + NOTEBLOCK_PLAYED(Stats.PLAY_NOTEBLOCK), + RECORD_PLAYED(Stats.PLAY_RECORD), + PLAY_ONE_MINUTE(Stats.PLAY_TIME), + PLAYER_KILLS(Stats.PLAYER_KILLS), + FLOWER_POTTED(Stats.POT_FLOWER), + RAID_TRIGGER(Stats.RAID_TRIGGER), + RAID_WIN(Stats.RAID_WIN), + SLEEP_IN_BED(Stats.SLEEP_IN_BED), + SNEAK_TIME(Stats.CROUCH_TIME), + SPRINT_ONE_CM(Stats.SPRINT_ONE_CM), + STRIDER_ONE_CM(Stats.STRIDER_ONE_CM), + SWIM_ONE_CM(Stats.SWIM_ONE_CM), + TALKED_TO_VILLAGER(Stats.TALKED_TO_VILLAGER), + TARGET_HIT(Stats.TARGET_HIT), + TIME_SINCE_DEATH(Stats.TIME_SINCE_DEATH), + TIME_SINCE_REST(Stats.TIME_SINCE_REST), + TOTAL_WORLD_TIME(Stats.TOTAL_WORLD_TIME), + TRADED_WITH_VILLAGER(Stats.TRADED_WITH_VILLAGER), + TRAPPED_CHEST_TRIGGERED(Stats.TRIGGER_TRAPPED_CHEST), + NOTEBLOCK_TUNED(Stats.TUNE_NOTEBLOCK), + CAULDRON_USED(Stats.USE_CAULDRON), + WALK_ON_WATER_ONE_CM(Stats.WALK_ON_WATER_ONE_CM), + WALK_ONE_CM(Stats.WALK_ONE_CM), + WALK_UNDER_WATER_ONE_CM(Stats.WALK_UNDER_WATER_ONE_CM), + // Paper end - Generated/CraftStatisticCustom + // Paper start - Generated/CraftStatisticType + // @GeneratedFrom 1.21.1 + BREAK_ITEM(ResourceLocation.withDefaultNamespace("broken")), + CRAFT_ITEM(ResourceLocation.withDefaultNamespace("crafted")), + DROP(ResourceLocation.withDefaultNamespace("dropped")), + KILL_ENTITY(ResourceLocation.withDefaultNamespace("killed")), + ENTITY_KILLED_BY(ResourceLocation.withDefaultNamespace("killed_by")), + MINE_BLOCK(ResourceLocation.withDefaultNamespace("mined")), + PICKUP(ResourceLocation.withDefaultNamespace("picked_up")), + USE_ITEM(ResourceLocation.withDefaultNamespace("used")); + // Paper end - Generated/CraftStatisticType + private final ResourceLocation minecraftKey; + private final org.bukkit.Statistic bukkit; + private static final BiMap statistics; + + static { + ImmutableBiMap.Builder statisticBuilder = ImmutableBiMap.builder(); + for (CraftStatistic statistic : CraftStatistic.values()) { + statisticBuilder.put(statistic.minecraftKey, statistic.bukkit); + } + + statistics = statisticBuilder.build(); + } + + private CraftStatistic(ResourceLocation minecraftKey) { + this.minecraftKey = minecraftKey; + + this.bukkit = org.bukkit.Statistic.valueOf(this.name()); + Preconditions.checkState(this.bukkit != null, "Bukkit statistic %s does not exist", this.name()); + } + + public static org.bukkit.Statistic getBukkitStatistic(net.minecraft.stats.Stat statistic) { + Preconditions.checkArgument(statistic != null, "NMS Statistic cannot be null"); + Registry statRegistry = statistic.getType().getRegistry(); + ResourceLocation nmsKey = BuiltInRegistries.STAT_TYPE.getKey(statistic.getType()); + + if (statRegistry == BuiltInRegistries.CUSTOM_STAT) { + nmsKey = (ResourceLocation) statistic.getValue(); + } + + return statistics.get(nmsKey); + } + + public static net.minecraft.stats.Stat getNMSStatistic(org.bukkit.Statistic bukkit) { + Preconditions.checkArgument(bukkit.getType() == Statistic.Type.UNTYPED, "This method only accepts untyped statistics"); + + net.minecraft.stats.Stat nms = Stats.CUSTOM.get(statistics.inverse().get(bukkit)); + Preconditions.checkArgument(nms != null, "NMS Statistic %s does not exist", bukkit); + + return nms; + } + + public static net.minecraft.stats.Stat getMaterialStatistic(org.bukkit.Statistic stat, Material material) { + try { + if (stat == Statistic.MINE_BLOCK) { + return Stats.BLOCK_MINED.get(CraftBlockType.bukkitToMinecraft(material)); + } + if (stat == Statistic.CRAFT_ITEM) { + return Stats.ITEM_CRAFTED.get(CraftItemType.bukkitToMinecraft(material)); + } + if (stat == Statistic.USE_ITEM) { + return Stats.ITEM_USED.get(CraftItemType.bukkitToMinecraft(material)); + } + if (stat == Statistic.BREAK_ITEM) { + return Stats.ITEM_BROKEN.get(CraftItemType.bukkitToMinecraft(material)); + } + if (stat == Statistic.PICKUP) { + return Stats.ITEM_PICKED_UP.get(CraftItemType.bukkitToMinecraft(material)); + } + if (stat == Statistic.DROP) { + return Stats.ITEM_DROPPED.get(CraftItemType.bukkitToMinecraft(material)); + } + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } + return null; + } + + public static net.minecraft.stats.Stat getEntityStatistic(org.bukkit.Statistic stat, EntityType entity) { + Preconditions.checkArgument(entity != null, "EntityType cannot be null"); + if (entity.getName() != null) { + net.minecraft.world.entity.EntityType nmsEntity = CraftEntityType.bukkitToMinecraft(entity); + + if (stat == org.bukkit.Statistic.KILL_ENTITY) { + return net.minecraft.stats.Stats.ENTITY_KILLED.get(nmsEntity); + } + if (stat == org.bukkit.Statistic.ENTITY_KILLED_BY) { + return net.minecraft.stats.Stats.ENTITY_KILLED_BY.get(nmsEntity); + } + } + return null; + } + + public static EntityType getEntityTypeFromStatistic(net.minecraft.stats.Stat> statistic) { + Preconditions.checkArgument(statistic != null, "NMS Statistic cannot be null"); + return CraftEntityType.minecraftToBukkit(statistic.getValue()); + } + + public static Material getMaterialFromStatistic(net.minecraft.stats.Stat statistic) { + if (statistic.getValue() instanceof Item statisticItemValue) { + return CraftItemType.minecraftToBukkit(statisticItemValue); + } + if (statistic.getValue() instanceof Block statisticBlockValue) { + return CraftBlockType.minecraftToBukkit(statisticBlockValue); + } + return null; + } + + public static void incrementStatistic(ServerStatsCounter manager, Statistic statistic, ServerPlayer player) { + incrementStatistic(manager, statistic, 1, player); + } + + public static void decrementStatistic(ServerStatsCounter manager, Statistic statistic, ServerPlayer player) { + decrementStatistic(manager, statistic, 1, player); + } + + public static int getStatistic(ServerStatsCounter manager, Statistic statistic) { + Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); + Preconditions.checkArgument(statistic.getType() == Type.UNTYPED, "Must supply additional parameter for this statistic"); + return manager.getValue(CraftStatistic.getNMSStatistic(statistic)); + } + + public static void incrementStatistic(ServerStatsCounter manager, Statistic statistic, int amount, ServerPlayer player) { + Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); + setStatistic(manager, statistic, getStatistic(manager, statistic) + amount, player); + } + + public static void decrementStatistic(ServerStatsCounter manager, Statistic statistic, int amount, ServerPlayer player) { + Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); + setStatistic(manager, statistic, getStatistic(manager, statistic) - amount, player); + } + + public static void setStatistic(ServerStatsCounter manager, Statistic statistic, int newValue, ServerPlayer player) { + Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); + Preconditions.checkArgument(statistic.getType() == Type.UNTYPED, "Must supply additional parameter for this statistic"); + Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0"); + net.minecraft.stats.Stat nmsStatistic = CraftStatistic.getNMSStatistic(statistic); + manager.setValue(null, nmsStatistic, newValue); + + // Update scoreboards + if (player != null) { + player.level().getCraftServer().getScoreboardManager().forAllObjectives(nmsStatistic, player, score -> { + score.set(newValue); + }); + } + } + + public static void incrementStatistic(ServerStatsCounter manager, Statistic statistic, Material material, ServerPlayer player) { + incrementStatistic(manager, statistic, material, 1, player); + } + + public static void decrementStatistic(ServerStatsCounter manager, Statistic statistic, Material material, ServerPlayer player) { + decrementStatistic(manager, statistic, material, 1, player); + } + + public static int getStatistic(ServerStatsCounter manager, Statistic statistic, Material material) { + Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); + Preconditions.checkArgument(material != null, "Material cannot be null"); + Preconditions.checkArgument(statistic.getType() == Type.BLOCK || statistic.getType() == Type.ITEM, "This statistic does not take a Material parameter"); + net.minecraft.stats.Stat nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); + Preconditions.checkArgument(nmsStatistic != null, "The supplied Material %s does not have a corresponding statistic", material); + return manager.getValue(nmsStatistic); + } + + public static void incrementStatistic(ServerStatsCounter manager, Statistic statistic, Material material, int amount, ServerPlayer player) { + Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); + setStatistic(manager, statistic, material, getStatistic(manager, statistic, material) + amount, player); + } + + public static void decrementStatistic(ServerStatsCounter manager, Statistic statistic, Material material, int amount, ServerPlayer player) { + Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); + setStatistic(manager, statistic, material, getStatistic(manager, statistic, material) - amount, player); + } + + public static void setStatistic(ServerStatsCounter manager, Statistic statistic, Material material, int newValue, ServerPlayer player) { + Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); + Preconditions.checkArgument(material != null, "Material cannot be null"); + Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0"); + Preconditions.checkArgument(statistic.getType() == Type.BLOCK || statistic.getType() == Type.ITEM, "This statistic does not take a Material parameter"); + net.minecraft.stats.Stat nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); + Preconditions.checkArgument(nmsStatistic != null, "The supplied Material %s does not have a corresponding statistic", material); + manager.setValue(null, nmsStatistic, newValue); + + // Update scoreboards + if (player != null) { + player.level().getCraftServer().getScoreboardManager().forAllObjectives(nmsStatistic, player, score -> { + score.set(newValue); + }); + } + } + + public static void incrementStatistic(ServerStatsCounter manager, Statistic statistic, EntityType entityType, ServerPlayer player) { + incrementStatistic(manager, statistic, entityType, 1, player); + } + + public static void decrementStatistic(ServerStatsCounter manager, Statistic statistic, EntityType entityType, ServerPlayer player) { + decrementStatistic(manager, statistic, entityType, 1, player); + } + + public static int getStatistic(ServerStatsCounter manager, Statistic statistic, EntityType entityType) { + Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); + Preconditions.checkArgument(entityType != null, "EntityType cannot be null"); + Preconditions.checkArgument(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter"); + net.minecraft.stats.Stat nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); + Preconditions.checkArgument(nmsStatistic != null, "The supplied EntityType %s does not have a corresponding statistic", entityType); + return manager.getValue(nmsStatistic); + } + + public static void incrementStatistic(ServerStatsCounter manager, Statistic statistic, EntityType entityType, int amount, ServerPlayer player) { + Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); + setStatistic(manager, statistic, entityType, getStatistic(manager, statistic, entityType) + amount, player); + } + + public static void decrementStatistic(ServerStatsCounter manager, Statistic statistic, EntityType entityType, int amount, ServerPlayer player) { + Preconditions.checkArgument(amount > 0, "Amount must be greater than 0"); + setStatistic(manager, statistic, entityType, getStatistic(manager, statistic, entityType) - amount, player); + } + + public static void setStatistic(ServerStatsCounter manager, Statistic statistic, EntityType entityType, int newValue, ServerPlayer player) { + Preconditions.checkArgument(statistic != null, "Statistic cannot be null"); + Preconditions.checkArgument(entityType != null, "EntityType cannot be null"); + Preconditions.checkArgument(newValue >= 0, "Value must be greater than or equal to 0"); + Preconditions.checkArgument(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter"); + net.minecraft.stats.Stat nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); + Preconditions.checkArgument(nmsStatistic != null, "The supplied EntityType %s does not have a corresponding statistic", entityType); + manager.setValue(null, nmsStatistic, newValue); + + // Update scoreboards + if (player != null) { + player.level().getCraftServer().getScoreboardManager().forAllObjectives(nmsStatistic, player, score -> { + score.set(newValue); + }); + } + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/CraftBlockStates.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/CraftBlockStates.java new file mode 100644 index 0000000000..1abdabd48e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -0,0 +1,334 @@ +package org.bukkit.craftbukkit.block; + +import com.google.common.base.Preconditions; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiFunction; +import javax.annotation.Nullable; +import net.minecraft.core.BlockPos; +import net.minecraft.core.RegistryAccess; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.entity.BannerBlockEntity; +import net.minecraft.world.level.block.entity.BarrelBlockEntity; +import net.minecraft.world.level.block.entity.BeaconBlockEntity; +import net.minecraft.world.level.block.entity.BedBlockEntity; +import net.minecraft.world.level.block.entity.BeehiveBlockEntity; +import net.minecraft.world.level.block.entity.BellBlockEntity; +import net.minecraft.world.level.block.entity.BlastFurnaceBlockEntity; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; // Paper +import net.minecraft.world.level.block.entity.BrewingStandBlockEntity; +import net.minecraft.world.level.block.entity.BrushableBlockEntity; +import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity; +import net.minecraft.world.level.block.entity.CampfireBlockEntity; +import net.minecraft.world.level.block.entity.ChestBlockEntity; +import net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity; +import net.minecraft.world.level.block.entity.CommandBlockEntity; +import net.minecraft.world.level.block.entity.ComparatorBlockEntity; +import net.minecraft.world.level.block.entity.ConduitBlockEntity; +import net.minecraft.world.level.block.entity.CrafterBlockEntity; +import net.minecraft.world.level.block.entity.DaylightDetectorBlockEntity; +import net.minecraft.world.level.block.entity.DecoratedPotBlockEntity; +import net.minecraft.world.level.block.entity.DispenserBlockEntity; +import net.minecraft.world.level.block.entity.DropperBlockEntity; +import net.minecraft.world.level.block.entity.EnchantingTableBlockEntity; +import net.minecraft.world.level.block.entity.EnderChestBlockEntity; +import net.minecraft.world.level.block.entity.FurnaceBlockEntity; +import net.minecraft.world.level.block.entity.HangingSignBlockEntity; +import net.minecraft.world.level.block.entity.HopperBlockEntity; +import net.minecraft.world.level.block.entity.JigsawBlockEntity; +import net.minecraft.world.level.block.entity.JukeboxBlockEntity; +import net.minecraft.world.level.block.entity.LecternBlockEntity; +import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity; +import net.minecraft.world.level.block.entity.SculkSensorBlockEntity; +import net.minecraft.world.level.block.entity.SculkShriekerBlockEntity; +import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity; +import net.minecraft.world.level.block.entity.SignBlockEntity; +import net.minecraft.world.level.block.entity.SkullBlockEntity; +import net.minecraft.world.level.block.entity.SmokerBlockEntity; +import net.minecraft.world.level.block.entity.SpawnerBlockEntity; +import net.minecraft.world.level.block.entity.StructureBlockEntity; +import net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity; +import net.minecraft.world.level.block.entity.TheEndPortalBlockEntity; +import net.minecraft.world.level.block.entity.TrappedChestBlockEntity; +import net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity; +import net.minecraft.world.level.block.entity.vault.VaultBlockEntity; +import net.minecraft.world.level.block.piston.PistonMovingBlockEntity; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.BlockState; +import org.bukkit.craftbukkit.CraftWorld; + +public final class CraftBlockStates { + + private abstract static class BlockStateFactory { + + public final Class blockStateType; + + public BlockStateFactory(Class blockStateType) { + this.blockStateType = blockStateType; + } + + // The given world can be null for unplaced BlockStates. + // If the world is not null and the given block data is a tile entity, the given tile entity is expected to not be null. + // Otherwise, the given tile entity may or may not be null. + // If the given tile entity is not null, its position and block data are expected to match the given block position and block data. + // In some situations, such as during chunk generation, the tile entity's world may be null, even if the given world is not null. + // If the tile entity's world is not null, it is expected to match the given world. + public abstract B createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity); + } + + private static class BlockEntityStateFactory> extends BlockStateFactory { + + private final BiFunction blockStateConstructor; + private final BlockEntityType tileEntityConstructor; // Paper + + protected BlockEntityStateFactory(Class blockStateType, BiFunction blockStateConstructor, BlockEntityType tileEntityConstructor) { // Paper + super(blockStateType); + this.blockStateConstructor = blockStateConstructor; + this.tileEntityConstructor = tileEntityConstructor; + } + + @Override + public final B createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { + if (world != null) { + Preconditions.checkState(tileEntity != null, "Tile is null, asynchronous access? %s", CraftBlock.at(((CraftWorld) world).getHandle(), blockPosition)); + } else if (tileEntity == null) { + tileEntity = this.createTileEntity(blockPosition, blockData); + } + return this.createBlockState(world, (T) tileEntity); + } + + private T createTileEntity(BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData) { + return this.tileEntityConstructor.create(blockPosition, blockData); // Paper + } + + private B createBlockState(World world, T tileEntity) { + return this.blockStateConstructor.apply(world, tileEntity); + } + } + + private static final Map> FACTORIES = new HashMap<>(); + private static final BlockStateFactory DEFAULT_FACTORY = new BlockStateFactory(CraftBlockState.class) { + @Override + public CraftBlockState createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { + // Paper - revert upstream's revert of the block state changes. Block entities that have already had the block type set to AIR are still valid, upstream decided to ignore them + Preconditions.checkState(tileEntity == null, "Unexpected BlockState for %s", CraftBlockType.minecraftToBukkit(blockData.getBlock())); + return new CraftBlockState(world, blockPosition, blockData); + } + }; + // Paper start + private static final Map, BlockStateFactory> FACTORIES_BY_BLOCK_ENTITY_TYPE = new HashMap<>(); + private static void register(BlockEntityType type, BlockStateFactory factory) { + FACTORIES_BY_BLOCK_ENTITY_TYPE.put(type, factory); + } + // Paper end + + static { + // Paper start - Generated/CraftBlockEntityStates + // @GeneratedFrom 1.21.1 + register(BlockEntityType.BANNER, CraftBanner.class, CraftBanner::new); + register(BlockEntityType.BARREL, CraftBarrel.class, CraftBarrel::new); + register(BlockEntityType.BEACON, CraftBeacon.class, CraftBeacon::new); + register(BlockEntityType.BED, CraftBed.class, CraftBed::new); + register(BlockEntityType.BEEHIVE, CraftBeehive.class, CraftBeehive::new); + register(BlockEntityType.BELL, CraftBell.class, CraftBell::new); + register(BlockEntityType.BLAST_FURNACE, CraftBlastFurnace.class, CraftBlastFurnace::new); + register(BlockEntityType.BREWING_STAND, CraftBrewingStand.class, CraftBrewingStand::new); + register(BlockEntityType.BRUSHABLE_BLOCK, CraftBrushableBlock.class, CraftBrushableBlock::new); + register(BlockEntityType.CALIBRATED_SCULK_SENSOR, CraftCalibratedSculkSensor.class, CraftCalibratedSculkSensor::new); + register(BlockEntityType.CAMPFIRE, CraftCampfire.class, CraftCampfire::new); + register(BlockEntityType.CHEST, CraftChest.class, CraftChest::new); + register(BlockEntityType.CHISELED_BOOKSHELF, CraftChiseledBookshelf.class, CraftChiseledBookshelf::new); + register(BlockEntityType.COMMAND_BLOCK, CraftCommandBlock.class, CraftCommandBlock::new); + register(BlockEntityType.COMPARATOR, CraftComparator.class, CraftComparator::new); + register(BlockEntityType.CONDUIT, CraftConduit.class, CraftConduit::new); + register(BlockEntityType.CRAFTER, CraftCrafter.class, CraftCrafter::new); + register(BlockEntityType.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new); + register(BlockEntityType.DECORATED_POT, CraftDecoratedPot.class, CraftDecoratedPot::new); + register(BlockEntityType.DISPENSER, CraftDispenser.class, CraftDispenser::new); + register(BlockEntityType.DROPPER, CraftDropper.class, CraftDropper::new); + register(BlockEntityType.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new); + register(BlockEntityType.END_GATEWAY, CraftEndGateway.class, CraftEndGateway::new); + register(BlockEntityType.END_PORTAL, CraftEndPortal.class, CraftEndPortal::new); + register(BlockEntityType.ENDER_CHEST, CraftEnderChest.class, CraftEnderChest::new); + register(BlockEntityType.FURNACE, CraftFurnaceFurnace.class, CraftFurnaceFurnace::new); + register(BlockEntityType.HANGING_SIGN, CraftHangingSign.class, CraftHangingSign::new); + register(BlockEntityType.HOPPER, CraftHopper.class, CraftHopper::new); + register(BlockEntityType.JIGSAW, CraftJigsaw.class, CraftJigsaw::new); + register(BlockEntityType.JUKEBOX, CraftJukebox.class, CraftJukebox::new); + register(BlockEntityType.LECTERN, CraftLectern.class, CraftLectern::new); + register(BlockEntityType.MOB_SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new); + register(BlockEntityType.PISTON, CraftMovingPiston.class, CraftMovingPiston::new); + register(BlockEntityType.SCULK_CATALYST, CraftSculkCatalyst.class, CraftSculkCatalyst::new); + register(BlockEntityType.SCULK_SENSOR, CraftSculkSensor.class, CraftSculkSensor::new); + register(BlockEntityType.SCULK_SHRIEKER, CraftSculkShrieker.class, CraftSculkShrieker::new); + register(BlockEntityType.SHULKER_BOX, CraftShulkerBox.class, CraftShulkerBox::new); + register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new); + register(BlockEntityType.SKULL, CraftSkull.class, CraftSkull::new); + register(BlockEntityType.SMOKER, CraftSmoker.class, CraftSmoker::new); + register(BlockEntityType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new); + register(BlockEntityType.TRAPPED_CHEST, CraftChest.class, CraftChest::new); + register(BlockEntityType.TRIAL_SPAWNER, CraftTrialSpawner.class, CraftTrialSpawner::new); + register(BlockEntityType.VAULT, CraftVault.class, CraftVault::new); + // Paper end - Generated/CraftBlockEntityStates + } + + private static void register(Material blockType, BlockStateFactory factory) { + CraftBlockStates.FACTORIES.put(blockType, factory); + } + + private static > void register( + net.minecraft.world.level.block.entity.BlockEntityType blockEntityType, // Paper + Class blockStateType, + BiFunction blockStateConstructor // Paper + ) { + // Paper start + BlockStateFactory factory = new BlockEntityStateFactory<>(blockStateType, blockStateConstructor, blockEntityType); // Paper + for (net.minecraft.world.level.block.Block block : blockEntityType.validBlocks) { + CraftBlockStates.register(CraftBlockType.minecraftToBukkit(block), factory); + } + CraftBlockStates.register(blockEntityType, factory); + // Paper end + } + + private static BlockStateFactory getFactory(Material material) { + return CraftBlockStates.FACTORIES.getOrDefault(material, CraftBlockStates.DEFAULT_FACTORY); + } + + // Paper start + private static BlockStateFactory getFactory(Material material, BlockEntityType type) { + if (type != null) { + return CraftBlockStates.FACTORIES_BY_BLOCK_ENTITY_TYPE.getOrDefault(type, getFactory(material)); + } else { + return getFactory(material); + } + } + // Paper end + + public static Class getBlockStateType(Material material) { + Preconditions.checkNotNull(material, "material is null"); + return CraftBlockStates.getFactory(material).blockStateType; + } + + public static BlockEntity createNewTileEntity(Material material) { + BlockStateFactory factory = CraftBlockStates.getFactory(material); + + if (factory instanceof BlockEntityStateFactory) { + return ((BlockEntityStateFactory) factory).createTileEntity(BlockPos.ZERO, CraftBlockType.bukkitToMinecraft(material).defaultBlockState()); + } + + return null; + } + + // Paper start + public static Class getBlockStateType(BlockEntityType blockEntityType) { + Preconditions.checkNotNull(blockEntityType, "blockEntityType is null"); + return CraftBlockStates.getFactory(null, blockEntityType).blockStateType; + } + // Paper end + + public static BlockState getBlockState(Block block) { + // Paper start + return CraftBlockStates.getBlockState(block, true); + } + public static BlockState getBlockState(Block block, boolean useSnapshot) { + // Paper end + Preconditions.checkNotNull(block, "block is null"); + CraftBlock craftBlock = (CraftBlock) block; + CraftWorld world = (CraftWorld) block.getWorld(); + BlockPos blockPosition = craftBlock.getPosition(); + net.minecraft.world.level.block.state.BlockState blockData = craftBlock.getNMS(); + BlockEntity tileEntity = craftBlock.getHandle().getBlockEntity(blockPosition); + // Paper start - block state snapshots + boolean prev = CraftBlockEntityState.DISABLE_SNAPSHOT; + CraftBlockEntityState.DISABLE_SNAPSHOT = !useSnapshot; + try { + // Paper end + CraftBlockState blockState = CraftBlockStates.getBlockState(world, blockPosition, blockData, tileEntity); + blockState.setWorldHandle(craftBlock.getHandle()); // Inject the block's generator access + return blockState; + // Paper start + } finally { + CraftBlockEntityState.DISABLE_SNAPSHOT = prev; + } + // Paper end + } + + @Deprecated + public static BlockState getBlockState(BlockPos blockPosition, Material material, @Nullable CompoundTag blockEntityTag) { + return CraftBlockStates.getBlockState(MinecraftServer.getDefaultRegistryAccess(), blockPosition, material, blockEntityTag); + } + + public static BlockState getBlockState(LevelReader world, BlockPos blockPosition, Material material, @Nullable CompoundTag blockEntityTag) { + return CraftBlockStates.getBlockState(world.registryAccess(), blockPosition, material, blockEntityTag); + } + + public static BlockState getBlockState(RegistryAccess registry, BlockPos blockPosition, Material material, @Nullable CompoundTag blockEntityTag) { + Preconditions.checkNotNull(material, "material is null"); + net.minecraft.world.level.block.state.BlockState blockData = CraftBlockType.bukkitToMinecraft(material).defaultBlockState(); + return CraftBlockStates.getBlockState(registry, blockPosition, blockData, blockEntityTag); + } + + @Deprecated + public static BlockState getBlockState(net.minecraft.world.level.block.state.BlockState blockData, @Nullable CompoundTag blockEntityTag) { + return CraftBlockStates.getBlockState(MinecraftServer.getDefaultRegistryAccess(), BlockPos.ZERO, blockData, blockEntityTag); + } + + public static BlockState getBlockState(LevelReader world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, @Nullable CompoundTag blockEntityTag) { + return CraftBlockStates.getBlockState(world.registryAccess(), blockPosition, blockData, blockEntityTag); + } + + public static BlockState getBlockState(RegistryAccess registry, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, @Nullable CompoundTag blockEntityTag) { + Preconditions.checkNotNull(blockPosition, "blockPosition is null"); + Preconditions.checkNotNull(blockData, "blockData is null"); + BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag, registry); + return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity); + } + + // See BlockStateFactory#createBlockState(World, BlockPosition, IBlockData, TileEntity) + public static CraftBlockState getBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { + Material material = CraftBlockType.minecraftToBukkit(blockData.getBlock()); + BlockStateFactory factory; + // For some types of TileEntity blocks (eg. moving pistons), Minecraft may in some situations (eg. when using Block#setType or the + // setBlock command) not create a corresponding TileEntity in the world. We return a normal BlockState in this case. + if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) { + factory = CraftBlockStates.DEFAULT_FACTORY; + } else { + factory = CraftBlockStates.getFactory(material, tileEntity != null ? tileEntity.getType() : null); // Paper + } + return factory.createBlockState(world, blockPosition, blockData, tileEntity); + } + + public static boolean isTileEntityOptional(Material material) { + return material == Material.MOVING_PISTON; + } + + // This ignores tile entity data. + public static CraftBlockState getBlockState(LevelAccessor world, BlockPos pos) { + return new CraftBlockState(CraftBlock.at(world, pos)); + } + + // This ignores tile entity data. + public static CraftBlockState getBlockState(LevelAccessor world, BlockPos pos, int flag) { + return new CraftBlockState(CraftBlock.at(world, pos), flag); + } + + // Paper start + @Nullable + public static BlockEntityType getBlockEntityType(final Material material) { + final BlockStateFactory factory = org.bukkit.craftbukkit.block.CraftBlockStates.FACTORIES.get(material); + return factory instanceof final BlockEntityStateFactory blockEntityStateFactory ? blockEntityStateFactory.tileEntityConstructor : null; + } + // Paper end + + private CraftBlockStates() { + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/data/CraftBlockData.java new file mode 100644 index 0000000000..e3f627693d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -0,0 +1,786 @@ +package org.bukkit.craftbukkit.block.data; + +import com.google.common.base.Function; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import com.mojang.brigadier.StringReader; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.commands.arguments.blocks.BlockStateParser; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.level.EmptyBlockGetter; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Rotation; +import net.minecraft.world.level.block.state.StateHolder; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.Property; +import org.bukkit.Color; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.SoundGroup; +import org.bukkit.block.BlockFace; +import org.bukkit.block.BlockState; +import org.bukkit.block.BlockSupport; +import org.bukkit.block.BlockType; +import org.bukkit.block.PistonMoveReaction; +import org.bukkit.block.data.BlockData; +import org.bukkit.block.structure.Mirror; +import org.bukkit.block.structure.StructureRotation; +import org.bukkit.craftbukkit.CraftSoundGroup; +import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlockStates; +import org.bukkit.craftbukkit.block.CraftBlockSupport; +import org.bukkit.craftbukkit.block.CraftBlockType; +import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftItemType; +import org.bukkit.craftbukkit.util.CraftLocation; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +public class CraftBlockData implements BlockData { + + private net.minecraft.world.level.block.state.BlockState state; + private Map, Comparable> parsedStates; + + protected CraftBlockData() { + throw new AssertionError("Template Constructor"); + } + + protected CraftBlockData(net.minecraft.world.level.block.state.BlockState state) { + this.state = state; + } + + @Override + public Material getMaterial() { + return this.state.getBukkitMaterial(); // Paper - optimise getType calls + } + + public net.minecraft.world.level.block.state.BlockState getState() { + return this.state; + } + + /** + * Get a given BlockStateEnum's value as its Bukkit counterpart. + * + * @param nms the NMS state to convert + * @param bukkit the Bukkit class + * @param the type + * @return the matching Bukkit type + */ + protected > B get(EnumProperty nms, Class bukkit) { + return CraftBlockData.toBukkit(this.state.getValue(nms), bukkit); + } + + /** + * Convert all values from the given BlockStateEnum to their appropriate + * Bukkit counterpart. + * + * @param nms the NMS state to get values from + * @param bukkit the bukkit class to convert the values to + * @param the bukkit class type + * @return an immutable Set of values in their appropriate Bukkit type + */ + @SuppressWarnings("unchecked") + protected > Set getValues(EnumProperty nms, Class bukkit) { + ImmutableSet.Builder values = ImmutableSet.builder(); + + for (Enum e : nms.getPossibleValues()) { + values.add(CraftBlockData.toBukkit(e, bukkit)); + } + + return values.build(); + } + + /** + * Set a given {@link EnumProperty} with the matching enum from Bukkit. + * + * @param nms the NMS BlockStateEnum to set + * @param bukkit the matching Bukkit Enum + * @param the Bukkit type + * @param the NMS type + */ + protected , N extends Enum & StringRepresentable> void set(EnumProperty nms, Enum bukkit) { + this.parsedStates = null; + this.state = this.state.setValue(nms, CraftBlockData.toNMS(bukkit, nms.getValueClass())); + } + + @Override + public BlockData merge(BlockData data) { + CraftBlockData craft = (CraftBlockData) data; + Preconditions.checkArgument(craft.parsedStates != null, "Data not created via string parsing"); + Preconditions.checkArgument(this.state.getBlock() == craft.state.getBlock(), "States have different types (got %s, expected %s)", data, this); + + CraftBlockData clone = (CraftBlockData) this.clone(); + clone.parsedStates = null; + + for (Property parsed : craft.parsedStates.keySet()) { + clone.state = clone.state.setValue(parsed, craft.state.getValue(parsed)); + } + + return clone; + } + + @Override + public boolean matches(BlockData data) { + if (data == null) { + return false; + } + if (!(data instanceof CraftBlockData)) { + return false; + } + + CraftBlockData craft = (CraftBlockData) data; + if (this.state.getBlock() != craft.state.getBlock()) { + return false; + } + + // Fastpath an exact match + boolean exactMatch = this.equals(data); + + // If that failed, do a merge and check + if (!exactMatch && craft.parsedStates != null) { + return this.merge(data).equals(this); + } + + return exactMatch; + } + + private static final Map>, Enum[]> ENUM_VALUES = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - cache block data strings; make thread safe + + /** + * Convert an NMS Enum (usually a BlockStateEnum) to its appropriate Bukkit + * enum from the given class. + * + * @throws IllegalStateException if the Enum could not be converted + */ + @SuppressWarnings("unchecked") + private static > B toBukkit(Enum nms, Class bukkit) { + if (nms instanceof Direction) { + return (B) CraftBlock.notchToBlockFace((Direction) nms); + } + return (B) CraftBlockData.ENUM_VALUES.computeIfAbsent(bukkit, Class::getEnumConstants)[nms.ordinal()]; + } + + /** + * Convert a given Bukkit enum to its matching NMS enum type. + * + * @param bukkit the Bukkit enum to convert + * @param nms the NMS class + * @return the matching NMS type + * @throws IllegalStateException if the Enum could not be converted + */ + @SuppressWarnings("unchecked") + public static & StringRepresentable> N toNMS(Enum bukkit, Class nms) { + if (bukkit instanceof BlockFace) { + return (N) CraftBlock.blockFaceToNotch((BlockFace) bukkit); + } + return (N) CraftBlockData.ENUM_VALUES.computeIfAbsent(nms, Class::getEnumConstants)[bukkit.ordinal()]; + } + + /** + * Get the current value of a given state. + * + * @param ibs the state to check + * @param the type + * @return the current value of the given state + */ + protected > T get(Property ibs) { + // Straight integer or boolean getter + return this.state.getValue(ibs); + } + + /** + * Set the specified state's value. + * + * @param ibs the state to set + * @param v the new value + * @param the state's type + * @param the value's type. Must match the state's type. + */ + public , V extends T> void set(Property ibs, V v) { + // Straight integer or boolean setter + this.parsedStates = null; + this.state = this.state.setValue(ibs, v); + } + + @Override + public String getAsString() { + return this.toString(this.state.getValues()); + } + + @Override + public String getAsString(boolean hideUnspecified) { + return (hideUnspecified && this.parsedStates != null) ? this.toString(this.parsedStates) : this.getAsString(); + } + + @Override + public BlockData clone() { + try { + return (BlockData) super.clone(); + } catch (CloneNotSupportedException ex) { + throw new AssertionError("Clone not supported", ex); + } + } + + @Override + public String toString() { + return "CraftBlockData{" + this.getAsString() + "}"; + } + + // Mimicked from BlockDataAbstract#toString() + public String toString(Map, Comparable> states) { + StringBuilder stateString = new StringBuilder(BuiltInRegistries.BLOCK.getKey(this.state.getBlock()).toString()); + + if (!states.isEmpty()) { + stateString.append('['); + stateString.append(states.entrySet().stream().map(StateHolder.PROPERTY_ENTRY_TO_STRING_FUNCTION).collect(Collectors.joining(","))); + stateString.append(']'); + } + + return stateString.toString(); + } + + public Map toStates() { + Map compound = new HashMap<>(); + + for (Map.Entry, Comparable> entry : this.state.getValues().entrySet()) { + Property iblockstate = (Property) entry.getKey(); + + compound.put(iblockstate.getName(), iblockstate.getName(entry.getValue())); + } + + return compound; + } + + @Override + public boolean equals(Object obj) { + return obj instanceof CraftBlockData && this.state.equals(((CraftBlockData) obj).state); + } + + @Override + public int hashCode() { + return this.state.hashCode(); + } + + protected static BooleanProperty getBoolean(String name) { + throw new AssertionError("Template Method"); + } + + protected static BooleanProperty getBoolean(String name, boolean optional) { + throw new AssertionError("Template Method"); + } + + protected static EnumProperty getEnum(String name) { + throw new AssertionError("Template Method"); + } + + protected static IntegerProperty getInteger(String name) { + throw new AssertionError("Template Method"); + } + + protected static BooleanProperty getBoolean(Class block, String name) { + return (BooleanProperty) CraftBlockData.getState(block, name, false); + } + + protected static BooleanProperty getBoolean(Class block, String name, boolean optional) { + return (BooleanProperty) CraftBlockData.getState(block, name, optional); + } + + protected static EnumProperty getEnum(Class block, String name) { + return (EnumProperty) CraftBlockData.getState(block, name, false); + } + + protected static IntegerProperty getInteger(Class block, String name) { + return (IntegerProperty) CraftBlockData.getState(block, name, false); + } + + /** + * Get a specified {@link Property} from a given block's class with a + * given name + * + * @param block the class to retrieve the state from + * @param name the name of the state to retrieve + * @param optional if the state can be null + * @return the specified state or null + * @throws IllegalStateException if the state is null and {@code optional} + * is false. + */ + private static Property getState(Class block, String name, boolean optional) { + Property state = null; + + for (Block instance : BuiltInRegistries.BLOCK) { + if (instance.getClass() == block) { + if (state == null) { + state = instance.getStateDefinition().getProperty(name); + } else { + Property newState = instance.getStateDefinition().getProperty(name); + + Preconditions.checkState(state == newState, "State mistmatch %s,%s", state, newState); + } + } + } + + Preconditions.checkState(optional || state != null, "Null state for %s,%s", block, name); + + return state; + } + + /** + * Get the minimum value allowed by the BlockStateInteger. + * + * @param state the state to check + * @return the minimum value allowed + */ + protected static int getMin(IntegerProperty state) { + return state.min; + } + + /** + * Get the maximum value allowed by the BlockStateInteger. + * + * @param state the state to check + * @return the maximum value allowed + */ + protected static int getMax(IntegerProperty state) { + return state.max; + } + + public static final BlockFace[] ROTATION_CYCLE = { + BlockFace.SOUTH, BlockFace.SOUTH_SOUTH_WEST, BlockFace.SOUTH_WEST, BlockFace.WEST_SOUTH_WEST, + BlockFace.WEST, BlockFace.WEST_NORTH_WEST, BlockFace.NORTH_WEST, BlockFace.NORTH_NORTH_WEST, + BlockFace.NORTH, BlockFace.NORTH_NORTH_EAST, BlockFace.NORTH_EAST, BlockFace.EAST_NORTH_EAST, + BlockFace.EAST, BlockFace.EAST_SOUTH_EAST, BlockFace.SOUTH_EAST, BlockFace.SOUTH_SOUTH_EAST + }; + + // + private static final Map, Function> MAP = new HashMap<>(); + + static { + // + // Paper start - Generated/CraftBlockData#MAP + // @GeneratedFrom 1.21.1 + register(net.minecraft.world.level.block.AmethystClusterBlock.class, org.bukkit.craftbukkit.block.impl.CraftAmethystCluster::new); + register(net.minecraft.world.level.block.AnvilBlock.class, org.bukkit.craftbukkit.block.impl.CraftAnvil::new); + register(net.minecraft.world.level.block.AttachedStemBlock.class, org.bukkit.craftbukkit.block.impl.CraftAttachedStem::new); + register(net.minecraft.world.level.block.BambooStalkBlock.class, org.bukkit.craftbukkit.block.impl.CraftBambooStalk::new); + register(net.minecraft.world.level.block.BannerBlock.class, org.bukkit.craftbukkit.block.impl.CraftBanner::new); + register(net.minecraft.world.level.block.BarrelBlock.class, org.bukkit.craftbukkit.block.impl.CraftBarrel::new); + register(net.minecraft.world.level.block.BarrierBlock.class, org.bukkit.craftbukkit.block.impl.CraftBarrier::new); + register(net.minecraft.world.level.block.BaseCoralFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftBaseCoralFan::new); + register(net.minecraft.world.level.block.BaseCoralPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftBaseCoralPlant::new); + register(net.minecraft.world.level.block.BaseCoralWallFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftBaseCoralWallFan::new); + register(net.minecraft.world.level.block.BedBlock.class, org.bukkit.craftbukkit.block.impl.CraftBed::new); + register(net.minecraft.world.level.block.BeehiveBlock.class, org.bukkit.craftbukkit.block.impl.CraftBeehive::new); + register(net.minecraft.world.level.block.BeetrootBlock.class, org.bukkit.craftbukkit.block.impl.CraftBeetroot::new); + register(net.minecraft.world.level.block.BellBlock.class, org.bukkit.craftbukkit.block.impl.CraftBell::new); + register(net.minecraft.world.level.block.BigDripleafBlock.class, org.bukkit.craftbukkit.block.impl.CraftBigDripleaf::new); + register(net.minecraft.world.level.block.BigDripleafStemBlock.class, org.bukkit.craftbukkit.block.impl.CraftBigDripleafStem::new); + register(net.minecraft.world.level.block.BlastFurnaceBlock.class, org.bukkit.craftbukkit.block.impl.CraftBlastFurnace::new); + register(net.minecraft.world.level.block.BrewingStandBlock.class, org.bukkit.craftbukkit.block.impl.CraftBrewingStand::new); + register(net.minecraft.world.level.block.BrushableBlock.class, org.bukkit.craftbukkit.block.impl.CraftBrushable::new); + register(net.minecraft.world.level.block.BubbleColumnBlock.class, org.bukkit.craftbukkit.block.impl.CraftBubbleColumn::new); + register(net.minecraft.world.level.block.ButtonBlock.class, org.bukkit.craftbukkit.block.impl.CraftButton::new); + register(net.minecraft.world.level.block.CactusBlock.class, org.bukkit.craftbukkit.block.impl.CraftCactus::new); + register(net.minecraft.world.level.block.CakeBlock.class, org.bukkit.craftbukkit.block.impl.CraftCake::new); + register(net.minecraft.world.level.block.CalibratedSculkSensorBlock.class, org.bukkit.craftbukkit.block.impl.CraftCalibratedSculkSensor::new); + register(net.minecraft.world.level.block.CampfireBlock.class, org.bukkit.craftbukkit.block.impl.CraftCampfire::new); + register(net.minecraft.world.level.block.CandleBlock.class, org.bukkit.craftbukkit.block.impl.CraftCandle::new); + register(net.minecraft.world.level.block.CandleCakeBlock.class, org.bukkit.craftbukkit.block.impl.CraftCandleCake::new); + register(net.minecraft.world.level.block.CarrotBlock.class, org.bukkit.craftbukkit.block.impl.CraftCarrot::new); + register(net.minecraft.world.level.block.CarvedPumpkinBlock.class, org.bukkit.craftbukkit.block.impl.CraftCarvedPumpkin::new); + register(net.minecraft.world.level.block.CaveVinesBlock.class, org.bukkit.craftbukkit.block.impl.CraftCaveVines::new); + register(net.minecraft.world.level.block.CaveVinesPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftCaveVinesPlant::new); + register(net.minecraft.world.level.block.CeilingHangingSignBlock.class, org.bukkit.craftbukkit.block.impl.CraftCeilingHangingSign::new); + register(net.minecraft.world.level.block.ChainBlock.class, org.bukkit.craftbukkit.block.impl.CraftChain::new); + register(net.minecraft.world.level.block.CherryLeavesBlock.class, org.bukkit.craftbukkit.block.impl.CraftCherryLeaves::new); + register(net.minecraft.world.level.block.ChestBlock.class, org.bukkit.craftbukkit.block.impl.CraftChest::new); + register(net.minecraft.world.level.block.ChiseledBookShelfBlock.class, org.bukkit.craftbukkit.block.impl.CraftChiseledBookShelf::new); + register(net.minecraft.world.level.block.ChorusFlowerBlock.class, org.bukkit.craftbukkit.block.impl.CraftChorusFlower::new); + register(net.minecraft.world.level.block.ChorusPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftChorusPlant::new); + register(net.minecraft.world.level.block.CocoaBlock.class, org.bukkit.craftbukkit.block.impl.CraftCocoa::new); + register(net.minecraft.world.level.block.CommandBlock.class, org.bukkit.craftbukkit.block.impl.CraftCommandBlock::new); + register(net.minecraft.world.level.block.ComparatorBlock.class, org.bukkit.craftbukkit.block.impl.CraftComparator::new); + register(net.minecraft.world.level.block.ComposterBlock.class, org.bukkit.craftbukkit.block.impl.CraftComposter::new); + register(net.minecraft.world.level.block.ConduitBlock.class, org.bukkit.craftbukkit.block.impl.CraftConduit::new); + register(net.minecraft.world.level.block.CopperBulbBlock.class, org.bukkit.craftbukkit.block.impl.CraftCopperBulb::new); + register(net.minecraft.world.level.block.CoralFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralFan::new); + register(net.minecraft.world.level.block.CoralPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralPlant::new); + register(net.minecraft.world.level.block.CoralWallFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralWallFan::new); + register(net.minecraft.world.level.block.CrafterBlock.class, org.bukkit.craftbukkit.block.impl.CraftCrafter::new); + register(net.minecraft.world.level.block.CropBlock.class, org.bukkit.craftbukkit.block.impl.CraftCrop::new); + register(net.minecraft.world.level.block.DaylightDetectorBlock.class, org.bukkit.craftbukkit.block.impl.CraftDaylightDetector::new); + register(net.minecraft.world.level.block.DecoratedPotBlock.class, org.bukkit.craftbukkit.block.impl.CraftDecoratedPot::new); + register(net.minecraft.world.level.block.DetectorRailBlock.class, org.bukkit.craftbukkit.block.impl.CraftDetectorRail::new); + register(net.minecraft.world.level.block.DispenserBlock.class, org.bukkit.craftbukkit.block.impl.CraftDispenser::new); + register(net.minecraft.world.level.block.DoorBlock.class, org.bukkit.craftbukkit.block.impl.CraftDoor::new); + register(net.minecraft.world.level.block.DoublePlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftDoublePlant::new); + register(net.minecraft.world.level.block.DropperBlock.class, org.bukkit.craftbukkit.block.impl.CraftDropper::new); + register(net.minecraft.world.level.block.EndPortalFrameBlock.class, org.bukkit.craftbukkit.block.impl.CraftEndPortalFrame::new); + register(net.minecraft.world.level.block.EndRodBlock.class, org.bukkit.craftbukkit.block.impl.CraftEndRod::new); + register(net.minecraft.world.level.block.EnderChestBlock.class, org.bukkit.craftbukkit.block.impl.CraftEnderChest::new); + register(net.minecraft.world.level.block.EquipableCarvedPumpkinBlock.class, org.bukkit.craftbukkit.block.impl.CraftEquipableCarvedPumpkin::new); + register(net.minecraft.world.level.block.FarmBlock.class, org.bukkit.craftbukkit.block.impl.CraftFarm::new); + register(net.minecraft.world.level.block.FenceBlock.class, org.bukkit.craftbukkit.block.impl.CraftFence::new); + register(net.minecraft.world.level.block.FenceGateBlock.class, org.bukkit.craftbukkit.block.impl.CraftFenceGate::new); + register(net.minecraft.world.level.block.FireBlock.class, org.bukkit.craftbukkit.block.impl.CraftFire::new); + register(net.minecraft.world.level.block.FrostedIceBlock.class, org.bukkit.craftbukkit.block.impl.CraftFrostedIce::new); + register(net.minecraft.world.level.block.FurnaceBlock.class, org.bukkit.craftbukkit.block.impl.CraftFurnace::new); + register(net.minecraft.world.level.block.GlazedTerracottaBlock.class, org.bukkit.craftbukkit.block.impl.CraftGlazedTerracotta::new); + register(net.minecraft.world.level.block.GlowLichenBlock.class, org.bukkit.craftbukkit.block.impl.CraftGlowLichen::new); + register(net.minecraft.world.level.block.GrassBlock.class, org.bukkit.craftbukkit.block.impl.CraftGrass::new); + register(net.minecraft.world.level.block.GrindstoneBlock.class, org.bukkit.craftbukkit.block.impl.CraftGrindstone::new); + register(net.minecraft.world.level.block.HangingRootsBlock.class, org.bukkit.craftbukkit.block.impl.CraftHangingRoots::new); + register(net.minecraft.world.level.block.HayBlock.class, org.bukkit.craftbukkit.block.impl.CraftHay::new); + register(net.minecraft.world.level.block.HeavyCoreBlock.class, org.bukkit.craftbukkit.block.impl.CraftHeavyCore::new); + register(net.minecraft.world.level.block.HopperBlock.class, org.bukkit.craftbukkit.block.impl.CraftHopper::new); + register(net.minecraft.world.level.block.HugeMushroomBlock.class, org.bukkit.craftbukkit.block.impl.CraftHugeMushroom::new); + register(net.minecraft.world.level.block.InfestedRotatedPillarBlock.class, org.bukkit.craftbukkit.block.impl.CraftInfestedRotatedPillar::new); + register(net.minecraft.world.level.block.IronBarsBlock.class, org.bukkit.craftbukkit.block.impl.CraftIronBars::new); + register(net.minecraft.world.level.block.JigsawBlock.class, org.bukkit.craftbukkit.block.impl.CraftJigsaw::new); + register(net.minecraft.world.level.block.JukeboxBlock.class, org.bukkit.craftbukkit.block.impl.CraftJukebox::new); + register(net.minecraft.world.level.block.KelpBlock.class, org.bukkit.craftbukkit.block.impl.CraftKelp::new); + register(net.minecraft.world.level.block.LadderBlock.class, org.bukkit.craftbukkit.block.impl.CraftLadder::new); + register(net.minecraft.world.level.block.LanternBlock.class, org.bukkit.craftbukkit.block.impl.CraftLantern::new); + register(net.minecraft.world.level.block.LayeredCauldronBlock.class, org.bukkit.craftbukkit.block.impl.CraftLayeredCauldron::new); + register(net.minecraft.world.level.block.LeavesBlock.class, org.bukkit.craftbukkit.block.impl.CraftLeaves::new); + register(net.minecraft.world.level.block.LecternBlock.class, org.bukkit.craftbukkit.block.impl.CraftLectern::new); + register(net.minecraft.world.level.block.LeverBlock.class, org.bukkit.craftbukkit.block.impl.CraftLever::new); + register(net.minecraft.world.level.block.LightBlock.class, org.bukkit.craftbukkit.block.impl.CraftLight::new); + register(net.minecraft.world.level.block.LightningRodBlock.class, org.bukkit.craftbukkit.block.impl.CraftLightningRod::new); + register(net.minecraft.world.level.block.LiquidBlock.class, org.bukkit.craftbukkit.block.impl.CraftLiquid::new); + register(net.minecraft.world.level.block.LoomBlock.class, org.bukkit.craftbukkit.block.impl.CraftLoom::new); + register(net.minecraft.world.level.block.MangroveLeavesBlock.class, org.bukkit.craftbukkit.block.impl.CraftMangroveLeaves::new); + register(net.minecraft.world.level.block.MangrovePropaguleBlock.class, org.bukkit.craftbukkit.block.impl.CraftMangrovePropagule::new); + register(net.minecraft.world.level.block.MangroveRootsBlock.class, org.bukkit.craftbukkit.block.impl.CraftMangroveRoots::new); + register(net.minecraft.world.level.block.MyceliumBlock.class, org.bukkit.craftbukkit.block.impl.CraftMycelium::new); + register(net.minecraft.world.level.block.NetherPortalBlock.class, org.bukkit.craftbukkit.block.impl.CraftNetherPortal::new); + register(net.minecraft.world.level.block.NetherWartBlock.class, org.bukkit.craftbukkit.block.impl.CraftNetherWart::new); + register(net.minecraft.world.level.block.NoteBlock.class, org.bukkit.craftbukkit.block.impl.CraftNoteBlock::new); + register(net.minecraft.world.level.block.ObserverBlock.class, org.bukkit.craftbukkit.block.impl.CraftObserver::new); + register(net.minecraft.world.level.block.PiglinWallSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftPiglinWallSkull::new); + register(net.minecraft.world.level.block.PinkPetalsBlock.class, org.bukkit.craftbukkit.block.impl.CraftPinkPetals::new); + register(net.minecraft.world.level.block.PitcherCropBlock.class, org.bukkit.craftbukkit.block.impl.CraftPitcherCrop::new); + register(net.minecraft.world.level.block.PlayerHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftPlayerHead::new); + register(net.minecraft.world.level.block.PlayerWallHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftPlayerWallHead::new); + register(net.minecraft.world.level.block.PointedDripstoneBlock.class, org.bukkit.craftbukkit.block.impl.CraftPointedDripstone::new); + register(net.minecraft.world.level.block.PotatoBlock.class, org.bukkit.craftbukkit.block.impl.CraftPotato::new); + register(net.minecraft.world.level.block.PoweredRailBlock.class, org.bukkit.craftbukkit.block.impl.CraftPoweredRail::new); + register(net.minecraft.world.level.block.PressurePlateBlock.class, org.bukkit.craftbukkit.block.impl.CraftPressurePlate::new); + register(net.minecraft.world.level.block.RailBlock.class, org.bukkit.craftbukkit.block.impl.CraftRail::new); + register(net.minecraft.world.level.block.RedStoneOreBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedStoneOre::new); + register(net.minecraft.world.level.block.RedStoneWireBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedStoneWire::new); + register(net.minecraft.world.level.block.RedstoneLampBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneLamp::new); + register(net.minecraft.world.level.block.RedstoneTorchBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneTorch::new); + register(net.minecraft.world.level.block.RedstoneWallTorchBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneWallTorch::new); + register(net.minecraft.world.level.block.RepeaterBlock.class, org.bukkit.craftbukkit.block.impl.CraftRepeater::new); + register(net.minecraft.world.level.block.RespawnAnchorBlock.class, org.bukkit.craftbukkit.block.impl.CraftRespawnAnchor::new); + register(net.minecraft.world.level.block.RotatedPillarBlock.class, org.bukkit.craftbukkit.block.impl.CraftRotatedPillar::new); + register(net.minecraft.world.level.block.SaplingBlock.class, org.bukkit.craftbukkit.block.impl.CraftSapling::new); + register(net.minecraft.world.level.block.ScaffoldingBlock.class, org.bukkit.craftbukkit.block.impl.CraftScaffolding::new); + register(net.minecraft.world.level.block.SculkCatalystBlock.class, org.bukkit.craftbukkit.block.impl.CraftSculkCatalyst::new); + register(net.minecraft.world.level.block.SculkSensorBlock.class, org.bukkit.craftbukkit.block.impl.CraftSculkSensor::new); + register(net.minecraft.world.level.block.SculkShriekerBlock.class, org.bukkit.craftbukkit.block.impl.CraftSculkShrieker::new); + register(net.minecraft.world.level.block.SculkVeinBlock.class, org.bukkit.craftbukkit.block.impl.CraftSculkVein::new); + register(net.minecraft.world.level.block.SeaPickleBlock.class, org.bukkit.craftbukkit.block.impl.CraftSeaPickle::new); + register(net.minecraft.world.level.block.ShulkerBoxBlock.class, org.bukkit.craftbukkit.block.impl.CraftShulkerBox::new); + register(net.minecraft.world.level.block.SkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftSkull::new); + register(net.minecraft.world.level.block.SlabBlock.class, org.bukkit.craftbukkit.block.impl.CraftSlab::new); + register(net.minecraft.world.level.block.SmallDripleafBlock.class, org.bukkit.craftbukkit.block.impl.CraftSmallDripleaf::new); + register(net.minecraft.world.level.block.SmokerBlock.class, org.bukkit.craftbukkit.block.impl.CraftSmoker::new); + register(net.minecraft.world.level.block.SnifferEggBlock.class, org.bukkit.craftbukkit.block.impl.CraftSnifferEgg::new); + register(net.minecraft.world.level.block.SnowLayerBlock.class, org.bukkit.craftbukkit.block.impl.CraftSnowLayer::new); + register(net.minecraft.world.level.block.SnowyDirtBlock.class, org.bukkit.craftbukkit.block.impl.CraftSnowyDirt::new); + register(net.minecraft.world.level.block.StainedGlassPaneBlock.class, org.bukkit.craftbukkit.block.impl.CraftStainedGlassPane::new); + register(net.minecraft.world.level.block.StairBlock.class, org.bukkit.craftbukkit.block.impl.CraftStair::new); + register(net.minecraft.world.level.block.StandingSignBlock.class, org.bukkit.craftbukkit.block.impl.CraftStandingSign::new); + register(net.minecraft.world.level.block.StemBlock.class, org.bukkit.craftbukkit.block.impl.CraftStem::new); + register(net.minecraft.world.level.block.StonecutterBlock.class, org.bukkit.craftbukkit.block.impl.CraftStonecutter::new); + register(net.minecraft.world.level.block.StructureBlock.class, org.bukkit.craftbukkit.block.impl.CraftStructureBlock::new); + register(net.minecraft.world.level.block.SugarCaneBlock.class, org.bukkit.craftbukkit.block.impl.CraftSugarCane::new); + register(net.minecraft.world.level.block.SweetBerryBushBlock.class, org.bukkit.craftbukkit.block.impl.CraftSweetBerryBush::new); + register(net.minecraft.world.level.block.TallFlowerBlock.class, org.bukkit.craftbukkit.block.impl.CraftTallFlower::new); + register(net.minecraft.world.level.block.TallSeagrassBlock.class, org.bukkit.craftbukkit.block.impl.CraftTallSeagrass::new); + register(net.minecraft.world.level.block.TargetBlock.class, org.bukkit.craftbukkit.block.impl.CraftTarget::new); + register(net.minecraft.world.level.block.TntBlock.class, org.bukkit.craftbukkit.block.impl.CraftTnt::new); + register(net.minecraft.world.level.block.TorchflowerCropBlock.class, org.bukkit.craftbukkit.block.impl.CraftTorchflowerCrop::new); + register(net.minecraft.world.level.block.TrapDoorBlock.class, org.bukkit.craftbukkit.block.impl.CraftTrapDoor::new); + register(net.minecraft.world.level.block.TrappedChestBlock.class, org.bukkit.craftbukkit.block.impl.CraftTrappedChest::new); + register(net.minecraft.world.level.block.TrialSpawnerBlock.class, org.bukkit.craftbukkit.block.impl.CraftTrialSpawner::new); + register(net.minecraft.world.level.block.TripWireBlock.class, org.bukkit.craftbukkit.block.impl.CraftTripWire::new); + register(net.minecraft.world.level.block.TripWireHookBlock.class, org.bukkit.craftbukkit.block.impl.CraftTripWireHook::new); + register(net.minecraft.world.level.block.TurtleEggBlock.class, org.bukkit.craftbukkit.block.impl.CraftTurtleEgg::new); + register(net.minecraft.world.level.block.TwistingVinesBlock.class, org.bukkit.craftbukkit.block.impl.CraftTwistingVines::new); + register(net.minecraft.world.level.block.VaultBlock.class, org.bukkit.craftbukkit.block.impl.CraftVault::new); + register(net.minecraft.world.level.block.VineBlock.class, org.bukkit.craftbukkit.block.impl.CraftVine::new); + register(net.minecraft.world.level.block.WallBannerBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallBanner::new); + register(net.minecraft.world.level.block.WallBlock.class, org.bukkit.craftbukkit.block.impl.CraftWall::new); + register(net.minecraft.world.level.block.WallHangingSignBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallHangingSign::new); + register(net.minecraft.world.level.block.WallSignBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallSign::new); + register(net.minecraft.world.level.block.WallSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallSkull::new); + register(net.minecraft.world.level.block.WallTorchBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallTorch::new); + register(net.minecraft.world.level.block.WaterloggedTransparentBlock.class, org.bukkit.craftbukkit.block.impl.CraftWaterloggedTransparent::new); + register(net.minecraft.world.level.block.WeatheringCopperBulbBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperBulb::new); + register(net.minecraft.world.level.block.WeatheringCopperDoorBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperDoor::new); + register(net.minecraft.world.level.block.WeatheringCopperGrateBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperGrate::new); + register(net.minecraft.world.level.block.WeatheringCopperSlabBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperSlab::new); + register(net.minecraft.world.level.block.WeatheringCopperStairBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperStair::new); + register(net.minecraft.world.level.block.WeatheringCopperTrapDoorBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperTrapDoor::new); + register(net.minecraft.world.level.block.WeepingVinesBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeepingVines::new); + register(net.minecraft.world.level.block.WeightedPressurePlateBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeightedPressurePlate::new); + register(net.minecraft.world.level.block.WitherSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftWitherSkull::new); + register(net.minecraft.world.level.block.WitherWallSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftWitherWallSkull::new); + register(net.minecraft.world.level.block.piston.MovingPistonBlock.class, org.bukkit.craftbukkit.block.impl.CraftMovingPiston::new); + register(net.minecraft.world.level.block.piston.PistonBaseBlock.class, org.bukkit.craftbukkit.block.impl.CraftPistonBase::new); + register(net.minecraft.world.level.block.piston.PistonHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftPistonHead::new); + // Paper end - Generated/CraftBlockData#MAP + // + } + + private static void register(Class nms, Function bukkit) { + Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit); + } + + // Paper start - cache block data strings + private static Map stringDataCache = new java.util.concurrent.ConcurrentHashMap<>(); + + static { + // cache all of the default states at startup, will not cache ones with the custom states inside of the + // brackets in a different order, though + reloadCache(); + } + + public static void reloadCache() { + stringDataCache.clear(); + Block.BLOCK_STATE_REGISTRY.forEach(blockData -> stringDataCache.put(blockData.toString(), blockData.createCraftBlockData())); + } + // Paper end - cache block data strings + + public static CraftBlockData newData(BlockType blockType, String data) { + + // Paper start - cache block data strings + if (blockType != null) { + Block block = CraftBlockType.bukkitToMinecraftNew(blockType); + if (block != null) { + net.minecraft.resources.ResourceLocation key = BuiltInRegistries.BLOCK.getKey(block); + data = data == null ? key.toString() : key + data; + } + } + + CraftBlockData cached = stringDataCache.computeIfAbsent(data, s -> createNewData(null, s)); + return (CraftBlockData) cached.clone(); + } + + private static CraftBlockData createNewData(BlockType blockType, String data) { + // Paper end - cache block data strings + net.minecraft.world.level.block.state.BlockState blockData; + Block block = blockType == null ? null : ((CraftBlockType) blockType).getHandle(); + Map, Comparable> parsed = null; + + // Data provided, use it + if (data != null) { + try { + // Material provided, force that material in + if (block != null) { + data = BuiltInRegistries.BLOCK.getKey(block) + data; + } + + StringReader reader = new StringReader(data); + BlockStateParser.BlockResult arg = BlockStateParser.parseForBlock(BuiltInRegistries.BLOCK.asLookup(), reader, false); + Preconditions.checkArgument(!reader.canRead(), "Spurious trailing data: " + data); + + blockData = arg.blockState(); + parsed = arg.properties(); + } catch (CommandSyntaxException ex) { + throw new IllegalArgumentException("Could not parse data: " + data, ex); + } + } else { + blockData = block.defaultBlockState(); + } + + CraftBlockData craft = CraftBlockData.fromData(blockData); + craft.parsedStates = parsed; + return craft; + } + + // Paper start - optimize creating BlockData to not need a map lookup + static { + // Initialize cached data for all IBlockData instances after registration + Block.BLOCK_STATE_REGISTRY.iterator().forEachRemaining(net.minecraft.world.level.block.state.BlockState::createCraftBlockData); + } + public static CraftBlockData fromData(net.minecraft.world.level.block.state.BlockState data) { + return data.createCraftBlockData(); + } + + public static CraftBlockData createData(net.minecraft.world.level.block.state.BlockState data) { + // Paper end + return CraftBlockData.MAP.getOrDefault(data.getBlock().getClass(), CraftBlockData::new).apply(data); + } + + @Override + public SoundGroup getSoundGroup() { + return CraftSoundGroup.getSoundGroup(this.state.getSoundType()); + } + + @Override + public int getLightEmission() { + return this.state.getLightEmission(); + } + + @Override + public boolean isOccluding() { + return this.state.canOcclude(); + } + + @Override + public boolean requiresCorrectToolForDrops() { + return this.state.requiresCorrectToolForDrops(); + } + + @Override + public boolean isPreferredTool(ItemStack tool) { + Preconditions.checkArgument(tool != null, "tool must not be null"); + + net.minecraft.world.item.ItemStack nms = CraftItemStack.asNMSCopy(tool); + return CraftBlockData.isPreferredTool(this.state, nms); + } + + public static boolean isPreferredTool(net.minecraft.world.level.block.state.BlockState iblockdata, net.minecraft.world.item.ItemStack nmsItem) { + return !iblockdata.requiresCorrectToolForDrops() || nmsItem.isCorrectToolForDrops(iblockdata); + } + + @Override + public PistonMoveReaction getPistonMoveReaction() { + return PistonMoveReaction.getById(this.state.getPistonPushReaction().ordinal()); + } + + @Override + public boolean isSupported(org.bukkit.block.Block block) { + Preconditions.checkArgument(block != null, "block must not be null"); + + CraftBlock craftBlock = (CraftBlock) block; + return this.state.canSurvive(craftBlock.getCraftWorld().getHandle(), craftBlock.getPosition()); + } + + @Override + public boolean isSupported(Location location) { + Preconditions.checkArgument(location != null, "location must not be null"); + + CraftWorld world = (CraftWorld) location.getWorld(); + Preconditions.checkArgument(world != null, "location must not have a null world"); + + BlockPos position = CraftLocation.toBlockPosition(location); + return this.state.canSurvive(world.getHandle(), position); + } + + @Override + public boolean isFaceSturdy(BlockFace face, BlockSupport support) { + Preconditions.checkArgument(face != null, "face must not be null"); + Preconditions.checkArgument(support != null, "support must not be null"); + + return this.state.isFaceSturdy(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CraftBlock.blockFaceToNotch(face), CraftBlockSupport.toNMS(support)); + } + + // Paper start + @Override + public org.bukkit.util.VoxelShape getCollisionShape(Location location) { + Preconditions.checkArgument(location != null, "location must not be null"); + + CraftWorld world = (CraftWorld) location.getWorld(); + Preconditions.checkArgument(world != null, "location must not have a null world"); + + BlockPos position = CraftLocation.toBlockPosition(location); + net.minecraft.world.phys.shapes.VoxelShape shape = this.state.getCollisionShape(world.getHandle(), position); + return new org.bukkit.craftbukkit.util.CraftVoxelShape(shape); + } + // Paper end + + @Override + public Color getMapColor() { + return Color.fromRGB(this.state.getMapColor(null, null).col); + } + + @Override + public Material getPlacementMaterial() { + return CraftItemType.minecraftToBukkit(this.state.getBlock().asItem()); + } + + @Override + public void rotate(StructureRotation rotation) { + this.state = this.state.rotate(Rotation.valueOf(rotation.name())); + } + + @Override + public void mirror(Mirror mirror) { + this.state = this.state.mirror(net.minecraft.world.level.block.Mirror.valueOf(mirror.name())); + } + + @Override + public void copyTo(BlockData blockData) { + CraftBlockData other = (CraftBlockData) blockData; + net.minecraft.world.level.block.state.BlockState nms = other.state; + for (Property property : this.state.getBlock().getStateDefinition().getProperties()) { + if (nms.hasProperty(property)) { + nms = this.copyProperty(this.state, nms, property); + } + } + + other.state = nms; + } + + private > net.minecraft.world.level.block.state.BlockState copyProperty(net.minecraft.world.level.block.state.BlockState source, net.minecraft.world.level.block.state.BlockState target, Property property) { + return target.setValue(property, source.getValue(property)); + } + + @NotNull + @Override + public BlockState createBlockState() { + return CraftBlockStates.getBlockState(this.state, null); + } + + // Paper start - destroy speed API + @Override + public float getDestroySpeed(final ItemStack itemStack, final boolean considerEnchants) { + net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.unwrap(itemStack); + float speed = nmsItemStack.getDestroySpeed(this.state); + if (speed > 1.0F && considerEnchants) { + final net.minecraft.core.Holder attribute = net.minecraft.world.entity.ai.attributes.Attributes.MINING_EFFICIENCY; + // Logic sourced from AttributeInstance#calculateValue + final double initialBaseValue = attribute.value().getDefaultValue(); + final org.apache.commons.lang3.mutable.MutableDouble modifiedBaseValue = new org.apache.commons.lang3.mutable.MutableDouble(initialBaseValue); + final org.apache.commons.lang3.mutable.MutableDouble baseValMul = new org.apache.commons.lang3.mutable.MutableDouble(1); + final org.apache.commons.lang3.mutable.MutableDouble totalValMul = new org.apache.commons.lang3.mutable.MutableDouble(1); + + net.minecraft.world.item.enchantment.EnchantmentHelper.forEachModifier( + nmsItemStack, net.minecraft.world.entity.EquipmentSlot.MAINHAND, (attributeHolder, attributeModifier) -> { + switch (attributeModifier.operation()) { + case ADD_VALUE -> modifiedBaseValue.add(attributeModifier.amount()); + case ADD_MULTIPLIED_BASE -> baseValMul.add(attributeModifier.amount()); + case ADD_MULTIPLIED_TOTAL -> totalValMul.setValue(totalValMul.doubleValue() * (1D + attributeModifier.amount())); + } + } + ); + + final double actualModifier = modifiedBaseValue.doubleValue() * baseValMul.doubleValue() * totalValMul.doubleValue(); + + speed += (float) attribute.value().sanitizeValue(actualModifier); + } + return speed; + } + // Paper end - destroy speed API + + // Paper start - Block tick API + @Override + public boolean isRandomlyTicked() { + return this.state.isRandomlyTicking(); + } + // Paper end - Block tick API +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAmethystCluster.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAmethystCluster.java new file mode 100644 index 0000000000..6ad0492c63 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAmethystCluster.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.AmethystClusterBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.AmethystCluster; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftAmethystCluster extends CraftBlockData implements AmethystCluster { + private static final DirectionProperty FACING = AmethystClusterBlock.FACING; + + private static final BooleanProperty WATERLOGGED = AmethystClusterBlock.WATERLOGGED; + + public CraftAmethystCluster(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAnvil.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAnvil.java new file mode 100644 index 0000000000..59988ef4e1 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAnvil.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.AnvilBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftAnvil extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = AnvilBlock.FACING; + + public CraftAnvil(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAttachedStem.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAttachedStem.java new file mode 100644 index 0000000000..0cb0e5aef8 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAttachedStem.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.AttachedStemBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftAttachedStem extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = AttachedStemBlock.FACING; + + public CraftAttachedStem(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBambooStalk.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBambooStalk.java new file mode 100644 index 0000000000..ec346f33d3 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBambooStalk.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.BambooStalkBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BambooLeaves; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Bamboo; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBambooStalk extends CraftBlockData implements Bamboo { + private static final IntegerProperty AGE = BambooStalkBlock.AGE; + + private static final EnumProperty LEAVES = BambooStalkBlock.LEAVES; + + private static final IntegerProperty STAGE = BambooStalkBlock.STAGE; + + public CraftBambooStalk(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } + + @Override + public Bamboo.Leaves getLeaves() { + return this.get(LEAVES, Bamboo.Leaves.class); + } + + @Override + public void setLeaves(final Bamboo.Leaves leaves) { + Preconditions.checkArgument(leaves != null, "leaves cannot be null!"); + this.set(LEAVES, leaves); + } + + @Override + public int getStage() { + return this.get(STAGE); + } + + @Override + public void setStage(final int stage) { + this.set(STAGE, stage); + } + + @Override + public int getMaximumStage() { + return STAGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBanner.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBanner.java new file mode 100644 index 0000000000..b21276193d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBanner.java @@ -0,0 +1,35 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.BannerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.RotationSegment; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Rotatable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.util.Vector; + +@GeneratedFrom("1.21.1") +public class CraftBanner extends CraftBlockData implements Rotatable { + private static final IntegerProperty ROTATION = BannerBlock.ROTATION; + + public CraftBanner(BlockState state) { + super(state); + } + + @Override + public BlockFace getRotation() { + return CraftBlockData.ROTATION_CYCLE[this.get(ROTATION)]; + } + + @Override + public void setRotation(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace != BlockFace.SELF && blockFace.getModY() == 0, "Invalid face, only horizontal face are allowed for this property!"); + Vector dir = blockFace.getDirection(); + float angle = (float) -Math.toDegrees(Math.atan2(dir.getX(), dir.getZ())); + this.set(ROTATION, RotationSegment.convertToSegment(angle)); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrel.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrel.java new file mode 100644 index 0000000000..959f46b933 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrel.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BarrelBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Barrel; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBarrel extends CraftBlockData implements Barrel { + private static final DirectionProperty FACING = BarrelBlock.FACING; + + private static final BooleanProperty OPEN = BarrelBlock.OPEN; + + public CraftBarrel(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isOpen() { + return this.get(OPEN); + } + + @Override + public void setOpen(final boolean open) { + this.set(OPEN, open); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrier.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrier.java new file mode 100644 index 0000000000..0cdd999738 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrier.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.BarrierBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBarrier extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = BarrierBlock.WATERLOGGED; + + public CraftBarrier(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralFan.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralFan.java new file mode 100644 index 0000000000..7ec4d300c0 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralFan.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.BaseCoralFanBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBaseCoralFan extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = BaseCoralFanBlock.WATERLOGGED; + + public CraftBaseCoralFan(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralPlant.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralPlant.java new file mode 100644 index 0000000000..eea92a3ecc --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralPlant.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.BaseCoralPlantBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBaseCoralPlant extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = BaseCoralPlantBlock.WATERLOGGED; + + public CraftBaseCoralPlant(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralWallFan.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralWallFan.java new file mode 100644 index 0000000000..8fb809c9eb --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralWallFan.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BaseCoralWallFanBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.CoralWallFan; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBaseCoralWallFan extends CraftBlockData implements CoralWallFan { + private static final DirectionProperty FACING = BaseCoralWallFanBlock.FACING; + + private static final BooleanProperty WATERLOGGED = BaseCoralWallFanBlock.WATERLOGGED; + + public CraftBaseCoralWallFan(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBed.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBed.java new file mode 100644 index 0000000000..4792bac4b0 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBed.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BedBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BedPart; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Bed; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBed extends CraftBlockData implements Bed { + private static final DirectionProperty FACING = BedBlock.FACING; + + private static final BooleanProperty OCCUPIED = BedBlock.OCCUPIED; + + private static final EnumProperty PART = BedBlock.PART; + + public CraftBed(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isOccupied() { + return this.get(OCCUPIED); + } + + @Override + public void setOccupied(final boolean occupied) { + this.set(OCCUPIED, occupied); + } + + @Override + public Bed.Part getPart() { + return this.get(PART, Bed.Part.class); + } + + @Override + public void setPart(final Bed.Part part) { + Preconditions.checkArgument(part != null, "part cannot be null!"); + this.set(PART, part); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeehive.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeehive.java new file mode 100644 index 0000000000..2202a9b464 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeehive.java @@ -0,0 +1,55 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BeehiveBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Beehive; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBeehive extends CraftBlockData implements Beehive { + private static final DirectionProperty FACING = BeehiveBlock.FACING; + + private static final IntegerProperty HONEY_LEVEL = BeehiveBlock.HONEY_LEVEL; + + public CraftBeehive(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public int getHoneyLevel() { + return this.get(HONEY_LEVEL); + } + + @Override + public void setHoneyLevel(final int honeyLevel) { + this.set(HONEY_LEVEL, honeyLevel); + } + + @Override + public int getMaximumHoneyLevel() { + return HONEY_LEVEL.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeetroot.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeetroot.java new file mode 100644 index 0000000000..9131873c08 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeetroot.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.BeetrootBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBeetroot extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = BeetrootBlock.AGE; + + public CraftBeetroot(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBell.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBell.java new file mode 100644 index 0000000000..9f0f06d7e7 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBell.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BellBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BellAttachType; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Bell; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBell extends CraftBlockData implements Bell { + private static final EnumProperty ATTACHMENT = BellBlock.ATTACHMENT; + + private static final DirectionProperty FACING = BellBlock.FACING; + + private static final BooleanProperty POWERED = BellBlock.POWERED; + + public CraftBell(BlockState state) { + super(state); + } + + @Override + public Bell.Attachment getAttachment() { + return this.get(ATTACHMENT, Bell.Attachment.class); + } + + @Override + public void setAttachment(final Bell.Attachment attachment) { + Preconditions.checkArgument(attachment != null, "attachment cannot be null!"); + this.set(ATTACHMENT, attachment); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleaf.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleaf.java new file mode 100644 index 0000000000..62de41ba85 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleaf.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BigDripleafBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.BigDripleaf; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBigDripleaf extends CraftBlockData implements BigDripleaf { + private static final DirectionProperty FACING = BigDripleafBlock.FACING; + + private static final EnumProperty TILT = BlockStateProperties.TILT; + + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CraftBigDripleaf(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public BigDripleaf.Tilt getTilt() { + return this.get(TILT, BigDripleaf.Tilt.class); + } + + @Override + public void setTilt(final BigDripleaf.Tilt tilt) { + Preconditions.checkArgument(tilt != null, "tilt cannot be null!"); + this.set(TILT, tilt); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleafStem.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleafStem.java new file mode 100644 index 0000000000..1c33b7c839 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleafStem.java @@ -0,0 +1,51 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BigDripleafStemBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Dripleaf; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBigDripleafStem extends CraftBlockData implements Dripleaf { + private static final DirectionProperty FACING = BigDripleafStemBlock.FACING; + + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CraftBigDripleafStem(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBlastFurnace.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBlastFurnace.java new file mode 100644 index 0000000000..abc8426f2d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBlastFurnace.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BlastFurnaceBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBlastFurnace extends CraftBlockData implements Furnace { + private static final DirectionProperty FACING = BlastFurnaceBlock.FACING; + + private static final BooleanProperty LIT = BlastFurnaceBlock.LIT; + + public CraftBlastFurnace(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBrewingStand.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBrewingStand.java new file mode 100644 index 0000000000..cbe04f364f --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBrewingStand.java @@ -0,0 +1,45 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.BrewingStandBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.BrewingStand; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBrewingStand extends CraftBlockData implements BrewingStand { + private static final BooleanProperty[] HAS_BOTTLE = BrewingStandBlock.HAS_BOTTLE; + + public CraftBrewingStand(BlockState state) { + super(state); + } + + @Override + public boolean hasBottle(final int index) { + return this.get(HAS_BOTTLE[index]); + } + + @Override + public void setBottle(final int index, final boolean bottle) { + this.set(HAS_BOTTLE[index], bottle); + } + + @Override + public Set getBottles() { + ImmutableSet.Builder bottles = ImmutableSet.builder(); + for (int index = 0, len = HAS_BOTTLE.length; index < len; index++) { + if (this.get(HAS_BOTTLE[index])) { + bottles.add(index); + } + } + return bottles.build(); + } + + @Override + public int getMaximumBottles() { + return HAS_BOTTLE.length; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBrushable.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBrushable.java new file mode 100644 index 0000000000..83adbe7dad --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBrushable.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Brushable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBrushable extends CraftBlockData implements Brushable { + private static final IntegerProperty DUSTED = BlockStateProperties.DUSTED; + + public CraftBrushable(BlockState state) { + super(state); + } + + @Override + public int getDusted() { + return this.get(DUSTED); + } + + @Override + public void setDusted(final int dusted) { + this.set(DUSTED, dusted); + } + + @Override + public int getMaximumDusted() { + return DUSTED.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBubbleColumn.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBubbleColumn.java new file mode 100644 index 0000000000..982a326871 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBubbleColumn.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.BubbleColumnBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.BubbleColumn; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftBubbleColumn extends CraftBlockData implements BubbleColumn { + private static final BooleanProperty DRAG_DOWN = BubbleColumnBlock.DRAG_DOWN; + + public CraftBubbleColumn(BlockState state) { + super(state); + } + + @Override + public boolean isDrag() { + return this.get(DRAG_DOWN); + } + + @Override + public void setDrag(final boolean drag) { + this.set(DRAG_DOWN, drag); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftButton.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftButton.java new file mode 100644 index 0000000000..3dce82b50d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftButton.java @@ -0,0 +1,66 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.ButtonBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.AttachFace; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Switch; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftButton extends CraftBlockData implements Switch { + private static final EnumProperty FACE = ButtonBlock.FACE; + + private static final DirectionProperty FACING = ButtonBlock.FACING; + + private static final BooleanProperty POWERED = ButtonBlock.POWERED; + + public CraftButton(BlockState state) { + super(state); + } + + @Override + public org.bukkit.block.data.FaceAttachable.AttachedFace getAttachedFace() { + return this.get(FACE, org.bukkit.block.data.FaceAttachable.AttachedFace.class); + } + + @Override + public void setAttachedFace( + final org.bukkit.block.data.FaceAttachable.AttachedFace attachedFace) { + Preconditions.checkArgument(attachedFace != null, "attachedFace cannot be null!"); + this.set(FACE, attachedFace); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCactus.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCactus.java new file mode 100644 index 0000000000..e9401e43d4 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCactus.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CactusBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCactus extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = CactusBlock.AGE; + + public CraftCactus(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCake.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCake.java new file mode 100644 index 0000000000..c43082a619 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCake.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CakeBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Cake; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCake extends CraftBlockData implements Cake { + private static final IntegerProperty BITES = CakeBlock.BITES; + + public CraftCake(BlockState state) { + super(state); + } + + @Override + public int getBites() { + return this.get(BITES); + } + + @Override + public void setBites(final int bites) { + this.set(BITES, bites); + } + + @Override + public int getMaximumBites() { + return BITES.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCalibratedSculkSensor.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCalibratedSculkSensor.java new file mode 100644 index 0000000000..57c68bb0ba --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCalibratedSculkSensor.java @@ -0,0 +1,83 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.CalibratedSculkSensorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.SculkSensorPhase; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.CalibratedSculkSensor; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCalibratedSculkSensor extends CraftBlockData implements CalibratedSculkSensor { + private static final DirectionProperty FACING = CalibratedSculkSensorBlock.FACING; + + private static final IntegerProperty POWER = CalibratedSculkSensorBlock.POWER; + + private static final EnumProperty PHASE = CalibratedSculkSensorBlock.PHASE; + + private static final BooleanProperty WATERLOGGED = CalibratedSculkSensorBlock.WATERLOGGED; + + public CraftCalibratedSculkSensor(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public int getPower() { + return this.get(POWER); + } + + @Override + public void setPower(final int power) { + this.set(POWER, power); + } + + @Override + public int getMaximumPower() { + return POWER.max; + } + + @Override + public org.bukkit.block.data.type.SculkSensor.Phase getSculkSensorPhase() { + return this.get(PHASE, org.bukkit.block.data.type.SculkSensor.Phase.class); + } + + @Override + public void setSculkSensorPhase(final org.bukkit.block.data.type.SculkSensor.Phase phase) { + Preconditions.checkArgument(phase != null, "phase cannot be null!"); + this.set(PHASE, phase); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCampfire.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCampfire.java new file mode 100644 index 0000000000..560e54b7f5 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCampfire.java @@ -0,0 +1,74 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.CampfireBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Campfire; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCampfire extends CraftBlockData implements Campfire { + private static final DirectionProperty FACING = CampfireBlock.FACING; + + private static final BooleanProperty LIT = CampfireBlock.LIT; + + private static final BooleanProperty SIGNAL_FIRE = CampfireBlock.SIGNAL_FIRE; + + private static final BooleanProperty WATERLOGGED = CampfireBlock.WATERLOGGED; + + public CraftCampfire(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } + + @Override + public boolean isSignalFire() { + return this.get(SIGNAL_FIRE); + } + + @Override + public void setSignalFire(final boolean signalFire) { + this.set(SIGNAL_FIRE, signalFire); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCandle.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCandle.java new file mode 100644 index 0000000000..56cbc42ee8 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCandle.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CandleBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Candle; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCandle extends CraftBlockData implements Candle { + private static final IntegerProperty CANDLES = CandleBlock.CANDLES; + + private static final BooleanProperty LIT = CandleBlock.LIT; + + private static final BooleanProperty WATERLOGGED = CandleBlock.WATERLOGGED; + + public CraftCandle(BlockState state) { + super(state); + } + + @Override + public int getCandles() { + return this.get(CANDLES); + } + + @Override + public void setCandles(final int candles) { + this.set(CANDLES, candles); + } + + @Override + public int getMinimumCandles() { + return CANDLES.min; + } + + @Override + public int getMaximumCandles() { + return CANDLES.max; + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCandleCake.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCandleCake.java new file mode 100644 index 0000000000..ba18a54ac0 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCandleCake.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CandleCakeBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Lightable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCandleCake extends CraftBlockData implements Lightable { + private static final BooleanProperty LIT = CandleCakeBlock.LIT; + + public CraftCandleCake(BlockState state) { + super(state); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarrot.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarrot.java new file mode 100644 index 0000000000..a71484e837 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarrot.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CarrotBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCarrot extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = CarrotBlock.AGE; + + public CraftCarrot(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarvedPumpkin.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarvedPumpkin.java new file mode 100644 index 0000000000..feef5e15cb --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarvedPumpkin.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.CarvedPumpkinBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCarvedPumpkin extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = CarvedPumpkinBlock.FACING; + + public CraftCarvedPumpkin(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCaveVines.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCaveVines.java new file mode 100644 index 0000000000..f434189125 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCaveVines.java @@ -0,0 +1,45 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CaveVinesBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.CaveVines; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCaveVines extends CraftBlockData implements CaveVines { + private static final IntegerProperty AGE = CaveVinesBlock.AGE; + + private static final BooleanProperty BERRIES = CaveVinesBlock.BERRIES; + + public CraftCaveVines(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } + + @Override + public boolean hasBerries() { + return this.get(BERRIES); + } + + @Override + public void setBerries(final boolean berries) { + this.set(BERRIES, berries); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCaveVinesPlant.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCaveVinesPlant.java new file mode 100644 index 0000000000..6f2f9d4903 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCaveVinesPlant.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CaveVinesPlantBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.CaveVinesPlant; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCaveVinesPlant extends CraftBlockData implements CaveVinesPlant { + private static final BooleanProperty BERRIES = CaveVinesPlantBlock.BERRIES; + + public CraftCaveVinesPlant(BlockState state) { + super(state); + } + + @Override + public boolean hasBerries() { + return this.get(BERRIES); + } + + @Override + public void setBerries(final boolean berries) { + this.set(BERRIES, berries); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCeilingHangingSign.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCeilingHangingSign.java new file mode 100644 index 0000000000..63679d021a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCeilingHangingSign.java @@ -0,0 +1,60 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CeilingHangingSignBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.RotationSegment; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.HangingSign; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.util.Vector; + +@GeneratedFrom("1.21.1") +public class CraftCeilingHangingSign extends CraftBlockData implements HangingSign { + private static final BooleanProperty ATTACHED = CeilingHangingSignBlock.ATTACHED; + + private static final IntegerProperty ROTATION = CeilingHangingSignBlock.ROTATION; + + private static final BooleanProperty WATERLOGGED = CeilingHangingSignBlock.WATERLOGGED; + + public CraftCeilingHangingSign(BlockState state) { + super(state); + } + + @Override + public boolean isAttached() { + return this.get(ATTACHED); + } + + @Override + public void setAttached(final boolean attached) { + this.set(ATTACHED, attached); + } + + @Override + public BlockFace getRotation() { + return CraftBlockData.ROTATION_CYCLE[this.get(ROTATION)]; + } + + @Override + public void setRotation(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace != BlockFace.SELF && blockFace.getModY() == 0, "Invalid face, only horizontal face are allowed for this property!"); + Vector dir = blockFace.getDirection(); + float angle = (float) -Math.toDegrees(Math.atan2(dir.getX(), dir.getZ())); + this.set(ROTATION, RotationSegment.convertToSegment(angle)); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChain.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChain.java new file mode 100644 index 0000000000..41f814cbbd --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChain.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.ChainBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.Axis; +import org.bukkit.block.data.type.Chain; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftChain extends CraftBlockData implements Chain { + private static final EnumProperty AXIS = ChainBlock.AXIS; + + private static final BooleanProperty WATERLOGGED = ChainBlock.WATERLOGGED; + + public CraftChain(BlockState state) { + super(state); + } + + @Override + public Axis getAxis() { + return this.get(AXIS, Axis.class); + } + + @Override + public void setAxis(final Axis axis) { + Preconditions.checkArgument(axis != null, "axis cannot be null!"); + this.set(AXIS, axis); + } + + @Override + public Set getAxes() { + return this.getValues(AXIS, Axis.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java new file mode 100644 index 0000000000..d18d95dc3e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CherryLeavesBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Leaves; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCherryLeaves extends CraftBlockData implements Leaves { + private static final IntegerProperty DISTANCE = CherryLeavesBlock.DISTANCE; + + private static final BooleanProperty PERSISTENT = CherryLeavesBlock.PERSISTENT; + + private static final BooleanProperty WATERLOGGED = CherryLeavesBlock.WATERLOGGED; + + public CraftCherryLeaves(BlockState state) { + super(state); + } + + @Override + public int getDistance() { + return this.get(DISTANCE); + } + + @Override + public void setDistance(final int distance) { + this.set(DISTANCE, distance); + } + + @Override + public int getMinimumDistance() { + return DISTANCE.min; + } + + @Override + public int getMaximumDistance() { + return DISTANCE.max; + } + + @Override + public boolean isPersistent() { + return this.get(PERSISTENT); + } + + @Override + public void setPersistent(final boolean persistent) { + this.set(PERSISTENT, persistent); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChest.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChest.java new file mode 100644 index 0000000000..a9f1ee9ffa --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChest.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.ChestBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.ChestType; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Chest; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftChest extends CraftBlockData implements Chest { + private static final DirectionProperty FACING = ChestBlock.FACING; + + private static final EnumProperty TYPE = ChestBlock.TYPE; + + private static final BooleanProperty WATERLOGGED = ChestBlock.WATERLOGGED; + + public CraftChest(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public Chest.Type getType() { + return this.get(TYPE, Chest.Type.class); + } + + @Override + public void setType(final Chest.Type type) { + Preconditions.checkArgument(type != null, "type cannot be null!"); + this.set(TYPE, type); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChiseledBookShelf.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChiseledBookShelf.java new file mode 100644 index 0000000000..159f16c36e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChiseledBookShelf.java @@ -0,0 +1,69 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.List; +import java.util.Set; +import net.minecraft.world.level.block.ChiseledBookShelfBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.ChiseledBookshelf; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftChiseledBookShelf extends CraftBlockData implements ChiseledBookshelf { + private static final DirectionProperty HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; + + private static final List SLOT_OCCUPIED_PROPERTIES = ChiseledBookShelfBlock.SLOT_OCCUPIED_PROPERTIES; + + public CraftChiseledBookShelf(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(HORIZONTAL_FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(HORIZONTAL_FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(HORIZONTAL_FACING, BlockFace.class); + } + + @Override + public boolean isSlotOccupied(final int index) { + return this.get(SLOT_OCCUPIED_PROPERTIES.get(index)); + } + + @Override + public void setSlotOccupied(final int index, final boolean slotOccupied) { + this.set(SLOT_OCCUPIED_PROPERTIES.get(index), slotOccupied); + } + + @Override + public Set getOccupiedSlots() { + ImmutableSet.Builder slotOccupieds = ImmutableSet.builder(); + for (int index = 0, size = SLOT_OCCUPIED_PROPERTIES.size(); index < size; index++) { + if (this.get(SLOT_OCCUPIED_PROPERTIES.get(index))) { + slotOccupieds.add(index); + } + } + return slotOccupieds.build(); + } + + @Override + public int getMaximumOccupiedSlots() { + return SLOT_OCCUPIED_PROPERTIES.size(); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChorusFlower.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChorusFlower.java new file mode 100644 index 0000000000..5fd9c3f67d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChorusFlower.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.ChorusFlowerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftChorusFlower extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = ChorusFlowerBlock.AGE; + + public CraftChorusFlower(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChorusPlant.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChorusPlant.java new file mode 100644 index 0000000000..99228edcfa --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChorusPlant.java @@ -0,0 +1,58 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.ChorusPlantBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.MultipleFacing; +import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftChorusPlant extends CraftBlockData implements MultipleFacing { + private static final Map PROPERTY_BY_DIRECTION = ChorusPlantBlock.PROPERTY_BY_DIRECTION.entrySet().stream() + .collect(Collectors.toMap(entry -> CraftBlock.notchToBlockFace(entry.getKey()), entry -> entry.getValue())); + + public CraftChorusPlant(BlockState state) { + super(state); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCocoa.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCocoa.java new file mode 100644 index 0000000000..bfeadfaed3 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCocoa.java @@ -0,0 +1,55 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.CocoaBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Cocoa; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCocoa extends CraftBlockData implements Cocoa { + private static final IntegerProperty AGE = CocoaBlock.AGE; + + private static final DirectionProperty FACING = CocoaBlock.FACING; + + public CraftCocoa(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCommandBlock.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCommandBlock.java new file mode 100644 index 0000000000..c1d58a5536 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCommandBlock.java @@ -0,0 +1,49 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.CommandBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCommandBlock extends CraftBlockData implements CommandBlock { + private static final BooleanProperty CONDITIONAL = net.minecraft.world.level.block.CommandBlock.CONDITIONAL; + + private static final DirectionProperty FACING = net.minecraft.world.level.block.CommandBlock.FACING; + + public CraftCommandBlock(BlockState state) { + super(state); + } + + @Override + public boolean isConditional() { + return this.get(CONDITIONAL); + } + + @Override + public void setConditional(final boolean conditional) { + this.set(CONDITIONAL, conditional); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftComparator.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftComparator.java new file mode 100644 index 0000000000..b15ddb5f5a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftComparator.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.ComparatorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.ComparatorMode; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Comparator; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftComparator extends CraftBlockData implements Comparator { + private static final DirectionProperty FACING = ComparatorBlock.FACING; + + private static final EnumProperty MODE = ComparatorBlock.MODE; + + private static final BooleanProperty POWERED = ComparatorBlock.POWERED; + + public CraftComparator(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public Comparator.Mode getMode() { + return this.get(MODE, Comparator.Mode.class); + } + + @Override + public void setMode(final Comparator.Mode mode) { + Preconditions.checkArgument(mode != null, "mode cannot be null!"); + this.set(MODE, mode); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftComposter.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftComposter.java new file mode 100644 index 0000000000..f5c931f9b9 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftComposter.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.ComposterBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Levelled; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftComposter extends CraftBlockData implements Levelled { + private static final IntegerProperty LEVEL = ComposterBlock.LEVEL; + + public CraftComposter(BlockState state) { + super(state); + } + + @Override + public int getLevel() { + return this.get(LEVEL); + } + + @Override + public void setLevel(final int level) { + this.set(LEVEL, level); + } + + @Override + public int getMinimumLevel() { + return LEVEL.min; + } + + @Override + public int getMaximumLevel() { + return LEVEL.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftConduit.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftConduit.java new file mode 100644 index 0000000000..03960981b9 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftConduit.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.ConduitBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftConduit extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = ConduitBlock.WATERLOGGED; + + public CraftConduit(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCopperBulb.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCopperBulb.java new file mode 100644 index 0000000000..ea6c917747 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCopperBulb.java @@ -0,0 +1,39 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CopperBulbBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.CopperBulb; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCopperBulb extends CraftBlockData implements CopperBulb { + private static final BooleanProperty LIT = CopperBulbBlock.LIT; + + private static final BooleanProperty POWERED = CopperBulbBlock.POWERED; + + public CraftCopperBulb(BlockState state) { + super(state); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralFan.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralFan.java new file mode 100644 index 0000000000..4c5c530c70 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralFan.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CoralFanBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCoralFan extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = CoralFanBlock.WATERLOGGED; + + public CraftCoralFan(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralPlant.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralPlant.java new file mode 100644 index 0000000000..3f81085abe --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralPlant.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CoralPlantBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCoralPlant extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = CoralPlantBlock.WATERLOGGED; + + public CraftCoralPlant(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralWallFan.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralWallFan.java new file mode 100644 index 0000000000..536183e2a6 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralWallFan.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.CoralWallFanBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.CoralWallFan; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCoralWallFan extends CraftBlockData implements CoralWallFan { + private static final DirectionProperty FACING = CoralWallFanBlock.FACING; + + private static final BooleanProperty WATERLOGGED = CoralWallFanBlock.WATERLOGGED; + + public CraftCoralWallFan(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCrafter.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCrafter.java new file mode 100644 index 0000000000..679574c3bb --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCrafter.java @@ -0,0 +1,56 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.core.FrontAndTop; +import net.minecraft.world.level.block.CrafterBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.data.type.Crafter; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCrafter extends CraftBlockData implements Crafter { + private static final BooleanProperty CRAFTING = CrafterBlock.CRAFTING; + + private static final EnumProperty ORIENTATION = BlockStateProperties.ORIENTATION; + + private static final BooleanProperty TRIGGERED = CrafterBlock.TRIGGERED; + + public CraftCrafter(BlockState state) { + super(state); + } + + @Override + public boolean isCrafting() { + return this.get(CRAFTING); + } + + @Override + public void setCrafting(final boolean crafting) { + this.set(CRAFTING, crafting); + } + + @Override + public org.bukkit.block.Orientation getOrientation() { + return this.get(ORIENTATION, org.bukkit.block.Orientation.class); + } + + @Override + public void setOrientation(final org.bukkit.block.Orientation orientation) { + Preconditions.checkArgument(orientation != null, "orientation cannot be null!"); + this.set(ORIENTATION, orientation); + } + + @Override + public boolean isTriggered() { + return this.get(TRIGGERED); + } + + @Override + public void setTriggered(final boolean triggered) { + this.set(TRIGGERED, triggered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCrop.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCrop.java new file mode 100644 index 0000000000..fc3ad04b83 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCrop.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.CropBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftCrop extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = CropBlock.AGE; + + public CraftCrop(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDaylightDetector.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDaylightDetector.java new file mode 100644 index 0000000000..900696a940 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDaylightDetector.java @@ -0,0 +1,45 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.DaylightDetectorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.DaylightDetector; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftDaylightDetector extends CraftBlockData implements DaylightDetector { + private static final BooleanProperty INVERTED = DaylightDetectorBlock.INVERTED; + + private static final IntegerProperty POWER = DaylightDetectorBlock.POWER; + + public CraftDaylightDetector(BlockState state) { + super(state); + } + + @Override + public boolean isInverted() { + return this.get(INVERTED); + } + + @Override + public void setInverted(final boolean inverted) { + this.set(INVERTED, inverted); + } + + @Override + public int getPower() { + return this.get(POWER); + } + + @Override + public void setPower(final int power) { + this.set(POWER, power); + } + + @Override + public int getMaximumPower() { + return POWER.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDecoratedPot.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDecoratedPot.java new file mode 100644 index 0000000000..ac325c52fe --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDecoratedPot.java @@ -0,0 +1,63 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.DecoratedPotBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.DecoratedPot; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftDecoratedPot extends CraftBlockData implements DecoratedPot { + private static final BooleanProperty CRACKED = DecoratedPotBlock.CRACKED; + + private static final DirectionProperty HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; + + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CraftDecoratedPot(BlockState state) { + super(state); + } + + @Override + public boolean isCracked() { + return this.get(CRACKED); + } + + @Override + public void setCracked(final boolean cracked) { + this.set(CRACKED, cracked); + } + + @Override + public BlockFace getFacing() { + return this.get(HORIZONTAL_FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(HORIZONTAL_FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(HORIZONTAL_FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDetectorRail.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDetectorRail.java new file mode 100644 index 0000000000..e3f9072ae9 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDetectorRail.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.DetectorRailBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.RailShape; +import org.bukkit.block.data.type.RedstoneRail; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftDetectorRail extends CraftBlockData implements RedstoneRail { + private static final BooleanProperty POWERED = DetectorRailBlock.POWERED; + + private static final EnumProperty SHAPE = DetectorRailBlock.SHAPE; + + private static final BooleanProperty WATERLOGGED = DetectorRailBlock.WATERLOGGED; + + public CraftDetectorRail(BlockState state) { + super(state); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public org.bukkit.block.data.Rail.Shape getShape() { + return this.get(SHAPE, org.bukkit.block.data.Rail.Shape.class); + } + + @Override + public void setShape(final org.bukkit.block.data.Rail.Shape shape) { + Preconditions.checkArgument(shape != null, "shape cannot be null!"); + Preconditions.checkArgument(shape != org.bukkit.block.data.Rail.Shape.NORTH_EAST && shape != org.bukkit.block.data.Rail.Shape.NORTH_WEST && shape != org.bukkit.block.data.Rail.Shape.SOUTH_EAST && shape != org.bukkit.block.data.Rail.Shape.SOUTH_WEST, "Invalid rail shape, only straight rail are allowed for this property!"); + this.set(SHAPE, shape); + } + + @Override + public Set getShapes() { + return this.getValues(SHAPE, org.bukkit.block.data.Rail.Shape.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDispenser.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDispenser.java new file mode 100644 index 0000000000..f3bd443bd4 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDispenser.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.DispenserBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Dispenser; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftDispenser extends CraftBlockData implements Dispenser { + private static final DirectionProperty FACING = DispenserBlock.FACING; + + private static final BooleanProperty TRIGGERED = DispenserBlock.TRIGGERED; + + public CraftDispenser(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isTriggered() { + return this.get(TRIGGERED); + } + + @Override + public void setTriggered(final boolean triggered) { + this.set(TRIGGERED, triggered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDoor.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDoor.java new file mode 100644 index 0000000000..9947d76a8c --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDoor.java @@ -0,0 +1,91 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.DoorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.DoorHingeSide; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Door; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftDoor extends CraftBlockData implements Door { + private static final DirectionProperty FACING = DoorBlock.FACING; + + private static final EnumProperty HALF = DoorBlock.HALF; + + private static final EnumProperty HINGE = DoorBlock.HINGE; + + private static final BooleanProperty OPEN = DoorBlock.OPEN; + + private static final BooleanProperty POWERED = DoorBlock.POWERED; + + public CraftDoor(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { + return this.get(HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(final org.bukkit.block.data.Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } + + @Override + public Door.Hinge getHinge() { + return this.get(HINGE, Door.Hinge.class); + } + + @Override + public void setHinge(final Door.Hinge hinge) { + Preconditions.checkArgument(hinge != null, "hinge cannot be null!"); + this.set(HINGE, hinge); + } + + @Override + public boolean isOpen() { + return this.get(OPEN); + } + + @Override + public void setOpen(final boolean open) { + this.set(OPEN, open); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDoublePlant.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDoublePlant.java new file mode 100644 index 0000000000..139d946a06 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDoublePlant.java @@ -0,0 +1,30 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.DoublePlantBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.data.Bisected; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftDoublePlant extends CraftBlockData implements Bisected { + private static final EnumProperty HALF = DoublePlantBlock.HALF; + + public CraftDoublePlant(BlockState state) { + super(state); + } + + @Override + public Bisected.Half getHalf() { + return this.get(HALF, Bisected.Half.class); + } + + @Override + public void setHalf(final Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDropper.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDropper.java new file mode 100644 index 0000000000..8b93006cff --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDropper.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.DropperBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Dispenser; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftDropper extends CraftBlockData implements Dispenser { + private static final DirectionProperty FACING = DropperBlock.FACING; + + private static final BooleanProperty TRIGGERED = DropperBlock.TRIGGERED; + + public CraftDropper(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isTriggered() { + return this.get(TRIGGERED); + } + + @Override + public void setTriggered(final boolean triggered) { + this.set(TRIGGERED, triggered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndPortalFrame.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndPortalFrame.java new file mode 100644 index 0000000000..2ab31f0119 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndPortalFrame.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.EndPortalFrameBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.EndPortalFrame; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftEndPortalFrame extends CraftBlockData implements EndPortalFrame { + private static final BooleanProperty HAS_EYE = EndPortalFrameBlock.HAS_EYE; + + private static final DirectionProperty FACING = EndPortalFrameBlock.FACING; + + public CraftEndPortalFrame(BlockState state) { + super(state); + } + + @Override + public boolean hasEye() { + return this.get(HAS_EYE); + } + + @Override + public void setEye(final boolean eye) { + this.set(HAS_EYE, eye); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndRod.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndRod.java new file mode 100644 index 0000000000..7df01dfe00 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndRod.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.EndRodBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftEndRod extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = EndRodBlock.FACING; + + public CraftEndRod(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEnderChest.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEnderChest.java new file mode 100644 index 0000000000..9a58792639 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEnderChest.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.EnderChestBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.EnderChest; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftEnderChest extends CraftBlockData implements EnderChest { + private static final DirectionProperty FACING = EnderChestBlock.FACING; + + private static final BooleanProperty WATERLOGGED = EnderChestBlock.WATERLOGGED; + + public CraftEnderChest(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEquipableCarvedPumpkin.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEquipableCarvedPumpkin.java new file mode 100644 index 0000000000..9704cbd819 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEquipableCarvedPumpkin.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.EquipableCarvedPumpkinBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftEquipableCarvedPumpkin extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = EquipableCarvedPumpkinBlock.FACING; + + public CraftEquipableCarvedPumpkin(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFarm.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFarm.java new file mode 100644 index 0000000000..f4d02abddd --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFarm.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.FarmBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Farmland; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftFarm extends CraftBlockData implements Farmland { + private static final IntegerProperty MOISTURE = FarmBlock.MOISTURE; + + public CraftFarm(BlockState state) { + super(state); + } + + @Override + public int getMoisture() { + return this.get(MOISTURE); + } + + @Override + public void setMoisture(final int moisture) { + this.set(MOISTURE, moisture); + } + + @Override + public int getMaximumMoisture() { + return MOISTURE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFence.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFence.java new file mode 100644 index 0000000000..a9cff53068 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFence.java @@ -0,0 +1,73 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.FenceBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Fence; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftFence extends CraftBlockData implements Fence { + private static final BooleanProperty WATERLOGGED = FenceBlock.WATERLOGGED; + + private static final Map PROPERTY_BY_DIRECTION = Map.of( + BlockFace.EAST, FenceBlock.EAST, + BlockFace.NORTH, FenceBlock.NORTH, + BlockFace.SOUTH, FenceBlock.SOUTH, + BlockFace.WEST, FenceBlock.WEST + ); + + public CraftFence(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFenceGate.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFenceGate.java new file mode 100644 index 0000000000..3175ae05a3 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFenceGate.java @@ -0,0 +1,74 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.FenceGateBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Gate; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftFenceGate extends CraftBlockData implements Gate { + private static final DirectionProperty FACING = FenceGateBlock.FACING; + + private static final BooleanProperty IN_WALL = FenceGateBlock.IN_WALL; + + private static final BooleanProperty OPEN = FenceGateBlock.OPEN; + + private static final BooleanProperty POWERED = FenceGateBlock.POWERED; + + public CraftFenceGate(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isInWall() { + return this.get(IN_WALL); + } + + @Override + public void setInWall(final boolean inWall) { + this.set(IN_WALL, inWall); + } + + @Override + public boolean isOpen() { + return this.get(OPEN); + } + + @Override + public void setOpen(final boolean open) { + this.set(OPEN, open); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFire.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFire.java new file mode 100644 index 0000000000..e3ffd9cfbb --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFire.java @@ -0,0 +1,80 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.FireBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Fire; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftFire extends CraftBlockData implements Fire { + private static final IntegerProperty AGE = FireBlock.AGE; + + private static final Map PROPERTY_BY_DIRECTION = Map.of( + BlockFace.EAST, FireBlock.EAST, + BlockFace.NORTH, FireBlock.NORTH, + BlockFace.SOUTH, FireBlock.SOUTH, + BlockFace.UP, FireBlock.UP, + BlockFace.WEST, FireBlock.WEST + ); + + public CraftFire(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFrostedIce.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFrostedIce.java new file mode 100644 index 0000000000..bfe0128884 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFrostedIce.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.FrostedIceBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftFrostedIce extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = FrostedIceBlock.AGE; + + public CraftFrostedIce(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFurnace.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFurnace.java new file mode 100644 index 0000000000..81b2c18847 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFurnace.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.FurnaceBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftFurnace extends CraftBlockData implements Furnace { + private static final DirectionProperty FACING = FurnaceBlock.FACING; + + private static final BooleanProperty LIT = FurnaceBlock.LIT; + + public CraftFurnace(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlazedTerracotta.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlazedTerracotta.java new file mode 100644 index 0000000000..5640d16647 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlazedTerracotta.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.GlazedTerracottaBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftGlazedTerracotta extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = GlazedTerracottaBlock.FACING; + + public CraftGlazedTerracotta(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlowLichen.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlowLichen.java new file mode 100644 index 0000000000..3815d28d98 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlowLichen.java @@ -0,0 +1,75 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.GlowLichen; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftGlowLichen extends CraftBlockData implements GlowLichen { + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + private static final Map PROPERTY_BY_DIRECTION = Map.of( + BlockFace.DOWN, BlockStateProperties.DOWN, + BlockFace.EAST, BlockStateProperties.EAST, + BlockFace.NORTH, BlockStateProperties.NORTH, + BlockFace.SOUTH, BlockStateProperties.SOUTH, + BlockFace.UP, BlockStateProperties.UP, + BlockFace.WEST, BlockStateProperties.WEST + ); + + public CraftGlowLichen(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGrass.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGrass.java new file mode 100644 index 0000000000..63a707674e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGrass.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.GrassBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Snowable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftGrass extends CraftBlockData implements Snowable { + private static final BooleanProperty SNOWY = GrassBlock.SNOWY; + + public CraftGrass(BlockState state) { + super(state); + } + + @Override + public boolean isSnowy() { + return this.get(SNOWY); + } + + @Override + public void setSnowy(final boolean snowy) { + this.set(SNOWY, snowy); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGrindstone.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGrindstone.java new file mode 100644 index 0000000000..6ec1902ad5 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGrindstone.java @@ -0,0 +1,53 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.GrindstoneBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.AttachFace; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Grindstone; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftGrindstone extends CraftBlockData implements Grindstone { + private static final EnumProperty FACE = GrindstoneBlock.FACE; + + private static final DirectionProperty FACING = GrindstoneBlock.FACING; + + public CraftGrindstone(BlockState state) { + super(state); + } + + @Override + public org.bukkit.block.data.FaceAttachable.AttachedFace getAttachedFace() { + return this.get(FACE, org.bukkit.block.data.FaceAttachable.AttachedFace.class); + } + + @Override + public void setAttachedFace( + final org.bukkit.block.data.FaceAttachable.AttachedFace attachedFace) { + Preconditions.checkArgument(attachedFace != null, "attachedFace cannot be null!"); + this.set(FACE, attachedFace); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHangingRoots.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHangingRoots.java new file mode 100644 index 0000000000..2663b93321 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHangingRoots.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftHangingRoots extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CraftHangingRoots(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHay.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHay.java new file mode 100644 index 0000000000..c569f02aec --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHay.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.HayBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.Axis; +import org.bukkit.block.data.Orientable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftHay extends CraftBlockData implements Orientable { + private static final EnumProperty AXIS = HayBlock.AXIS; + + public CraftHay(BlockState state) { + super(state); + } + + @Override + public Axis getAxis() { + return this.get(AXIS, Axis.class); + } + + @Override + public void setAxis(final Axis axis) { + Preconditions.checkArgument(axis != null, "axis cannot be null!"); + this.set(AXIS, axis); + } + + @Override + public Set getAxes() { + return this.getValues(AXIS, Axis.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHeavyCore.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHeavyCore.java new file mode 100644 index 0000000000..75fd562e0a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHeavyCore.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftHeavyCore extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CraftHeavyCore(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHopper.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHopper.java new file mode 100644 index 0000000000..33ee88ffe1 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHopper.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.HopperBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Hopper; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftHopper extends CraftBlockData implements Hopper { + private static final BooleanProperty ENABLED = HopperBlock.ENABLED; + + private static final DirectionProperty FACING = HopperBlock.FACING; + + public CraftHopper(BlockState state) { + super(state); + } + + @Override + public boolean isEnabled() { + return this.get(ENABLED); + } + + @Override + public void setEnabled(final boolean enabled) { + this.set(ENABLED, enabled); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace != BlockFace.UP, "Invalid face, only cartesian face (excluding UP) are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHugeMushroom.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHugeMushroom.java new file mode 100644 index 0000000000..9e621a1a6b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHugeMushroom.java @@ -0,0 +1,63 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.HugeMushroomBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.MultipleFacing; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftHugeMushroom extends CraftBlockData implements MultipleFacing { + private static final Map PROPERTY_BY_DIRECTION = Map.of( + BlockFace.DOWN, HugeMushroomBlock.DOWN, + BlockFace.EAST, HugeMushroomBlock.EAST, + BlockFace.NORTH, HugeMushroomBlock.NORTH, + BlockFace.SOUTH, HugeMushroomBlock.SOUTH, + BlockFace.UP, HugeMushroomBlock.UP, + BlockFace.WEST, HugeMushroomBlock.WEST + ); + + public CraftHugeMushroom(BlockState state) { + super(state); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftInfestedRotatedPillar.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftInfestedRotatedPillar.java new file mode 100644 index 0000000000..727beb441b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftInfestedRotatedPillar.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.Axis; +import org.bukkit.block.data.Orientable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftInfestedRotatedPillar extends CraftBlockData implements Orientable { + private static final EnumProperty AXIS = BlockStateProperties.AXIS; + + public CraftInfestedRotatedPillar(BlockState state) { + super(state); + } + + @Override + public Axis getAxis() { + return this.get(AXIS, Axis.class); + } + + @Override + public void setAxis(final Axis axis) { + Preconditions.checkArgument(axis != null, "axis cannot be null!"); + this.set(AXIS, axis); + } + + @Override + public Set getAxes() { + return this.getValues(AXIS, Axis.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftIronBars.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftIronBars.java new file mode 100644 index 0000000000..87ed012190 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftIronBars.java @@ -0,0 +1,73 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.IronBarsBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Fence; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftIronBars extends CraftBlockData implements Fence { + private static final BooleanProperty WATERLOGGED = IronBarsBlock.WATERLOGGED; + + private static final Map PROPERTY_BY_DIRECTION = Map.of( + BlockFace.EAST, IronBarsBlock.EAST, + BlockFace.NORTH, IronBarsBlock.NORTH, + BlockFace.SOUTH, IronBarsBlock.SOUTH, + BlockFace.WEST, IronBarsBlock.WEST + ); + + public CraftIronBars(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftJigsaw.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftJigsaw.java new file mode 100644 index 0000000000..67f4965c1f --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftJigsaw.java @@ -0,0 +1,30 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.core.FrontAndTop; +import net.minecraft.world.level.block.JigsawBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.data.type.Jigsaw; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftJigsaw extends CraftBlockData implements Jigsaw { + private static final EnumProperty ORIENTATION = JigsawBlock.ORIENTATION; + + public CraftJigsaw(BlockState state) { + super(state); + } + + @Override + public org.bukkit.block.Orientation getOrientation() { + return this.get(ORIENTATION, org.bukkit.block.Orientation.class); + } + + @Override + public void setOrientation(final org.bukkit.block.Orientation orientation) { + Preconditions.checkArgument(orientation != null, "orientation cannot be null!"); + this.set(ORIENTATION, orientation); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftJukebox.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftJukebox.java new file mode 100644 index 0000000000..15908a2abc --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftJukebox.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.JukeboxBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.Jukebox; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftJukebox extends CraftBlockData implements Jukebox { + private static final BooleanProperty HAS_RECORD = JukeboxBlock.HAS_RECORD; + + public CraftJukebox(BlockState state) { + super(state); + } + + @Override + public boolean hasRecord() { + return this.get(HAS_RECORD); + } + + @Override + public void setHasRecord(final boolean hasRecord) { + this.set(HAS_RECORD, hasRecord); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftKelp.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftKelp.java new file mode 100644 index 0000000000..8a066d2124 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftKelp.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.KelpBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftKelp extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = KelpBlock.AGE; + + public CraftKelp(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLadder.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLadder.java new file mode 100644 index 0000000000..0ae2fd66ef --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLadder.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.LadderBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Ladder; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLadder extends CraftBlockData implements Ladder { + private static final DirectionProperty FACING = LadderBlock.FACING; + + private static final BooleanProperty WATERLOGGED = LadderBlock.WATERLOGGED; + + public CraftLadder(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLantern.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLantern.java new file mode 100644 index 0000000000..4eaee8c409 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLantern.java @@ -0,0 +1,39 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.LanternBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.Lantern; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLantern extends CraftBlockData implements Lantern { + private static final BooleanProperty HANGING = LanternBlock.HANGING; + + private static final BooleanProperty WATERLOGGED = LanternBlock.WATERLOGGED; + + public CraftLantern(BlockState state) { + super(state); + } + + @Override + public boolean isHanging() { + return this.get(HANGING); + } + + @Override + public void setHanging(final boolean hanging) { + this.set(HANGING, hanging); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLayeredCauldron.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLayeredCauldron.java new file mode 100644 index 0000000000..aa18f6692b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLayeredCauldron.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.LayeredCauldronBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Levelled; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLayeredCauldron extends CraftBlockData implements Levelled { + private static final IntegerProperty LEVEL = LayeredCauldronBlock.LEVEL; + + public CraftLayeredCauldron(BlockState state) { + super(state); + } + + @Override + public int getLevel() { + return this.get(LEVEL); + } + + @Override + public void setLevel(final int level) { + this.set(LEVEL, level); + } + + @Override + public int getMinimumLevel() { + return LEVEL.min; + } + + @Override + public int getMaximumLevel() { + return LEVEL.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLeaves.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLeaves.java new file mode 100644 index 0000000000..2b5ca923a7 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLeaves.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.LeavesBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Leaves; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLeaves extends CraftBlockData implements Leaves { + private static final IntegerProperty DISTANCE = LeavesBlock.DISTANCE; + + private static final BooleanProperty PERSISTENT = LeavesBlock.PERSISTENT; + + private static final BooleanProperty WATERLOGGED = LeavesBlock.WATERLOGGED; + + public CraftLeaves(BlockState state) { + super(state); + } + + @Override + public int getDistance() { + return this.get(DISTANCE); + } + + @Override + public void setDistance(final int distance) { + this.set(DISTANCE, distance); + } + + @Override + public int getMinimumDistance() { + return DISTANCE.min; + } + + @Override + public int getMaximumDistance() { + return DISTANCE.max; + } + + @Override + public boolean isPersistent() { + return this.get(PERSISTENT); + } + + @Override + public void setPersistent(final boolean persistent) { + this.set(PERSISTENT, persistent); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLectern.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLectern.java new file mode 100644 index 0000000000..82443701af --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLectern.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.LecternBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Lectern; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLectern extends CraftBlockData implements Lectern { + private static final DirectionProperty FACING = LecternBlock.FACING; + + private static final BooleanProperty HAS_BOOK = LecternBlock.HAS_BOOK; + + private static final BooleanProperty POWERED = LecternBlock.POWERED; + + public CraftLectern(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean hasBook() { + return this.get(HAS_BOOK); + } + + @Override + public void setHasBook(final boolean hasBook) { + this.set(HAS_BOOK, hasBook); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLever.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLever.java new file mode 100644 index 0000000000..8a18039f55 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLever.java @@ -0,0 +1,66 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.LeverBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.AttachFace; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Switch; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLever extends CraftBlockData implements Switch { + private static final EnumProperty FACE = LeverBlock.FACE; + + private static final DirectionProperty FACING = LeverBlock.FACING; + + private static final BooleanProperty POWERED = LeverBlock.POWERED; + + public CraftLever(BlockState state) { + super(state); + } + + @Override + public org.bukkit.block.data.FaceAttachable.AttachedFace getAttachedFace() { + return this.get(FACE, org.bukkit.block.data.FaceAttachable.AttachedFace.class); + } + + @Override + public void setAttachedFace( + final org.bukkit.block.data.FaceAttachable.AttachedFace attachedFace) { + Preconditions.checkArgument(attachedFace != null, "attachedFace cannot be null!"); + this.set(FACE, attachedFace); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLight.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLight.java new file mode 100644 index 0000000000..fc96e16f31 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLight.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.LightBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Light; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLight extends CraftBlockData implements Light { + private static final IntegerProperty LEVEL = LightBlock.LEVEL; + + private static final BooleanProperty WATERLOGGED = LightBlock.WATERLOGGED; + + public CraftLight(BlockState state) { + super(state); + } + + @Override + public int getLevel() { + return this.get(LEVEL); + } + + @Override + public void setLevel(final int level) { + this.set(LEVEL, level); + } + + @Override + public int getMinimumLevel() { + return LEVEL.min; + } + + @Override + public int getMaximumLevel() { + return LEVEL.max; + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLightningRod.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLightningRod.java new file mode 100644 index 0000000000..1f4f6df1f2 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLightningRod.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.LightningRodBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.LightningRod; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLightningRod extends CraftBlockData implements LightningRod { + private static final DirectionProperty FACING = LightningRodBlock.FACING; + + private static final BooleanProperty POWERED = LightningRodBlock.POWERED; + + private static final BooleanProperty WATERLOGGED = LightningRodBlock.WATERLOGGED; + + public CraftLightningRod(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLiquid.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLiquid.java new file mode 100644 index 0000000000..1d397cbaa3 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLiquid.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.LiquidBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Levelled; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLiquid extends CraftBlockData implements Levelled { + private static final IntegerProperty LEVEL = LiquidBlock.LEVEL; + + public CraftLiquid(BlockState state) { + super(state); + } + + @Override + public int getLevel() { + return this.get(LEVEL); + } + + @Override + public void setLevel(final int level) { + this.set(LEVEL, level); + } + + @Override + public int getMinimumLevel() { + return LEVEL.min; + } + + @Override + public int getMaximumLevel() { + return LEVEL.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLoom.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLoom.java new file mode 100644 index 0000000000..d4f69a402e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLoom.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.LoomBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftLoom extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = LoomBlock.FACING; + + public CraftLoom(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java new file mode 100644 index 0000000000..ab250d9d2e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.MangroveLeavesBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Leaves; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftMangroveLeaves extends CraftBlockData implements Leaves { + private static final IntegerProperty DISTANCE = MangroveLeavesBlock.DISTANCE; + + private static final BooleanProperty PERSISTENT = MangroveLeavesBlock.PERSISTENT; + + private static final BooleanProperty WATERLOGGED = MangroveLeavesBlock.WATERLOGGED; + + public CraftMangroveLeaves(BlockState state) { + super(state); + } + + @Override + public int getDistance() { + return this.get(DISTANCE); + } + + @Override + public void setDistance(final int distance) { + this.set(DISTANCE, distance); + } + + @Override + public int getMinimumDistance() { + return DISTANCE.min; + } + + @Override + public int getMaximumDistance() { + return DISTANCE.max; + } + + @Override + public boolean isPersistent() { + return this.get(PERSISTENT); + } + + @Override + public void setPersistent(final boolean persistent) { + this.set(PERSISTENT, persistent); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangrovePropagule.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangrovePropagule.java new file mode 100644 index 0000000000..dae9cd0381 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangrovePropagule.java @@ -0,0 +1,75 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.MangrovePropaguleBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.MangrovePropagule; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftMangrovePropagule extends CraftBlockData implements MangrovePropagule { + private static final IntegerProperty AGE = MangrovePropaguleBlock.AGE; + + private static final BooleanProperty HANGING = MangrovePropaguleBlock.HANGING; + + private static final IntegerProperty STAGE = MangrovePropaguleBlock.STAGE; + + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CraftMangrovePropagule(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } + + @Override + public boolean isHanging() { + return this.get(HANGING); + } + + @Override + public void setHanging(final boolean hanging) { + this.set(HANGING, hanging); + } + + @Override + public int getStage() { + return this.get(STAGE); + } + + @Override + public void setStage(final int stage) { + this.set(STAGE, stage); + } + + @Override + public int getMaximumStage() { + return STAGE.max; + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangroveRoots.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangroveRoots.java new file mode 100644 index 0000000000..f78d51835e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangroveRoots.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.MangroveRootsBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftMangroveRoots extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = MangroveRootsBlock.WATERLOGGED; + + public CraftMangroveRoots(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMovingPiston.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMovingPiston.java new file mode 100644 index 0000000000..f1d33e167c --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMovingPiston.java @@ -0,0 +1,52 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.piston.MovingPistonBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.PistonType; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.TechnicalPiston; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftMovingPiston extends CraftBlockData implements TechnicalPiston { + private static final DirectionProperty FACING = MovingPistonBlock.FACING; + + private static final EnumProperty TYPE = MovingPistonBlock.TYPE; + + public CraftMovingPiston(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public TechnicalPiston.Type getType() { + return this.get(TYPE, TechnicalPiston.Type.class); + } + + @Override + public void setType(final TechnicalPiston.Type type) { + Preconditions.checkArgument(type != null, "type cannot be null!"); + this.set(TYPE, type); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMycelium.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMycelium.java new file mode 100644 index 0000000000..d22640474a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMycelium.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.MyceliumBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Snowable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftMycelium extends CraftBlockData implements Snowable { + private static final BooleanProperty SNOWY = MyceliumBlock.SNOWY; + + public CraftMycelium(BlockState state) { + super(state); + } + + @Override + public boolean isSnowy() { + return this.get(SNOWY); + } + + @Override + public void setSnowy(final boolean snowy) { + this.set(SNOWY, snowy); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNetherPortal.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNetherPortal.java new file mode 100644 index 0000000000..3894cdd2a1 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNetherPortal.java @@ -0,0 +1,38 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.NetherPortalBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.Axis; +import org.bukkit.block.data.Orientable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftNetherPortal extends CraftBlockData implements Orientable { + private static final EnumProperty AXIS = NetherPortalBlock.AXIS; + + public CraftNetherPortal(BlockState state) { + super(state); + } + + @Override + public Axis getAxis() { + return this.get(AXIS, Axis.class); + } + + @Override + public void setAxis(final Axis axis) { + Preconditions.checkArgument(axis != null, "axis cannot be null!"); + Preconditions.checkArgument(axis == Axis.X || axis == Axis.Z, "Invalid axis, only horizontal axis are allowed for this property!"); + this.set(AXIS, axis); + } + + @Override + public Set getAxes() { + return this.getValues(AXIS, Axis.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNetherWart.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNetherWart.java new file mode 100644 index 0000000000..93fe3c7ee0 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNetherWart.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.NetherWartBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftNetherWart extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = NetherWartBlock.AGE; + + public CraftNetherWart(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNoteBlock.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNoteBlock.java new file mode 100644 index 0000000000..cf7b93439b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNoteBlock.java @@ -0,0 +1,58 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; +import org.bukkit.Instrument; +import org.bukkit.Note; +import org.bukkit.block.data.type.NoteBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftNoteBlock extends CraftBlockData implements NoteBlock { + private static final EnumProperty INSTRUMENT = net.minecraft.world.level.block.NoteBlock.INSTRUMENT; + + private static final IntegerProperty NOTE = net.minecraft.world.level.block.NoteBlock.NOTE; + + private static final BooleanProperty POWERED = net.minecraft.world.level.block.NoteBlock.POWERED; + + public CraftNoteBlock(BlockState state) { + super(state); + } + + @Override + public Instrument getInstrument() { + return this.get(INSTRUMENT, Instrument.class); + } + + @Override + public void setInstrument(final Instrument instrument) { + Preconditions.checkArgument(instrument != null, "instrument cannot be null!"); + this.set(INSTRUMENT, instrument); + } + + @Override + public Note getNote() { + return new Note(this.get(NOTE)); + } + + @Override + public void setNote(final Note note) { + Preconditions.checkArgument(note != null, "note cannot be null!"); + this.set(NOTE, (int) note.getId()); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftObserver.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftObserver.java new file mode 100644 index 0000000000..fa99524550 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftObserver.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.ObserverBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Observer; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftObserver extends CraftBlockData implements Observer { + private static final DirectionProperty FACING = ObserverBlock.FACING; + + private static final BooleanProperty POWERED = ObserverBlock.POWERED; + + public CraftObserver(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.java new file mode 100644 index 0000000000..2aca502f32 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.PiglinWallSkullBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPiglinWallSkull extends CraftBlockData implements WallSkull { + private static final DirectionProperty FACING = PiglinWallSkullBlock.FACING; + + private static final BooleanProperty POWERED = PiglinWallSkullBlock.POWERED; + + public CraftPiglinWallSkull(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPinkPetals.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPinkPetals.java new file mode 100644 index 0000000000..f25a7d14e4 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPinkPetals.java @@ -0,0 +1,60 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.PinkPetalsBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.PinkPetals; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPinkPetals extends CraftBlockData implements PinkPetals { + private static final DirectionProperty FACING = PinkPetalsBlock.FACING; + + private static final IntegerProperty AMOUNT = PinkPetalsBlock.AMOUNT; + + public CraftPinkPetals(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public int getFlowerAmount() { + return this.get(AMOUNT); + } + + @Override + public void setFlowerAmount(final int flowerAmount) { + this.set(AMOUNT, flowerAmount); + } + + @Override + public int getMinimumFlowerAmount() { + return AMOUNT.min; + } + + @Override + public int getMaximumFlowerAmount() { + return AMOUNT.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonBase.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonBase.java new file mode 100644 index 0000000000..46385cca60 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonBase.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.piston.PistonBaseBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Piston; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPistonBase extends CraftBlockData implements Piston { + private static final BooleanProperty EXTENDED = PistonBaseBlock.EXTENDED; + + private static final DirectionProperty FACING = PistonBaseBlock.FACING; + + public CraftPistonBase(BlockState state) { + super(state); + } + + @Override + public boolean isExtended() { + return this.get(EXTENDED); + } + + @Override + public void setExtended(final boolean extended) { + this.set(EXTENDED, extended); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonHead.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonHead.java new file mode 100644 index 0000000000..df7e61d36f --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonHead.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.piston.PistonHeadBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.PistonType; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.PistonHead; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPistonHead extends CraftBlockData implements PistonHead { + private static final DirectionProperty FACING = PistonHeadBlock.FACING; + + private static final BooleanProperty SHORT = PistonHeadBlock.SHORT; + + private static final EnumProperty TYPE = PistonHeadBlock.TYPE; + + public CraftPistonHead(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isShort() { + return this.get(SHORT); + } + + @Override + public void setShort(final boolean _short) { + this.set(SHORT, _short); + } + + @Override + public org.bukkit.block.data.type.TechnicalPiston.Type getType() { + return this.get(TYPE, org.bukkit.block.data.type.TechnicalPiston.Type.class); + } + + @Override + public void setType(final org.bukkit.block.data.type.TechnicalPiston.Type type) { + Preconditions.checkArgument(type != null, "type cannot be null!"); + this.set(TYPE, type); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPitcherCrop.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPitcherCrop.java new file mode 100644 index 0000000000..482ee15a49 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPitcherCrop.java @@ -0,0 +1,48 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.PitcherCropBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.PitcherCrop; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPitcherCrop extends CraftBlockData implements PitcherCrop { + private static final IntegerProperty AGE = PitcherCropBlock.AGE; + + private static final EnumProperty HALF = PitcherCropBlock.HALF; + + public CraftPitcherCrop(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { + return this.get(HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(final org.bukkit.block.data.Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerHead.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerHead.java new file mode 100644 index 0000000000..926940f529 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerHead.java @@ -0,0 +1,48 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.PlayerHeadBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.RotationSegment; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Skull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.util.Vector; + +@GeneratedFrom("1.21.1") +public class CraftPlayerHead extends CraftBlockData implements Skull { + private static final BooleanProperty POWERED = PlayerHeadBlock.POWERED; + + private static final IntegerProperty ROTATION = PlayerHeadBlock.ROTATION; + + public CraftPlayerHead(BlockState state) { + super(state); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public BlockFace getRotation() { + return CraftBlockData.ROTATION_CYCLE[this.get(ROTATION)]; + } + + @Override + public void setRotation(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace != BlockFace.SELF && blockFace.getModY() == 0, "Invalid face, only horizontal face are allowed for this property!"); + Vector dir = blockFace.getDirection(); + float angle = (float) -Math.toDegrees(Math.atan2(dir.getX(), dir.getZ())); + this.set(ROTATION, RotationSegment.convertToSegment(angle)); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerWallHead.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerWallHead.java new file mode 100644 index 0000000000..1ed11c2bee --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerWallHead.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.PlayerWallHeadBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPlayerWallHead extends CraftBlockData implements WallSkull { + private static final DirectionProperty FACING = PlayerWallHeadBlock.FACING; + + private static final BooleanProperty POWERED = PlayerWallHeadBlock.POWERED; + + public CraftPlayerWallHead(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPointedDripstone.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPointedDripstone.java new file mode 100644 index 0000000000..0bae245cd2 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPointedDripstone.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.PointedDripstoneBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.DripstoneThickness; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.PointedDripstone; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPointedDripstone extends CraftBlockData implements PointedDripstone { + private static final EnumProperty THICKNESS = PointedDripstoneBlock.THICKNESS; + + private static final DirectionProperty TIP_DIRECTION = PointedDripstoneBlock.TIP_DIRECTION; + + private static final BooleanProperty WATERLOGGED = PointedDripstoneBlock.WATERLOGGED; + + public CraftPointedDripstone(BlockState state) { + super(state); + } + + @Override + public PointedDripstone.Thickness getThickness() { + return this.get(THICKNESS, PointedDripstone.Thickness.class); + } + + @Override + public void setThickness(final PointedDripstone.Thickness thickness) { + Preconditions.checkArgument(thickness != null, "thickness cannot be null!"); + this.set(THICKNESS, thickness); + } + + @Override + public BlockFace getVerticalDirection() { + return this.get(TIP_DIRECTION, BlockFace.class); + } + + @Override + public void setVerticalDirection(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.getModY() != 0, "Invalid face, only vertical face are allowed for this property!"); + this.set(TIP_DIRECTION, blockFace); + } + + @Override + public Set getVerticalDirections() { + return this.getValues(TIP_DIRECTION, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPotato.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPotato.java new file mode 100644 index 0000000000..da8f5d5202 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPotato.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.PotatoBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPotato extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = PotatoBlock.AGE; + + public CraftPotato(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPoweredRail.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPoweredRail.java new file mode 100644 index 0000000000..05d6425fbf --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPoweredRail.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.PoweredRailBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.RailShape; +import org.bukkit.block.data.type.RedstoneRail; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPoweredRail extends CraftBlockData implements RedstoneRail { + private static final BooleanProperty POWERED = PoweredRailBlock.POWERED; + + private static final EnumProperty SHAPE = PoweredRailBlock.SHAPE; + + private static final BooleanProperty WATERLOGGED = PoweredRailBlock.WATERLOGGED; + + public CraftPoweredRail(BlockState state) { + super(state); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public org.bukkit.block.data.Rail.Shape getShape() { + return this.get(SHAPE, org.bukkit.block.data.Rail.Shape.class); + } + + @Override + public void setShape(final org.bukkit.block.data.Rail.Shape shape) { + Preconditions.checkArgument(shape != null, "shape cannot be null!"); + Preconditions.checkArgument(shape != org.bukkit.block.data.Rail.Shape.NORTH_EAST && shape != org.bukkit.block.data.Rail.Shape.NORTH_WEST && shape != org.bukkit.block.data.Rail.Shape.SOUTH_EAST && shape != org.bukkit.block.data.Rail.Shape.SOUTH_WEST, "Invalid rail shape, only straight rail are allowed for this property!"); + this.set(SHAPE, shape); + } + + @Override + public Set getShapes() { + return this.getValues(SHAPE, org.bukkit.block.data.Rail.Shape.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPressurePlate.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPressurePlate.java new file mode 100644 index 0000000000..573797c962 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPressurePlate.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.PressurePlateBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Powerable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftPressurePlate extends CraftBlockData implements Powerable { + private static final BooleanProperty POWERED = PressurePlateBlock.POWERED; + + public CraftPressurePlate(BlockState state) { + super(state); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRail.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRail.java new file mode 100644 index 0000000000..5c06200b83 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRail.java @@ -0,0 +1,49 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.RailBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.RailShape; +import org.bukkit.block.data.Rail; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRail extends CraftBlockData implements Rail { + private static final EnumProperty SHAPE = RailBlock.SHAPE; + + private static final BooleanProperty WATERLOGGED = RailBlock.WATERLOGGED; + + public CraftRail(BlockState state) { + super(state); + } + + @Override + public Rail.Shape getShape() { + return this.get(SHAPE, Rail.Shape.class); + } + + @Override + public void setShape(final Rail.Shape shape) { + Preconditions.checkArgument(shape != null, "shape cannot be null!"); + this.set(SHAPE, shape); + } + + @Override + public Set getShapes() { + return this.getValues(SHAPE, Rail.Shape.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedStoneOre.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedStoneOre.java new file mode 100644 index 0000000000..5aceeddbaa --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedStoneOre.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.RedStoneOreBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Lightable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRedStoneOre extends CraftBlockData implements Lightable { + private static final BooleanProperty LIT = RedStoneOreBlock.LIT; + + public CraftRedStoneOre(BlockState state) { + super(state); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedStoneWire.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedStoneWire.java new file mode 100644 index 0000000000..58903bc46b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedStoneWire.java @@ -0,0 +1,66 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.RedStoneWireBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.RedstoneSide; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.RedstoneWire; +import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRedStoneWire extends CraftBlockData implements RedstoneWire { + private static final IntegerProperty POWER = RedStoneWireBlock.POWER; + + private static final Map> PROPERTY_BY_DIRECTION = RedStoneWireBlock.PROPERTY_BY_DIRECTION.entrySet().stream() + .collect(Collectors.toMap(entry -> CraftBlock.notchToBlockFace(entry.getKey()), entry -> entry.getValue())); + + public CraftRedStoneWire(BlockState state) { + super(state); + } + + @Override + public int getPower() { + return this.get(POWER); + } + + @Override + public void setPower(final int power) { + this.set(POWER, power); + } + + @Override + public int getMaximumPower() { + return POWER.max; + } + + @Override + public RedstoneWire.Connection getFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + EnumProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property, RedstoneWire.Connection.class); + } + + @Override + public void setFace(final BlockFace blockFace, final RedstoneWire.Connection connection) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(connection != null, "connection cannot be null!"); + EnumProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, connection); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneLamp.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneLamp.java new file mode 100644 index 0000000000..1a0a162ce7 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneLamp.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.RedstoneLampBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Lightable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRedstoneLamp extends CraftBlockData implements Lightable { + private static final BooleanProperty LIT = RedstoneLampBlock.LIT; + + public CraftRedstoneLamp(BlockState state) { + super(state); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneTorch.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneTorch.java new file mode 100644 index 0000000000..3f7ed133d3 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneTorch.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.RedstoneTorchBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Lightable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRedstoneTorch extends CraftBlockData implements Lightable { + private static final BooleanProperty LIT = RedstoneTorchBlock.LIT; + + public CraftRedstoneTorch(BlockState state) { + super(state); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneWallTorch.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneWallTorch.java new file mode 100644 index 0000000000..33f7da378b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneWallTorch.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.RedstoneWallTorchBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.RedstoneWallTorch; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRedstoneWallTorch extends CraftBlockData implements RedstoneWallTorch { + private static final DirectionProperty FACING = RedstoneWallTorchBlock.FACING; + + private static final BooleanProperty LIT = RedstoneWallTorchBlock.LIT; + + public CraftRedstoneWallTorch(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRepeater.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRepeater.java new file mode 100644 index 0000000000..a0cbec9764 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRepeater.java @@ -0,0 +1,85 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.RepeaterBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Repeater; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRepeater extends CraftBlockData implements Repeater { + private static final IntegerProperty DELAY = RepeaterBlock.DELAY; + + private static final DirectionProperty FACING = RepeaterBlock.FACING; + + private static final BooleanProperty LOCKED = RepeaterBlock.LOCKED; + + private static final BooleanProperty POWERED = RepeaterBlock.POWERED; + + public CraftRepeater(BlockState state) { + super(state); + } + + @Override + public int getDelay() { + return this.get(DELAY); + } + + @Override + public void setDelay(final int delay) { + this.set(DELAY, delay); + } + + @Override + public int getMinimumDelay() { + return DELAY.min; + } + + @Override + public int getMaximumDelay() { + return DELAY.max; + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isLocked() { + return this.get(LOCKED); + } + + @Override + public void setLocked(final boolean locked) { + this.set(LOCKED, locked); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRespawnAnchor.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRespawnAnchor.java new file mode 100644 index 0000000000..d1abae788b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRespawnAnchor.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.RespawnAnchorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.RespawnAnchor; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRespawnAnchor extends CraftBlockData implements RespawnAnchor { + private static final IntegerProperty CHARGE = RespawnAnchorBlock.CHARGE; + + public CraftRespawnAnchor(BlockState state) { + super(state); + } + + @Override + public int getCharges() { + return this.get(CHARGE); + } + + @Override + public void setCharges(final int charges) { + this.set(CHARGE, charges); + } + + @Override + public int getMaximumCharges() { + return CHARGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRotatedPillar.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRotatedPillar.java new file mode 100644 index 0000000000..eebfa9624f --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRotatedPillar.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.RotatedPillarBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.Axis; +import org.bukkit.block.data.Orientable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftRotatedPillar extends CraftBlockData implements Orientable { + private static final EnumProperty AXIS = RotatedPillarBlock.AXIS; + + public CraftRotatedPillar(BlockState state) { + super(state); + } + + @Override + public Axis getAxis() { + return this.get(AXIS, Axis.class); + } + + @Override + public void setAxis(final Axis axis) { + Preconditions.checkArgument(axis != null, "axis cannot be null!"); + this.set(AXIS, axis); + } + + @Override + public Set getAxes() { + return this.getValues(AXIS, Axis.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSapling.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSapling.java new file mode 100644 index 0000000000..d27516a50b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSapling.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SaplingBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Sapling; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSapling extends CraftBlockData implements Sapling { + private static final IntegerProperty STAGE = SaplingBlock.STAGE; + + public CraftSapling(BlockState state) { + super(state); + } + + @Override + public int getStage() { + return this.get(STAGE); + } + + @Override + public void setStage(final int stage) { + this.set(STAGE, stage); + } + + @Override + public int getMaximumStage() { + return STAGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftScaffolding.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftScaffolding.java new file mode 100644 index 0000000000..1ae9400889 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftScaffolding.java @@ -0,0 +1,57 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.ScaffoldingBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Scaffolding; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftScaffolding extends CraftBlockData implements Scaffolding { + private static final BooleanProperty BOTTOM = ScaffoldingBlock.BOTTOM; + + private static final IntegerProperty DISTANCE = ScaffoldingBlock.DISTANCE; + + private static final BooleanProperty WATERLOGGED = ScaffoldingBlock.WATERLOGGED; + + public CraftScaffolding(BlockState state) { + super(state); + } + + @Override + public boolean isBottom() { + return this.get(BOTTOM); + } + + @Override + public void setBottom(final boolean bottom) { + this.set(BOTTOM, bottom); + } + + @Override + public int getDistance() { + return this.get(DISTANCE); + } + + @Override + public void setDistance(final int distance) { + this.set(DISTANCE, distance); + } + + @Override + public int getMaximumDistance() { + return DISTANCE.max; + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkCatalyst.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkCatalyst.java new file mode 100644 index 0000000000..0c50d097d7 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkCatalyst.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SculkCatalystBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.SculkCatalyst; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSculkCatalyst extends CraftBlockData implements SculkCatalyst { + private static final BooleanProperty PULSE = SculkCatalystBlock.PULSE; + + public CraftSculkCatalyst(BlockState state) { + super(state); + } + + @Override + public boolean isBloom() { + return this.get(PULSE); + } + + @Override + public void setBloom(final boolean bloom) { + this.set(PULSE, bloom); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkSensor.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkSensor.java new file mode 100644 index 0000000000..315b03f6ab --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkSensor.java @@ -0,0 +1,61 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SculkSensorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.SculkSensorPhase; +import org.bukkit.block.data.type.SculkSensor; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSculkSensor extends CraftBlockData implements SculkSensor { + private static final IntegerProperty POWER = SculkSensorBlock.POWER; + + private static final EnumProperty PHASE = SculkSensorBlock.PHASE; + + private static final BooleanProperty WATERLOGGED = SculkSensorBlock.WATERLOGGED; + + public CraftSculkSensor(BlockState state) { + super(state); + } + + @Override + public int getPower() { + return this.get(POWER); + } + + @Override + public void setPower(final int power) { + this.set(POWER, power); + } + + @Override + public int getMaximumPower() { + return POWER.max; + } + + @Override + public SculkSensor.Phase getSculkSensorPhase() { + return this.get(PHASE, SculkSensor.Phase.class); + } + + @Override + public void setSculkSensorPhase(final SculkSensor.Phase phase) { + Preconditions.checkArgument(phase != null, "phase cannot be null!"); + this.set(PHASE, phase); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkShrieker.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkShrieker.java new file mode 100644 index 0000000000..0bb33b7db2 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkShrieker.java @@ -0,0 +1,51 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SculkShriekerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.SculkShrieker; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSculkShrieker extends CraftBlockData implements SculkShrieker { + private static final BooleanProperty CAN_SUMMON = SculkShriekerBlock.CAN_SUMMON; + + private static final BooleanProperty SHRIEKING = SculkShriekerBlock.SHRIEKING; + + private static final BooleanProperty WATERLOGGED = SculkShriekerBlock.WATERLOGGED; + + public CraftSculkShrieker(BlockState state) { + super(state); + } + + @Override + public boolean isCanSummon() { + return this.get(CAN_SUMMON); + } + + @Override + public void setCanSummon(final boolean canSummon) { + this.set(CAN_SUMMON, canSummon); + } + + @Override + public boolean isShrieking() { + return this.get(SHRIEKING); + } + + @Override + public void setShrieking(final boolean shrieking) { + this.set(SHRIEKING, shrieking); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkVein.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkVein.java new file mode 100644 index 0000000000..b4fe9cc16a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkVein.java @@ -0,0 +1,75 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.SculkVein; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSculkVein extends CraftBlockData implements SculkVein { + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + private static final Map PROPERTY_BY_DIRECTION = Map.of( + BlockFace.DOWN, BlockStateProperties.DOWN, + BlockFace.EAST, BlockStateProperties.EAST, + BlockFace.NORTH, BlockStateProperties.NORTH, + BlockFace.SOUTH, BlockStateProperties.SOUTH, + BlockFace.UP, BlockStateProperties.UP, + BlockFace.WEST, BlockStateProperties.WEST + ); + + public CraftSculkVein(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSeaPickle.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSeaPickle.java new file mode 100644 index 0000000000..778540b536 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSeaPickle.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SeaPickleBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.SeaPickle; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSeaPickle extends CraftBlockData implements SeaPickle { + private static final IntegerProperty PICKLES = SeaPickleBlock.PICKLES; + + private static final BooleanProperty WATERLOGGED = SeaPickleBlock.WATERLOGGED; + + public CraftSeaPickle(BlockState state) { + super(state); + } + + @Override + public int getPickles() { + return this.get(PICKLES); + } + + @Override + public void setPickles(final int pickles) { + this.set(PICKLES, pickles); + } + + @Override + public int getMinimumPickles() { + return PICKLES.min; + } + + @Override + public int getMaximumPickles() { + return PICKLES.max; + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftShulkerBox.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftShulkerBox.java new file mode 100644 index 0000000000..9c5f7d79b6 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftShulkerBox.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftShulkerBox extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = BlockStateProperties.FACING; + + public CraftShulkerBox(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian(), "Invalid face, only cartesian face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSkull.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSkull.java new file mode 100644 index 0000000000..037f7e39db --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSkull.java @@ -0,0 +1,48 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SkullBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.RotationSegment; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Skull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.util.Vector; + +@GeneratedFrom("1.21.1") +public class CraftSkull extends CraftBlockData implements Skull { + private static final BooleanProperty POWERED = SkullBlock.POWERED; + + private static final IntegerProperty ROTATION = SkullBlock.ROTATION; + + public CraftSkull(BlockState state) { + super(state); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public BlockFace getRotation() { + return CraftBlockData.ROTATION_CYCLE[this.get(ROTATION)]; + } + + @Override + public void setRotation(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace != BlockFace.SELF && blockFace.getModY() == 0, "Invalid face, only horizontal face are allowed for this property!"); + Vector dir = blockFace.getDirection(); + float angle = (float) -Math.toDegrees(Math.atan2(dir.getX(), dir.getZ())); + this.set(ROTATION, RotationSegment.convertToSegment(angle)); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSlab.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSlab.java new file mode 100644 index 0000000000..2af280b82d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSlab.java @@ -0,0 +1,43 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SlabBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.SlabType; +import org.bukkit.block.data.type.Slab; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSlab extends CraftBlockData implements Slab { + private static final EnumProperty TYPE = SlabBlock.TYPE; + + private static final BooleanProperty WATERLOGGED = SlabBlock.WATERLOGGED; + + public CraftSlab(BlockState state) { + super(state); + } + + @Override + public Slab.Type getType() { + return this.get(TYPE, Slab.Type.class); + } + + @Override + public void setType(final Slab.Type type) { + Preconditions.checkArgument(type != null, "type cannot be null!"); + this.set(TYPE, type); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmallDripleaf.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmallDripleaf.java new file mode 100644 index 0000000000..11dc99f495 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmallDripleaf.java @@ -0,0 +1,66 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.SmallDripleafBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.SmallDripleaf; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSmallDripleaf extends CraftBlockData implements SmallDripleaf { + private static final DirectionProperty FACING = SmallDripleafBlock.FACING; + + private static final EnumProperty HALF = SmallDripleafBlock.HALF; + + private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CraftSmallDripleaf(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { + return this.get(HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(final org.bukkit.block.data.Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmoker.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmoker.java new file mode 100644 index 0000000000..edbd1ed815 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmoker.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.SmokerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSmoker extends CraftBlockData implements Furnace { + private static final DirectionProperty FACING = SmokerBlock.FACING; + + private static final BooleanProperty LIT = SmokerBlock.LIT; + + public CraftSmoker(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnifferEgg.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnifferEgg.java new file mode 100644 index 0000000000..72c69efc48 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnifferEgg.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SnifferEggBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Hatchable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSnifferEgg extends CraftBlockData implements Hatchable { + private static final IntegerProperty HATCH = SnifferEggBlock.HATCH; + + public CraftSnifferEgg(BlockState state) { + super(state); + } + + @Override + public int getHatch() { + return this.get(HATCH); + } + + @Override + public void setHatch(final int hatch) { + this.set(HATCH, hatch); + } + + @Override + public int getMaximumHatch() { + return HATCH.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnowLayer.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnowLayer.java new file mode 100644 index 0000000000..f5add6f015 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnowLayer.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SnowLayerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.Snow; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSnowLayer extends CraftBlockData implements Snow { + private static final IntegerProperty LAYERS = SnowLayerBlock.LAYERS; + + public CraftSnowLayer(BlockState state) { + super(state); + } + + @Override + public int getLayers() { + return this.get(LAYERS); + } + + @Override + public void setLayers(final int layers) { + this.set(LAYERS, layers); + } + + @Override + public int getMinimumLayers() { + return LAYERS.min; + } + + @Override + public int getMaximumLayers() { + return LAYERS.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnowyDirt.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnowyDirt.java new file mode 100644 index 0000000000..95774add29 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnowyDirt.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SnowyDirtBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Snowable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSnowyDirt extends CraftBlockData implements Snowable { + private static final BooleanProperty SNOWY = SnowyDirtBlock.SNOWY; + + public CraftSnowyDirt(BlockState state) { + super(state); + } + + @Override + public boolean isSnowy() { + return this.get(SNOWY); + } + + @Override + public void setSnowy(final boolean snowy) { + this.set(SNOWY, snowy); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStainedGlassPane.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStainedGlassPane.java new file mode 100644 index 0000000000..03fbfc3ea8 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStainedGlassPane.java @@ -0,0 +1,73 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.StainedGlassPaneBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.GlassPane; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftStainedGlassPane extends CraftBlockData implements GlassPane { + private static final BooleanProperty WATERLOGGED = StainedGlassPaneBlock.WATERLOGGED; + + private static final Map PROPERTY_BY_DIRECTION = Map.of( + BlockFace.EAST, StainedGlassPaneBlock.EAST, + BlockFace.NORTH, StainedGlassPaneBlock.NORTH, + BlockFace.SOUTH, StainedGlassPaneBlock.SOUTH, + BlockFace.WEST, StainedGlassPaneBlock.WEST + ); + + public CraftStainedGlassPane(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStair.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStair.java new file mode 100644 index 0000000000..7922808925 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStair.java @@ -0,0 +1,78 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.StairBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.StairsShape; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Stairs; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftStair extends CraftBlockData implements Stairs { + private static final DirectionProperty FACING = StairBlock.FACING; + + private static final EnumProperty HALF = StairBlock.HALF; + + private static final EnumProperty SHAPE = StairBlock.SHAPE; + + private static final BooleanProperty WATERLOGGED = StairBlock.WATERLOGGED; + + public CraftStair(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { + return this.get(HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(final org.bukkit.block.data.Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } + + @Override + public Stairs.Shape getShape() { + return this.get(SHAPE, Stairs.Shape.class); + } + + @Override + public void setShape(final Stairs.Shape shape) { + Preconditions.checkArgument(shape != null, "shape cannot be null!"); + this.set(SHAPE, shape); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStandingSign.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStandingSign.java new file mode 100644 index 0000000000..b2426bcabb --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStandingSign.java @@ -0,0 +1,48 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.StandingSignBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.RotationSegment; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Sign; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.util.Vector; + +@GeneratedFrom("1.21.1") +public class CraftStandingSign extends CraftBlockData implements Sign { + private static final IntegerProperty ROTATION = StandingSignBlock.ROTATION; + + private static final BooleanProperty WATERLOGGED = StandingSignBlock.WATERLOGGED; + + public CraftStandingSign(BlockState state) { + super(state); + } + + @Override + public BlockFace getRotation() { + return CraftBlockData.ROTATION_CYCLE[this.get(ROTATION)]; + } + + @Override + public void setRotation(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace != BlockFace.SELF && blockFace.getModY() == 0, "Invalid face, only horizontal face are allowed for this property!"); + Vector dir = blockFace.getDirection(); + float angle = (float) -Math.toDegrees(Math.atan2(dir.getX(), dir.getZ())); + this.set(ROTATION, RotationSegment.convertToSegment(angle)); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStem.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStem.java new file mode 100644 index 0000000000..e124d37efa --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStem.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.StemBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftStem extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = StemBlock.AGE; + + public CraftStem(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStonecutter.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStonecutter.java new file mode 100644 index 0000000000..cd3a1e07bf --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStonecutter.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.StonecutterBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftStonecutter extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = StonecutterBlock.FACING; + + public CraftStonecutter(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStructureBlock.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStructureBlock.java new file mode 100644 index 0000000000..bebe30541c --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStructureBlock.java @@ -0,0 +1,29 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.StructureMode; +import org.bukkit.block.data.type.StructureBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftStructureBlock extends CraftBlockData implements StructureBlock { + private static final EnumProperty MODE = net.minecraft.world.level.block.StructureBlock.MODE; + + public CraftStructureBlock(BlockState state) { + super(state); + } + + @Override + public StructureBlock.Mode getMode() { + return this.get(MODE, StructureBlock.Mode.class); + } + + @Override + public void setMode(final StructureBlock.Mode mode) { + Preconditions.checkArgument(mode != null, "mode cannot be null!"); + this.set(MODE, mode); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSugarCane.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSugarCane.java new file mode 100644 index 0000000000..252c02220a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSugarCane.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SugarCaneBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSugarCane extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = SugarCaneBlock.AGE; + + public CraftSugarCane(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSweetBerryBush.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSweetBerryBush.java new file mode 100644 index 0000000000..8d1d4cbd4b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSweetBerryBush.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.SweetBerryBushBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftSweetBerryBush extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = SweetBerryBushBlock.AGE; + + public CraftSweetBerryBush(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTallFlower.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTallFlower.java new file mode 100644 index 0000000000..bd31be1b8a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTallFlower.java @@ -0,0 +1,30 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.TallFlowerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.data.Bisected; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTallFlower extends CraftBlockData implements Bisected { + private static final EnumProperty HALF = TallFlowerBlock.HALF; + + public CraftTallFlower(BlockState state) { + super(state); + } + + @Override + public Bisected.Half getHalf() { + return this.get(HALF, Bisected.Half.class); + } + + @Override + public void setHalf(final Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTallSeagrass.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTallSeagrass.java new file mode 100644 index 0000000000..f05b3d72aa --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTallSeagrass.java @@ -0,0 +1,30 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.TallSeagrassBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.data.Bisected; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTallSeagrass extends CraftBlockData implements Bisected { + private static final EnumProperty HALF = TallSeagrassBlock.HALF; + + public CraftTallSeagrass(BlockState state) { + super(state); + } + + @Override + public Bisected.Half getHalf() { + return this.get(HALF, Bisected.Half.class); + } + + @Override + public void setHalf(final Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTarget.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTarget.java new file mode 100644 index 0000000000..ffd8e1de78 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTarget.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.AnaloguePowerable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTarget extends CraftBlockData implements AnaloguePowerable { + private static final IntegerProperty OUTPUT_POWER = BlockStateProperties.POWER; + + public CraftTarget(BlockState state) { + super(state); + } + + @Override + public int getPower() { + return this.get(OUTPUT_POWER); + } + + @Override + public void setPower(final int power) { + this.set(OUTPUT_POWER, power); + } + + @Override + public int getMaximumPower() { + return OUTPUT_POWER.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTnt.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTnt.java new file mode 100644 index 0000000000..eaf9363600 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTnt.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.TntBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.TNT; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTnt extends CraftBlockData implements TNT { + private static final BooleanProperty UNSTABLE = TntBlock.UNSTABLE; + + public CraftTnt(BlockState state) { + super(state); + } + + @Override + public boolean isUnstable() { + return this.get(UNSTABLE); + } + + @Override + public void setUnstable(final boolean unstable) { + this.set(UNSTABLE, unstable); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTorchflowerCrop.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTorchflowerCrop.java new file mode 100644 index 0000000000..f573ead856 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTorchflowerCrop.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.TorchflowerCropBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTorchflowerCrop extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = TorchflowerCropBlock.AGE; + + public CraftTorchflowerCrop(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrapDoor.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrapDoor.java new file mode 100644 index 0000000000..3d27ec6d43 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrapDoor.java @@ -0,0 +1,88 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.TrapDoorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.TrapDoor; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTrapDoor extends CraftBlockData implements TrapDoor { + private static final DirectionProperty FACING = TrapDoorBlock.FACING; + + private static final EnumProperty HALF = TrapDoorBlock.HALF; + + private static final BooleanProperty OPEN = TrapDoorBlock.OPEN; + + private static final BooleanProperty POWERED = TrapDoorBlock.POWERED; + + private static final BooleanProperty WATERLOGGED = TrapDoorBlock.WATERLOGGED; + + public CraftTrapDoor(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { + return this.get(HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(final org.bukkit.block.data.Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } + + @Override + public boolean isOpen() { + return this.get(OPEN); + } + + @Override + public void setOpen(final boolean open) { + this.set(OPEN, open); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrappedChest.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrappedChest.java new file mode 100644 index 0000000000..089e564d2a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrappedChest.java @@ -0,0 +1,65 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.TrappedChestBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.ChestType; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Chest; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTrappedChest extends CraftBlockData implements Chest { + private static final DirectionProperty FACING = TrappedChestBlock.FACING; + + private static final EnumProperty TYPE = TrappedChestBlock.TYPE; + + private static final BooleanProperty WATERLOGGED = TrappedChestBlock.WATERLOGGED; + + public CraftTrappedChest(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public Chest.Type getType() { + return this.get(TYPE, Chest.Type.class); + } + + @Override + public void setType(final Chest.Type type) { + Preconditions.checkArgument(type != null, "type cannot be null!"); + this.set(TYPE, type); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrialSpawner.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrialSpawner.java new file mode 100644 index 0000000000..e8d1af1be4 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrialSpawner.java @@ -0,0 +1,43 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.TrialSpawnerBlock; +import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerState; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.data.type.TrialSpawner; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTrialSpawner extends CraftBlockData implements TrialSpawner { + private static final BooleanProperty OMINOUS = TrialSpawnerBlock.OMINOUS; + + private static final EnumProperty STATE = TrialSpawnerBlock.STATE; + + public CraftTrialSpawner(BlockState state) { + super(state); + } + + @Override + public boolean isOminous() { + return this.get(OMINOUS); + } + + @Override + public void setOminous(final boolean ominous) { + this.set(OMINOUS, ominous); + } + + @Override + public TrialSpawner.State getTrialSpawnerState() { + return this.get(STATE, TrialSpawner.State.class); + } + + @Override + public void setTrialSpawnerState(final TrialSpawner.State state) { + Preconditions.checkArgument(state != null, "state cannot be null!"); + this.set(STATE, state); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWire.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWire.java new file mode 100644 index 0000000000..f4b7696baa --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWire.java @@ -0,0 +1,97 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.TripWireBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Tripwire; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTripWire extends CraftBlockData implements Tripwire { + private static final BooleanProperty ATTACHED = TripWireBlock.ATTACHED; + + private static final BooleanProperty DISARMED = TripWireBlock.DISARMED; + + private static final BooleanProperty POWERED = TripWireBlock.POWERED; + + private static final Map PROPERTY_BY_DIRECTION = Map.of( + BlockFace.EAST, TripWireBlock.EAST, + BlockFace.NORTH, TripWireBlock.NORTH, + BlockFace.SOUTH, TripWireBlock.SOUTH, + BlockFace.WEST, TripWireBlock.WEST + ); + + public CraftTripWire(BlockState state) { + super(state); + } + + @Override + public boolean isAttached() { + return this.get(ATTACHED); + } + + @Override + public void setAttached(final boolean attached) { + this.set(ATTACHED, attached); + } + + @Override + public boolean isDisarmed() { + return this.get(DISARMED); + } + + @Override + public void setDisarmed(final boolean disarmed) { + this.set(DISARMED, disarmed); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWireHook.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWireHook.java new file mode 100644 index 0000000000..d20bb58310 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWireHook.java @@ -0,0 +1,62 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.TripWireHookBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.TripwireHook; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTripWireHook extends CraftBlockData implements TripwireHook { + private static final BooleanProperty ATTACHED = TripWireHookBlock.ATTACHED; + + private static final DirectionProperty FACING = TripWireHookBlock.FACING; + + private static final BooleanProperty POWERED = TripWireHookBlock.POWERED; + + public CraftTripWireHook(BlockState state) { + super(state); + } + + @Override + public boolean isAttached() { + return this.get(ATTACHED); + } + + @Override + public void setAttached(final boolean attached) { + this.set(ATTACHED, attached); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTurtleEgg.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTurtleEgg.java new file mode 100644 index 0000000000..b90b345e2e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTurtleEgg.java @@ -0,0 +1,54 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.TurtleEggBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.type.TurtleEgg; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTurtleEgg extends CraftBlockData implements TurtleEgg { + private static final IntegerProperty EGGS = TurtleEggBlock.EGGS; + + private static final IntegerProperty HATCH = TurtleEggBlock.HATCH; + + public CraftTurtleEgg(BlockState state) { + super(state); + } + + @Override + public int getEggs() { + return this.get(EGGS); + } + + @Override + public void setEggs(final int eggs) { + this.set(EGGS, eggs); + } + + @Override + public int getMinimumEggs() { + return EGGS.min; + } + + @Override + public int getMaximumEggs() { + return EGGS.max; + } + + @Override + public int getHatch() { + return this.get(HATCH); + } + + @Override + public void setHatch(final int hatch) { + this.set(HATCH, hatch); + } + + @Override + public int getMaximumHatch() { + return HATCH.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTwistingVines.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTwistingVines.java new file mode 100644 index 0000000000..c7529561ca --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTwistingVines.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.TwistingVinesBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftTwistingVines extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = TwistingVinesBlock.AGE; + + public CraftTwistingVines(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftVault.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftVault.java new file mode 100644 index 0000000000..fe19dd99f9 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftVault.java @@ -0,0 +1,66 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.VaultBlock; +import net.minecraft.world.level.block.entity.vault.VaultState; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Vault; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftVault extends CraftBlockData implements Vault { + private static final DirectionProperty FACING = VaultBlock.FACING; + + private static final BooleanProperty OMINOUS = VaultBlock.OMINOUS; + + private static final EnumProperty STATE = BlockStateProperties.VAULT_STATE; + + public CraftVault(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isOminous() { + return this.get(OMINOUS); + } + + @Override + public void setOminous(final boolean ominous) { + this.set(OMINOUS, ominous); + } + + @Override + public Vault.State getVaultState() { + return this.get(STATE, Vault.State.class); + } + + @Override + public void setVaultState(final Vault.State state) { + Preconditions.checkArgument(state != null, "state cannot be null!"); + this.set(STATE, state); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftVine.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftVine.java new file mode 100644 index 0000000000..8bbca6e438 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftVine.java @@ -0,0 +1,58 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.VineBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.MultipleFacing; +import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftVine extends CraftBlockData implements MultipleFacing { + private static final Map PROPERTY_BY_DIRECTION = VineBlock.PROPERTY_BY_DIRECTION.entrySet().stream() + .collect(Collectors.toMap(entry -> CraftBlock.notchToBlockFace(entry.getKey()), entry -> entry.getValue())); + + public CraftVine(BlockState state) { + super(state); + } + + @Override + public boolean hasFace(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property); + } + + @Override + public void setFace(final BlockFace blockFace, final boolean face) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + BooleanProperty property = PROPERTY_BY_DIRECTION.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_DIRECTION.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, face); + } + + @Override + public Set getFaces() { + ImmutableSet.Builder faces = ImmutableSet.builder(); + for (Map.Entry entry : PROPERTY_BY_DIRECTION.entrySet()) { + if (this.get(entry.getValue())) { + faces.add(entry.getKey()); + } + } + return faces.build(); + } + + @Override + public Set getAllowedFaces() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWall.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWall.java new file mode 100644 index 0000000000..b851d14a72 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWall.java @@ -0,0 +1,69 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Map; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.WallBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.WallSide; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Wall; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWall extends CraftBlockData implements Wall { + private static final BooleanProperty UP = WallBlock.UP; + + private static final BooleanProperty WATERLOGGED = WallBlock.WATERLOGGED; + + private static final Map> PROPERTY_BY_FACE = Map.of( + BlockFace.EAST, WallBlock.EAST_WALL, + BlockFace.NORTH, WallBlock.NORTH_WALL, + BlockFace.SOUTH, WallBlock.SOUTH_WALL, + BlockFace.WEST, WallBlock.WEST_WALL + ); + + public CraftWall(BlockState state) { + super(state); + } + + @Override + public boolean isUp() { + return this.get(UP); + } + + @Override + public void setUp(final boolean up) { + this.set(UP, up); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } + + @Override + public Wall.Height getHeight(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + EnumProperty property = PROPERTY_BY_FACE.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_FACE.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + return this.get(property, Wall.Height.class); + } + + @Override + public void setHeight(final BlockFace blockFace, final Wall.Height height) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(height != null, "height cannot be null!"); + EnumProperty property = PROPERTY_BY_FACE.get(blockFace); + Preconditions.checkArgument(property != null, "Invalid blockFace, only %s are allowed!", PROPERTY_BY_FACE.keySet().stream().map(Enum::name).collect(Collectors.joining(", "))); + this.set(property, height); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallBanner.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallBanner.java new file mode 100644 index 0000000000..a7c8573e02 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallBanner.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WallBannerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWallBanner extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = WallBannerBlock.FACING; + + public CraftWallBanner(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallHangingSign.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallHangingSign.java new file mode 100644 index 0000000000..7afa58d43f --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallHangingSign.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WallHangingSignBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallHangingSign; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWallHangingSign extends CraftBlockData implements WallHangingSign { + private static final DirectionProperty FACING = WallHangingSignBlock.FACING; + + private static final BooleanProperty WATERLOGGED = WallHangingSignBlock.WATERLOGGED; + + public CraftWallHangingSign(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSign.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSign.java new file mode 100644 index 0000000000..836b517b72 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSign.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WallSignBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSign; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWallSign extends CraftBlockData implements WallSign { + private static final DirectionProperty FACING = WallSignBlock.FACING; + + private static final BooleanProperty WATERLOGGED = WallSignBlock.WATERLOGGED; + + public CraftWallSign(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSkull.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSkull.java new file mode 100644 index 0000000000..9aa46e65c4 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSkull.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WallSkullBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWallSkull extends CraftBlockData implements WallSkull { + private static final DirectionProperty FACING = WallSkullBlock.FACING; + + private static final BooleanProperty POWERED = WallSkullBlock.POWERED; + + public CraftWallSkull(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallTorch.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallTorch.java new file mode 100644 index 0000000000..69cc6d5c90 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallTorch.java @@ -0,0 +1,37 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WallTorchBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWallTorch extends CraftBlockData implements Directional { + private static final DirectionProperty FACING = WallTorchBlock.FACING; + + public CraftWallTorch(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWaterloggedTransparent.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWaterloggedTransparent.java new file mode 100644 index 0000000000..425fd7dd88 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWaterloggedTransparent.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.WaterloggedTransparentBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWaterloggedTransparent extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = WaterloggedTransparentBlock.WATERLOGGED; + + public CraftWaterloggedTransparent(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperBulb.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperBulb.java new file mode 100644 index 0000000000..ed860ecc54 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperBulb.java @@ -0,0 +1,39 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.WeatheringCopperBulbBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.CopperBulb; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWeatheringCopperBulb extends CraftBlockData implements CopperBulb { + private static final BooleanProperty LIT = WeatheringCopperBulbBlock.LIT; + + private static final BooleanProperty POWERED = WeatheringCopperBulbBlock.POWERED; + + public CraftWeatheringCopperBulb(BlockState state) { + super(state); + } + + @Override + public boolean isLit() { + return this.get(LIT); + } + + @Override + public void setLit(final boolean lit) { + this.set(LIT, lit); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperDoor.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperDoor.java new file mode 100644 index 0000000000..1823e4b22c --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperDoor.java @@ -0,0 +1,91 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WeatheringCopperDoorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.DoorHingeSide; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Door; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWeatheringCopperDoor extends CraftBlockData implements Door { + private static final DirectionProperty FACING = WeatheringCopperDoorBlock.FACING; + + private static final EnumProperty HALF = WeatheringCopperDoorBlock.HALF; + + private static final EnumProperty HINGE = WeatheringCopperDoorBlock.HINGE; + + private static final BooleanProperty OPEN = WeatheringCopperDoorBlock.OPEN; + + private static final BooleanProperty POWERED = WeatheringCopperDoorBlock.POWERED; + + public CraftWeatheringCopperDoor(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { + return this.get(HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(final org.bukkit.block.data.Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } + + @Override + public Door.Hinge getHinge() { + return this.get(HINGE, Door.Hinge.class); + } + + @Override + public void setHinge(final Door.Hinge hinge) { + Preconditions.checkArgument(hinge != null, "hinge cannot be null!"); + this.set(HINGE, hinge); + } + + @Override + public boolean isOpen() { + return this.get(OPEN); + } + + @Override + public void setOpen(final boolean open) { + this.set(OPEN, open); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperGrate.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperGrate.java new file mode 100644 index 0000000000..0aaae8b73a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperGrate.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.WeatheringCopperGrateBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWeatheringCopperGrate extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = WeatheringCopperGrateBlock.WATERLOGGED; + + public CraftWeatheringCopperGrate(BlockState state) { + super(state); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperSlab.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperSlab.java new file mode 100644 index 0000000000..6d28f4e477 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperSlab.java @@ -0,0 +1,43 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.WeatheringCopperSlabBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.SlabType; +import org.bukkit.block.data.type.Slab; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWeatheringCopperSlab extends CraftBlockData implements Slab { + private static final EnumProperty TYPE = WeatheringCopperSlabBlock.TYPE; + + private static final BooleanProperty WATERLOGGED = WeatheringCopperSlabBlock.WATERLOGGED; + + public CraftWeatheringCopperSlab(BlockState state) { + super(state); + } + + @Override + public Slab.Type getType() { + return this.get(TYPE, Slab.Type.class); + } + + @Override + public void setType(final Slab.Type type) { + Preconditions.checkArgument(type != null, "type cannot be null!"); + this.set(TYPE, type); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperStair.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperStair.java new file mode 100644 index 0000000000..ccfa06b286 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperStair.java @@ -0,0 +1,78 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WeatheringCopperStairBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.StairsShape; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Stairs; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWeatheringCopperStair extends CraftBlockData implements Stairs { + private static final DirectionProperty FACING = WeatheringCopperStairBlock.FACING; + + private static final EnumProperty HALF = WeatheringCopperStairBlock.HALF; + + private static final EnumProperty SHAPE = WeatheringCopperStairBlock.SHAPE; + + private static final BooleanProperty WATERLOGGED = WeatheringCopperStairBlock.WATERLOGGED; + + public CraftWeatheringCopperStair(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { + return this.get(HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(final org.bukkit.block.data.Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } + + @Override + public Stairs.Shape getShape() { + return this.get(SHAPE, Stairs.Shape.class); + } + + @Override + public void setShape(final Stairs.Shape shape) { + Preconditions.checkArgument(shape != null, "shape cannot be null!"); + this.set(SHAPE, shape); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperTrapDoor.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperTrapDoor.java new file mode 100644 index 0000000000..9acdd3d07d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperTrapDoor.java @@ -0,0 +1,88 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WeatheringCopperTrapDoorBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.TrapDoor; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWeatheringCopperTrapDoor extends CraftBlockData implements TrapDoor { + private static final DirectionProperty FACING = WeatheringCopperTrapDoorBlock.FACING; + + private static final EnumProperty HALF = WeatheringCopperTrapDoorBlock.HALF; + + private static final BooleanProperty OPEN = WeatheringCopperTrapDoorBlock.OPEN; + + private static final BooleanProperty POWERED = WeatheringCopperTrapDoorBlock.POWERED; + + private static final BooleanProperty WATERLOGGED = WeatheringCopperTrapDoorBlock.WATERLOGGED; + + public CraftWeatheringCopperTrapDoor(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { + return this.get(HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(final org.bukkit.block.data.Bisected.Half half) { + Preconditions.checkArgument(half != null, "half cannot be null!"); + this.set(HALF, half); + } + + @Override + public boolean isOpen() { + return this.get(OPEN); + } + + @Override + public void setOpen(final boolean open) { + this.set(OPEN, open); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public boolean isWaterlogged() { + return this.get(WATERLOGGED); + } + + @Override + public void setWaterlogged(final boolean waterlogged) { + this.set(WATERLOGGED, waterlogged); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeepingVines.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeepingVines.java new file mode 100644 index 0000000000..f26605b36e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeepingVines.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.WeepingVinesBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.Ageable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWeepingVines extends CraftBlockData implements Ageable { + private static final IntegerProperty AGE = WeepingVinesBlock.AGE; + + public CraftWeepingVines(BlockState state) { + super(state); + } + + @Override + public int getAge() { + return this.get(AGE); + } + + @Override + public void setAge(final int age) { + this.set(AGE, age); + } + + @Override + public int getMaximumAge() { + return AGE.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeightedPressurePlate.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeightedPressurePlate.java new file mode 100644 index 0000000000..d6daf8d348 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeightedPressurePlate.java @@ -0,0 +1,32 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.WeightedPressurePlateBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.bukkit.block.data.AnaloguePowerable; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWeightedPressurePlate extends CraftBlockData implements AnaloguePowerable { + private static final IntegerProperty POWER = WeightedPressurePlateBlock.POWER; + + public CraftWeightedPressurePlate(BlockState state) { + super(state); + } + + @Override + public int getPower() { + return this.get(POWER); + } + + @Override + public void setPower(final int power) { + this.set(POWER, power); + } + + @Override + public int getMaximumPower() { + return POWER.max; + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherSkull.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherSkull.java new file mode 100644 index 0000000000..5ed9aee176 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherSkull.java @@ -0,0 +1,48 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.WitherSkullBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.RotationSegment; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Skull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.util.Vector; + +@GeneratedFrom("1.21.1") +public class CraftWitherSkull extends CraftBlockData implements Skull { + private static final BooleanProperty POWERED = WitherSkullBlock.POWERED; + + private static final IntegerProperty ROTATION = WitherSkullBlock.ROTATION; + + public CraftWitherSkull(BlockState state) { + super(state); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } + + @Override + public BlockFace getRotation() { + return CraftBlockData.ROTATION_CYCLE[this.get(ROTATION)]; + } + + @Override + public void setRotation(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace != BlockFace.SELF && blockFace.getModY() == 0, "Invalid face, only horizontal face are allowed for this property!"); + Vector dir = blockFace.getDirection(); + float angle = (float) -Math.toDegrees(Math.atan2(dir.getX(), dir.getZ())); + this.set(ROTATION, RotationSegment.convertToSegment(angle)); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherWallSkull.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherWallSkull.java new file mode 100644 index 0000000000..2d5c5597e5 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherWallSkull.java @@ -0,0 +1,50 @@ +package org.bukkit.craftbukkit.block.impl; + +import com.google.common.base.Preconditions; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.Set; +import net.minecraft.world.level.block.WitherWallSkullBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.1") +public class CraftWitherWallSkull extends CraftBlockData implements WallSkull { + private static final DirectionProperty FACING = WitherWallSkullBlock.FACING; + + private static final BooleanProperty POWERED = WitherWallSkullBlock.POWERED; + + public CraftWitherWallSkull(BlockState state) { + super(state); + } + + @Override + public BlockFace getFacing() { + return this.get(FACING, BlockFace.class); + } + + @Override + public void setFacing(final BlockFace blockFace) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!"); + this.set(FACING, blockFace); + } + + @Override + public Set getFaces() { + return this.getValues(FACING, BlockFace.class); + } + + @Override + public boolean isPowered() { + return this.get(POWERED); + } + + @Override + public void setPowered(final boolean powered) { + this.set(POWERED, powered); + } +} diff --git a/paper-generator/generatedServer/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/potion/CraftPotionUtil.java new file mode 100644 index 0000000000..f6e0088db1 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/potion/CraftPotionUtil.java @@ -0,0 +1,104 @@ +package org.bukkit.craftbukkit.potion; + +import com.google.common.base.Preconditions; +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableBiMap; +import net.minecraft.core.Holder; +import net.minecraft.world.effect.MobEffect; +import net.minecraft.world.effect.MobEffectInstance; +import org.bukkit.potion.PotionData; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionType; + +public class CraftPotionUtil { + + private static final BiMap upgradeable = ImmutableBiMap.builder() + // Paper start - Generated/CraftPotionUtil#upgradeable + // @GeneratedFrom 1.21.1 + .put(PotionType.HARMING, PotionType.STRONG_HARMING) + .put(PotionType.HEALING, PotionType.STRONG_HEALING) + .put(PotionType.LEAPING, PotionType.STRONG_LEAPING) + .put(PotionType.POISON, PotionType.STRONG_POISON) + .put(PotionType.REGENERATION, PotionType.STRONG_REGENERATION) + .put(PotionType.SLOWNESS, PotionType.STRONG_SLOWNESS) + .put(PotionType.STRENGTH, PotionType.STRONG_STRENGTH) + .put(PotionType.SWIFTNESS, PotionType.STRONG_SWIFTNESS) + .put(PotionType.TURTLE_MASTER, PotionType.STRONG_TURTLE_MASTER) + // Paper end - Generated/CraftPotionUtil#upgradeable + .build(); + private static final BiMap extendable = ImmutableBiMap.builder() + // Paper start - Generated/CraftPotionUtil#extendable + // @GeneratedFrom 1.21.1 + .put(PotionType.FIRE_RESISTANCE, PotionType.LONG_FIRE_RESISTANCE) + .put(PotionType.INVISIBILITY, PotionType.LONG_INVISIBILITY) + .put(PotionType.LEAPING, PotionType.LONG_LEAPING) + .put(PotionType.NIGHT_VISION, PotionType.LONG_NIGHT_VISION) + .put(PotionType.POISON, PotionType.LONG_POISON) + .put(PotionType.REGENERATION, PotionType.LONG_REGENERATION) + .put(PotionType.SLOW_FALLING, PotionType.LONG_SLOW_FALLING) + .put(PotionType.SLOWNESS, PotionType.LONG_SLOWNESS) + .put(PotionType.STRENGTH, PotionType.LONG_STRENGTH) + .put(PotionType.SWIFTNESS, PotionType.LONG_SWIFTNESS) + .put(PotionType.TURTLE_MASTER, PotionType.LONG_TURTLE_MASTER) + .put(PotionType.WATER_BREATHING, PotionType.LONG_WATER_BREATHING) + .put(PotionType.WEAKNESS, PotionType.LONG_WEAKNESS) + // Paper end - Generated/CraftPotionUtil#extendable + .build(); + + public static PotionType fromBukkit(PotionData data) { + if (data == null) { + return null; + } + + PotionType type; + if (data.isUpgraded()) { + type = CraftPotionUtil.upgradeable.get(data.getType()); + } else if (data.isExtended()) { + type = CraftPotionUtil.extendable.get(data.getType()); + } else { + type = data.getType(); + } + Preconditions.checkNotNull(type, "Unknown potion type from data " + data); + + return type; + } + + public static PotionData toBukkit(PotionType type) { + if (type == null) { + return null; + } + + PotionType potionType; + potionType = CraftPotionUtil.extendable.inverse().get(type); + if (potionType != null) { + return new PotionData(potionType, true, false); + } + potionType = CraftPotionUtil.upgradeable.inverse().get(type); + if (potionType != null) { + return new PotionData(potionType, false, true); + } + + return new PotionData(type, false, false); + } + + public static MobEffectInstance fromBukkit(PotionEffect effect) { + Holder type = CraftPotionEffectType.bukkitToMinecraftHolder(effect.getType()); + // Paper - Note: do not copy over the hidden effect, as this method is only used for applying to entities which we do not want to convert over. + return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon()); // Paper + } + + public static PotionEffect toBukkit(MobEffectInstance effect) { + PotionEffectType type = CraftPotionEffectType.minecraftHolderToBukkit(effect.getEffect()); + int amp = effect.getAmplifier(); + int duration = effect.getDuration(); + boolean ambient = effect.isAmbient(); + boolean particles = effect.isVisible(); + return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.hiddenEffect == null ? null : toBukkit(effect.hiddenEffect)); // Paper + } + + public static boolean equals(Holder mobEffect, PotionEffectType type) { + PotionEffectType typeV = CraftPotionEffectType.minecraftHolderToBukkit(mobEffect); + return typeV.equals(type); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/Generators.java b/paper-generator/src/main/java/io/papermc/generator/Generators.java new file mode 100644 index 0000000000..ae7353b5b4 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/Generators.java @@ -0,0 +1,23 @@ +package io.papermc.generator; + +import io.papermc.generator.registry.RegistryBootstrapper; +import io.papermc.generator.types.SourceGenerator; +import io.papermc.generator.types.craftblockdata.CraftBlockDataBootstrapper; +import io.papermc.generator.types.goal.MobGoalGenerator; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import net.minecraft.Util; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface Generators { + + List API = Collections.unmodifiableList(Util.make(new ArrayList<>(), list -> { + RegistryBootstrapper.bootstrap(list); + list.add(new MobGoalGenerator("VanillaGoal", "com.destroystokyo.paper.entity.ai")); + // todo extract fields for registry based api + })); + + List SERVER = Collections.unmodifiableList(Util.make(new ArrayList<>(), CraftBlockDataBootstrapper::bootstrap)); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/Main.java b/paper-generator/src/main/java/io/papermc/generator/Main.java new file mode 100644 index 0000000000..bacd561270 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/Main.java @@ -0,0 +1,94 @@ +package io.papermc.generator; + +import com.google.common.util.concurrent.MoreExecutors; +import com.mojang.logging.LogUtils; +import io.papermc.generator.rewriter.registration.PaperPatternSourceSetRewriter; +import io.papermc.generator.rewriter.registration.PatternSourceSetRewriter; +import io.papermc.generator.types.SourceGenerator; +import io.papermc.generator.utils.experimental.TagCollector; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collection; +import java.util.Map; +import net.minecraft.SharedConstants; +import net.minecraft.commands.Commands; +import net.minecraft.core.LayeredRegistryAccess; +import net.minecraft.core.RegistryAccess; +import net.minecraft.resources.RegistryDataLoader; +import net.minecraft.server.Bootstrap; +import net.minecraft.server.RegistryLayer; +import net.minecraft.server.ReloadableServerResources; +import net.minecraft.server.WorldLoader; +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.MultiPackResourceManager; +import net.minecraft.tags.TagKey; +import net.minecraft.world.flag.FeatureFlags; +import org.apache.commons.io.file.PathUtils; +import org.jspecify.annotations.NullMarked; +import org.slf4j.Logger; + +@NullMarked +public final class Main { + + private static final Logger LOGGER = LogUtils.getLogger(); + public static final RegistryAccess.Frozen REGISTRY_ACCESS; + public static final Map, String> EXPERIMENTAL_TAGS; + + static { + SharedConstants.tryDetectVersion(); + Bootstrap.bootStrap(); + Bootstrap.validate(); + + PackRepository resourceRepository = ServerPacksSource.createVanillaTrustedRepository(); + resourceRepository.reload(); + MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList()); + LayeredRegistryAccess layers = RegistryLayer.createRegistryAccess(); + layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES); + REGISTRY_ACCESS = layers.compositeAccess().freeze(); + ReloadableServerResources datapack = ReloadableServerResources.loadResources(resourceManager, layers, FeatureFlags.REGISTRY.allFlags(), Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join(); + datapack.updateRegistryTags(); + + EXPERIMENTAL_TAGS = TagCollector.grabExperimental(resourceManager); + } + + private Main() { + } + + public static void main(String[] args) { + Path generatedApiPath = Path.of(args[0]); // todo remove + Path generatedServerPath = Path.of(args[2]); // todo remove + + PatternSourceSetRewriter apiSourceSet = new PaperPatternSourceSetRewriter(generatedApiPath); + PatternSourceSetRewriter serverSourceSet = new PaperPatternSourceSetRewriter(generatedServerPath); + Rewriters.bootstrap(apiSourceSet, serverSourceSet); + + try { + LOGGER.info("Running API generators..."); + generate(generatedApiPath, Generators.API); + apiSourceSet.apply(Path.of(args[1])); + + LOGGER.info("Running Server generators..."); + generate(generatedServerPath, Generators.SERVER); + serverSourceSet.apply(Path.of(args[3])); + } catch (RuntimeException ex) { + throw ex; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private static void generate(Path output, Collection generators) throws IOException { + if (Files.exists(output)) { + PathUtils.deleteDirectory(output); + } + + for (SourceGenerator generator : generators) { + generator.writeToFile(output); + } + LOGGER.info("Files written to {}", output.toAbsolutePath()); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/Rewriters.java b/paper-generator/src/main/java/io/papermc/generator/Rewriters.java new file mode 100644 index 0000000000..f654f4e71c --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/Rewriters.java @@ -0,0 +1,201 @@ +package io.papermc.generator; + +import io.papermc.generator.registry.RegistryBootstrapper; +import io.papermc.generator.registry.RegistryEntries; +import io.papermc.generator.rewriter.registration.PatternSourceSetRewriter; +import io.papermc.generator.rewriter.types.Types; +import io.papermc.generator.rewriter.types.registry.EnumRegistryRewriter; +import io.papermc.generator.rewriter.types.registry.FeatureFlagRewriter; +import io.papermc.generator.rewriter.types.registry.RegistryFieldRewriter; +import io.papermc.generator.rewriter.types.registry.TagRewriter; +import io.papermc.generator.rewriter.types.simple.BlockTypeRewriter; +import io.papermc.generator.rewriter.types.simple.CraftBlockDataMapping; +import io.papermc.generator.rewriter.types.simple.CraftBlockEntityStateMapping; +import io.papermc.generator.rewriter.types.simple.CraftPotionUtilRewriter; +import io.papermc.generator.rewriter.types.simple.EntityTypeRewriter; +import io.papermc.generator.rewriter.types.simple.ItemTypeRewriter; +import io.papermc.generator.rewriter.types.simple.MapPaletteRewriter; +import io.papermc.generator.rewriter.types.simple.MaterialRewriter; +import io.papermc.generator.rewriter.types.simple.MemoryKeyRewriter; +import io.papermc.generator.rewriter.types.simple.StatisticRewriter; +import io.papermc.generator.rewriter.types.simple.VillagerProfessionRewriter; +import io.papermc.generator.utils.Formatting; +import io.papermc.typewriter.preset.EnumCloneRewriter; +import io.papermc.typewriter.preset.model.EnumValue; +import java.util.Locale; +import javax.lang.model.SourceVersion; +import net.kyori.adventure.text.format.NamedTextColor; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.world.entity.decoration.PaintingVariant; +import net.minecraft.world.item.Rarity; +import org.bukkit.Art; +import org.bukkit.FeatureFlag; +import org.bukkit.Fluid; +import org.bukkit.GameEvent; +import org.bukkit.JukeboxSong; +import org.bukkit.Material; +import org.bukkit.MusicInstrument; +import org.bukkit.Sound; +import org.bukkit.Statistic; +import org.bukkit.Tag; +import org.bukkit.attribute.Attribute; +import org.bukkit.block.Biome; +import org.bukkit.block.BlockType; +import org.bukkit.block.banner.PatternType; +import org.bukkit.damage.DamageType; +import org.bukkit.entity.Boat; +import org.bukkit.entity.Cat; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Fox; +import org.bukkit.entity.Frog; +import org.bukkit.entity.Panda; +import org.bukkit.entity.Sniffer; +import org.bukkit.entity.TropicalFish; +import org.bukkit.entity.Villager; +import org.bukkit.entity.Wolf; +import org.bukkit.entity.memory.MemoryKey; +import org.bukkit.generator.structure.Structure; +import org.bukkit.generator.structure.StructureType; +import org.bukkit.inventory.ItemRarity; +import org.bukkit.inventory.ItemType; +import org.bukkit.inventory.meta.trim.TrimMaterial; +import org.bukkit.inventory.meta.trim.TrimPattern; +import org.bukkit.inventory.recipe.CookingBookCategory; +import org.bukkit.inventory.recipe.CraftingBookCategory; +import org.bukkit.map.MapCursor; +import org.bukkit.map.MapPalette; +import org.bukkit.potion.PotionType; +import org.bukkit.scoreboard.DisplaySlot; +import org.jspecify.annotations.NullMarked; + +import static io.papermc.generator.rewriter.registration.PaperPatternSourceSetRewriter.composite; +import static io.papermc.generator.rewriter.registration.RewriterHolder.holder; +import static io.papermc.generator.utils.Formatting.asCode; +import static io.papermc.typewriter.utils.Formatting.quoted; + +@NullMarked +public final class Rewriters { + + public static void bootstrap(PatternSourceSetRewriter apiSourceSet, PatternSourceSetRewriter serverSourceSet) { + apiSourceSet + .register("Fluid", Fluid.class, EnumRegistryRewriter.forLegacyEnum(Registries.FLUID)) + .register("Sound", Sound.class, new EnumRegistryRewriter<>(Registries.SOUND_EVENT)) + .register("Biome", Biome.class, EnumRegistryRewriter.forLegacyEnum(Registries.BIOME)) + .register("Attribute", Attribute.class, new EnumRegistryRewriter<>(Registries.ATTRIBUTE)) + .register("PotionType", PotionType.class, new EnumRegistryRewriter<>(Registries.POTION)) + .register("Art", Art.class, new EnumRegistryRewriter<>(Registries.PAINTING_VARIANT) { + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference reference) { + PaintingVariant variant = reference.value(); + return super.rewriteEnumValue(reference).arguments(asCode( + Main.REGISTRY_ACCESS.registryOrThrow(Registries.PAINTING_VARIANT).getId(reference.value()), // id is broken no way to fix legacy it's too late + variant.width(), + variant.height() + )); + } + }) + .register("EntityType", EntityType.class, new EntityTypeRewriter()) + .register("DisplaySlot", DisplaySlot.class, new EnumCloneRewriter<>(net.minecraft.world.scores.DisplaySlot.class) { + @Override + protected EnumValue.Builder rewriteEnumValue(net.minecraft.world.scores.DisplaySlot slot) { + final String name; + if (slot == net.minecraft.world.scores.DisplaySlot.LIST) { + name = "PLAYER_LIST"; + } else { + name = Formatting.formatKeyAsField(slot.getSerializedName()); + } + + return EnumValue.builder(name).argument(quoted(slot.getSerializedName())); + } + }) + .register("SnifferState", Sniffer.State.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.sniffer.Sniffer.State.class)) + .register("PandaGene", Panda.Gene.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Panda.Gene.class) { + @Override + protected EnumValue.Builder rewriteEnumValue(net.minecraft.world.entity.animal.Panda.Gene gene) { + return super.rewriteEnumValue(gene).argument(String.valueOf(gene.isRecessive())); + } + }) + .register("CookingBookCategory", CookingBookCategory.class, new EnumCloneRewriter<>(net.minecraft.world.item.crafting.CookingBookCategory.class)) + .register("CraftingBookCategory", CraftingBookCategory.class, new EnumCloneRewriter<>(net.minecraft.world.item.crafting.CraftingBookCategory.class)) + .register("TropicalFishPattern", TropicalFish.Pattern.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.TropicalFish.Pattern.class)) + .register("FoxType", Fox.Type.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Fox.Type.class)) + .register("ItemRarity", ItemRarity.class, new EnumCloneRewriter<>(Rarity.class) { + @Override + protected EnumValue.Builder rewriteEnumValue(Rarity rarity) { + return super.rewriteEnumValue(rarity).argument( + "%s.%s".formatted(NamedTextColor.class.getCanonicalName(), rarity.color().name()) + ); + } + }) + .register(Boat.class, composite( + holder("BoatType", Boat.Type.class, new EnumCloneRewriter<>(net.minecraft.world.entity.vehicle.Boat.Type.class) { + @Override + protected EnumValue.Builder rewriteEnumValue(net.minecraft.world.entity.vehicle.Boat.Type type) { + return super.rewriteEnumValue(type).argument( + "%s.%s".formatted(Material.class.getSimpleName(), BuiltInRegistries.BLOCK.getKey(type.getPlanks()).getPath().toUpperCase(Locale.ENGLISH)) + ); + } + }), + holder("BoatStatus", Boat.Status.class, new EnumCloneRewriter<>(net.minecraft.world.entity.vehicle.Boat.Status.class)) + )) + .register(Material.class, composite( + holder("Blocks", new MaterialRewriter.Blocks()), + //holder("Material#isTransparent", MaterialRewriter.IsTransparent()), + + holder("Items", new MaterialRewriter.Items()), + holder("Material#getEquipmentSlot", new MaterialRewriter.GetEquipmentSlot()) + )) + .register(Statistic.class, composite( + holder("StatisticCustom", new StatisticRewriter.Custom()), + holder("StatisticType", new StatisticRewriter.Type()) + )) + .register(Villager.class, composite( + holder("VillagerType", Villager.Type.class, new RegistryFieldRewriter<>(Registries.VILLAGER_TYPE, "getType")), + holder("VillagerProfession", Villager.Profession.class, new VillagerProfessionRewriter()) + )) + .register("JukeboxSong", JukeboxSong.class, new RegistryFieldRewriter<>(Registries.JUKEBOX_SONG, "get") { + @Override + protected String rewriteFieldName(Holder.Reference reference) { + String keyedName = super.rewriteFieldName(reference); + if (!SourceVersion.isIdentifier(keyedName)) { + // fallback to field names for invalid identifier (happens for 5, 11, 13 etc.) + return RegistryEntries.byRegistryKey(Registries.JUKEBOX_SONG).getFieldNames().get(reference.key()); + } + return keyedName; + } + }) + .register("MapCursorType", MapCursor.Type.class, new RegistryFieldRewriter<>(Registries.MAP_DECORATION_TYPE, "getType")) + .register("Structure", Structure.class, new RegistryFieldRewriter<>(Registries.STRUCTURE, "getStructure")) + .register("StructureType", StructureType.class, new RegistryFieldRewriter<>(Registries.STRUCTURE_TYPE, "getStructureType")) + .register("TrimPattern", TrimPattern.class, new RegistryFieldRewriter<>(Registries.TRIM_PATTERN, "getTrimPattern")) + .register("TrimMaterial", TrimMaterial.class, new RegistryFieldRewriter<>(Registries.TRIM_MATERIAL, "getTrimMaterial")) + .register("DamageType", DamageType.class, new RegistryFieldRewriter<>(Registries.DAMAGE_TYPE, "getDamageType")) + .register("GameEvent", GameEvent.class, new RegistryFieldRewriter<>(Registries.GAME_EVENT, "getEvent")) + .register("MusicInstrument", MusicInstrument.class, new RegistryFieldRewriter<>(Registries.INSTRUMENT, "getInstrument")) + .register("WolfVariant", Wolf.Variant.class, new RegistryFieldRewriter<>(Registries.WOLF_VARIANT, "getVariant")) + .register("CatType", Cat.Type.class, new RegistryFieldRewriter<>(Registries.CAT_VARIANT, "getType")) + .register("FrogVariant", Frog.Variant.class, new RegistryFieldRewriter<>(Registries.FROG_VARIANT, "getVariant")) + .register("PatternType", PatternType.class, new RegistryFieldRewriter<>(Registries.BANNER_PATTERN, "getType")) + .register("MemoryKey", MemoryKey.class, new MemoryKeyRewriter()) + .register("ItemType", ItemType.class, new ItemTypeRewriter()) + .register("BlockType", BlockType.class, new BlockTypeRewriter()) + .register("FeatureFlag", FeatureFlag.class, new FeatureFlagRewriter()) + .register("Tag", Tag.class, new TagRewriter()) + .register("MapPalette#colors", MapPalette.class, new MapPaletteRewriter()); + + serverSourceSet + .register("CraftBlockData#MAP", Types.CRAFT_BLOCK_DATA, new CraftBlockDataMapping()) + .register("CraftBlockEntityStates", Types.CRAFT_BLOCK_STATES, new CraftBlockEntityStateMapping()) + .register(Types.CRAFT_STATISTIC, composite( + holder("CraftStatisticCustom", new StatisticRewriter.CraftCustom()), + holder("CraftStatisticType", new StatisticRewriter.CraftType()) + )) + .register(Types.CRAFT_POTION_UTIL, composite( + holder("CraftPotionUtil#upgradeable", new CraftPotionUtilRewriter("strong")), + holder("CraftPotionUtil#extendable", new CraftPotionUtilRewriter("long")) + )); + RegistryBootstrapper.bootstrap(apiSourceSet, serverSourceSet); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/registry/RegistryBootstrapper.java b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryBootstrapper.java new file mode 100644 index 0000000000..972546b40b --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryBootstrapper.java @@ -0,0 +1,33 @@ +package io.papermc.generator.registry; + +import io.papermc.generator.rewriter.registration.PatternSourceSetRewriter; +import io.papermc.generator.rewriter.types.Types; +import io.papermc.generator.rewriter.types.registry.PaperRegistriesRewriter; +import io.papermc.generator.rewriter.types.registry.RegistryEventsRewriter; +import io.papermc.generator.types.SourceGenerator; +import io.papermc.generator.types.registry.GeneratedKeyType; +import io.papermc.generator.types.registry.GeneratedTagKeyType; +import io.papermc.paper.registry.event.RegistryEvents; +import java.util.List; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class RegistryBootstrapper { + + private static final String PAPER_REGISTRY_PACKAGE = "io.papermc.paper.registry"; + + public static void bootstrap(List generators) { + // typed/tag keys + RegistryEntries.forEach(entry -> { + generators.add(new GeneratedKeyType<>(PAPER_REGISTRY_PACKAGE + ".keys", entry)); + if (entry.registry().getTagNames().findAny().isPresent()) { + generators.add(new GeneratedTagKeyType(entry, PAPER_REGISTRY_PACKAGE + ".keys.tags")); + } + }); + } + + public static void bootstrap(PatternSourceSetRewriter apiSourceSet, PatternSourceSetRewriter serverSourceSet) { + apiSourceSet.register("RegistryEvents", RegistryEvents.class, new RegistryEventsRewriter()); + serverSourceSet.register("RegistryDefinitions", Types.PAPER_REGISTRIES, new PaperRegistriesRewriter()); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntries.java b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntries.java new file mode 100644 index 0000000000..03da8393f7 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntries.java @@ -0,0 +1,200 @@ +package io.papermc.generator.registry; + +import io.papermc.generator.utils.ClassHelper; +import io.papermc.paper.registry.data.EnchantmentRegistryEntry; +import io.papermc.paper.registry.data.GameEventRegistryEntry; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.lang.reflect.Type; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.function.Consumer; +import net.minecraft.core.Registry; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.world.damagesource.DamageTypes; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.entity.ai.memory.MemoryModuleType; +import net.minecraft.world.entity.animal.CatVariant; +import net.minecraft.world.entity.animal.FrogVariant; +import net.minecraft.world.entity.animal.WolfVariants; +import net.minecraft.world.entity.decoration.PaintingVariants; +import net.minecraft.world.entity.npc.VillagerProfession; +import net.minecraft.world.entity.npc.VillagerType; +import net.minecraft.world.item.Instruments; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.JukeboxSongs; +import net.minecraft.world.item.alchemy.Potions; +import net.minecraft.world.item.armortrim.TrimMaterials; +import net.minecraft.world.item.armortrim.TrimPatterns; +import net.minecraft.world.item.enchantment.Enchantments; +import net.minecraft.world.level.biome.Biomes; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.entity.BannerPatterns; +import net.minecraft.world.level.material.Fluids; +import net.minecraft.world.level.saveddata.maps.MapDecorationTypes; +import org.bukkit.Art; +import org.bukkit.Fluid; +import org.bukkit.GameEvent; +import org.bukkit.JukeboxSong; +import org.bukkit.Keyed; +import org.bukkit.MusicInstrument; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.attribute.Attribute; +import org.bukkit.block.Biome; +import org.bukkit.block.BlockType; +import org.bukkit.block.banner.PatternType; +import org.bukkit.damage.DamageType; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Cat; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Frog; +import org.bukkit.entity.Villager; +import org.bukkit.entity.Wolf; +import org.bukkit.entity.memory.MemoryKey; +import org.bukkit.generator.structure.Structure; +import org.bukkit.generator.structure.StructureType; +import org.bukkit.inventory.ItemType; +import org.bukkit.inventory.MenuType; +import org.bukkit.inventory.meta.trim.TrimMaterial; +import org.bukkit.inventory.meta.trim.TrimPattern; +import org.bukkit.map.MapCursor; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionType; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public final class RegistryEntries { + + private static RegistryEntry entry(ResourceKey> registryKey, @Nullable Class registryConstantClass, Class apiClass, String implClass) { + return new RegistryEntry<>(registryKey, (RegistryKeyField) REGISTRY_KEY_FIELDS.get(registryKey), registryConstantClass, apiClass, implClass); + } + + // CraftBukkit entry where implementation start by "Craft" + private static RegistryEntry entry(ResourceKey> registryKey, @Nullable Class registryConstantClass, Class apiClass) { + return entry(registryKey, registryConstantClass, "Craft", apiClass); + } + + private static RegistryEntry entry(ResourceKey> registryKey, @Nullable Class registryConstantClass, String implPrefix, Class apiClass) { + String name = io.papermc.typewriter.utils.ClassHelper.retrieveFullNestedName(apiClass); + RegistryKeyField registryKeyField = (RegistryKeyField) REGISTRY_KEY_FIELDS.get(registryKey); + String[] classes = name.split("\\."); + if (classes.length == 0) { + return new RegistryEntry<>(registryKey, registryKeyField, registryConstantClass, apiClass, implPrefix.concat(apiClass.getSimpleName())); + } + + StringBuilder implName = new StringBuilder(name.length() + implPrefix.length() * classes.length); + implName.append(implPrefix.concat(classes[0])); + for (int i = 1; i < classes.length; i++) { + implName.append('.'); + implName.append(implPrefix.concat(classes[i])); + } + + return new RegistryEntry<>(registryKey, registryKeyField, registryConstantClass, apiClass,implName.toString()); + } + + private static final Map>, RegistryKeyField> REGISTRY_KEY_FIELDS; + static { + Map>, RegistryKeyField> registryKeyFields = new IdentityHashMap<>(); + try { + for (Field field : Registries.class.getDeclaredFields()) { + if (!ResourceKey.class.isAssignableFrom(field.getType())) { + continue; + } + + if (ClassHelper.isStaticConstant(field, Modifier.PUBLIC)) { + Type elementType = ClassHelper.getNestedTypeParameter(field.getGenericType(), ResourceKey.class, Registry.class, null); + if (elementType != null) { + registryKeyFields.put(((ResourceKey>) field.get(null)), new RegistryKeyField<>(ClassHelper.eraseType(elementType), field.getName())); + } + } + } + } catch (ReflectiveOperationException ex) { + throw new RuntimeException(ex); + } + REGISTRY_KEY_FIELDS = Collections.unmodifiableMap(registryKeyFields); + } + + public static final Set> REGISTRY_CLASS_NAME_BASED_ON_API = Set.of( + BlockType.class, + ItemType.class + ); + + public static final List> BUILT_IN = List.of( + entry(Registries.GAME_EVENT, net.minecraft.world.level.gameevent.GameEvent.class, GameEvent.class).apiRegistryBuilder(GameEventRegistryEntry.Builder.class, "PaperGameEventRegistryEntry.PaperBuilder"), + entry(Registries.STRUCTURE_TYPE, net.minecraft.world.level.levelgen.structure.StructureType.class, StructureType.class), + entry(Registries.INSTRUMENT, Instruments.class, MusicInstrument.class), + entry(Registries.MOB_EFFECT, MobEffects.class, PotionEffectType.class), + entry(Registries.BLOCK, Blocks.class, BlockType.class), + entry(Registries.ITEM, Items.class, ItemType.class), + entry(Registries.CAT_VARIANT, CatVariant.class, Cat.Type.class), + entry(Registries.FROG_VARIANT, FrogVariant.class, Frog.Variant.class), + entry(Registries.VILLAGER_PROFESSION, VillagerProfession.class, Villager.Profession.class), + entry(Registries.VILLAGER_TYPE, VillagerType.class, Villager.Type.class), + entry(Registries.MAP_DECORATION_TYPE, MapDecorationTypes.class, MapCursor.Type.class), + entry(Registries.MENU, net.minecraft.world.inventory.MenuType.class, MenuType.class) + ); + + public static final List> DATA_DRIVEN = List.of( + entry(Registries.STRUCTURE, null, Structure.class).delayed(), + entry(Registries.TRIM_MATERIAL, TrimMaterials.class, TrimMaterial.class).delayed(), + entry(Registries.TRIM_PATTERN, TrimPatterns.class, TrimPattern.class).delayed(), + entry(Registries.DAMAGE_TYPE, DamageTypes.class, DamageType.class).delayed(), + entry(Registries.WOLF_VARIANT, WolfVariants.class, Wolf.Variant.class).delayed(), + entry(Registries.ENCHANTMENT, Enchantments.class, Enchantment.class).apiRegistryBuilder(EnchantmentRegistryEntry.Builder.class, "PaperEnchantmentRegistryEntry.PaperBuilder").withSerializationUpdater("ENCHANTMENT_RENAME").delayed(), + entry(Registries.JUKEBOX_SONG, JukeboxSongs.class, JukeboxSong.class).delayed(), + entry(Registries.BANNER_PATTERN, BannerPatterns.class, PatternType.class).delayed() + ); + + public static final List> API_ONLY = List.of( + entry(Registries.BIOME, Biomes.class, Biome.class), + entry(Registries.PAINTING_VARIANT, PaintingVariants.class, Art.class).apiRegistryField("ART"), + entry(Registries.ATTRIBUTE, Attributes.class, Attribute.class), + entry(Registries.ENTITY_TYPE, net.minecraft.world.entity.EntityType.class, EntityType.class), + entry(Registries.PARTICLE_TYPE, ParticleTypes.class, Particle.class), + entry(Registries.POTION, Potions.class, PotionType.class), + entry(Registries.SOUND_EVENT, SoundEvents.class, Sound.class).apiRegistryField("SOUNDS"), + entry(Registries.MEMORY_MODULE_TYPE, MemoryModuleType.class, MemoryKey.class), + entry(Registries.FLUID, Fluids.class, Fluid.class) + ); + + public static final Map>, RegistryEntry> BY_REGISTRY_KEY; + static { + Map>, RegistryEntry> byRegistryKey = new IdentityHashMap<>(BUILT_IN.size() + DATA_DRIVEN.size() + API_ONLY.size()); + forEach(entry -> { + byRegistryKey.put(entry.registryKey(), entry); + }, RegistryEntries.BUILT_IN, RegistryEntries.DATA_DRIVEN, RegistryEntries.API_ONLY); + BY_REGISTRY_KEY = Collections.unmodifiableMap(byRegistryKey); + } + + @SuppressWarnings("unchecked") + public static RegistryEntry byRegistryKey(ResourceKey> registryKey) { + return (RegistryEntry) Objects.requireNonNull(BY_REGISTRY_KEY.get(registryKey)); + } + + // real registries + public static void forEach(Consumer> callback) { + forEach(callback, RegistryEntries.BUILT_IN, RegistryEntries.DATA_DRIVEN); + } + + @SafeVarargs + public static void forEach(Consumer> callback, List>... datas) { + for (List> data : datas) { + for (RegistryEntry entry : data) { + callback.accept(entry); + } + } + } + + private RegistryEntries() { + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntry.java b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntry.java new file mode 100644 index 0000000000..ea1cccf35c --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntry.java @@ -0,0 +1,183 @@ +package io.papermc.generator.registry; + +import io.papermc.generator.Main; +import io.papermc.generator.utils.ClassHelper; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import net.minecraft.core.Holder; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import org.bukkit.Keyed; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public final class RegistryEntry { + + private final ResourceKey> registryKey; + private final RegistryKeyField registryKeyField; + private final Class registryElementClass; + private final @Nullable Class registryConstantClass; + + private final Class apiClass; // TODO remove Keyed + private final String implClass; + + private @Nullable Class apiRegistryBuilder; + private @Nullable String apiRegistryBuilderImpl; + + private @Nullable String fieldRename; + private boolean delayed; + private Optional apiRegistryField = Optional.empty(); + + private @Nullable Map, String> fieldNames; + + public RegistryEntry(ResourceKey> registryKey, RegistryKeyField registryKeyField, @Nullable Class registryConstantClass, Class apiClass, String implClass) { + this.registryKey = registryKey; + this.registryKeyField = registryKeyField; + this.registryElementClass = registryKeyField.elementClass(); + this.registryConstantClass = registryConstantClass; + this.apiClass = apiClass; + this.implClass = implClass; + } + + public ResourceKey> registryKey() { + return this.registryKey; + } + + public Registry registry() { + return Main.REGISTRY_ACCESS.registryOrThrow(this.registryKey); + } + + public String registryKeyField() { + return this.registryKeyField.name(); + } + + public Class apiClass() { + return this.apiClass; + } + + public String implClass() { + return this.implClass; + } + + public RegistryEntry delayed() { + this.delayed = true; + return this; + } + + public RegistryEntry withSerializationUpdater(String fieldName) { + this.fieldRename = fieldName; + return this; + } + + public boolean isDelayed() { + return this.delayed; + } + + public @Nullable String fieldRename() { + return this.fieldRename; + } + + public @Nullable Class apiRegistryBuilder() { + return this.apiRegistryBuilder; + } + + public @Nullable String apiRegistryBuilderImpl() { + return this.apiRegistryBuilderImpl; + } + + public RegistryEntry apiRegistryBuilder(Class builderClass, String builderImplClass) { + this.apiRegistryBuilder = builderClass; + this.apiRegistryBuilderImpl = builderImplClass; + return this; + } + + public Optional apiRegistryField() { + return this.apiRegistryField; + } + + public RegistryEntry apiRegistryField(String registryField) { + this.apiRegistryField = Optional.of(registryField); + return this; + } + + public String keyClassName() { + if (RegistryEntries.REGISTRY_CLASS_NAME_BASED_ON_API.contains(this.apiClass)) { + return this.apiClass.getSimpleName(); + } + + return this.registryElementClass.getSimpleName(); + } + + public boolean allowCustomKeys() { + return this.apiRegistryBuilder != null || RegistryEntries.DATA_DRIVEN.contains(this); + } + + private Map, TO> getFields(Map, TO> map, Function transform) { + Registry registry = this.registry(); + try { + for (Field field : this.registryConstantClass.getDeclaredFields()) { + if (!ResourceKey.class.isAssignableFrom(field.getType()) && !Holder.Reference.class.isAssignableFrom(field.getType()) && !this.registryElementClass.isAssignableFrom(field.getType())) { + continue; + } + + if (ClassHelper.isStaticConstant(field, Modifier.PUBLIC)) { + ResourceKey key = null; + if (this.registryElementClass.isAssignableFrom(field.getType())) { + key = registry.getResourceKey(this.registryElementClass.cast(field.get(null))).orElseThrow(); + } else { + if (field.getGenericType() instanceof ParameterizedType complexType && complexType.getActualTypeArguments().length == 1 && + complexType.getActualTypeArguments()[0] == this.registryElementClass) { + + if (Holder.Reference.class.isAssignableFrom(field.getType())) { + key = ((Holder.Reference) field.get(null)).key(); + } else { + key = (ResourceKey) field.get(null); + } + } + } + if (key != null) { + TO value = transform.apply(field); + if (value != null) { + map.put(key, value); + } + } + } + } + } catch (ReflectiveOperationException ex) { + throw new RuntimeException(ex); + } + return map; + } + + public Map, String> getFieldNames() { + if (this.fieldNames == null) { + this.fieldNames = this.getFields(Field::getName); + } + return this.fieldNames; + } + + public Map, TO> getFields(Function transform) { + if (this.registryConstantClass == null) { + return Collections.emptyMap(); + } + + return Collections.unmodifiableMap(this.getFields(new IdentityHashMap<>(), transform)); + } + + @Override + public String toString() { + return "RegistryEntry[" + + "registryKey=" + this.registryKey + ", " + + "registryKeyField=" + this.registryKeyField + ", " + + "apiClass=" + this.apiClass + ", " + + "implClass=" + this.implClass + ", " + + ']'; + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/registry/RegistryKeyField.java b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryKeyField.java new file mode 100644 index 0000000000..7a91f0bd4b --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryKeyField.java @@ -0,0 +1,7 @@ +package io.papermc.generator.registry; + +import org.jspecify.annotations.NullMarked; + +@NullMarked +public record RegistryKeyField(Class elementClass, String name) { +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/PaperPatternSourceSetRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/PaperPatternSourceSetRewriter.java new file mode 100644 index 0000000000..dd6ecbf317 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/PaperPatternSourceSetRewriter.java @@ -0,0 +1,85 @@ +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.FileMetadata; +import io.papermc.typewriter.IndentUnit; +import io.papermc.typewriter.SourceFile; +import io.papermc.typewriter.SourceRewriter; +import io.papermc.typewriter.registration.SourceSetRewriterImpl; +import io.papermc.typewriter.replace.CompositeRewriter; +import io.papermc.typewriter.replace.ReplaceOptions; +import io.papermc.typewriter.replace.ReplaceOptionsLike; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Map; +import net.minecraft.SharedConstants; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.VisibleForTesting; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public class PaperPatternSourceSetRewriter extends SourceSetRewriterImpl implements PatternSourceSetRewriter { + + private static final String PAPER_START_FORMAT = "Paper start"; + private static final String PAPER_END_FORMAT = "Paper end"; + private static final String COMMENT_MARKER_FORMAT = "%s - Generated/%s"; // {0} = PAPER_START_FORMAT|PAPER_END_FORMAT {1} = pattern + private static final IndentUnit INDENT_UNIT = IndentUnit.parse(SimpleGenerator.INDENT_UNIT); + + @Deprecated + private final Path alternateOutput; + + @Deprecated + public PaperPatternSourceSetRewriter(Path alternateOutput) { + super(INDENT_UNIT); + this.alternateOutput = alternateOutput; + } + + @VisibleForTesting + public FileMetadata getMetadata() { + return this.fileMetadata; + } + + @Deprecated + public Path getAlternateOutput() { + return this.alternateOutput; + } + + private static ReplaceOptionsLike getOptions(String pattern, @Nullable ClassNamed targetClass) { + return ReplaceOptions.between( + COMMENT_MARKER_FORMAT.formatted(PAPER_START_FORMAT, pattern), + COMMENT_MARKER_FORMAT.formatted(PAPER_END_FORMAT, pattern) + ) + .generatedComment(Annotations.annotationStyle(GeneratedFrom.class) + " " + SharedConstants.getCurrentVersion().getName()) + .targetClass(targetClass); + } + + @Override + public PatternSourceSetRewriter register(String pattern, ClassNamed targetClass, SearchReplaceRewriter rewriter) { + return super.register(SourceFile.of(targetClass.topLevel()), rewriter.withOptions(getOptions(pattern, targetClass)).customName(pattern)); + } + + @Override + public PatternSourceSetRewriter register(ClassNamed mainClass, CompositeRewriter rewriter) { + return super.register(SourceFile.of(mainClass), rewriter); + } + + @Contract(value = "_ -> new", pure = true) + public static CompositeRewriter composite(RewriterHolder... holders) { + return CompositeRewriter.bind(Arrays.stream(holders) + .map(holder -> holder.transform(PaperPatternSourceSetRewriter::getOptions)) + .toArray(SearchReplaceRewriter[]::new)); + } + + @Override + public void apply(Path output) throws IOException { // todo remove + for (Map.Entry rewriter : this.rewrites.entrySet()) { + rewriter.getValue().writeToFile(output, this.alternateOutput, this.fileMetadata, rewriter.getKey()); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/PatternSourceSetRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/PatternSourceSetRewriter.java new file mode 100644 index 0000000000..0189efb104 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/PatternSourceSetRewriter.java @@ -0,0 +1,23 @@ +package io.papermc.generator.rewriter.registration; + +import io.papermc.typewriter.ClassNamed; +import io.papermc.typewriter.registration.SourceSetRewriter; +import io.papermc.typewriter.replace.CompositeRewriter; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface PatternSourceSetRewriter extends SourceSetRewriter { + + default PatternSourceSetRewriter register(String pattern, Class targetClass, SearchReplaceRewriter rewriter) { + return register(pattern, new ClassNamed(targetClass), rewriter); + } + + PatternSourceSetRewriter register(String pattern, ClassNamed targetClass, SearchReplaceRewriter rewriter); + + default PatternSourceSetRewriter register(Class mainClass, CompositeRewriter rewriter) { + return this.register(new ClassNamed(mainClass), rewriter); + } + + PatternSourceSetRewriter register(ClassNamed mainClass, CompositeRewriter rewriter); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/RewriterHolder.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/RewriterHolder.java new file mode 100644 index 0000000000..0d4809a214 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/registration/RewriterHolder.java @@ -0,0 +1,27 @@ +package io.papermc.generator.rewriter.registration; + +import io.papermc.typewriter.ClassNamed; +import io.papermc.typewriter.replace.ReplaceOptionsLike; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import java.util.function.BiFunction; +import org.jetbrains.annotations.Contract; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public record RewriterHolder(String pattern, @Nullable ClassNamed targetClass, SearchReplaceRewriter rewriter) { + + @Contract(value = "_, _, _ -> new", pure = true) + public static RewriterHolder holder(String pattern, @Nullable Class targetClass, SearchReplaceRewriter rewriter) { + return new RewriterHolder(pattern, targetClass == null ? null : new ClassNamed(targetClass), rewriter); + } + + @Contract(value = "_, _ -> new", pure = true) + public static RewriterHolder holder(String pattern, SearchReplaceRewriter rewriter) { + return holder(pattern, null, rewriter); + } + + public SearchReplaceRewriter transform(BiFunction patternMapper) { + return this.rewriter.withOptions(patternMapper.apply(this.pattern, this.targetClass)).customName(this.pattern); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/Types.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/Types.java new file mode 100644 index 0000000000..387c631cef --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/Types.java @@ -0,0 +1,22 @@ +package io.papermc.generator.rewriter.types; + +import io.papermc.typewriter.ClassNamed; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class Types { + + public static final String BASE_PACKAGE = "org.bukkit.craftbukkit"; + + public static final ClassNamed CRAFT_BLOCK_DATA = ClassNamed.of(BASE_PACKAGE + ".block.data", "CraftBlockData"); + + public static final ClassNamed CRAFT_BLOCK_STATES = ClassNamed.of(BASE_PACKAGE + ".block", "CraftBlockStates"); + + public static final ClassNamed CRAFT_STATISTIC = ClassNamed.of(BASE_PACKAGE, "CraftStatistic"); + + public static final ClassNamed CRAFT_POTION_UTIL = ClassNamed.of(BASE_PACKAGE + ".potion", "CraftPotionUtil"); + + public static final ClassNamed FIELD_RENAME = ClassNamed.of(BASE_PACKAGE + ".legacy", "FieldRename"); + + public static final ClassNamed PAPER_REGISTRIES = ClassNamed.of("io.papermc.paper.registry", "PaperRegistries"); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/EnumRegistryRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/EnumRegistryRewriter.java new file mode 100644 index 0000000000..df923e1067 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/EnumRegistryRewriter.java @@ -0,0 +1,88 @@ +package io.papermc.generator.rewriter.types.registry; + +import com.google.common.base.Suppliers; +import io.papermc.generator.Main; +import io.papermc.generator.rewriter.utils.Annotations; +import io.papermc.generator.utils.Formatting; +import io.papermc.generator.utils.RegistryUtils; +import io.papermc.generator.utils.experimental.FlagHolders; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.typewriter.preset.EnumRewriter; +import io.papermc.typewriter.preset.model.EnumValue; +import java.util.Set; +import java.util.function.Supplier; +import net.minecraft.core.Holder; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.flag.FeatureElement; +import net.minecraft.world.flag.FeatureFlags; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +import static io.papermc.typewriter.utils.Formatting.quoted; + +@NullMarked +public class EnumRegistryRewriter extends EnumRewriter> { + + private final Registry registry; + private final Supplier>> experimentalKeys; + private final boolean isFilteredRegistry; + private final boolean hasKeyArgument; + + public EnumRegistryRewriter(ResourceKey> registryKey) { + this(registryKey, true); + } + + protected EnumRegistryRewriter(ResourceKey> registryKey, boolean hasKeyArgument) { + this.registry = Main.REGISTRY_ACCESS.registryOrThrow(registryKey); + this.experimentalKeys = Suppliers.memoize(() -> RegistryUtils.collectExperimentalDataDrivenKeys(this.registry)); + this.isFilteredRegistry = FeatureElement.FILTERED_REGISTRIES.contains(registryKey); + this.hasKeyArgument = hasKeyArgument; + } + + @Deprecated + public static EnumRegistryRewriter forLegacyEnum(ResourceKey> registryKey) { // get the key from the name of the enum + return new EnumRegistryRewriter<>(registryKey, false); + } + + @Override + protected Iterable> getValues() { + return this.registry.holders().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; + } + + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference reference) { + EnumValue.Builder value = EnumValue.builder(Formatting.formatKeyAsField(reference.key().location().getPath())); + if (this.hasKeyArgument) { + value.argument(quoted(reference.key().location().getPath())); + } + return value; + } + + @Override + protected void appendEnumValue(Holder.Reference reference, StringBuilder builder, String indent, boolean reachEnd) { + // experimental annotation + SingleFlagHolder requiredFeature = this.getRequiredFeature(reference); + if (requiredFeature != null) { + Annotations.experimentalAnnotations(builder, indent, this.importCollector, requiredFeature); + } + + super.appendEnumValue(reference, builder, indent, reachEnd); + } + + protected @Nullable SingleFlagHolder getRequiredFeature(Holder.Reference reference) { + if (this.isFilteredRegistry) { + // built-in registry + FeatureElement element = (FeatureElement) reference.value(); + if (FeatureFlags.isExperimental(element.requiredFeatures())) { + return SingleFlagHolder.fromSet(element.requiredFeatures()); + } + } else { + // data-driven registry + if (this.experimentalKeys.get().contains(reference.key())) { + return FlagHolders.NEXT_UPDATE; + } + } + return null; + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/FeatureFlagRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/FeatureFlagRewriter.java new file mode 100644 index 0000000000..2a32034b35 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/FeatureFlagRewriter.java @@ -0,0 +1,61 @@ +package io.papermc.generator.rewriter.types.registry; + +import com.mojang.logging.LogUtils; +import io.papermc.generator.utils.Formatting; +import io.papermc.typewriter.SourceFile; +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.flag.FeatureFlag; +import net.minecraft.world.flag.FeatureFlagSet; +import net.minecraft.world.flag.FeatureFlags; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; +import org.slf4j.Logger; + +import static io.papermc.generator.rewriter.utils.Annotations.annotation; +import static io.papermc.typewriter.utils.Formatting.quoted; + +@NullMarked +public class FeatureFlagRewriter extends SearchReplaceRewriter { + + private static final Logger LOGGER = LogUtils.getLogger(); + + @Override + public boolean registerFor(SourceFile file) { + try { + org.bukkit.FeatureFlag.class.getDeclaredMethod("create", String.class); + } catch (NoSuchMethodException e) { + LOGGER.error("Fetch method not found, skipping the rewriter for feature flag", e); + return false; + } + + return super.registerFor(file); + } + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + Iterator> flagIterator = FeatureFlags.REGISTRY.names.entrySet().stream().sorted(Formatting.alphabeticKeyOrder(entry -> entry.getKey().getPath())).iterator(); + while (flagIterator.hasNext()) { + Map.Entry entry = flagIterator.next(); + ResourceLocation name = entry.getKey(); + if (FeatureFlags.isExperimental(FeatureFlagSet.of(entry.getValue()))) { + builder.append(metadata.indent()).append(annotation(ApiStatus.Experimental.class, this.importCollector)).append('\n'); + } + + builder.append(metadata.indent()); + + builder.append(org.bukkit.FeatureFlag.class.getSimpleName()).append(' ').append(Formatting.formatKeyAsField(name.getPath())); + builder.append(" = "); + builder.append("create(%s)".formatted(quoted(name.getPath()))); + builder.append(';'); + + builder.append('\n'); + if (flagIterator.hasNext()) { + builder.append('\n'); + } + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/PaperRegistriesRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/PaperRegistriesRewriter.java new file mode 100644 index 0000000000..db4bf05208 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/PaperRegistriesRewriter.java @@ -0,0 +1,83 @@ +package io.papermc.generator.rewriter.types.registry; + +import io.papermc.generator.registry.RegistryEntries; +import io.papermc.generator.registry.RegistryEntry; +import io.papermc.generator.rewriter.types.Types; +import io.papermc.paper.registry.RegistryKey; +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import net.minecraft.core.registries.Registries; +import org.bukkit.Registry; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class PaperRegistriesRewriter extends SearchReplaceRewriter { + + private void appendEntry(String indent, StringBuilder builder, RegistryEntry entry, boolean canBeDelayed, boolean apiOnly) { + builder.append(indent); + if (apiOnly) { + builder.append("apiOnly"); + } else { + if (entry.apiRegistryBuilderImpl() != null) { + builder.append("writable"); + } else { + builder.append("entry"); + } + } + builder.append('('); + builder.append(Registries.class.getSimpleName()).append('.').append(entry.registryKeyField()); + builder.append(", "); + builder.append(RegistryKey.class.getSimpleName()).append('.').append(entry.registryKeyField()); + builder.append(", "); + if (apiOnly) { + builder.append("() -> "); + builder.append(Registry.class.getCanonicalName()).append('.').append(entry.apiRegistryField().orElse(entry.registryKeyField())); + } else { + builder.append(this.importCollector.getShortName(entry.apiClass())).append(".class"); + builder.append(", "); + + builder.append(this.importCollector.getShortName(this.classNamedView.findFirst(entry.implClass()))).append("::new"); + if (entry.apiRegistryBuilderImpl() != null) { + builder.append(", "); + builder.append(this.importCollector.getShortName(this.classNamedView.findFirst(entry.apiRegistryBuilderImpl()))).append("::new"); + } + } + builder.append(')'); + if (entry.fieldRename() != null) { + builder.append(".withSerializationUpdater(").append(Types.FIELD_RENAME.simpleName()).append('.').append(entry.fieldRename()).append(")"); + } + if (canBeDelayed && entry.isDelayed()) { + builder.append(".delayed()"); + } + builder.append(','); + builder.append('\n'); + } + + @Override + public void insert(SearchMetadata metadata, StringBuilder builder) { + builder.append(metadata.indent()).append("// built-in"); + builder.append('\n'); + + for (RegistryEntry entry : RegistryEntries.BUILT_IN) { + appendEntry(metadata.indent(), builder, entry, false, false); + } + + builder.append('\n'); + builder.append(metadata.indent()).append("// data-driven"); + builder.append('\n'); + + for (RegistryEntry entry : RegistryEntries.DATA_DRIVEN) { + appendEntry(metadata.indent(), builder, entry, true, false); + } + + builder.append('\n'); + builder.append(metadata.indent()).append("// api-only"); + builder.append('\n'); + + for (RegistryEntry entry : RegistryEntries.API_ONLY) { + appendEntry(metadata.indent(), builder, entry, false, true); + } + + builder.deleteCharAt(builder.length() - 2); // delete extra comma... + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryEventsRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryEventsRewriter.java new file mode 100644 index 0000000000..6d289d4d05 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryEventsRewriter.java @@ -0,0 +1,33 @@ +package io.papermc.generator.rewriter.types.registry; + +import io.papermc.generator.registry.RegistryEntries; +import io.papermc.paper.registry.RegistryKey; +import io.papermc.paper.registry.event.RegistryEventProvider; +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import org.jspecify.annotations.NullMarked; + +import static javax.lang.model.element.Modifier.FINAL; +import static javax.lang.model.element.Modifier.PUBLIC; +import static javax.lang.model.element.Modifier.STATIC; + +@NullMarked +public class RegistryEventsRewriter extends SearchReplaceRewriter { + + @Override + public void insert(SearchMetadata metadata, StringBuilder builder) { + RegistryEntries.forEach(entry -> { + if (entry.apiRegistryBuilder() != null) { + builder.append(metadata.indent()); + builder.append("%s %s %s ".formatted(PUBLIC, STATIC, FINAL)); + builder.append(RegistryEventProvider.class.getSimpleName()); + builder.append("<").append(this.importCollector.getShortName(entry.apiClass())).append(", ").append(this.importCollector.getShortName(entry.apiRegistryBuilder())).append('>'); + builder.append(' '); + builder.append(entry.registryKeyField()); + builder.append(" = "); + builder.append("create(").append(RegistryKey.class.getSimpleName()).append('.').append(entry.registryKeyField()).append(");"); + builder.append('\n'); + } + }); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryFieldRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryFieldRewriter.java new file mode 100644 index 0000000000..5f4b9dc324 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryFieldRewriter.java @@ -0,0 +1,136 @@ +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.rewriter.utils.Annotations; +import io.papermc.generator.utils.Formatting; +import io.papermc.generator.utils.RegistryUtils; +import io.papermc.generator.utils.experimental.FlagHolders; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +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.Iterator; +import java.util.Set; +import java.util.function.Supplier; +import net.minecraft.core.Holder; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.flag.FeatureElement; +import net.minecraft.world.flag.FeatureFlags; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; +import org.slf4j.Logger; + +import static io.papermc.typewriter.utils.Formatting.quoted; +import static javax.lang.model.element.Modifier.FINAL; +import static javax.lang.model.element.Modifier.PUBLIC; +import static javax.lang.model.element.Modifier.STATIC; + +@NullMarked +public class RegistryFieldRewriter extends SearchReplaceRewriter { + + private static final Logger LOGGER = LogUtils.getLogger(); + + private final Registry registry; + private final Supplier>> experimentalKeys; + private final boolean isFilteredRegistry; + private final @Nullable String fetchMethod; + + protected @MonotonicNonNull ClassNamed fieldClass; + + public RegistryFieldRewriter(ResourceKey> registryKey, @Nullable String fetchMethod) { + this.registry = Main.REGISTRY_ACCESS.registryOrThrow(registryKey); + this.experimentalKeys = Suppliers.memoize(() -> RegistryUtils.collectExperimentalDataDrivenKeys(this.registry)); + this.isFilteredRegistry = FeatureElement.FILTERED_REGISTRIES.contains(registryKey); + this.fetchMethod = fetchMethod; + } + + @Override + public boolean registerFor(SourceFile file) { + this.fieldClass = this.options.targetClass().orElse(file.mainClass()); + Preconditions.checkState(this.fieldClass.knownClass() != null, "This rewriter can't run without knowing the field class at runtime!"); + + if (this.fetchMethod != null) { + 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.registry.key(), e); + return false; + } + } + + return super.registerFor(file); + } + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + boolean isInterface = this.fieldClass.knownClass() != null && this.fieldClass.knownClass().isInterface(); + Iterator> referenceIterator = this.registry.holders().filter(this::canPrintField).sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).iterator(); + + while (referenceIterator.hasNext()) { + Holder.Reference reference = referenceIterator.next(); + + this.rewriteJavadocs(reference, metadata.indent(), builder); + + SingleFlagHolder requiredFeature = this.getRequiredFeature(reference); + if (requiredFeature != null) { + Annotations.experimentalAnnotations(builder, metadata.indent(), this.importCollector, requiredFeature); + } + + builder.append(metadata.indent()); + if (!isInterface) { + builder.append("%s %s %s ".formatted(PUBLIC, STATIC, FINAL)); + } + + builder.append(this.rewriteFieldType(reference)).append(' ').append(this.rewriteFieldName(reference)); + builder.append(" = "); + builder.append(this.rewriteFieldValue(reference)); + builder.append(';'); + + builder.append('\n'); + if (referenceIterator.hasNext()) { + builder.append('\n'); + } + } + } + + protected void rewriteJavadocs(Holder.Reference reference, String indent, StringBuilder builder) { + } + + protected boolean canPrintField(Holder.Reference reference) { + return true; + } + + protected String rewriteFieldType(Holder.Reference reference) { + return this.fieldClass.simpleName(); + } + + protected String rewriteFieldName(Holder.Reference reference) { + return Formatting.formatKeyAsField(reference.key().location().getPath()); + } + + protected String rewriteFieldValue(Holder.Reference reference) { + return "%s(%s)".formatted(this.fetchMethod, quoted(reference.key().location().getPath())); + } + + protected @Nullable SingleFlagHolder getRequiredFeature(Holder.Reference reference) { + if (this.isFilteredRegistry) { + // built-in registry + FeatureElement element = (FeatureElement) reference.value(); + if (FeatureFlags.isExperimental(element.requiredFeatures())) { + return SingleFlagHolder.fromSet(element.requiredFeatures()); + } + } else { + // data-driven registry + if (this.experimentalKeys.get().contains(reference.key())) { + return FlagHolders.NEXT_UPDATE; + } + } + return null; + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/TagRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/TagRewriter.java new file mode 100644 index 0000000000..3ac1b7f670 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/TagRewriter.java @@ -0,0 +1,88 @@ +package io.papermc.generator.rewriter.types.registry; + +import io.papermc.generator.Main; +import io.papermc.generator.rewriter.utils.Annotations; +import io.papermc.generator.utils.Formatting; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import java.util.Iterator; +import java.util.Locale; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.tags.TagKey; +import org.bukkit.Bukkit; +import org.bukkit.Fluid; +import org.bukkit.GameEvent; +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.EntityType; +import org.jspecify.annotations.NullMarked; + +import static io.papermc.typewriter.utils.Formatting.quoted; + +@NullMarked +public class TagRewriter extends SearchReplaceRewriter { + + public record TagRegistry(String legacyFolderName, Class apiType, ResourceKey> registryKey) { // TODO remove Keyed + } + + private static final TagRegistry[] SUPPORTED_REGISTRIES = { // 1.21 folder name are normalized to registry key but api will stay as is + new TagRegistry("blocks", Material.class, Registries.BLOCK), + new TagRegistry("items", Material.class, Registries.ITEM), + new TagRegistry("fluids", Fluid.class, Registries.FLUID), + new TagRegistry("entity_types", EntityType.class, Registries.ENTITY_TYPE), + new TagRegistry("game_events", GameEvent.class, Registries.GAME_EVENT) + }; + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + for (int i = 0, len = SUPPORTED_REGISTRIES.length; i < len; i++) { + final TagRegistry tagRegistry = SUPPORTED_REGISTRIES[i]; + + final ResourceKey> registryKey = tagRegistry.registryKey(); + final Registry registry = Main.REGISTRY_ACCESS.registryOrThrow(registryKey); + + final String fieldPrefix = Formatting.formatTagFieldPrefix(tagRegistry.legacyFolderName(), registryKey); + final String registryFieldName = "REGISTRY_" + tagRegistry.legacyFolderName().toUpperCase(Locale.ENGLISH); + + if (i != 0) { + builder.append('\n'); // extra line before the registry field + } + + // registry name field + builder.append(metadata.indent()); + builder.append("%s %s = %s;".formatted(String.class.getSimpleName(), registryFieldName, quoted(tagRegistry.legacyFolderName()))); + + builder.append('\n'); + builder.append('\n'); + + Iterator> keyIterator = registry.getTagNames().sorted(Formatting.alphabeticKeyOrder(tagKey -> tagKey.location().getPath())).iterator(); + + while (keyIterator.hasNext()) { + TagKey tagKey = keyIterator.next(); + final String keyPath = tagKey.location().getPath(); + final String fieldName = fieldPrefix + Formatting.formatKeyAsField(keyPath); + + // tag field + String featureFlagName = Main.EXPERIMENTAL_TAGS.get(tagKey); + if (featureFlagName != null) { + Annotations.experimentalAnnotations(builder, metadata.indent(), this.importCollector, SingleFlagHolder.fromVanillaName(featureFlagName)); + } + + builder.append(metadata.indent()); + builder.append("%s<%s>".formatted(this.source.mainClass().simpleName(), this.importCollector.getShortName(tagRegistry.apiType()))).append(' ').append(fieldName); + builder.append(" = "); + builder.append("%s.getTag(%s, %s.minecraft(%s), %s.class)".formatted(Bukkit.class.getSimpleName(), registryFieldName, NamespacedKey.class.getSimpleName(), quoted(keyPath), tagRegistry.apiType().getSimpleName())); // assume type is imported properly + builder.append(';'); + + builder.append('\n'); + if (keyIterator.hasNext()) { + builder.append('\n'); + } + } + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/BlockTypeRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/BlockTypeRewriter.java new file mode 100644 index 0000000000..6a82e91a3c --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/BlockTypeRewriter.java @@ -0,0 +1,27 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.generator.rewriter.types.registry.RegistryFieldRewriter; +import io.papermc.generator.utils.BlockStateMapping; +import io.papermc.typewriter.utils.ClassHelper; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.Registries; +import net.minecraft.world.level.block.Block; +import org.bukkit.block.BlockType; +import org.bukkit.block.data.BlockData; + +public class BlockTypeRewriter extends RegistryFieldRewriter { + + public BlockTypeRewriter() { + super(Registries.BLOCK, "getBlockType"); + } + + @Override + protected String rewriteFieldType(Holder.Reference reference) { + Class blockData = BlockStateMapping.getBestSuitedApiClass(reference.value().getClass()); + if (blockData == null) { + blockData = BlockData.class; + } + + return "%s<%s>".formatted(ClassHelper.retrieveFullNestedName(BlockType.Typed.class), this.importCollector.getShortName(blockData)); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftBlockDataMapping.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftBlockDataMapping.java new file mode 100644 index 0000000000..2a090056e0 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftBlockDataMapping.java @@ -0,0 +1,19 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.generator.rewriter.types.Types; +import io.papermc.generator.utils.BlockStateMapping; +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import java.util.Comparator; + +public class CraftBlockDataMapping extends SearchReplaceRewriter { + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + BlockStateMapping.MAPPING.entrySet().stream().sorted(Comparator.comparing(entry -> entry.getKey().getCanonicalName())).forEach(entry -> { + builder.append(metadata.indent()); + builder.append("register(%s.class, %s.block.impl.%s::new);".formatted(entry.getKey().getCanonicalName(), Types.BASE_PACKAGE, entry.getValue().implName())); + builder.append('\n'); + }); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftBlockEntityStateMapping.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftBlockEntityStateMapping.java new file mode 100644 index 0000000000..2fd4d0c69f --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftBlockEntityStateMapping.java @@ -0,0 +1,21 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.generator.utils.BlockEntityMapping; +import io.papermc.generator.utils.Formatting; +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import net.minecraft.world.level.block.entity.BlockEntityType; + +public class CraftBlockEntityStateMapping extends SearchReplaceRewriter { + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + BlockEntityMapping.MAPPING.entrySet().stream().sorted(Formatting.alphabeticKeyOrder(entry -> entry.getKey().location().getPath())).forEach(entry -> { + builder.append(metadata.indent()); + builder.append("register(%s.%s, %s.class, %s::new);".formatted( + BlockEntityType.class.getSimpleName(), Formatting.formatKeyAsField(entry.getKey().location().getPath()), + entry.getValue(), entry.getValue())); + builder.append('\n'); + }); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftPotionUtilRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftPotionUtilRewriter.java new file mode 100644 index 0000000000..df57fadbc8 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftPotionUtilRewriter.java @@ -0,0 +1,32 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.generator.utils.Formatting; +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import java.util.Locale; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import org.bukkit.potion.PotionType; + +@Deprecated(forRemoval = true) +public class CraftPotionUtilRewriter extends SearchReplaceRewriter { + + private final String statePrefix; + + public CraftPotionUtilRewriter(String statePrefix) { + this.statePrefix = statePrefix; + } + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + String upperStatePrefix = this.statePrefix.toUpperCase(Locale.ENGLISH); + BuiltInRegistries.POTION.keySet().stream() + .filter(key -> BuiltInRegistries.POTION.containsKey(key.withPath(path -> this.statePrefix + "_" + path))) + .sorted(Formatting.alphabeticKeyOrder(ResourceLocation::getPath)).forEach(key -> { + String keyedName = Formatting.formatKeyAsField(key.getPath()); + builder.append(metadata.indent()); + builder.append(".put(%s.%s, %s.%s_%s)".formatted(PotionType.class.getSimpleName(), keyedName, PotionType.class.getSimpleName(), upperStatePrefix, keyedName)); + builder.append('\n'); + }); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/EntityTypeRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/EntityTypeRewriter.java new file mode 100644 index 0000000000..036c74578f --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/EntityTypeRewriter.java @@ -0,0 +1,170 @@ +package io.papermc.generator.rewriter.types.simple; + +import com.google.common.base.CaseFormat; +import com.google.common.collect.ImmutableMap; +import io.papermc.generator.registry.RegistryEntries; +import io.papermc.generator.rewriter.types.registry.EnumRegistryRewriter; +import io.papermc.generator.types.goal.MobGoalNames; +import io.papermc.typewriter.preset.model.EnumValue; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import java.lang.reflect.ParameterizedType; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import net.minecraft.Util; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.Mob; + +import static io.papermc.typewriter.utils.Formatting.quoted; + +public class EntityTypeRewriter extends EnumRegistryRewriter> { + + private static final Map>, Class> ENTITY_GENERIC_TYPES = + RegistryEntries.byRegistryKey(Registries.ENTITY_TYPE).getFields(field -> { + if (field.getGenericType() instanceof ParameterizedType complexType && complexType.getActualTypeArguments().length == 1) { + return (Class) complexType.getActualTypeArguments()[0]; + } + return null; + }); + + private static final Map CLASS_RENAMES = ImmutableMap.builder() + .put("ExperienceBottle", "ThrownExpBottle") + .put("EyeOfEnder", "EnderSignal") + .put("EndCrystal", "EnderCrystal") + .put("FireworkRocket", "Firework") + .put("FishingBobber", "FishHook") + .put("LeashKnot", "LeashHitch") + .put("LightningBolt", "LightningStrike") + .put("Potion", "ThrownPotion") + .put("Tnt", "TNTPrimed") + .put("ChestMinecart", "StorageMinecart") + .put("CommandBlockMinecart", "CommandMinecart") + .put("TntMinecart", "ExplosiveMinecart") + .put("FurnaceMinecart", "PoweredMinecart") + .build(); + + @Deprecated + private static final Object2IntMap> LEGACY_ID = Util.make(new Object2IntOpenHashMap<>(), map -> { + map.put(EntityType.ITEM, 1); + map.put(EntityType.EXPERIENCE_ORB, 2); + map.put(EntityType.AREA_EFFECT_CLOUD, 3); + map.put(EntityType.ELDER_GUARDIAN, 4); + map.put(EntityType.WITHER_SKELETON, 5); + map.put(EntityType.STRAY, 6); + map.put(EntityType.EGG, 7); + map.put(EntityType.LEASH_KNOT, 8); + map.put(EntityType.PAINTING, 9); + map.put(EntityType.ARROW, 10); + map.put(EntityType.SNOWBALL, 11); + map.put(EntityType.FIREBALL, 12); + map.put(EntityType.SMALL_FIREBALL, 13); + map.put(EntityType.ENDER_PEARL, 14); + map.put(EntityType.EYE_OF_ENDER, 15); + map.put(EntityType.POTION, 16); + map.put(EntityType.EXPERIENCE_BOTTLE, 17); + map.put(EntityType.ITEM_FRAME, 18); + map.put(EntityType.WITHER_SKULL, 19); + map.put(EntityType.TNT, 20); + map.put(EntityType.FALLING_BLOCK, 21); + map.put(EntityType.FIREWORK_ROCKET, 22); + map.put(EntityType.HUSK, 23); + map.put(EntityType.SPECTRAL_ARROW, 24); + map.put(EntityType.SHULKER_BULLET, 25); + map.put(EntityType.DRAGON_FIREBALL, 26); + map.put(EntityType.ZOMBIE_VILLAGER, 27); + map.put(EntityType.SKELETON_HORSE, 28); + map.put(EntityType.ZOMBIE_HORSE, 29); + map.put(EntityType.ARMOR_STAND, 30); + map.put(EntityType.DONKEY, 31); + map.put(EntityType.MULE, 32); + map.put(EntityType.EVOKER_FANGS, 33); + map.put(EntityType.EVOKER, 34); + map.put(EntityType.VEX, 35); + map.put(EntityType.VINDICATOR, 36); + map.put(EntityType.ILLUSIONER, 37); + + map.put(EntityType.COMMAND_BLOCK_MINECART, 40); + map.put(EntityType.BOAT, 41); + map.put(EntityType.MINECART, 42); + map.put(EntityType.CHEST_MINECART, 43); + map.put(EntityType.FURNACE_MINECART, 44); + map.put(EntityType.TNT_MINECART, 45); + map.put(EntityType.HOPPER_MINECART, 46); + map.put(EntityType.SPAWNER_MINECART, 47); + + map.put(EntityType.CREEPER, 50); + map.put(EntityType.SKELETON, 51); + map.put(EntityType.SPIDER, 52); + map.put(EntityType.GIANT, 53); + map.put(EntityType.ZOMBIE, 54); + map.put(EntityType.SLIME, 55); + map.put(EntityType.GHAST, 56); + map.put(EntityType.ZOMBIFIED_PIGLIN, 57); + map.put(EntityType.ENDERMAN, 58); + map.put(EntityType.CAVE_SPIDER, 59); + map.put(EntityType.SILVERFISH, 60); + map.put(EntityType.BLAZE, 61); + map.put(EntityType.MAGMA_CUBE, 62); + map.put(EntityType.ENDER_DRAGON, 63); + map.put(EntityType.WITHER, 64); + map.put(EntityType.BAT, 65); + map.put(EntityType.WITCH, 66); + map.put(EntityType.ENDERMITE, 67); + map.put(EntityType.GUARDIAN, 68); + map.put(EntityType.SHULKER, 69); + + map.put(EntityType.PIG, 90); + map.put(EntityType.SHEEP, 91); + map.put(EntityType.COW, 92); + map.put(EntityType.CHICKEN, 93); + map.put(EntityType.SQUID, 94); + map.put(EntityType.WOLF, 95); + map.put(EntityType.MOOSHROOM, 96); + map.put(EntityType.SNOW_GOLEM, 97); + map.put(EntityType.OCELOT, 98); + map.put(EntityType.IRON_GOLEM, 99); + map.put(EntityType.HORSE, 100); + map.put(EntityType.RABBIT, 101); + map.put(EntityType.POLAR_BEAR, 102); + map.put(EntityType.LLAMA, 103); + map.put(EntityType.LLAMA_SPIT, 104); + map.put(EntityType.PARROT, 105); + + map.put(EntityType.VILLAGER, 120); + + map.put(EntityType.END_CRYSTAL, 200); + }); + + public EntityTypeRewriter() { + super(Registries.ENTITY_TYPE, false); + } + + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference> reference) { + String path = reference.key().location().getPath(); + List arguments = Util.make(new ArrayList<>(), args -> { + args.add(quoted(path)); + args.add(toBukkitClass(reference).concat(".class")); + args.add(Integer.toString(LEGACY_ID.getOrDefault(reference.value(), -1))); + }); + if (!reference.value().canSummon()) { + arguments.add(Boolean.FALSE.toString()); + } + return super.rewriteEnumValue(reference).arguments(arguments); + } + + private String toBukkitClass(Holder.Reference> reference) { + Class internalClass = ENTITY_GENERIC_TYPES.get(reference.key()); + if (Mob.class.isAssignableFrom(internalClass)) { + return this.importCollector.getShortName(MobGoalNames.bukkitMap.get((Class) internalClass)); + } + + String className = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, reference.key().location().getPath()); // use the key instead of the internal class name since name match a bit more + return this.importCollector.getShortName(this.classNamedView.findFirst(CLASS_RENAMES.getOrDefault(className, className))); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/ItemTypeRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/ItemTypeRewriter.java new file mode 100644 index 0000000000..f702206999 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/ItemTypeRewriter.java @@ -0,0 +1,40 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.generator.rewriter.types.registry.RegistryFieldRewriter; +import io.papermc.generator.utils.experimental.FlagHolders; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.typewriter.utils.ClassHelper; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.Registries; +import net.minecraft.world.item.BundleItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; +import org.bukkit.inventory.ItemType; +import org.bukkit.inventory.meta.ItemMeta; +import org.jspecify.annotations.Nullable; + +@Deprecated // bad generic +public class ItemTypeRewriter extends RegistryFieldRewriter { + + public ItemTypeRewriter() { + super(Registries.ITEM, "getItemType"); + } + + @Override + protected String rewriteFieldType(Holder.Reference reference) { + if (reference.value().equals(Items.AIR)) { + return super.rewriteFieldType(reference); + } + + return "%s<%s>".formatted(ClassHelper.retrieveFullNestedName(ItemType.Typed.class), ItemMeta.class.getSimpleName()); + } + + @Override + protected @Nullable SingleFlagHolder getRequiredFeature(Holder.Reference reference) { + if (reference.value() instanceof BundleItem) { + return FlagHolders.BUNDLE; // special case since the item is not locked itself just in the creative menu + } else { + return super.getRequiredFeature(reference); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MapPaletteRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MapPaletteRewriter.java new file mode 100644 index 0000000000..3bdd45ae73 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MapPaletteRewriter.java @@ -0,0 +1,41 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import java.awt.Color; +import net.minecraft.world.level.material.MapColor; +import org.jspecify.annotations.Nullable; + +public class MapPaletteRewriter extends SearchReplaceRewriter { + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + for (@Nullable MapColor mapColor : MapColor.MATERIAL_COLORS) { + if (mapColor == null) { + continue; + } + + for (MapColor. Brightness brightness : MapColor.Brightness.values()) { + builder.append(metadata.indent()); + Color color = fromABGR(mapColor.calculateRGBColor(brightness)); // int is encoded as 0xFF << 24 | blue << 16 | green << 8 | red (BGR and not RGB) + if (color.getAlpha() != 0xFF) { + builder.append("new %s(%d, %d, %d, %d),".formatted(color.getClass().getSimpleName(), color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha())); + } else { + builder.append("new %s(%d, %d, %d),".formatted(color.getClass().getSimpleName(), color.getRed(), color.getGreen(), color.getBlue())); + } + builder.append('\n'); + } + } + } + + private static final int EXCEPT_RED_MASK = 0xFFFFFF00; + private static final int RED_MASK = ~EXCEPT_RED_MASK; + private static final int EXCEPT_BLUE_MASK = 0xFF00FFFF; + private static final int BLUE_MASK = ~EXCEPT_BLUE_MASK; + + private Color fromABGR(int abgr) { + int red = abgr & RED_MASK; + int blue = (abgr & BLUE_MASK) >> 16; + return new Color((abgr & EXCEPT_RED_MASK & EXCEPT_BLUE_MASK) | (red << 16) | blue, true); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MaterialRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MaterialRewriter.java new file mode 100644 index 0000000000..193ec7b3dc --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MaterialRewriter.java @@ -0,0 +1,166 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.generator.rewriter.types.registry.EnumRegistryRewriter; +import io.papermc.generator.utils.BlockStateMapping; +import io.papermc.generator.utils.Formatting; +import io.papermc.generator.utils.experimental.FlagHolders; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.typewriter.preset.SwitchRewriter; +import io.papermc.typewriter.preset.model.CodeBlock; +import io.papermc.typewriter.preset.model.EnumValue; +import io.papermc.typewriter.preset.model.SwitchCases; +import io.papermc.typewriter.preset.model.SwitchContent; +import java.util.Comparator; +import java.util.Locale; +import java.util.Optional; +import java.util.SortedMap; +import java.util.TreeMap; +import net.minecraft.core.Holder; +import net.minecraft.core.component.DataComponents; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.world.item.BundleItem; +import net.minecraft.world.item.Equipable; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.WallSignBlock; +import org.bukkit.block.data.BlockData; +import org.bukkit.inventory.EquipmentSlot; +import org.jspecify.annotations.Nullable; + +import static io.papermc.generator.utils.Formatting.asCode; + +@Deprecated(forRemoval = true) +public class MaterialRewriter { + + // blocks + + public static class Blocks extends EnumRegistryRewriter { + + public Blocks() { + super(Registries.BLOCK, false); + } + + @Override + protected Iterable> getValues() { + return BuiltInRegistries.BLOCK.holders().filter(reference -> !reference.value().equals(net.minecraft.world.level.block.Blocks.AIR)) + .sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; + } + + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference reference) { + EnumValue.Builder value = super.rewriteEnumValue(reference); + Block block = reference.value(); + if (BlockStateMapping.MAPPING.containsKey(block.getClass())) { + // some block can also be represented as item in that enum + // doing a double job + Optional equivalentItem = BuiltInRegistries.ITEM.getOptional(reference.key().location()); + + if (equivalentItem.isEmpty() && block instanceof WallSignBlock) { + // wall sign block stack size is 16 for some reason like the sign item? + // but that rule doesn't work for the wall hanging sign block?? + equivalentItem = Optional.of(block.asItem()); + } + + Class blockData = BlockStateMapping.getBestSuitedApiClass(block.getClass()); + if (blockData == null) { + blockData = BlockData.class; + } + if (equivalentItem.isPresent() && equivalentItem.get().getDefaultMaxStackSize() != Item.DEFAULT_MAX_STACK_SIZE) { + return value.arguments(Integer.toString(-1), Integer.toString(equivalentItem.get().getDefaultMaxStackSize()), this.importCollector.getShortName(blockData).concat(".class")); + } + return value.arguments(Integer.toString(-1), this.importCollector.getShortName(blockData).concat(".class")); + } + return value.argument(Integer.toString(-1)); // id not needed for non legacy material + } + } + + /* todo test is broken + public static class IsTransparent extends SwitchCaseRewriter { + + public IsTransparent() { + super(false); + } + + @Override + protected Iterable getCases() { + return BuiltInRegistries.BLOCK.holders().filter(reference -> reference.value().defaultBlockState().useShapeForLightOcclusion()) + .map(reference -> reference.key().location().getPath().toUpperCase(Locale.ENGLISH)).sorted(Formatting.ALPHABETIC_KEY_ORDER)::iterator; + } + }*/ + + // items + + public static class Items extends EnumRegistryRewriter { + + public Items() { + super(Registries.ITEM, false); + } + + @Override + protected Iterable> getValues() { + return BuiltInRegistries.ITEM.holders().filter(reference -> BuiltInRegistries.BLOCK.getOptional(reference.key().location()).isEmpty() || reference.value().equals(net.minecraft.world.item.Items.AIR)) + .sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; + } + + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference reference) { + EnumValue.Builder value = super.rewriteEnumValue(reference); + Item item = reference.value(); + if (item.equals(net.minecraft.world.item.Items.AIR)) { + return value.arguments(asCode(-1, 0)); // item+block + } + + int maxStackSize = item.getDefaultMaxStackSize(); + int maxDamage = item.components().getOrDefault(DataComponents.MAX_DAMAGE, 0); + + if (maxStackSize != Item.DEFAULT_MAX_STACK_SIZE) { + if (maxDamage != 0) { + value.arguments(asCode(-1, maxStackSize, maxDamage)); + } else { + value.arguments(asCode(-1, maxStackSize)); + } + return value; + } + + return value.argument(Integer.toString(-1)); // id not needed for non legacy material + } + + @Override + protected @Nullable SingleFlagHolder getRequiredFeature(Holder.Reference reference) { + if (reference.value() instanceof BundleItem) { + return FlagHolders.BUNDLE; // special case since the item is not locked itself just in the creative menu + } else { + return super.getRequiredFeature(reference); + } + } + } + + public static class GetEquipmentSlot extends SwitchRewriter { + + @Override + protected SwitchContent getContent() { + SortedMap cases = new TreeMap<>( + Comparator.comparing(Enum::ordinal, (i1, i2) -> Integer.compare(i2, i1)) // reversed (BODY -> HAND) + ); + + net.minecraft.world.entity.EquipmentSlot defaultValue = net.minecraft.world.entity.EquipmentSlot.MAINHAND; + CodeBlock defaultBlock = CodeBlock.of("return " + asCode(EquipmentSlot.HAND) + ";"); + + BuiltInRegistries.ITEM.holders().forEach(reference -> { + net.minecraft.world.entity.EquipmentSlot slot = Optional.ofNullable(Equipable.get(new ItemStack(reference.value()))) + .map(Equipable::getEquipmentSlot).orElse(defaultValue); + if (slot != defaultValue) { + cases.computeIfAbsent(slot, key -> { + return SwitchCases.chain() + .sortValues(Formatting.ALPHABETIC_KEY_ORDER) + .enclosingContent(CodeBlock.of("return " + asCode(EquipmentSlot.values()[slot.ordinal()]) + ";")); + }).add(reference.key().location().getPath().toUpperCase(Locale.ENGLISH)); + } + }); + + return SwitchContent.of(cases.values().stream().map(SwitchCases.SwitchCasesChain::build).toList()).withDefault(defaultBlock); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MemoryKeyRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MemoryKeyRewriter.java new file mode 100644 index 0000000000..45de3e79fb --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MemoryKeyRewriter.java @@ -0,0 +1,115 @@ +package io.papermc.generator.rewriter.types.simple; + +import com.google.gson.internal.Primitives; +import io.papermc.generator.registry.RegistryEntries; +import io.papermc.generator.rewriter.types.registry.RegistryFieldRewriter; +import io.papermc.generator.utils.ClassHelper; +import java.lang.reflect.ParameterizedType; +import java.util.Map; +import java.util.Set; +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.util.Unit; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.ai.behavior.PositionTracker; +import net.minecraft.world.entity.ai.memory.MemoryModuleType; +import net.minecraft.world.entity.ai.memory.NearestVisibleLivingEntities; +import net.minecraft.world.entity.ai.memory.WalkTarget; +import net.minecraft.world.level.pathfinder.Path; +import net.minecraft.world.phys.Vec3; +import org.bukkit.Location; +import org.bukkit.NamespacedKey; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; + +import static io.papermc.typewriter.utils.Formatting.quoted; + +public class MemoryKeyRewriter extends RegistryFieldRewriter> { + + private static final Map>, Class> MEMORY_GENERIC_TYPES = RegistryEntries.byRegistryKey(Registries.MEMORY_MODULE_TYPE).getFields(field -> { + if (field.getGenericType() instanceof ParameterizedType complexType && complexType.getActualTypeArguments().length == 1) { + return ClassHelper.eraseType(complexType.getActualTypeArguments()[0]); + } + return null; + }); + + public MemoryKeyRewriter() { + super(Registries.MEMORY_MODULE_TYPE, null); + } + + // this api is not implemented and is not backed by a proper registry + private static final Set> IGNORED_TYPES = Set.of( + NearestVisibleLivingEntities.class, + WalkTarget.class, + PositionTracker.class, + Path.class, + DamageSource.class, + Vec3.class, + BlockPos.class, + Unit.class, + Void.class + ); + + private static final Set> IGNORED_SUB_TYPES = Set.of( + Iterable.class, + Map.class, + Entity.class + ); + + private static final Map, Class> API_BRIDGE = Map.of( + GlobalPos.class, Location.class + ); + + private static final Map FIELD_RENAMES = Map.of( + "LIKED_NOTEBLOCK", "LIKED_NOTEBLOCK_POSITION" + ); + + @Override + protected boolean canPrintField(Holder.Reference> reference) { + Class memoryType = MEMORY_GENERIC_TYPES.get(reference.key()); + if (IGNORED_TYPES.contains(memoryType)) { + return false; + } + for (Class subType : IGNORED_SUB_TYPES) { + if (subType.isAssignableFrom(memoryType)) { + return false; + } + } + + return true; + } + + private @MonotonicNonNull Class apiMemoryType; + + @Override + protected String rewriteFieldType(Holder.Reference> reference) { + Class memoryType = MEMORY_GENERIC_TYPES.get(reference.key()); + + if (!Primitives.isWrapperType(memoryType) && API_BRIDGE.containsKey(memoryType)) { + this.apiMemoryType = API_BRIDGE.get(memoryType); + } else { + this.apiMemoryType = memoryType; + } + + return "%s<%s>".formatted(this.fieldClass.simpleName(), this.importCollector.getShortName(this.apiMemoryType)); + } + + @Override + protected String rewriteFieldName(Holder.Reference> reference) { + String keyedName = super.rewriteFieldName(reference); + return FIELD_RENAMES.getOrDefault(keyedName, keyedName); + } + + @Override + protected String rewriteFieldValue(Holder.Reference> reference) { + return "new %s<>(%s.minecraft(%s), %s.class)".formatted( + this.fieldClass.simpleName(), + NamespacedKey.class.getSimpleName(), + quoted(reference.key().location().getPath()), + this.apiMemoryType.getSimpleName() // assume the type is already import (see above in rewriteFieldType) + ); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/StatisticRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/StatisticRewriter.java new file mode 100644 index 0000000000..48bfd44709 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/StatisticRewriter.java @@ -0,0 +1,169 @@ +package io.papermc.generator.rewriter.types.simple; + +import com.google.common.collect.ImmutableMap; +import io.papermc.generator.rewriter.types.registry.EnumRegistryRewriter; +import io.papermc.generator.utils.ClassHelper; +import io.papermc.generator.utils.Formatting; +import io.papermc.typewriter.preset.model.EnumValue; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.Map; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.stats.StatType; +import net.minecraft.stats.Stats; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import org.bukkit.Statistic; + +import static io.papermc.typewriter.utils.Formatting.quoted; + +@Deprecated(forRemoval = true) +public class StatisticRewriter { + + private static final Map FIELD_RENAMES = ImmutableMap.builder() + .put("DROP", "DROP_COUNT") + .put("DROPPED", "DROP") + .put("PICKED_UP", "PICKUP") + .put("PLAY_TIME", "PLAY_ONE_MINUTE") + .put("CROUCH_TIME", "SNEAK_TIME") + .put("MINED", "MINE_BLOCK") + .put("USED", "USE_ITEM") + .put("BROKEN", "BREAK_ITEM") + .put("CRAFTED", "CRAFT_ITEM") + .put("KILLED", "KILL_ENTITY") + .put("KILLED_BY", "ENTITY_KILLED_BY") + .put("EAT_CAKE_SLICE", "CAKE_SLICES_EATEN") + .put("FILL_CAULDRON", "CAULDRON_FILLED") + .put("USE_CAULDRON", "CAULDRON_USED") + .put("CLEAN_ARMOR", "ARMOR_CLEANED") + .put("CLEAN_BANNER", "BANNER_CLEANED") + .put("INTERACT_WITH_BREWINGSTAND", "BREWINGSTAND_INTERACTION") + .put("INTERACT_WITH_BEACON", "BEACON_INTERACTION") + .put("INSPECT_DROPPER", "DROPPER_INSPECTED") + .put("INSPECT_HOPPER", "HOPPER_INSPECTED") + .put("INSPECT_DISPENSER", "DISPENSER_INSPECTED") + .put("PLAY_NOTEBLOCK", "NOTEBLOCK_PLAYED") + .put("TUNE_NOTEBLOCK", "NOTEBLOCK_TUNED") + .put("POT_FLOWER", "FLOWER_POTTED") + .put("TRIGGER_TRAPPED_CHEST", "TRAPPED_CHEST_TRIGGERED") + .put("OPEN_ENDERCHEST", "ENDERCHEST_OPENED") + .put("ENCHANT_ITEM", "ITEM_ENCHANTED") + .put("PLAY_RECORD", "RECORD_PLAYED") + .put("INTERACT_WITH_FURNACE", "FURNACE_INTERACTION") + .put("INTERACT_WITH_CRAFTING_TABLE", "CRAFTING_TABLE_INTERACTION") + .put("OPEN_CHEST", "CHEST_OPENED") + .put("OPEN_SHULKER_BOX", "SHULKER_BOX_OPENED").build(); + + public static class Custom extends EnumRegistryRewriter { + + public Custom() { + super(Registries.CUSTOM_STAT, false); + } + + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference reference) { + return super.rewriteEnumValue(reference).rename(name -> FIELD_RENAMES.getOrDefault(name, name)); + } + } + + public static class CraftCustom extends EnumRegistryRewriter { + + private static final Map INTERNAL_FIELD_RENAMES = Map.of( + "SNEAK_TIME", "CROUCH_TIME" + ); + + public CraftCustom() { + super(Registries.CUSTOM_STAT, false); + } + + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference reference) { + String keyedName = Formatting.formatKeyAsField(reference.key().location().getPath()); + + return super.rewriteEnumValue(reference) + .rename(name -> FIELD_RENAMES.getOrDefault(name, name)) + .argument("%s.%s".formatted(Stats.class.getSimpleName(), INTERNAL_FIELD_RENAMES.getOrDefault(keyedName, keyedName))); + } + } + + public static class Type extends EnumRegistryRewriter> { + + private static final Map, String> TYPE_MAPPING = Map.of( + Item.class, "ITEM", + Block.class, "BLOCK", + EntityType.class, "ENTITY" + ); + + private static final Map, Class> FIELD_GENERIC_TYPE; + + static { + final Map, Class> map = new IdentityHashMap<>(); + + try { + for (Field field : Stats.class.getDeclaredFields()) { + if (field.getType() != StatType.class) { + continue; + } + + if (ClassHelper.isStaticConstant(field, Modifier.PUBLIC)) { + java.lang.reflect.Type genericType = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0]; + map.put((StatType) field.get(null), ClassHelper.eraseType(genericType)); + } + } + } catch (ReflectiveOperationException ex) { + throw new RuntimeException(ex); + } + FIELD_GENERIC_TYPE = Collections.unmodifiableMap(map); + } + + public Type() { + super(Registries.STAT_TYPE, false); + } + + @Override + protected Iterable>> getValues() { + return BuiltInRegistries.STAT_TYPE.holders().filter(reference -> reference.value() != Stats.CUSTOM) + .sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; + } + + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference> reference) { + Class genericType = FIELD_GENERIC_TYPE.get(reference.value()); + if (!TYPE_MAPPING.containsKey(genericType)) { + throw new IllegalStateException("Unable to translate stat type generic " + genericType.getCanonicalName() + " into the api!"); + } + + return super.rewriteEnumValue(reference) + .rename(name -> FIELD_RENAMES.getOrDefault(name, name)) + .argument("%s.%s".formatted(Statistic.Type.class.getSimpleName(), TYPE_MAPPING.get(genericType))); // find a more direct way? + + } + } + + public static class CraftType extends EnumRegistryRewriter> { + + public CraftType() { + super(Registries.STAT_TYPE, false); + } + + @Override + protected Iterable>> getValues() { + return BuiltInRegistries.STAT_TYPE.holders().filter(reference -> reference.value() != Stats.CUSTOM) + .sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath()))::iterator; + } + + @Override + protected EnumValue.Builder rewriteEnumValue(Holder.Reference> reference) { + return super.rewriteEnumValue(reference) + .rename(name -> FIELD_RENAMES.getOrDefault(name, name)) + .argument("%s.withDefaultNamespace(%s)".formatted(ResourceLocation.class.getSimpleName(), quoted(reference.key().location().getPath()))); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/VillagerProfessionRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/VillagerProfessionRewriter.java new file mode 100644 index 0000000000..d0361aa46e --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/VillagerProfessionRewriter.java @@ -0,0 +1,162 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.generator.rewriter.types.registry.RegistryFieldRewriter; +import io.papermc.generator.utils.Formatting; +import io.papermc.typewriter.parser.Lexer; +import io.papermc.typewriter.parser.exception.ParserException; +import io.papermc.typewriter.parser.token.CharSequenceBlockToken; +import io.papermc.typewriter.parser.token.CharSequenceToken; +import io.papermc.typewriter.parser.token.Token; +import io.papermc.typewriter.parser.token.TokenType; +import io.papermc.typewriter.replace.SearchMetadata; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.Registries; +import net.minecraft.world.entity.npc.VillagerProfession; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.Nullable; + +@ApiStatus.Experimental +public class VillagerProfessionRewriter extends RegistryFieldRewriter { + + public VillagerProfessionRewriter() { + super(Registries.VILLAGER_PROFESSION, "getProfession"); + } + + private static final Set FORMAT_TOKENS = EnumSet.of( + TokenType.COMMENT, + TokenType.SINGLE_COMMENT, + TokenType.MARKDOWN_JAVADOC // for now ignore + ); + + private @MonotonicNonNull Map> javadocsPerConstant; + + private Map> parseConstantJavadocs(String content) { + Map> map = new HashMap<>(); + + Lexer lex = new Lexer(content.toCharArray()); + String constantName = null; + List javadocs = null; + boolean firstId = true; + while (lex.canRead()) { + Token token = lex.readToken(); + if (token.type() == TokenType.EOI) { + break; + } + + if (token.type() == TokenType.SECO) { + if (constantName != null && javadocs != null) { + map.put(constantName, new ArrayList<>(javadocs)); + } + firstId = true; + constantName = null; + javadocs = null; + continue; + } + + if (FORMAT_TOKENS.contains(token.type())) { + continue; + } + + if (token.type() == TokenType.LPAREN && constantName != null) { + if (!this.skipClosure(lex)) { + return map; + } + continue; + } + + if (token.type() == TokenType.JAVADOC) { + javadocs = ((CharSequenceBlockToken) token).value(); + } else if (token.type() == TokenType.PUBLIC || token.type() == TokenType.STATIC || token.type() == TokenType.FINAL) { + // should check duplicate per statement + continue; // ignore + } else if (token.type() == TokenType.IDENTIFIER && constantName == null) { + if (firstId) { + Token nextToken = this.skipTypeName(lex); + if (nextToken != null && nextToken.type() == TokenType.IDENTIFIER) { + token = nextToken; + } + firstId = false; + } + + constantName = ((CharSequenceToken) token).value(); + } + } + + return map; + } + + private boolean skipClosure(Lexer lex) { + int parenDepth = 1; + while (lex.canRead()) { + Token nestedToken = lex.readToken(); + if (nestedToken.type() == TokenType.EOI) { + return false; + } + + if (nestedToken.type() == TokenType.LPAREN) { + parenDepth++; + } else if (nestedToken.type() == TokenType.RPAREN) { + parenDepth--; + } + + if (parenDepth == 0) { + break; + } + + if (parenDepth < 0) { + throw new ParserException("Unbalanced parenthesis", nestedToken); + } + } + + return true; + } + + private @Nullable Token skipTypeName(Lexer lex) { + boolean expectDot = true; + while (lex.canRead()) { + Token token = lex.readToken(); + if (token.type() == TokenType.EOI) { + break; + } + + if (FORMAT_TOKENS.contains(token.type()) || token.type() == TokenType.JAVADOC) { + continue; // ignore intrusive comments inside the name + } + + if (token.type() == (expectDot ? TokenType.DOT : TokenType.IDENTIFIER)) { + expectDot = !expectDot; + } else { + return token; + } + } + return null; + } + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + this.javadocsPerConstant = parseConstantJavadocs(metadata.replacedContent()); + super.insert(metadata, builder); + } + + @Override + protected void rewriteJavadocs(Holder.Reference reference, String indent, StringBuilder builder) { + String constantName = Formatting.formatKeyAsField(reference.key().location().getPath()); + if (this.javadocsPerConstant.containsKey(constantName)) { + builder.append(indent).append("/**"); + builder.append('\n'); + for (String line : this.javadocsPerConstant.get(constantName)) { + builder.append(indent).append(" * ").append(line); + builder.append('\n'); + } + builder.append(indent).append(" */"); + builder.append('\n'); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/package-info.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/package-info.java new file mode 100644 index 0000000000..fbb169e219 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package io.papermc.generator.rewriter.types.simple; + +import org.jspecify.annotations.NullMarked; diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/utils/Annotations.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/utils/Annotations.java new file mode 100644 index 0000000000..5295264994 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/utils/Annotations.java @@ -0,0 +1,48 @@ +package io.papermc.generator.rewriter.utils; + +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.typewriter.context.ImportCollector; +import io.papermc.typewriter.utils.ClassHelper; +import java.lang.annotation.Annotation; +import org.bukkit.MinecraftExperimental; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class Annotations { + + public static String annotation(Class clazz, ImportCollector collector) { + return "@%s".formatted(collector.getShortName(clazz, false)); // todo toggle the flag after the spoon + } + + public static String annotationStyle(Class clazz) { + return "@%s".formatted(ClassHelper.retrieveFullNestedName(clazz)); + } + + public static String annotation(Class clazz, ImportCollector collector, String param, String value) { + String annotation = annotation(clazz, collector); + if (value.isEmpty()) { + return annotation; + } + return "%s(%s = %s)".formatted(annotation, param, value); + } + + public static String annotation(Class clazz, ImportCollector collector, String value) { + String annotation = annotation(clazz, collector); + if (value.isEmpty()) { + return annotation; + } + return "%s(%s)".formatted(annotation, value); + } + + public static void experimentalAnnotations(StringBuilder builder, String indent, ImportCollector importCollector, SingleFlagHolder requiredFeature) { + builder.append(indent).append(annotation(MinecraftExperimental.class, importCollector, "%s.%s".formatted( + importCollector.getShortName(MinecraftExperimental.Requires.class, false), requiredFeature.asAnnotationMember().name() + ))).append('\n'); + + builder.append(indent).append(annotation(ApiStatus.Experimental.class, importCollector)).append('\n'); + } + + private Annotations() { + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/SimpleEnumGenerator.java b/paper-generator/src/main/java/io/papermc/generator/types/SimpleEnumGenerator.java new file mode 100644 index 0000000000..282a30568a --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/SimpleEnumGenerator.java @@ -0,0 +1,30 @@ +package io.papermc.generator.types; + +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.utils.Annotations; +import javax.lang.model.element.Modifier; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class SimpleEnumGenerator> extends SimpleGenerator { + + private final Class enumClass; + + public SimpleEnumGenerator(Class enumClass, String packageName) { + super(enumClass.getSimpleName(), packageName); + this.enumClass = enumClass; + } + + @Override + protected TypeSpec getTypeSpec() { + TypeSpec.Builder typeBuilder = TypeSpec.enumBuilder(this.enumClass.getSimpleName()) + .addModifiers(Modifier.PUBLIC) + .addAnnotations(Annotations.CLASS_HEADER); + + for (T enumValue : this.enumClass.getEnumConstants()) { + typeBuilder.addEnumConstant(enumValue.name()); + } + + return typeBuilder.build(); + } +} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java b/paper-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java similarity index 78% rename from paper-api-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java rename to paper-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java index b4c1095c84..c4476d50a3 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java +++ b/paper-generator/src/main/java/io/papermc/generator/types/SimpleGenerator.java @@ -2,13 +2,16 @@ package io.papermc.generator.types; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.TypeSpec; - import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Path; +import org.jspecify.annotations.NullMarked; +@NullMarked public abstract class SimpleGenerator implements SourceGenerator { + public static final String INDENT_UNIT = " "; + protected final String className; protected final String packageName; @@ -19,17 +22,17 @@ public abstract class SimpleGenerator implements SourceGenerator { protected abstract TypeSpec getTypeSpec(); - protected abstract JavaFile.Builder file(JavaFile.Builder builder); + protected JavaFile.Builder file(JavaFile.Builder builder) { + return builder; + } @Override public void writeToFile(Path parent) throws IOException { - JavaFile.Builder builder = JavaFile.builder(this.packageName, this.getTypeSpec()); this.file(builder) - .indent(" ") + .indent(INDENT_UNIT) .skipJavaLangImports(true); builder.build().writeTo(parent, StandardCharsets.UTF_8); } - } diff --git a/paper-api-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java b/paper-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java similarity index 76% rename from paper-api-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java rename to paper-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java index 2d550fa421..434b7b4822 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java +++ b/paper-generator/src/main/java/io/papermc/generator/types/SourceGenerator.java @@ -2,7 +2,9 @@ package io.papermc.generator.types; import java.io.IOException; import java.nio.file.Path; +import org.jspecify.annotations.NullMarked; +@NullMarked public interface SourceGenerator { void writeToFile(Path parent) throws IOException; diff --git a/paper-generator/src/main/java/io/papermc/generator/types/StructuredGenerator.java b/paper-generator/src/main/java/io/papermc/generator/types/StructuredGenerator.java new file mode 100644 index 0000000000..144b19b7a3 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/StructuredGenerator.java @@ -0,0 +1,46 @@ +package io.papermc.generator.types; + +import com.mojang.logging.LogUtils; +import com.squareup.javapoet.MethodSpec; +import io.papermc.generator.utils.Annotations; +import java.util.Arrays; +import org.jspecify.annotations.NullMarked; +import org.slf4j.Logger; + +import static javax.lang.model.element.Modifier.PUBLIC; + +@NullMarked +public abstract class StructuredGenerator extends SimpleGenerator { + + private static final Logger LOGGER = LogUtils.getLogger(); + + protected final Class baseClass; + protected boolean printWarningOnMissingOverride; + + protected StructuredGenerator(Class baseClass, String className, String packageName) { + super(className, packageName); + this.baseClass = baseClass; + } + + public MethodSpec.Builder createMethod(String name, Class... parameterTypes) { + MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(name) + .addModifiers(PUBLIC); + if (methodExists(name, parameterTypes)) { + methodBuilder.addAnnotation(Annotations.OVERRIDE); + } else { + if (this.printWarningOnMissingOverride) { + LOGGER.warn("Method {}{} didn't override a known api method!", name, Arrays.toString(parameterTypes)); + } + } + return methodBuilder; + } + + protected boolean methodExists(String name, Class... parameterTypes) { + try { + this.baseClass.getMethod(name, parameterTypes); + return true; + } catch (NoSuchMethodException e) { + return false; + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/Types.java b/paper-generator/src/main/java/io/papermc/generator/types/Types.java new file mode 100644 index 0000000000..84b52e7940 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/Types.java @@ -0,0 +1,14 @@ +package io.papermc.generator.types; + +import com.squareup.javapoet.ClassName; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class Types { + + public static final String BASE_PACKAGE = "org.bukkit.craftbukkit"; + + public static final ClassName CRAFT_BLOCK_DATA = ClassName.get(BASE_PACKAGE + ".block.data", "CraftBlockData"); + + public static final ClassName CRAFT_BLOCK = ClassName.get(BASE_PACKAGE + ".block", "CraftBlock"); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/CraftBlockDataBootstrapper.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/CraftBlockDataBootstrapper.java new file mode 100644 index 0000000000..fbdd1f3f21 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/CraftBlockDataBootstrapper.java @@ -0,0 +1,23 @@ +package io.papermc.generator.types.craftblockdata; + +import com.google.common.base.Preconditions; +import io.papermc.generator.types.SourceGenerator; +import io.papermc.generator.utils.BlockStateMapping; +import java.util.List; +import java.util.Map; +import net.minecraft.world.level.block.Block; +import org.bukkit.block.data.BlockData; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class CraftBlockDataBootstrapper { + + public static void bootstrap(List generators) { + for (Map.Entry, BlockStateMapping.BlockData> entry : BlockStateMapping.MAPPING.entrySet()) { + Class api = BlockStateMapping.getBestSuitedApiClass(entry.getValue()); + Preconditions.checkState(api != null, "Unknown custom BlockData api class for " + entry.getKey().getCanonicalName()); + + generators.add(new CraftBlockDataGenerator<>(entry.getKey(), entry.getValue(), api)); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/CraftBlockDataGenerator.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/CraftBlockDataGenerator.java new file mode 100644 index 0000000000..c2f25ac9ce --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/CraftBlockDataGenerator.java @@ -0,0 +1,243 @@ +package io.papermc.generator.types.craftblockdata; + +import com.google.common.base.CaseFormat; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.mojang.datafixers.util.Either; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.Types; +import io.papermc.generator.types.craftblockdata.property.PropertyMaker; +import io.papermc.generator.types.craftblockdata.property.PropertyWriter; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.converter.Converters; +import io.papermc.generator.types.craftblockdata.property.holder.DataPropertyMaker; +import io.papermc.generator.types.craftblockdata.property.holder.VirtualField; +import io.papermc.generator.types.craftblockdata.property.holder.converter.DataConverter; +import io.papermc.generator.types.craftblockdata.property.holder.converter.DataConverters; +import io.papermc.generator.utils.Annotations; +import io.papermc.generator.utils.BlockStateMapping; +import io.papermc.generator.utils.CommonVariable; +import io.papermc.generator.utils.NamingManager; +import it.unimi.dsi.fastutil.Pair; +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.Map; +import java.util.function.BiConsumer; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.ChiseledBookShelfBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.Property; +import org.bukkit.Axis; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.Rail; +import org.jspecify.annotations.NullMarked; + +import static io.papermc.generator.utils.NamingManager.keywordGet; +import static io.papermc.generator.utils.NamingManager.keywordGetSet; +import static javax.lang.model.element.Modifier.FINAL; +import static javax.lang.model.element.Modifier.PRIVATE; +import static javax.lang.model.element.Modifier.PUBLIC; +import static javax.lang.model.element.Modifier.STATIC; + +@NullMarked +public class CraftBlockDataGenerator extends StructuredGenerator { + + private final Class blockClass; + private final BlockStateMapping.BlockData blockData; + + protected CraftBlockDataGenerator(Class blockClass, BlockStateMapping.BlockData blockData, Class baseClass) { + super(baseClass, blockData.implName(), Types.BASE_PACKAGE + ".block.impl"); + this.blockClass = blockClass; + this.blockData = blockData; + this.printWarningOnMissingOverride = true; + } + + // default keywords: get/set + // for single boolean property: get = is + // for indexed boolean property: get = has + private static final Map, NamingManager.AccessKeyword> FLUENT_KEYWORD = ImmutableMap., NamingManager.AccessKeyword>builder() + .put(BlockStateProperties.ATTACH_FACE, keywordGetSet("getAttached", "setAttached")) // todo remove this once switch methods are gone + .put(BlockStateProperties.EYE, keywordGet("has")) + .put(BlockStateProperties.BERRIES, keywordGet("has")) // spigot method rename + // data holder keywords is only needed for the first property they hold + .put(ChiseledBookShelfBlock.SLOT_OCCUPIED_PROPERTIES.get(0), keywordGet("is")) + .build(); + + private static final Map, BiConsumer> SETTER_PRECONDITIONS = Map.of( + BlockStateProperties.FACING, (param, method) -> { + method.addStatement("$T.checkArgument($N.isCartesian(), $S)", Preconditions.class, param, "Invalid face, only cartesian face are allowed for this property!"); + }, + BlockStateProperties.HORIZONTAL_FACING, (param, method) -> { + method.addStatement("$1T.checkArgument($2N.isCartesian() && $2N.getModY() == 0, $3S)", Preconditions.class, param, "Invalid face, only cartesian horizontal face are allowed for this property!"); + }, + BlockStateProperties.FACING_HOPPER, (param, method) -> { + method.addStatement("$1T.checkArgument($2N.isCartesian() && $2N != $3T.UP, $4S)", Preconditions.class, param, BlockFace.class, "Invalid face, only cartesian face (excluding UP) are allowed for this property!"); + }, + BlockStateProperties.VERTICAL_DIRECTION, (param, method) -> { + method.addStatement("$T.checkArgument($N.getModY() != 0, $S)", Preconditions.class, param, "Invalid face, only vertical face are allowed for this property!"); + }, + BlockStateProperties.ROTATION_16, (param, method) -> { + method.addStatement("$1T.checkArgument($2N != $3T.SELF && $2N.getModY() == 0, $4S)", Preconditions.class, param, BlockFace.class, "Invalid face, only horizontal face are allowed for this property!"); + }, + BlockStateProperties.HORIZONTAL_AXIS, (param, method) -> { + method.addStatement("$1T.checkArgument($2N == $3T.X || $2N == $3T.Z, $4S)", Preconditions.class, param, Axis.class, "Invalid axis, only horizontal axis are allowed for this property!"); + }, + BlockStateProperties.RAIL_SHAPE_STRAIGHT, (param, method) -> { + method.addStatement("$1T.checkArgument($2N != $3T.NORTH_EAST && $2N != $3T.NORTH_WEST && $2N != $3T.SOUTH_EAST && $2N != $3T.SOUTH_WEST, $4S)", Preconditions.class, param, Rail.Shape.class, "Invalid rail shape, only straight rail are allowed for this property!"); + } + ); + + private TypeSpec.Builder propertyHolder() { + TypeSpec.Builder typeBuilder = TypeSpec.classBuilder(this.className) + .addModifiers(PUBLIC) + .addAnnotation(Annotations.GENERATED_FROM) + .superclass(Types.CRAFT_BLOCK_DATA) + .addSuperinterface(this.baseClass); + + ParameterSpec parameter = ParameterSpec.builder(BlockState.class, "state").build(); + MethodSpec constructor = MethodSpec.constructorBuilder() + .addModifiers(PUBLIC) + .addParameter(parameter) + .addStatement("super($N)", parameter) + .build(); + + typeBuilder.addMethod(constructor); + return typeBuilder; + } + + @Override + protected TypeSpec getTypeSpec() { + TypeSpec.Builder typeBuilder = this.propertyHolder(); + + for (Property property : this.blockData.properties()) { + Pair, String> fieldName = PropertyWriter.referenceFieldFromVar(this.blockClass, property, this.blockData.propertyFields()); + + PropertyMaker propertyMaker = PropertyMaker.make(property); + + final String varName; + if (this.blockData.propertyFields().containsKey(property)) { + // get the name from the local class or fallback to the generic BlockStateProperties constant name if not found + varName = this.blockData.propertyFields().get(property).getName(); + } else { + varName = fieldName.right(); + } + + FieldSpec.Builder fieldBuilder = FieldSpec.builder(propertyMaker.getPropertyType(), varName, PRIVATE, STATIC, FINAL) + .initializer("$T.$L", fieldName.left(), fieldName.right()); + FieldSpec field = fieldBuilder.build(); + + typeBuilder.addField(field); + + ConverterBase converter = Converters.getOrDefault(property, propertyMaker); + Class apiClass = converter.getApiType(); + + NamingManager.AccessKeyword accessKeyword = null; + if (apiClass == Boolean.TYPE) { + accessKeyword = keywordGet("is"); + } + accessKeyword = FLUENT_KEYWORD.getOrDefault(property, accessKeyword); + NamingManager naming = new NamingManager(accessKeyword, CaseFormat.LOWER_UNDERSCORE, property.getName()); + + // get + { + MethodSpec.Builder methodBuilder = createMethod(naming.simpleGetterName(name -> !name.startsWith("is_") && !name.startsWith("has_"))); + converter.convertGetter(methodBuilder, field); + methodBuilder.returns(apiClass); + + typeBuilder.addMethod(methodBuilder.build()); + } + + // set + { + String paramName = naming.paramName(apiClass); + ParameterSpec parameter = ParameterSpec.builder(apiClass, paramName, FINAL).build(); + + MethodSpec.Builder methodBuilder = createMethod(naming.simpleSetterName(name -> !name.startsWith("is_")), apiClass).addParameter(parameter); + if (!apiClass.isPrimitive()) { + methodBuilder.addStatement("$T.checkArgument($N != null, $S)", Preconditions.class, parameter, "%s cannot be null!".formatted(paramName)); + } + if (SETTER_PRECONDITIONS.containsKey(property)) { + SETTER_PRECONDITIONS.get(property).accept(parameter, methodBuilder); + } + converter.convertSetter(methodBuilder, field, parameter); + + typeBuilder.addMethod(methodBuilder.build()); + } + + // extra + propertyMaker.addExtras(typeBuilder, field, this, naming); + } + + for (Map.Entry, Collection>> complexFields : this.blockData.complexPropertyFields().asMap().entrySet()) { + Either fieldData = complexFields.getKey(); + Collection> properties = complexFields.getValue(); + Property firstProperty = properties.iterator().next(); + + PropertyMaker propertyMaker = PropertyMaker.make(firstProperty); + ConverterBase propertyConverter = Converters.getOrDefault(firstProperty, propertyMaker); + + DataPropertyMaker dataPropertyMaker = DataPropertyMaker.make(properties, this.blockClass, fieldData); + + FieldSpec field = dataPropertyMaker.getOrCreateField(this.blockData.propertyFields()).build(); + typeBuilder.addField(field); + + DataConverter converter = DataConverters.getOrThrow(dataPropertyMaker.getType()); + Class apiClass = propertyConverter.getApiType(); + + NamingManager.AccessKeyword accessKeyword = null; + if (apiClass == Boolean.TYPE) { + accessKeyword = NamingManager.keywordGet("has"); + } + accessKeyword = FLUENT_KEYWORD.getOrDefault(firstProperty, accessKeyword); + NamingManager naming = new NamingManager(accessKeyword, CaseFormat.UPPER_UNDERSCORE, dataPropertyMaker.getBaseName()); + + ParameterSpec indexParameter = ParameterSpec.builder(dataPropertyMaker.getIndexClass(), dataPropertyMaker.getIndexClass() == Integer.TYPE ? CommonVariable.INDEX : naming.paramName(dataPropertyMaker.getIndexClass()), FINAL).build(); + + // get + { + MethodSpec.Builder methodBuilder = createMethod(naming.simpleGetterName(name -> true), dataPropertyMaker.getIndexClass()) + .addParameter(indexParameter); + if (!dataPropertyMaker.getIndexClass().isPrimitive()) { + methodBuilder.addStatement("$T.checkArgument($N != null, $S)", Preconditions.class, indexParameter, "%s cannot be null!".formatted(indexParameter.name)); + } + converter.convertGetter(propertyConverter, methodBuilder, field, indexParameter); + methodBuilder.returns(apiClass); + + typeBuilder.addMethod(methodBuilder.build()); + } + + // set + { + String paramName = naming.paramName(apiClass); + ParameterSpec parameter = ParameterSpec.builder(apiClass, paramName, FINAL).build(); + + MethodSpec.Builder methodBuilder = createMethod(naming.simpleSetterName(name -> true), dataPropertyMaker.getIndexClass(), apiClass) + .addParameter(indexParameter) + .addParameter(parameter); + if (!dataPropertyMaker.getIndexClass().isPrimitive()) { + methodBuilder.addStatement("$T.checkArgument($N != null, $S)", Preconditions.class, indexParameter, "%s cannot be null!".formatted(indexParameter.name)); + } + if (!apiClass.isPrimitive()) { + methodBuilder.addStatement("$T.checkArgument($N != null, $S)", Preconditions.class, parameter, "%s cannot be null!".formatted(paramName)); + } + if (SETTER_PRECONDITIONS.containsKey(firstProperty)) { + SETTER_PRECONDITIONS.get(firstProperty).accept(parameter, methodBuilder); + } + converter.convertSetter(propertyConverter, methodBuilder, field, indexParameter, parameter); + + typeBuilder.addMethod(methodBuilder.build()); + } + + // extra + dataPropertyMaker.addExtras(typeBuilder, field, indexParameter, propertyConverter, this, naming); + } + + return typeBuilder.build(); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/EnumPropertyWriter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/EnumPropertyWriter.java new file mode 100644 index 0000000000..9c38001d09 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/EnumPropertyWriter.java @@ -0,0 +1,46 @@ +package io.papermc.generator.types.craftblockdata.property; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import io.papermc.generator.utils.BlockStateMapping; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class EnumPropertyWriter & StringRepresentable> extends PropertyWriter { + + protected EnumPropertyWriter(EnumProperty property) { + super(property); + } + + @Override + public TypeName getPropertyType() { + if (this.property.getClass() == EnumProperty.class) { // exact match + return ParameterizedTypeName.get(this.property.getClass(), this.property.getValueClass()); + } + return super.getPropertyType(); + } + + @Override + protected Class processApiType() { + Class apiClass = this.property.getValueClass(); + apiClass = BlockStateMapping.ENUM_BRIDGE.get(apiClass); + if (apiClass == null) { + throw new IllegalStateException("Unknown enum type for " + this.property); + } + return apiClass; + } + + @Override + public void convertGetter(MethodSpec.Builder method, FieldSpec field) { + method.addStatement("return " + this.rawGetExprent().formatted("$N"), field, this.getApiType()); + } + + @Override + public String rawGetExprent() { + return "this.get(%s, $T.class)"; + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/IntegerPropertyWriter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/IntegerPropertyWriter.java new file mode 100644 index 0000000000..dc6b937c73 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/IntegerPropertyWriter.java @@ -0,0 +1,44 @@ +package io.papermc.generator.types.craftblockdata.property; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.craftblockdata.property.converter.Converters; +import io.papermc.generator.utils.NamingManager; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class IntegerPropertyWriter extends PropertyWriter { + + protected IntegerPropertyWriter(IntegerProperty property) { + super(property); + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, StructuredGenerator generator, NamingManager naming) { + if (Converters.has(this.property)) { + return; + } + + IntegerProperty property = (IntegerProperty) this.property; + + if (property.min != 0 || property.getName().equals(BlockStateProperties.LEVEL.getName())) { // special case (levelled: composter) + MethodSpec.Builder methodBuilder = generator.createMethod(naming.getterName(name -> true).pre("Minimum").concat()); + methodBuilder.addStatement("return $N.min", field); + methodBuilder.returns(this.getApiType()); + + builder.addMethod(methodBuilder.build()); + } + + { + MethodSpec.Builder methodBuilder = generator.createMethod(naming.getterName(name -> true).pre("Maximum").concat()); + methodBuilder.addStatement("return $N.max", field); + methodBuilder.returns(this.getApiType()); + + builder.addMethod(methodBuilder.build()); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyMaker.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyMaker.java new file mode 100644 index 0000000000..0560e19f07 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyMaker.java @@ -0,0 +1,25 @@ +package io.papermc.generator.types.craftblockdata.property; + +import com.squareup.javapoet.TypeName; +import io.papermc.generator.types.craftblockdata.property.appender.AppenderBase; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.block.state.properties.Property; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface PropertyMaker extends ConverterBase, AppenderBase { + + TypeName getPropertyType(); + + static > PropertyMaker make(Property property) { + if (property instanceof IntegerProperty intProperty) { + return new IntegerPropertyWriter(intProperty); + } + if (property instanceof EnumProperty enumProperty) { + return new EnumPropertyWriter<>(enumProperty); + } + return new PropertyWriter<>(property); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyWriter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyWriter.java new file mode 100644 index 0000000000..cbda1466f4 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyWriter.java @@ -0,0 +1,115 @@ +package io.papermc.generator.types.craftblockdata.property; + +import com.google.common.base.Suppliers; +import com.google.common.collect.ImmutableMap; +import com.google.common.primitives.Primitives; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.craftblockdata.property.appender.AppenderBase; +import io.papermc.generator.types.craftblockdata.property.appender.EnumValuesAppender; +import io.papermc.generator.types.craftblockdata.property.appender.PropertyAppender; +import io.papermc.generator.utils.BlockStateMapping; +import io.papermc.generator.utils.NamingManager; +import it.unimi.dsi.fastutil.Pair; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Map; +import java.util.function.Supplier; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.Property; +import org.bukkit.Axis; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Rail; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class PropertyWriter> implements PropertyMaker { + + protected final Property property; + private final Supplier> apiClassSupplier; + + protected PropertyWriter(Property property) { + this.property = property; + this.apiClassSupplier = Suppliers.memoize(this::processApiType); + } + + @Override + public TypeName getPropertyType() { + return TypeName.get(this.property.getClass()); + } + + protected Class processApiType() { + Class apiClass = this.property.getValueClass(); + if (Primitives.isWrapperType(apiClass)) { + apiClass = Primitives.unwrap(apiClass); + } + return apiClass; + } + + @Override + public Class getApiType() { + return this.apiClassSupplier.get(); + } + + @Override + public String rawSetExprent() { + return "this.set(%s, $N)"; + } + + @Override + public String rawGetExprent() { + return "this.get(%s)"; + } + + private static final Map, AppenderBase> APPENDERS; + private static final ImmutableMap.Builder, AppenderBase> builder = ImmutableMap.builder(); + + static { + register(new EnumValuesAppender<>(BlockStateProperties.AXIS, Axis.class, "getAxes")); + register(new EnumValuesAppender<>(BlockStateProperties.HORIZONTAL_AXIS, Axis.class, "getAxes")); + register(new EnumValuesAppender<>(BlockStateProperties.FACING, BlockFace.class, "getFaces")); + register(new EnumValuesAppender<>(BlockStateProperties.HORIZONTAL_FACING, BlockFace.class, "getFaces")); + register(new EnumValuesAppender<>(BlockStateProperties.FACING_HOPPER, BlockFace.class, "getFaces")); + register(new EnumValuesAppender<>(BlockStateProperties.RAIL_SHAPE, Rail.Shape.class, "getShapes")); + register(new EnumValuesAppender<>(BlockStateProperties.RAIL_SHAPE_STRAIGHT, Rail.Shape.class, "getShapes")); + register(new EnumValuesAppender<>(BlockStateProperties.VERTICAL_DIRECTION, BlockFace.class, "getVerticalDirections")); + APPENDERS = builder.build(); + } + + private static void register(PropertyAppender, ?> converter) { + builder.put(converter.getProperty(), converter); + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, StructuredGenerator generator, NamingManager naming) { + if (APPENDERS.containsKey(this.property)) { + APPENDERS.get(this.property).addExtras(builder, field, generator, naming); + } + } + + public static Pair, String> referenceField(Class from, Property property, Map, Field> fields) { + Class fieldAccess = from; + Field field = fields.get(property); + if (field == null || !Modifier.isPublic(field.getModifiers())) { + fieldAccess = BlockStateProperties.class; + field = BlockStateMapping.FALLBACK_GENERIC_FIELDS.get(property); + } + return Pair.of(fieldAccess, field.getName()); + } + + public static Pair, String> referenceFieldFromVar(Class from, Property property, Map, Field> fields) { + Class fieldAccess = from; + Field field = fields.get(property); + Field genericField = BlockStateMapping.FALLBACK_GENERIC_FIELDS.get(property); + if (field == null || !Modifier.isPublic(field.getModifiers()) || !genericField.getType().equals(field.getType())) { + // field type can differ from BlockStateProperties constants (that's the case for the shulker box (#FACING) and the vault (#STATE)) ref: 1.20.5 + // in that case fallback to the more accurate type to avoid compile error + fieldAccess = BlockStateProperties.class; + field = genericField; + } + return Pair.of(fieldAccess, field.getName()); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/AppenderBase.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/AppenderBase.java new file mode 100644 index 0000000000..0c16b104af --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/AppenderBase.java @@ -0,0 +1,13 @@ +package io.papermc.generator.types.craftblockdata.property.appender; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.utils.NamingManager; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface AppenderBase { + + void addExtras(TypeSpec.Builder builder, FieldSpec field, StructuredGenerator generator, NamingManager naming); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/EnumValuesAppender.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/EnumValuesAppender.java new file mode 100644 index 0000000000..9dd5532732 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/EnumValuesAppender.java @@ -0,0 +1,45 @@ +package io.papermc.generator.types.craftblockdata.property.appender; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.utils.NamingManager; +import java.util.Set; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class EnumValuesAppender & StringRepresentable, A extends Enum> implements PropertyAppender { + + private final EnumProperty property; + private final Class apiType; + private final String methodName; + + public EnumValuesAppender(EnumProperty property, Class apiType, String methodName) { + this.property = property; + this.apiType = apiType; + this.methodName = methodName; + } + + @Override + public EnumProperty getProperty() { + return this.property; + } + + @Override + public Class getApiType() { + return this.apiType; + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, StructuredGenerator generator, NamingManager naming) { + MethodSpec.Builder methodBuilder = generator.createMethod(this.methodName); + methodBuilder.addStatement("return this.getValues($N, $T.class)", field, this.apiType); + methodBuilder.returns(ParameterizedTypeName.get(Set.class, this.apiType)); + + builder.addMethod(methodBuilder.build()); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/PropertyAppender.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/PropertyAppender.java new file mode 100644 index 0000000000..63bc0dbd28 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/PropertyAppender.java @@ -0,0 +1,12 @@ +package io.papermc.generator.types.craftblockdata.property.appender; + +import net.minecraft.world.level.block.state.properties.Property; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface PropertyAppender, A> extends AppenderBase { + + Property getProperty(); + + Class getApiType(); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converter.java new file mode 100644 index 0000000000..17dbd6e8e8 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converter.java @@ -0,0 +1,12 @@ +package io.papermc.generator.types.craftblockdata.property.converter; + +import net.minecraft.world.level.block.state.properties.Property; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface Converter, A> extends ConverterBase { + + Property getProperty(); + + Class getApiType(); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/ConverterBase.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/ConverterBase.java new file mode 100644 index 0000000000..cbe2e0f59a --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/ConverterBase.java @@ -0,0 +1,24 @@ +package io.papermc.generator.types.craftblockdata.property.converter; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface ConverterBase { + + Class getApiType(); + + default void convertSetter(MethodSpec.Builder method, FieldSpec field, ParameterSpec parameter) { + method.addStatement(this.rawSetExprent().formatted("$N"), field, parameter); + } + + String rawSetExprent(); // this go on two layers which can be hard to follow refactor? + + default void convertGetter(MethodSpec.Builder method, FieldSpec field) { + method.addStatement("return " + this.rawGetExprent().formatted("$N"), field); + } + + String rawGetExprent(); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converters.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converters.java new file mode 100644 index 0000000000..6c4575c719 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converters.java @@ -0,0 +1,32 @@ +package io.papermc.generator.types.craftblockdata.property.converter; + +import com.google.common.collect.ImmutableMap; +import io.papermc.generator.types.craftblockdata.property.PropertyMaker; +import java.util.Map; +import net.minecraft.world.level.block.state.properties.Property; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class Converters { + + private static final Map, ConverterBase> CONVERTERS; + private static final ImmutableMap.Builder, ConverterBase> builder = ImmutableMap.builder(); + + static { + register(new RotationConverter()); + register(new NoteConverter()); + CONVERTERS = builder.build(); + } + + public static ConverterBase getOrDefault(Property property, PropertyMaker maker) { + return CONVERTERS.getOrDefault(property, maker); + } + + public static boolean has(Property property) { + return CONVERTERS.containsKey(property); + } + + private static void register(Converter, ?> converter) { + builder.put(converter.getProperty(), converter); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/NoteConverter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/NoteConverter.java new file mode 100644 index 0000000000..91189dd6a5 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/NoteConverter.java @@ -0,0 +1,37 @@ +package io.papermc.generator.types.craftblockdata.property.converter; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.Property; +import org.bukkit.Note; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class NoteConverter implements Converter { + + @Override + public Property getProperty() { + return BlockStateProperties.NOTE; + } + + @Override + public Class getApiType() { + return Note.class; + } + + @Override + public String rawSetExprent() { + return "this.set(%s, (int) $N.getId())"; + } + + @Override + public void convertGetter(MethodSpec.Builder method, FieldSpec field) { + method.addStatement("return " + this.rawGetExprent().formatted("$N"), this.getApiType(), field); + } + + @Override + public String rawGetExprent() { + return "new $T(this.get(%s))"; + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/RotationConverter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/RotationConverter.java new file mode 100644 index 0000000000..7726efd33c --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/RotationConverter.java @@ -0,0 +1,45 @@ +package io.papermc.generator.types.craftblockdata.property.converter; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.block.state.properties.RotationSegment; +import org.bukkit.block.BlockFace; +import org.bukkit.util.Vector; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class RotationConverter implements Converter { + + private static final String DIRECTION_VAR = "dir"; + private static final String ANGLE_VAR = "angle"; + + @Override + public Property getProperty() { + return BlockStateProperties.ROTATION_16; + } + + @Override + public Class getApiType() { + return BlockFace.class; + } + + @Override + public void convertSetter(MethodSpec.Builder method, FieldSpec field, ParameterSpec parameter) { + method.addStatement("$T $L = $N.getDirection()", Vector.class, DIRECTION_VAR, parameter); + method.addStatement("$1T $2L = ($1T) -$3T.toDegrees($3T.atan2($4L.getX(), $4L.getZ()))", Float.TYPE, ANGLE_VAR, Math.class, DIRECTION_VAR); + method.addStatement(this.rawSetExprent().formatted("$N", ANGLE_VAR), field, RotationSegment.class); + } + + @Override + public String rawSetExprent() { + return "this.set(%s, $T.convertToSegment(%s))"; + } + + @Override + public String rawGetExprent() { + return "CraftBlockData.ROTATION_CYCLE[this.get(%s)]"; + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataHolderType.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataHolderType.java new file mode 100644 index 0000000000..86a70923c1 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataHolderType.java @@ -0,0 +1,7 @@ +package io.papermc.generator.types.craftblockdata.property.holder; + +public enum DataHolderType { + MAP, + LIST, + ARRAY +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyMaker.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyMaker.java new file mode 100644 index 0000000000..117b2cd8a2 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyMaker.java @@ -0,0 +1,31 @@ +package io.papermc.generator.types.craftblockdata.property.holder; + +import com.mojang.datafixers.util.Either; +import com.squareup.javapoet.FieldSpec; +import io.papermc.generator.types.craftblockdata.property.holder.appender.DataAppender; +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.Map; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.properties.Property; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface DataPropertyMaker extends DataAppender { + + FieldSpec.Builder getOrCreateField(Map, Field> fields); + + Class getIndexClass(); + + @Override + DataHolderType getType(); + + String getBaseName(); + + static DataPropertyMaker make(Collection> properties, Class blockClass, Either fieldData) { + return fieldData.map( + field -> new DataPropertyWriter(field, properties, blockClass), + virtualField -> new VirtualDataPropertyWriter(virtualField, properties, blockClass) + ); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriter.java new file mode 100644 index 0000000000..ad4c5983e1 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriter.java @@ -0,0 +1,164 @@ +package io.papermc.generator.types.craftblockdata.property.holder; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import com.squareup.javapoet.ClassName; +import com.squareup.javapoet.CodeBlock; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.Types; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.appender.ArrayAppender; +import io.papermc.generator.types.craftblockdata.property.holder.appender.DataAppender; +import io.papermc.generator.types.craftblockdata.property.holder.appender.ListAppender; +import io.papermc.generator.types.craftblockdata.property.holder.appender.MapAppender; +import io.papermc.generator.utils.BlockStateMapping; +import io.papermc.generator.utils.ClassHelper; +import io.papermc.generator.utils.CommonVariable; +import io.papermc.generator.utils.NamingManager; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.properties.Property; +import org.bukkit.block.BlockFace; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; +import org.jspecify.annotations.NullMarked; + +import static javax.lang.model.element.Modifier.FINAL; +import static javax.lang.model.element.Modifier.PRIVATE; +import static javax.lang.model.element.Modifier.STATIC; + +@NullMarked +public class DataPropertyWriter extends DataPropertyWriterBase { + + private static final Map FIELD_TO_BASE_NAME = Map.of( + BlockStateMapping.PIPE_FIELD_NAME, "FACE", + "SLOT_OCCUPIED_PROPERTIES", "SLOT_OCCUPIED" + ); + + protected final Field field; + protected DataHolderType type; + protected @MonotonicNonNull Class indexClass, internalIndexClass; + protected @MonotonicNonNull TypeName fieldType; + + protected DataPropertyWriter(Field field, Collection> properties, Class blockClass) { + super(properties, blockClass); + this.field = field; + this.computeTypes(field); + } + + protected void computeTypes(Field field) { + this.fieldType = TypeName.get(field.getGenericType()); + + if (field.getType().isArray()) { + this.type = DataHolderType.ARRAY; + this.indexClass = Integer.TYPE; + } else if (List.class.isAssignableFrom(field.getType())) { + this.type = DataHolderType.LIST; + this.indexClass = Integer.TYPE; + } else if (Map.class.isAssignableFrom(field.getType()) && field.getGenericType() instanceof ParameterizedType complexType) { + this.type = DataHolderType.MAP; + this.internalIndexClass = ClassHelper.eraseType(complexType.getActualTypeArguments()[0]); + if (this.internalIndexClass.isEnum()) { + this.indexClass = BlockStateMapping.ENUM_BRIDGE.getOrDefault(this.internalIndexClass, (Class>) this.internalIndexClass); + this.fieldType = ParameterizedTypeName.get( + ClassName.get(field.getType()), + ClassName.get(this.indexClass), + ClassName.get(complexType.getActualTypeArguments()[1]) + ); + } else { + this.indexClass = this.internalIndexClass; + } + } else { + throw new IllegalStateException("Don't know how to turn " + field + " into api"); + } + } + + @Override + public FieldSpec.Builder getOrCreateField(Map, Field> fields) { + FieldSpec.Builder fieldBuilder = FieldSpec.builder(this.fieldType, this.field.getName(), PRIVATE, STATIC, FINAL); + if (Modifier.isPublic(this.field.getModifiers())) { + // accessible phew + if (this.type == DataHolderType.MAP && + this.internalIndexClass == Direction.class && this.indexClass == BlockFace.class) { // Direction -> BlockFace + // convert the key manually only this one is needed for now + fieldBuilder.initializer("$[$1T.$2L.entrySet().stream()\n.collect($3T.toMap($4L -> $5T.notchToBlockFace($4L.getKey()), $4L -> $4L.getValue()))$]", + this.blockClass, this.field.getName(), Collectors.class, CommonVariable.MAP_ENTRY, Types.CRAFT_BLOCK); + } else { + fieldBuilder.initializer("$T.$L", this.blockClass, this.field.getName()); + } + } else { + if (this.type == DataHolderType.ARRAY || this.type == DataHolderType.LIST) { + CodeBlock.Builder code = CodeBlock.builder(); + this.createSyntheticCollection(code, this.type == DataHolderType.ARRAY, fields); + fieldBuilder.initializer(code.build()); + } else if (this.type == DataHolderType.MAP) { + CodeBlock.Builder code = CodeBlock.builder(); + this.createSyntheticMap(code, this.indexClass, fields); + fieldBuilder.initializer(code.build()); + } + } + return fieldBuilder; + } + + @Override + public Class getIndexClass() { + return this.indexClass; + } + + @Override + public DataHolderType getType() { + return this.type; + } + + @Override + public String getBaseName() { + String constantName = this.field.getName(); + if (FIELD_TO_BASE_NAME.containsKey(constantName)) { + return FIELD_TO_BASE_NAME.get(constantName); + } + return stripFieldAccessKeyword(constantName); + } + + private static final List CUSTOM_KEYWORD = List.of("HAS", "IS", "CAN"); + + private String stripFieldAccessKeyword(String name) { + for (String keyword : CUSTOM_KEYWORD) { + if (name.startsWith(keyword + "_")) { + return name.substring(keyword.length() + 1); + } + } + return name; + } + + private static final Map APPENDERS; + private static final ImmutableMap.Builder builder = ImmutableMap.builder(); + + static { + register(new ArrayAppender()); + register(new ListAppender()); + register(new MapAppender()); + APPENDERS = Maps.immutableEnumMap(builder.build()); + } + + private static void register(DataAppender converter) { + builder.put(converter.getType(), converter); + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, ParameterSpec indexParameter, ConverterBase childConverter, StructuredGenerator generator, NamingManager naming) { + if (APPENDERS.containsKey(this.type)) { + APPENDERS.get(this.type).addExtras(builder, field, indexParameter, childConverter, generator, naming); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriterBase.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriterBase.java new file mode 100644 index 0000000000..ef6aa97629 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriterBase.java @@ -0,0 +1,66 @@ +package io.papermc.generator.types.craftblockdata.property.holder; + +import com.squareup.javapoet.CodeBlock; +import io.papermc.generator.types.craftblockdata.property.PropertyWriter; +import io.papermc.generator.utils.Formatting; +import it.unimi.dsi.fastutil.Pair; +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.properties.Property; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public abstract class DataPropertyWriterBase implements DataPropertyMaker { + + protected final Collection> properties; + protected final Class blockClass; + + protected DataPropertyWriterBase(Collection> properties, Class blockClass) { + this.properties = properties; + this.blockClass = blockClass; + } + + protected void createSyntheticCollection(CodeBlock.Builder code, boolean isArray, Map, Field> fields) { + if (isArray) { + code.add("{\n"); + } else { + code.add("$T.of(\n", List.class); + } + code.indent(); + Iterator> it = this.properties.iterator(); + while (it.hasNext()) { + Property property = it.next(); + Pair, String> fieldName = PropertyWriter.referenceField(this.blockClass, property, fields); + code.add("$T.$L", fieldName.left(), fieldName.right()); + if (it.hasNext()) { + code.add(","); + } + code.add("\n"); + } + code.unindent().add(isArray ? "}" : ")"); + } + + protected void createSyntheticMap(CodeBlock.Builder code, Class indexClass, Map, Field> fields) { + // assume indexClass is an enum with its values matching the property names + code.add("$T.of(\n", Map.class).indent(); + Iterator> it = this.properties.iterator(); + while (it.hasNext()) { + Property property = it.next(); + String name = Formatting.formatKeyAsField(property.getName()); + Pair, String> fieldName = PropertyWriter.referenceField(this.blockClass, property, fields); + code.add("$T.$L, $T.$L", indexClass, name, fieldName.left(), fieldName.right()); + if (it.hasNext()) { + code.add(","); + } + code.add("\n"); + } + code.unindent().add(")"); + } + + @Override + public abstract Class getIndexClass(); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/VirtualDataPropertyWriter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/VirtualDataPropertyWriter.java new file mode 100644 index 0000000000..5a863b4218 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/VirtualDataPropertyWriter.java @@ -0,0 +1,99 @@ +package io.papermc.generator.types.craftblockdata.property.holder; + +import com.squareup.javapoet.ArrayTypeName; +import com.squareup.javapoet.CodeBlock; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.utils.BlockStateMapping; +import io.papermc.generator.utils.NamingManager; +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.properties.Property; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; +import org.jspecify.annotations.NullMarked; + +import static javax.lang.model.element.Modifier.FINAL; +import static javax.lang.model.element.Modifier.PRIVATE; +import static javax.lang.model.element.Modifier.STATIC; + +@NullMarked +public class VirtualDataPropertyWriter extends DataPropertyWriterBase { + + private final VirtualField virtualField; + protected @MonotonicNonNull Class indexClass; + protected @MonotonicNonNull TypeName fieldType; + + protected VirtualDataPropertyWriter(VirtualField virtualField, Collection> properties, Class blockClass) { + super(properties, blockClass); + this.virtualField = virtualField; + this.computeTypes(virtualField); + } + + protected void computeTypes(VirtualField virtualField) { + switch (virtualField.holderType()) { + case ARRAY -> { + this.indexClass = Integer.TYPE; + this.fieldType = ArrayTypeName.of(virtualField.valueType()); + } + case LIST -> { + this.indexClass = Integer.TYPE; + this.fieldType = ParameterizedTypeName.get(List.class, virtualField.valueType()); + } + case MAP -> { + if (virtualField.keyClass() != null) { + this.indexClass = virtualField.keyClass(); + } else { + this.indexClass = this.properties.iterator().next().getValueClass(); + if (this.indexClass.isEnum()) { + this.indexClass = BlockStateMapping.ENUM_BRIDGE.getOrDefault(this.indexClass, (Class>) this.indexClass); + } + } + this.fieldType = ParameterizedTypeName.get(Map.class, this.indexClass, virtualField.valueType()); + } + } + } + + @Override + public FieldSpec.Builder getOrCreateField(Map, Field> fields) { + FieldSpec.Builder fieldBuilder = FieldSpec.builder(this.fieldType, this.virtualField.name(), PRIVATE, STATIC, FINAL); + if (this.getType() == DataHolderType.ARRAY || this.getType() == DataHolderType.LIST) { + CodeBlock.Builder code = CodeBlock.builder(); + this.createSyntheticCollection(code, this.getType() == DataHolderType.ARRAY, fields); + fieldBuilder.initializer(code.build()); + } else if (this.getType() == DataHolderType.MAP) { + CodeBlock.Builder code = CodeBlock.builder(); + this.createSyntheticMap(code, this.indexClass, fields); + fieldBuilder.initializer(code.build()); + } + + return fieldBuilder; + } + + @Override + public Class getIndexClass() { + return this.indexClass; + } + + @Override + public DataHolderType getType() { + return this.virtualField.holderType(); + } + + @Override + public String getBaseName() { + return this.virtualField.baseName(); + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, ParameterSpec indexParameter, ConverterBase converter, StructuredGenerator generator, NamingManager naming) { + + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/VirtualField.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/VirtualField.java new file mode 100644 index 0000000000..26245f80d7 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/VirtualField.java @@ -0,0 +1,72 @@ +package io.papermc.generator.types.craftblockdata.property.holder; + +import com.google.common.base.Preconditions; +import com.google.common.reflect.TypeToken; +import java.lang.reflect.Type; +import java.util.Collection; +import java.util.List; +import net.minecraft.world.level.block.state.properties.Property; +import org.jetbrains.annotations.Contract; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public record VirtualField( + String name, + Type valueType, + DataHolderType holderType, + String baseName, + @Nullable Class keyClass, + Collection> values +) { + + @Contract(value = "_, _, _, _ -> new", pure = true) + public static >> VirtualField.FieldValue createCollection(String name, TypeToken valueType, boolean isArray, String baseName) { + return new VirtualField.FieldValue<>(name, valueType, isArray ? DataHolderType.ARRAY : DataHolderType.LIST, baseName, null); + } + + @Contract(value = "_, _, _, _ -> new", pure = true) + public static >> VirtualField.FieldValue createCollection(String name, Class valueType, boolean isArray, String baseName) { + return createCollection(name, TypeToken.of(valueType), isArray, baseName); + } + + @Contract(value = "_, _, _, _ -> new", pure = true) + public static >> VirtualField.FieldValue createMap(String name, Class keyClass, TypeToken valueType, String baseName) { + return new VirtualField.FieldValue<>(name, valueType, DataHolderType.MAP, baseName, keyClass); + } + + @Contract(value = "_, _, _, _ -> new", pure = true) + public static >> VirtualField.FieldValue createMap(String name, Class keyClass, Class valueType, String baseName) { + return createMap(name, keyClass, TypeToken.of(valueType), baseName); + } + + public static class FieldValue>> { + + private final String name; + private final DataHolderType holderType; + private final TypeToken valueTypeToken; + private final String baseName; + private final @Nullable Class keyClass; + + private @Nullable Collection values; + + public FieldValue(String name, TypeToken valueTypeToken, DataHolderType holderType, String baseName, @Nullable Class keyClass) { + this.name = name; + this.valueTypeToken = valueTypeToken; + this.holderType = holderType; + this.baseName = baseName; + this.keyClass = keyClass; + } + + @Contract(value = "_ -> this", mutates = "this") + public FieldValue withValues(Collection properties) { + this.values = List.copyOf(properties); + return this; + } + + public VirtualField make() { + Preconditions.checkState(this.values != null && !this.values.isEmpty(), "The field should doesn't have any content"); + return new VirtualField(this.name, this.valueTypeToken.getType(), this.holderType, this.baseName, this.keyClass, this.values); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/ArrayAppender.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/ArrayAppender.java new file mode 100644 index 0000000000..c8ebf5cea5 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/ArrayAppender.java @@ -0,0 +1,54 @@ +package io.papermc.generator.types.craftblockdata.property.holder.appender; + +import com.google.common.collect.ImmutableSet; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import io.papermc.generator.utils.CommonVariable; +import io.papermc.generator.utils.NamingManager; +import java.util.Set; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class ArrayAppender implements DataAppender { + + @Override + public DataHolderType getType() { + return DataHolderType.ARRAY; + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, ParameterSpec indexParameter, ConverterBase childConverter, StructuredGenerator generator, NamingManager naming) { + if (childConverter.getApiType() == Boolean.TYPE) { + String collectVarName = naming.getVariableNameWrapper().post("s").concat(); + MethodSpec.Builder methodBuilder = generator.createMethod(naming.getMethodNameWrapper().post("s").concat()); + methodBuilder.addStatement("$T $L = $T.builder()", ParameterizedTypeName.get(ImmutableSet.Builder.class, Integer.class), collectVarName, ImmutableSet.class); + methodBuilder.beginControlFlow("for (int $1L = 0, len = $2N.length; $1L < len; $1L++)", CommonVariable.INDEX, field); + { + methodBuilder.beginControlFlow("if (" + childConverter.rawGetExprent().formatted("$N[$N]") + ")", field, indexParameter); + { + methodBuilder.addStatement("$L.add($L)", collectVarName, CommonVariable.INDEX); + } + methodBuilder.endControlFlow(); + } + methodBuilder.endControlFlow(); + methodBuilder.addStatement("return $L.build()", collectVarName); + methodBuilder.returns(ParameterizedTypeName.get(Set.class, Integer.class)); + + builder.addMethod(methodBuilder.build()); + } + + { + MethodSpec.Builder methodBuilder = generator.createMethod(naming.getMethodNameWrapper().pre("Maximum").post("s").concat()); + methodBuilder.addStatement("return $N.length", field); + methodBuilder.returns(Integer.TYPE); + + builder.addMethod(methodBuilder.build()); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/DataAppender.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/DataAppender.java new file mode 100644 index 0000000000..34f308acf4 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/DataAppender.java @@ -0,0 +1,18 @@ +package io.papermc.generator.types.craftblockdata.property.holder.appender; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import io.papermc.generator.utils.NamingManager; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface DataAppender { + + DataHolderType getType(); + + void addExtras(TypeSpec.Builder builder, FieldSpec field, ParameterSpec indexParameter, ConverterBase converter, StructuredGenerator generator, NamingManager naming); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/ListAppender.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/ListAppender.java new file mode 100644 index 0000000000..9bf0b406b1 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/ListAppender.java @@ -0,0 +1,61 @@ +package io.papermc.generator.types.craftblockdata.property.holder.appender; + +import com.google.common.collect.ImmutableSet; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import io.papermc.generator.utils.CommonVariable; +import io.papermc.generator.utils.NamingManager; +import java.util.Map; +import java.util.Set; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class ListAppender implements DataAppender { + + private static final Map METHOD_BASE_RENAMES = Map.of( + "SlotOccupied", "OccupiedSlot" + ); + + @Override + public DataHolderType getType() { + return DataHolderType.LIST; + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, ParameterSpec indexParameter, ConverterBase childConverter, StructuredGenerator generator, NamingManager naming) { + NamingManager.NameWrapper methodName = NamingManager.NameWrapper.wrap("get", METHOD_BASE_RENAMES.getOrDefault(naming.getMethodBaseName(), naming.getMethodBaseName())); + + if (childConverter.getApiType() == Boolean.TYPE) { + String collectVarName = naming.getVariableNameWrapper().post("s").concat(); + MethodSpec.Builder methodBuilder = generator.createMethod(methodName.post("s").concat()); + methodBuilder.addStatement("$T $L = $T.builder()", ParameterizedTypeName.get(ImmutableSet.Builder.class, Integer.class), collectVarName, ImmutableSet.class); + methodBuilder.beginControlFlow("for (int $1L = 0, size = $2N.size(); $1L < size; $1L++)", CommonVariable.INDEX, field); + { + methodBuilder.beginControlFlow("if (" + childConverter.rawGetExprent().formatted("$N.get($N)") + ")", field, indexParameter); + { + methodBuilder.addStatement("$L.add($L)", collectVarName, CommonVariable.INDEX); + } + methodBuilder.endControlFlow(); + } + methodBuilder.endControlFlow(); + methodBuilder.addStatement("return $L.build()", collectVarName); + methodBuilder.returns(ParameterizedTypeName.get(Set.class, Integer.class)); + + builder.addMethod(methodBuilder.build()); + } + + { + MethodSpec.Builder methodBuilder = generator.createMethod(methodName.pre("Maximum").post("s").concat()); + methodBuilder.addStatement("return $N.size()", field); + methodBuilder.returns(Integer.TYPE); + + builder.addMethod(methodBuilder.build()); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/MapAppender.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/MapAppender.java new file mode 100644 index 0000000000..63b013b90d --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/MapAppender.java @@ -0,0 +1,58 @@ +package io.papermc.generator.types.craftblockdata.property.holder.appender; + +import com.google.common.collect.ImmutableSet; +import com.squareup.javapoet.ClassName; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.types.StructuredGenerator; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import io.papermc.generator.utils.CommonVariable; +import io.papermc.generator.utils.NamingManager; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class MapAppender implements DataAppender { + + @Override + public DataHolderType getType() { + return DataHolderType.MAP; + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, ParameterSpec indexParameter, ConverterBase childConverter, StructuredGenerator generator, NamingManager naming) { + if (childConverter.getApiType() == Boolean.TYPE) { + String collectVarName = naming.getVariableNameWrapper().post("s").concat(); + MethodSpec.Builder methodBuilder = generator.createMethod(naming.getMethodNameWrapper().post("s").concat()); + methodBuilder.addStatement("$T $L = $T.builder()", ParameterizedTypeName.get(ClassName.get(ImmutableSet.Builder.class), indexParameter.type), collectVarName, ImmutableSet.class); + methodBuilder.beginControlFlow("for ($T $N : $N.entrySet())", ParameterizedTypeName.get(ClassName.get(Map.Entry.class), indexParameter.type, ClassName.get(BooleanProperty.class)), CommonVariable.MAP_ENTRY, field); + { + methodBuilder.beginControlFlow("if (" + childConverter.rawGetExprent().formatted("$L.getValue()") + ")", CommonVariable.MAP_ENTRY); + { + methodBuilder.addStatement("$L.add($N.getKey())", collectVarName, CommonVariable.MAP_ENTRY); + } + methodBuilder.endControlFlow(); + } + methodBuilder.endControlFlow(); + methodBuilder.addStatement("return $L.build()", collectVarName); + methodBuilder.returns(ParameterizedTypeName.get(ClassName.get(Set.class), indexParameter.type)); + + builder.addMethod(methodBuilder.build()); + } + + { + MethodSpec.Builder methodBuilder = generator.createMethod(naming.getMethodNameWrapper().pre("Allowed").post("s").concat()); + methodBuilder.addStatement("return $T.unmodifiableSet($N.keySet())", Collections.class, field); + methodBuilder.returns(ParameterizedTypeName.get(ClassName.get(Set.class), indexParameter.type)); + + builder.addMethod(methodBuilder.build()); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/ArrayConverter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/ArrayConverter.java new file mode 100644 index 0000000000..a9b943bc0a --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/ArrayConverter.java @@ -0,0 +1,32 @@ +package io.papermc.generator.types.craftblockdata.property.holder.converter; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import io.papermc.generator.types.craftblockdata.property.EnumPropertyWriter; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class ArrayConverter implements DataConverter { + + @Override + public DataHolderType getType() { + return DataHolderType.ARRAY; + } + + @Override + public void convertSetter(ConverterBase childConverter, MethodSpec.Builder method, FieldSpec field, ParameterSpec indexParameter, ParameterSpec parameter) { + method.addStatement(childConverter.rawSetExprent().formatted("$N[$N]"), field, indexParameter, parameter); + } + + @Override + public void convertGetter(ConverterBase childConverter, MethodSpec.Builder method, FieldSpec field, ParameterSpec indexParameter) { + if (childConverter instanceof EnumPropertyWriter enumConverter) { + method.addStatement("return " + childConverter.rawGetExprent().formatted("$N[$N]"), field, indexParameter, enumConverter.getApiType()); + } else { + method.addStatement("return " + childConverter.rawGetExprent().formatted("$N[$N]"), field, indexParameter); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverter.java new file mode 100644 index 0000000000..596eb31cc6 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverter.java @@ -0,0 +1,18 @@ +package io.papermc.generator.types.craftblockdata.property.holder.converter; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface DataConverter { + + DataHolderType getType(); + + void convertSetter(ConverterBase childConverter, MethodSpec.Builder method, FieldSpec field, ParameterSpec indexParameter, ParameterSpec parameter); + + void convertGetter(ConverterBase childConverter, MethodSpec.Builder method, FieldSpec field, ParameterSpec indexParameter); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverters.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverters.java new file mode 100644 index 0000000000..c96efd597b --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverters.java @@ -0,0 +1,32 @@ +package io.papermc.generator.types.craftblockdata.property.holder.converter; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class DataConverters { + + private static final ImmutableMap CONVERTERS; + private static final ImmutableMap.Builder builder = ImmutableMap.builder(); + + static { + register(new ArrayConverter()); + register(new ListConverter()); + register(new MapConverter()); + CONVERTERS = Maps.immutableEnumMap(builder.build()); + } + + public static DataConverter getOrThrow(DataHolderType type) { + DataConverter converter = CONVERTERS.get(type); + if (converter == null) { + throw new IllegalStateException("Cannot handle " + type); + } + return converter; + } + + private static void register(DataConverter converter) { + builder.put(converter.getType(), converter); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/ListConverter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/ListConverter.java new file mode 100644 index 0000000000..157b519345 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/ListConverter.java @@ -0,0 +1,32 @@ +package io.papermc.generator.types.craftblockdata.property.holder.converter; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import io.papermc.generator.types.craftblockdata.property.EnumPropertyWriter; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class ListConverter implements DataConverter { + + @Override + public DataHolderType getType() { + return DataHolderType.LIST; + } + + @Override + public void convertSetter(ConverterBase childConverter, MethodSpec.Builder method, FieldSpec field, ParameterSpec indexParameter, ParameterSpec parameter) { + method.addStatement(childConverter.rawSetExprent().formatted("$N.get($N)"), field, indexParameter, parameter); + } + + @Override + public void convertGetter(ConverterBase childConverter, MethodSpec.Builder method, FieldSpec field, ParameterSpec indexParameter) { + if (childConverter instanceof EnumPropertyWriter enumConverter) { + method.addStatement("return " + childConverter.rawGetExprent().formatted("$N.get($N)"), field, indexParameter, enumConverter.getApiType()); + } else { + method.addStatement("return " + childConverter.rawGetExprent().formatted("$N.get($N)"), field, indexParameter); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/MapConverter.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/MapConverter.java new file mode 100644 index 0000000000..73903ef5f9 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/MapConverter.java @@ -0,0 +1,45 @@ +package io.papermc.generator.types.craftblockdata.property.holder.converter; + +import com.google.common.base.Preconditions; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import io.papermc.generator.types.craftblockdata.property.EnumPropertyWriter; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import java.util.stream.Collectors; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class MapConverter implements DataConverter { + + private static final String PROPERTY_VAR = "property"; + + @Override + public DataHolderType getType() { + return DataHolderType.MAP; + } + + @Override + public void convertSetter(ConverterBase childConverter, MethodSpec.Builder method, FieldSpec field, ParameterSpec indexParameter, ParameterSpec parameter) { + method.addStatement("$T $L = $N.get($N)", ((ParameterizedTypeName) field.type).typeArguments.get(1), PROPERTY_VAR, field, indexParameter); + method.addStatement("$T.checkArgument($N != null, $S, $N.keySet().stream().map($T::name).collect($T.joining($S)))", + Preconditions.class, PROPERTY_VAR, "Invalid " + indexParameter.name + ", only %s are allowed!", field, Enum.class, Collectors.class, ", "); + + method.addStatement(childConverter.rawSetExprent().formatted("$L"), PROPERTY_VAR, parameter); + } + + @Override + public void convertGetter(ConverterBase childConverter, MethodSpec.Builder method, FieldSpec field, ParameterSpec indexParameter) { + method.addStatement("$T $L = $N.get($N)", ((ParameterizedTypeName) field.type).typeArguments.get(1), PROPERTY_VAR, field, indexParameter); + method.addStatement("$T.checkArgument($N != null, $S, $N.keySet().stream().map($T::name).collect($T.joining($S)))", + Preconditions.class, PROPERTY_VAR, "Invalid " + indexParameter.name + ", only %s are allowed!", field, Enum.class, Collectors.class, ", "); + + if (childConverter instanceof EnumPropertyWriter enumConverter) { + method.addStatement("return " + childConverter.rawGetExprent().formatted("$L"), PROPERTY_VAR, enumConverter.getApiType()); + } else { + method.addStatement("return " + childConverter.rawGetExprent().formatted("$L"), PROPERTY_VAR); + } + } +} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/types/goal/MobGoalGenerator.java b/paper-generator/src/main/java/io/papermc/generator/types/goal/MobGoalGenerator.java similarity index 55% rename from paper-api-generator/src/main/java/io/papermc/generator/types/goal/MobGoalGenerator.java rename to paper-generator/src/main/java/io/papermc/generator/types/goal/MobGoalGenerator.java index ffe3c48572..9db9e2cbdb 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/goal/MobGoalGenerator.java +++ b/paper-generator/src/main/java/io/papermc/generator/types/goal/MobGoalGenerator.java @@ -1,10 +1,8 @@ package io.papermc.generator.types.goal; -import com.destroystokyo.paper.entity.RangedEntity; import com.destroystokyo.paper.entity.ai.GoalKey; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.FieldSpec; -import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterSpec; import com.squareup.javapoet.ParameterizedTypeName; @@ -17,62 +15,28 @@ import io.papermc.generator.types.SimpleGenerator; import io.papermc.generator.utils.Annotations; import io.papermc.generator.utils.Formatting; import io.papermc.generator.utils.Javadocs; +import io.papermc.typewriter.utils.ClassHelper; import java.util.Comparator; import java.util.List; -import javax.lang.model.element.Modifier; import net.minecraft.world.entity.ai.goal.Goal; +import net.minecraft.world.entity.ai.goal.GoalSelector; import net.minecraft.world.entity.ai.goal.WrappedGoal; import org.bukkit.NamespacedKey; -import org.bukkit.entity.AbstractHorse; -import org.bukkit.entity.Blaze; -import org.bukkit.entity.Cat; -import org.bukkit.entity.Creature; -import org.bukkit.entity.Dolphin; -import org.bukkit.entity.Drowned; -import org.bukkit.entity.Enderman; -import org.bukkit.entity.Evoker; -import org.bukkit.entity.Fish; -import org.bukkit.entity.Fox; -import org.bukkit.entity.Ghast; -import org.bukkit.entity.Llama; import org.bukkit.entity.Mob; -import org.bukkit.entity.Monster; -import org.bukkit.entity.Panda; -import org.bukkit.entity.Parrot; -import org.bukkit.entity.PigZombie; -import org.bukkit.entity.PolarBear; -import org.bukkit.entity.Rabbit; -import org.bukkit.entity.Raider; -import org.bukkit.entity.Ravager; -import org.bukkit.entity.Shulker; -import org.bukkit.entity.Silverfish; -import org.bukkit.entity.SkeletonHorse; -import org.bukkit.entity.Slime; -import org.bukkit.entity.Spellcaster; -import org.bukkit.entity.Spider; -import org.bukkit.entity.Squid; -import org.bukkit.entity.Tameable; -import org.bukkit.entity.TraderLlama; -import org.bukkit.entity.Turtle; -import org.bukkit.entity.Vex; -import org.bukkit.entity.Vindicator; -import org.bukkit.entity.WanderingTrader; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.framework.qual.DefaultQualifier; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.NullMarked; import static javax.lang.model.element.Modifier.FINAL; import static javax.lang.model.element.Modifier.PRIVATE; import static javax.lang.model.element.Modifier.PUBLIC; import static javax.lang.model.element.Modifier.STATIC; -@DefaultQualifier(NonNull.class) +@NullMarked public class MobGoalGenerator extends SimpleGenerator { - private static final String CLASS_HEADER = Javadocs.getVersionDependentClassHeader("Mob Goals"); + private static final String CLASS_HEADER = Javadocs.getVersionDependentClassHeader("keys", "Mob Goals"); - public MobGoalGenerator(final String keysClassName, final String pkg) { - super(keysClassName, pkg); + public MobGoalGenerator(String className, String packageName) { + super(className, packageName); } @Override @@ -85,43 +49,36 @@ public class MobGoalGenerator extends SimpleGenerator { .addAnnotations(Annotations.CLASS_HEADER) .addJavadoc(CLASS_HEADER); - TypeName mobType = ParameterizedTypeName.get(ClassName.get(Class.class), type) - .annotated(Annotations.NOT_NULL); - TypeName keyType = TypeName.get(String.class) - .annotated(Annotations.NOT_NULL); - - ParameterSpec keyParam = ParameterSpec.builder(keyType, "key", FINAL).build(); - ParameterSpec typeParam = ParameterSpec.builder(mobType, "type", FINAL).build(); + ParameterSpec keyParam = ParameterSpec.builder(String.class, "key", FINAL).build(); + ParameterSpec typeParam = ParameterSpec.builder(ParameterizedTypeName.get(ClassName.get(Class.class), type), "type", FINAL).build(); MethodSpec.Builder createMethod = MethodSpec.methodBuilder("create") .addModifiers(PRIVATE, STATIC) .addParameter(keyParam) .addParameter(typeParam) .addCode("return $T.of($N, $T.minecraft($N));", GoalKey.class, typeParam, NamespacedKey.class, keyParam) .addTypeVariable(type) - .returns(ParameterizedTypeName.get(ClassName.get(GoalKey.class), type).annotated(Annotations.NOT_NULL)); + .returns(ParameterizedTypeName.get(ClassName.get(GoalKey.class), type)); List> classes; try (ScanResult scanResult = new ClassGraph().enableAllInfo().whitelistPackages("net.minecraft").scan()) { classes = scanResult.getSubclasses(Goal.class.getName()).loadClasses(Goal.class); } - List> vanillaNames = classes.stream() + List> vanillaGoals = classes.stream() .filter(clazz -> !java.lang.reflect.Modifier.isAbstract(clazz.getModifiers())) + .filter(clazz -> !clazz.isAnonymousClass() || ClassHelper.getTopLevelClass(clazz) != GoalSelector.class) .filter(clazz -> !WrappedGoal.class.equals(clazz)) // TODO - properly fix - .map(goalClass -> MobGoalNames.getKey(goalClass.getName(), goalClass)) - .filter((key) -> !MobGoalNames.isIgnored(key.getNamespacedKey().getKey())) + .map(MobGoalNames::getKey) .sorted(Comparator., String>comparing(o -> o.getEntityClass().getSimpleName()) .thenComparing(vanillaGoalKey -> vanillaGoalKey.getNamespacedKey().getKey()) ) .toList(); - - for (final GoalKey goalKey : vanillaNames) { - TypeName typedKey = ParameterizedTypeName.get(GoalKey.class, goalKey.getEntityClass()); - NamespacedKey key = goalKey.getNamespacedKey(); - - String keyPath = key.getKey(); + for (GoalKey goalKey : vanillaGoals) { + String keyPath = goalKey.getNamespacedKey().getKey(); String fieldName = Formatting.formatKeyAsField(keyPath); + + TypeName typedKey = ParameterizedTypeName.get(GoalKey.class, goalKey.getEntityClass()); FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, PUBLIC, STATIC, FINAL) .initializer("$N($S, $T.class)", createMethod.build(), keyPath, goalKey.getEntityClass()); typeBuilder.addField(fieldBuilder.build()); @@ -129,15 +86,4 @@ public class MobGoalGenerator extends SimpleGenerator { return typeBuilder.addMethod(createMethod.build()).build(); } - - @Override - protected JavaFile.Builder file(JavaFile.Builder builder) { - return builder; - } - - record DeprecatedEntry(Class entity, String entryName, @Nullable String removalVersion, - @Nullable String removedVersion) { - - } - } diff --git a/paper-api-generator/src/main/java/io/papermc/generator/types/goal/MobGoalNames.java b/paper-generator/src/main/java/io/papermc/generator/types/goal/MobGoalNames.java similarity index 51% rename from paper-api-generator/src/main/java/io/papermc/generator/types/goal/MobGoalNames.java rename to paper-generator/src/main/java/io/papermc/generator/types/goal/MobGoalNames.java index 1bd6342f61..327c587b85 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/goal/MobGoalNames.java +++ b/paper-generator/src/main/java/io/papermc/generator/types/goal/MobGoalNames.java @@ -2,140 +2,31 @@ package io.papermc.generator.types.goal; import com.destroystokyo.paper.entity.RangedEntity; import com.destroystokyo.paper.entity.ai.GoalKey; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; -import net.minecraft.world.entity.FlyingMob; -import net.minecraft.world.entity.PathfinderMob; -import net.minecraft.world.entity.TamableAnimal; -import net.minecraft.world.entity.ai.goal.Goal; -import net.minecraft.world.entity.ambient.AmbientCreature; -import net.minecraft.world.entity.animal.AbstractFish; -import net.minecraft.world.entity.animal.AbstractGolem; -import net.minecraft.world.entity.animal.AbstractSchoolingFish; -import net.minecraft.world.entity.animal.Animal; -import net.minecraft.world.entity.animal.Pufferfish; -import net.minecraft.world.entity.animal.ShoulderRidingEntity; -import net.minecraft.world.entity.animal.SnowGolem; -import net.minecraft.world.entity.animal.WaterAnimal; -import net.minecraft.world.entity.animal.horse.AbstractChestedHorse; -import net.minecraft.world.entity.boss.wither.WitherBoss; -import net.minecraft.world.entity.monster.AbstractIllager; -import net.minecraft.world.entity.monster.EnderMan; -import net.minecraft.world.entity.monster.PatrollingMonster; -import net.minecraft.world.entity.monster.RangedAttackMob; -import net.minecraft.world.entity.monster.SpellcasterIllager; -import net.minecraft.world.entity.monster.ZombifiedPiglin; -import net.minecraft.world.entity.monster.piglin.AbstractPiglin; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.AbstractHorse; -import org.bukkit.entity.AbstractSkeleton; -import org.bukkit.entity.AbstractVillager; -import org.bukkit.entity.Ageable; -import org.bukkit.entity.Ambient; -import org.bukkit.entity.Animals; -import org.bukkit.entity.Bat; -import org.bukkit.entity.Bee; -import org.bukkit.entity.Blaze; -import org.bukkit.entity.Cat; -import org.bukkit.entity.CaveSpider; -import org.bukkit.entity.ChestedHorse; -import org.bukkit.entity.Chicken; -import org.bukkit.entity.Cod; -import org.bukkit.entity.Cow; -import org.bukkit.entity.Creature; -import org.bukkit.entity.Creeper; -import org.bukkit.entity.Dolphin; -import org.bukkit.entity.Donkey; -import org.bukkit.entity.Drowned; -import org.bukkit.entity.ElderGuardian; -import org.bukkit.entity.EnderDragon; -import org.bukkit.entity.Enderman; -import org.bukkit.entity.Endermite; -import org.bukkit.entity.Evoker; -import org.bukkit.entity.Fish; -import org.bukkit.entity.Flying; -import org.bukkit.entity.Fox; -import org.bukkit.entity.Ghast; -import org.bukkit.entity.Giant; -import org.bukkit.entity.Golem; -import org.bukkit.entity.Guardian; -import org.bukkit.entity.Hoglin; -import org.bukkit.entity.Horse; -import org.bukkit.entity.Husk; -import org.bukkit.entity.Illager; -import org.bukkit.entity.Illusioner; -import org.bukkit.entity.IronGolem; -import org.bukkit.entity.Llama; -import org.bukkit.entity.MagmaCube; -import org.bukkit.entity.Mob; -import org.bukkit.entity.Monster; -import org.bukkit.entity.Mule; -import org.bukkit.entity.MushroomCow; -import org.bukkit.entity.Ocelot; -import org.bukkit.entity.Panda; -import org.bukkit.entity.Parrot; -import org.bukkit.entity.Phantom; -import org.bukkit.entity.Pig; -import org.bukkit.entity.PigZombie; -import org.bukkit.entity.Piglin; -import org.bukkit.entity.PiglinAbstract; -import org.bukkit.entity.PiglinBrute; -import org.bukkit.entity.Pillager; -import org.bukkit.entity.PolarBear; -import org.bukkit.entity.PufferFish; -import org.bukkit.entity.Rabbit; -import org.bukkit.entity.Raider; -import org.bukkit.entity.Ravager; -import org.bukkit.entity.Salmon; -import org.bukkit.entity.Sheep; -import org.bukkit.entity.Shulker; -import org.bukkit.entity.Silverfish; -import org.bukkit.entity.Skeleton; -import org.bukkit.entity.SkeletonHorse; -import org.bukkit.entity.Slime; -import org.bukkit.entity.Snowman; -import org.bukkit.entity.Spellcaster; -import org.bukkit.entity.Spider; -import org.bukkit.entity.Squid; -import org.bukkit.entity.Stray; -import org.bukkit.entity.Strider; -import org.bukkit.entity.Tameable; -import org.bukkit.entity.TraderLlama; -import org.bukkit.entity.TropicalFish; -import org.bukkit.entity.Turtle; -import org.bukkit.entity.Vex; -import org.bukkit.entity.Villager; -import org.bukkit.entity.Vindicator; -import org.bukkit.entity.WanderingTrader; -import org.bukkit.entity.WaterMob; -import org.bukkit.entity.Witch; -import org.bukkit.entity.Wither; -import org.bukkit.entity.WitherSkeleton; -import org.bukkit.entity.Wolf; -import org.bukkit.entity.Zoglin; -import org.bukkit.entity.Zombie; -import org.bukkit.entity.ZombieHorse; -import org.bukkit.entity.ZombieVillager; - +import com.google.common.base.CaseFormat; +import io.papermc.generator.utils.Formatting; +import io.papermc.paper.entity.SchoolableFish; import java.lang.reflect.Constructor; import java.util.HashMap; -import java.util.HashSet; -import java.util.Locale; import java.util.Map; -import java.util.Set; +import net.minecraft.world.entity.ai.goal.Goal; +import net.minecraft.world.entity.monster.RangedAttackMob; +import org.apache.commons.lang3.math.NumberUtils; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.*; +import org.jspecify.annotations.NullMarked; -public class MobGoalNames { +@NullMarked +public final class MobGoalNames { // todo sync with MobGoalHelper ideally this should not be duplicated private static final Map, Class> entityClassCache = new HashMap<>(); public static final Map, Class> bukkitMap = new HashMap<>(); - static { // bukkitMap.put(net.minecraft.world.entity.Mob.class, Mob.class); bukkitMap.put(net.minecraft.world.entity.AgeableMob.class, Ageable.class); - bukkitMap.put(AmbientCreature.class, Ambient.class); - bukkitMap.put(Animal.class, Animals.class); + bukkitMap.put(net.minecraft.world.entity.ambient.AmbientCreature.class, Ambient.class); + bukkitMap.put(net.minecraft.world.entity.animal.Animal.class, Animals.class); bukkitMap.put(net.minecraft.world.entity.ambient.Bat.class, Bat.class); bukkitMap.put(net.minecraft.world.entity.animal.Bee.class, Bee.class); bukkitMap.put(net.minecraft.world.entity.monster.Blaze.class, Blaze.class); @@ -144,51 +35,51 @@ public class MobGoalNames { bukkitMap.put(net.minecraft.world.entity.animal.Chicken.class, Chicken.class); bukkitMap.put(net.minecraft.world.entity.animal.Cod.class, Cod.class); bukkitMap.put(net.minecraft.world.entity.animal.Cow.class, Cow.class); - bukkitMap.put(PathfinderMob.class, Creature.class); + bukkitMap.put(net.minecraft.world.entity.PathfinderMob.class, Creature.class); bukkitMap.put(net.minecraft.world.entity.monster.Creeper.class, Creeper.class); bukkitMap.put(net.minecraft.world.entity.animal.Dolphin.class, Dolphin.class); bukkitMap.put(net.minecraft.world.entity.monster.Drowned.class, Drowned.class); bukkitMap.put(net.minecraft.world.entity.boss.enderdragon.EnderDragon.class, EnderDragon.class); - bukkitMap.put(EnderMan.class, Enderman.class); + bukkitMap.put(net.minecraft.world.entity.monster.EnderMan.class, Enderman.class); bukkitMap.put(net.minecraft.world.entity.monster.Endermite.class, Endermite.class); bukkitMap.put(net.minecraft.world.entity.monster.Evoker.class, Evoker.class); - bukkitMap.put(AbstractFish.class, Fish.class); - bukkitMap.put(AbstractSchoolingFish.class, io.papermc.paper.entity.SchoolableFish.class); - bukkitMap.put(FlyingMob.class, Flying.class); + bukkitMap.put(net.minecraft.world.entity.animal.AbstractFish.class, Fish.class); + bukkitMap.put(net.minecraft.world.entity.animal.AbstractSchoolingFish.class, SchoolableFish.class); + bukkitMap.put(net.minecraft.world.entity.FlyingMob.class, Flying.class); bukkitMap.put(net.minecraft.world.entity.animal.Fox.class, Fox.class); bukkitMap.put(net.minecraft.world.entity.monster.Ghast.class, Ghast.class); bukkitMap.put(net.minecraft.world.entity.monster.Giant.class, Giant.class); - bukkitMap.put(AbstractGolem.class, Golem.class); + bukkitMap.put(net.minecraft.world.entity.animal.AbstractGolem.class, Golem.class); bukkitMap.put(net.minecraft.world.entity.monster.Guardian.class, Guardian.class); bukkitMap.put(net.minecraft.world.entity.monster.ElderGuardian.class, ElderGuardian.class); bukkitMap.put(net.minecraft.world.entity.animal.horse.Horse.class, Horse.class); bukkitMap.put(net.minecraft.world.entity.animal.horse.AbstractHorse.class, AbstractHorse.class); - bukkitMap.put(AbstractChestedHorse.class, ChestedHorse.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.AbstractChestedHorse.class, ChestedHorse.class); bukkitMap.put(net.minecraft.world.entity.animal.horse.Donkey.class, Donkey.class); bukkitMap.put(net.minecraft.world.entity.animal.horse.Mule.class, Mule.class); bukkitMap.put(net.minecraft.world.entity.animal.horse.SkeletonHorse.class, SkeletonHorse.class); bukkitMap.put(net.minecraft.world.entity.animal.horse.ZombieHorse.class, ZombieHorse.class); bukkitMap.put(net.minecraft.world.entity.animal.camel.Camel.class, org.bukkit.entity.Camel.class); - bukkitMap.put(AbstractIllager.class, Illager.class); + bukkitMap.put(net.minecraft.world.entity.monster.AbstractIllager.class, Illager.class); bukkitMap.put(net.minecraft.world.entity.monster.Illusioner.class, Illusioner.class); - bukkitMap.put(SpellcasterIllager.class, Spellcaster.class); + bukkitMap.put(net.minecraft.world.entity.monster.SpellcasterIllager.class, Spellcaster.class); bukkitMap.put(net.minecraft.world.entity.animal.IronGolem.class, IronGolem.class); bukkitMap.put(net.minecraft.world.entity.animal.horse.Llama.class, Llama.class); bukkitMap.put(net.minecraft.world.entity.animal.horse.TraderLlama.class, TraderLlama.class); bukkitMap.put(net.minecraft.world.entity.monster.MagmaCube.class, MagmaCube.class); bukkitMap.put(net.minecraft.world.entity.monster.Monster.class, Monster.class); - bukkitMap.put(PatrollingMonster.class, Raider.class); // close enough + bukkitMap.put(net.minecraft.world.entity.monster.PatrollingMonster.class, Raider.class); // close enough bukkitMap.put(net.minecraft.world.entity.animal.MushroomCow.class, MushroomCow.class); bukkitMap.put(net.minecraft.world.entity.animal.Ocelot.class, Ocelot.class); bukkitMap.put(net.minecraft.world.entity.animal.Panda.class, Panda.class); bukkitMap.put(net.minecraft.world.entity.animal.Parrot.class, Parrot.class); - bukkitMap.put(ShoulderRidingEntity.class, Parrot.class); // close enough + bukkitMap.put(net.minecraft.world.entity.animal.ShoulderRidingEntity.class, Parrot.class); // close enough bukkitMap.put(net.minecraft.world.entity.monster.Phantom.class, Phantom.class); bukkitMap.put(net.minecraft.world.entity.animal.Pig.class, Pig.class); - bukkitMap.put(ZombifiedPiglin.class, PigZombie.class); + bukkitMap.put(net.minecraft.world.entity.monster.ZombifiedPiglin.class, PigZombie.class); bukkitMap.put(net.minecraft.world.entity.monster.Pillager.class, Pillager.class); bukkitMap.put(net.minecraft.world.entity.animal.PolarBear.class, PolarBear.class); - bukkitMap.put(Pufferfish.class, PufferFish.class); + bukkitMap.put(net.minecraft.world.entity.animal.Pufferfish.class, PufferFish.class); bukkitMap.put(net.minecraft.world.entity.animal.Rabbit.class, Rabbit.class); bukkitMap.put(net.minecraft.world.entity.raid.Raider.class, Raider.class); bukkitMap.put(net.minecraft.world.entity.monster.Ravager.class, Ravager.class); @@ -201,10 +92,10 @@ public class MobGoalNames { bukkitMap.put(net.minecraft.world.entity.monster.Stray.class, Stray.class); bukkitMap.put(net.minecraft.world.entity.monster.WitherSkeleton.class, WitherSkeleton.class); bukkitMap.put(net.minecraft.world.entity.monster.Slime.class, Slime.class); - bukkitMap.put(SnowGolem.class, Snowman.class); + bukkitMap.put(net.minecraft.world.entity.animal.SnowGolem.class, Snowman.class); bukkitMap.put(net.minecraft.world.entity.monster.Spider.class, Spider.class); bukkitMap.put(net.minecraft.world.entity.animal.Squid.class, Squid.class); - bukkitMap.put(TamableAnimal.class, Tameable.class); + bukkitMap.put(net.minecraft.world.entity.TamableAnimal.class, Tameable.class); bukkitMap.put(net.minecraft.world.entity.animal.TropicalFish.class, TropicalFish.class); bukkitMap.put(net.minecraft.world.entity.animal.Turtle.class, Turtle.class); bukkitMap.put(net.minecraft.world.entity.monster.Vex.class, Vex.class); @@ -212,105 +103,83 @@ public class MobGoalNames { bukkitMap.put(net.minecraft.world.entity.npc.AbstractVillager.class, AbstractVillager.class); bukkitMap.put(net.minecraft.world.entity.npc.WanderingTrader.class, WanderingTrader.class); bukkitMap.put(net.minecraft.world.entity.monster.Vindicator.class, Vindicator.class); - bukkitMap.put(WaterAnimal.class, WaterMob.class); + bukkitMap.put(net.minecraft.world.entity.animal.WaterAnimal.class, WaterMob.class); bukkitMap.put(net.minecraft.world.entity.monster.Witch.class, Witch.class); - bukkitMap.put(WitherBoss.class, Wither.class); + bukkitMap.put(net.minecraft.world.entity.boss.wither.WitherBoss.class, Wither.class); bukkitMap.put(net.minecraft.world.entity.animal.Wolf.class, Wolf.class); bukkitMap.put(net.minecraft.world.entity.monster.Zombie.class, Zombie.class); bukkitMap.put(net.minecraft.world.entity.monster.Husk.class, Husk.class); bukkitMap.put(net.minecraft.world.entity.monster.ZombieVillager.class, ZombieVillager.class); bukkitMap.put(net.minecraft.world.entity.monster.hoglin.Hoglin.class, Hoglin.class); bukkitMap.put(net.minecraft.world.entity.monster.piglin.Piglin.class, Piglin.class); - bukkitMap.put(AbstractPiglin.class, PiglinAbstract.class); + bukkitMap.put(net.minecraft.world.entity.monster.piglin.AbstractPiglin.class, PiglinAbstract.class); bukkitMap.put(net.minecraft.world.entity.monster.piglin.PiglinBrute.class, PiglinBrute.class); bukkitMap.put(net.minecraft.world.entity.monster.Strider.class, Strider.class); bukkitMap.put(net.minecraft.world.entity.monster.Zoglin.class, Zoglin.class); - bukkitMap.put(net.minecraft.world.entity.GlowSquid.class, org.bukkit.entity.GlowSquid.class); - bukkitMap.put(net.minecraft.world.entity.animal.axolotl.Axolotl.class, org.bukkit.entity.Axolotl.class); - bukkitMap.put(net.minecraft.world.entity.animal.goat.Goat.class, org.bukkit.entity.Goat.class); - bukkitMap.put(net.minecraft.world.entity.animal.frog.Frog.class, org.bukkit.entity.Frog.class); - bukkitMap.put(net.minecraft.world.entity.animal.frog.Tadpole.class, org.bukkit.entity.Tadpole.class); - bukkitMap.put(net.minecraft.world.entity.monster.warden.Warden.class, org.bukkit.entity.Warden.class); - bukkitMap.put(net.minecraft.world.entity.animal.allay.Allay.class, org.bukkit.entity.Allay.class); - bukkitMap.put(net.minecraft.world.entity.animal.sniffer.Sniffer.class, org.bukkit.entity.Sniffer.class); - bukkitMap.put(net.minecraft.world.entity.monster.breeze.Breeze.class, org.bukkit.entity.Breeze.class); - bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, org.bukkit.entity.Armadillo.class); - bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, org.bukkit.entity.Bogged.class); + bukkitMap.put(net.minecraft.world.entity.GlowSquid.class, GlowSquid.class); + bukkitMap.put(net.minecraft.world.entity.animal.axolotl.Axolotl.class, Axolotl.class); + bukkitMap.put(net.minecraft.world.entity.animal.goat.Goat.class, Goat.class); + bukkitMap.put(net.minecraft.world.entity.animal.frog.Frog.class, Frog.class); + bukkitMap.put(net.minecraft.world.entity.animal.frog.Tadpole.class, Tadpole.class); + bukkitMap.put(net.minecraft.world.entity.monster.warden.Warden.class, Warden.class); + bukkitMap.put(net.minecraft.world.entity.animal.allay.Allay.class, Allay.class); + bukkitMap.put(net.minecraft.world.entity.animal.sniffer.Sniffer.class, Sniffer.class); + bukkitMap.put(net.minecraft.world.entity.monster.breeze.Breeze.class, Breeze.class); + bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, Armadillo.class); + bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, Bogged.class); // } - private static final BiMap deobfuscationMap = HashBiMap.create(); - static final Set ignored = new HashSet<>(); + private static final Map deobfuscationMap = new HashMap<>(); static { + // TODO these kinda should be checked on each release, in case obfuscation changes deobfuscationMap.put("abstract_skeleton_1", "abstract_skeleton_melee"); - - ignored.add("goal_selector_1"); - ignored.add("goal_selector_2"); - ignored.add("selector_1"); - ignored.add("selector_2"); - ignored.add("wrapped"); } - public static String getUsableName(String name) { - final String original = name; - name = name.substring(name.lastIndexOf(".") + 1); - boolean flag = false; - // inner classes - if (name.contains("$")) { - String cut = name.substring(name.indexOf("$") + 1); - if (cut.length() <= 2) { - name = name.replace("Entity", ""); - name = name.replace("$", "_"); - flag = true; - } else { - // mapped, wooo - name = cut; - } - } - name = name.replace("PathfinderGoal", ""); - name = name.replace("TargetGoal", ""); - name = name.replace("Goal", ""); - StringBuilder sb = new StringBuilder(); - for (char c : name.toCharArray()) { - if (c >= 'A' && c <= 'Z') { - sb.append("_"); - sb.append(Character.toLowerCase(c)); - } else { - sb.append(c); - } - } - name = sb.toString(); - name = name.replaceFirst("_", ""); + private static String getPathName(String name) { + String pathName = name.substring(name.lastIndexOf('.') + 1); + boolean needDeobfMap = false; - if (flag && !deobfuscationMap.containsKey(name.toLowerCase(Locale.ROOT)) && !ignored.contains(name)) { - System.out.println("need to map " + original + " (" + name.toLowerCase(Locale.ROOT) + ")"); + // inner classes + int firstInnerDelimiter = pathName.indexOf('$'); + if (firstInnerDelimiter != -1) { + String innerClassName = pathName.substring(firstInnerDelimiter + 1); + for (String nestedClass : innerClassName.split("\\$")) { + if (NumberUtils.isDigits(nestedClass)) { + needDeobfMap = true; + break; + } + } + if (!needDeobfMap) { + pathName = innerClassName; + } + pathName = pathName.replace('$', '_'); + // mapped, wooo! + } + + pathName = Formatting.stripWordOfCamelCaseName(pathName, "TargetGoal", true); // replace last? reverse search? + pathName = Formatting.stripWordOfCamelCaseName(pathName, "Goal", true); + pathName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, pathName); + + if (needDeobfMap && !deobfuscationMap.containsKey(pathName)) { + System.err.println("need to map " + name + " (" + pathName + ")"); } // did we rename this key? - return deobfuscationMap.getOrDefault(name, name); + return deobfuscationMap.getOrDefault(pathName, pathName); } - public static boolean isIgnored(String name) { - return ignored.contains(name); - } - - - public static GoalKey getKey(String clazzName, Class goalClass) { - String name = getUsableName(clazzName); - if (MobGoalNames.isIgnored(name)) { - //noinspection unchecked - return (GoalKey) GoalKey.of(Mob.class, NamespacedKey.minecraft(name)); - } + public static GoalKey getKey(Class goalClass) { + String name = getPathName(goalClass.getName()); return GoalKey.of(getEntity(goalClass), NamespacedKey.minecraft(name)); } - public static Class getEntity(Class goalClass) { + private static Class getEntity(Class goalClass) { //noinspection unchecked return (Class) entityClassCache.computeIfAbsent(goalClass, key -> { for (Constructor ctor : key.getDeclaredConstructors()) { - for (int i = 0; i < ctor.getParameterCount(); i++) { - Class param = ctor.getParameterTypes()[i]; + for (Class param : ctor.getParameterTypes()) { if (net.minecraft.world.entity.Mob.class.isAssignableFrom(param)) { //noinspection unchecked return toBukkitClass((Class) param); @@ -319,11 +188,11 @@ public class MobGoalNames { } } } - throw new RuntimeException("Can't figure out applicable entity for mob goal " + goalClass); // maybe just return EntityInsentient? + throw new RuntimeException("Can't figure out applicable entity for mob goal " + goalClass); // maybe just return Mob? }); } - public static Class toBukkitClass(Class nmsClass) { + private static Class toBukkitClass(Class nmsClass) { Class bukkitClass = bukkitMap.get(nmsClass); if (bukkitClass == null) { throw new RuntimeException("Can't figure out applicable bukkit entity for nms entity " + nmsClass); // maybe just return Mob? diff --git a/paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedKeyType.java b/paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedKeyType.java new file mode 100644 index 0000000000..3a8cdd9727 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedKeyType.java @@ -0,0 +1,142 @@ +package io.papermc.generator.types.registry; + +import com.google.common.base.Suppliers; +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.registry.RegistryEntry; +import io.papermc.generator.types.SimpleGenerator; +import io.papermc.generator.utils.Annotations; +import io.papermc.generator.utils.Formatting; +import io.papermc.generator.utils.Javadocs; +import io.papermc.generator.utils.RegistryUtils; +import io.papermc.generator.utils.experimental.FlagHolders; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.paper.registry.RegistryKey; +import io.papermc.paper.registry.TypedKey; +import java.util.Set; +import java.util.function.Supplier; +import javax.lang.model.SourceVersion; +import net.kyori.adventure.key.Key; +import net.minecraft.core.Holder; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.flag.FeatureElement; +import net.minecraft.world.flag.FeatureFlags; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +import static com.squareup.javapoet.TypeSpec.classBuilder; +import static io.papermc.generator.utils.Annotations.EXPERIMENTAL_API_ANNOTATION; +import static io.papermc.generator.utils.Annotations.experimentalAnnotations; +import static javax.lang.model.element.Modifier.FINAL; +import static javax.lang.model.element.Modifier.PRIVATE; +import static javax.lang.model.element.Modifier.PUBLIC; +import static javax.lang.model.element.Modifier.STATIC; + +@NullMarked +public class GeneratedKeyType extends SimpleGenerator { + + private final RegistryEntry entry; + private final Registry registry; + private final Supplier>> experimentalKeys; + private final boolean isFilteredRegistry; + + public GeneratedKeyType(String packageName, RegistryEntry entry) { + super(entry.keyClassName().concat("Keys"), packageName); + this.entry = entry; + this.registry = entry.registry(); + this.experimentalKeys = Suppliers.memoize(() -> RegistryUtils.collectExperimentalDataDrivenKeys(this.registry)); + this.isFilteredRegistry = FeatureElement.FILTERED_REGISTRIES.contains(entry.registryKey()); + } + + private MethodSpec.Builder createMethod(TypeName returnType) { + boolean publicCreateKeyMethod = this.entry.allowCustomKeys(); + + ParameterSpec keyParam = ParameterSpec.builder(Key.class, "key", FINAL).build(); + MethodSpec.Builder create = MethodSpec.methodBuilder("create") + .addModifiers(publicCreateKeyMethod ? PUBLIC : PRIVATE, STATIC) + .addParameter(keyParam) + .addCode("return $T.create($T.$L, $N);", TypedKey.class, RegistryKey.class, this.entry.registryKeyField(), keyParam) + .returns(returnType); + if (publicCreateKeyMethod) { + create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental + create.addJavadoc(Javadocs.CREATE_TYPED_KEY_JAVADOC, this.entry.apiClass(), this.registry.key().location().toString()); + } + return create; + } + + private TypeSpec.Builder keyHolderType() { + return classBuilder(this.className) + .addModifiers(PUBLIC, FINAL) + .addJavadoc(Javadocs.getVersionDependentClassHeader("keys", "{@link $T#$L}"), RegistryKey.class, this.entry.registryKeyField()) + .addAnnotations(Annotations.CLASS_HEADER) + .addMethod(MethodSpec.constructorBuilder() + .addModifiers(PRIVATE) + .build() + ); + } + + @Override + protected TypeSpec getTypeSpec() { + TypeName typedKeyType = ParameterizedTypeName.get(TypedKey.class, this.entry.apiClass()); + + TypeSpec.Builder typeBuilder = this.keyHolderType(); + MethodSpec.Builder createMethod = this.createMethod(typedKeyType); + + boolean allExperimental = true; + for (Holder.Reference reference : this.registry.holders().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) { + ResourceKey key = reference.key(); + String keyPath = key.location().getPath(); + String fieldName = Formatting.formatKeyAsField(keyPath); + if (!SourceVersion.isIdentifier(fieldName) && this.entry.getFieldNames().containsKey(key)) { + fieldName = this.entry.getFieldNames().get(key); + } + + FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKeyType, fieldName, PUBLIC, STATIC, FINAL) + .initializer("$N(key($S))", createMethod.build(), keyPath) + .addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), key.location().toString()); + + SingleFlagHolder requiredFeature = this.getRequiredFeature(reference); + if (requiredFeature != null) { + fieldBuilder.addAnnotations(experimentalAnnotations(requiredFeature)); + } else { + allExperimental = false; + } + typeBuilder.addField(fieldBuilder.build()); + } + + if (allExperimental) { + typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); + createMethod.addAnnotation(EXPERIMENTAL_API_ANNOTATION); + } else { + typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API + } + return typeBuilder.addMethod(createMethod.build()).build(); + } + + @Override + protected JavaFile.Builder file(JavaFile.Builder builder) { + return builder.addStaticImport(Key.class, "key"); + } + + public @Nullable SingleFlagHolder getRequiredFeature(Holder.Reference reference) { + if (this.isFilteredRegistry) { + // built-in registry + FeatureElement element = (FeatureElement) reference.value(); + if (FeatureFlags.isExperimental(element.requiredFeatures())) { + return SingleFlagHolder.fromSet(element.requiredFeatures()); + } + } else { + // data-driven registry + if (this.experimentalKeys.get().contains(reference.key())) { + return FlagHolders.NEXT_UPDATE; + } + } + return null; + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedTagKeyType.java b/paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedTagKeyType.java new file mode 100644 index 0000000000..c994748430 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedTagKeyType.java @@ -0,0 +1,106 @@ +package io.papermc.generator.types.registry; + +import com.squareup.javapoet.FieldSpec; +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.MethodSpec; +import com.squareup.javapoet.ParameterSpec; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; +import com.squareup.javapoet.TypeSpec; +import io.papermc.generator.Main; +import io.papermc.generator.registry.RegistryEntry; +import io.papermc.generator.types.SimpleGenerator; +import io.papermc.generator.utils.Annotations; +import io.papermc.generator.utils.Formatting; +import io.papermc.generator.utils.Javadocs; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.paper.registry.RegistryKey; +import io.papermc.paper.registry.tag.TagKey; +import java.util.concurrent.atomic.AtomicBoolean; +import net.kyori.adventure.key.Key; +import net.minecraft.core.Registry; +import org.jspecify.annotations.NullMarked; + +import static com.squareup.javapoet.TypeSpec.classBuilder; +import static io.papermc.generator.utils.Annotations.EXPERIMENTAL_API_ANNOTATION; +import static io.papermc.generator.utils.Annotations.experimentalAnnotations; +import static javax.lang.model.element.Modifier.FINAL; +import static javax.lang.model.element.Modifier.PRIVATE; +import static javax.lang.model.element.Modifier.PUBLIC; +import static javax.lang.model.element.Modifier.STATIC; + +@NullMarked +public class GeneratedTagKeyType extends SimpleGenerator { + + private final RegistryEntry entry; + + public GeneratedTagKeyType(RegistryEntry entry, String packageName) { + super(entry.keyClassName().concat("TagKeys"), packageName); + this.entry = entry; + } + + private MethodSpec.Builder createMethod(TypeName returnType) { + boolean publicCreateKeyMethod = true; // tag lifecycle event exists + + ParameterSpec keyParam = ParameterSpec.builder(Key.class, "key", FINAL).build(); + MethodSpec.Builder create = MethodSpec.methodBuilder("create") + .addModifiers(publicCreateKeyMethod ? PUBLIC : PRIVATE, STATIC) + .addParameter(keyParam) + .addCode("return $T.create($T.$L, $N);", TagKey.class, RegistryKey.class, this.entry.registryKeyField(), keyParam) + .returns(returnType); + if (publicCreateKeyMethod) { + create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental + create.addJavadoc(Javadocs.CREATED_TAG_KEY_JAVADOC, this.entry.apiClass(), this.entry.registryKey().location().toString()); + } + return create; + } + + private TypeSpec.Builder keyHolderType() { + return classBuilder(this.className) + .addModifiers(PUBLIC, FINAL) + .addJavadoc(Javadocs.getVersionDependentClassHeader("tag keys", "{@link $T#$L}"), RegistryKey.class, this.entry.registryKeyField()) + .addAnnotations(Annotations.CLASS_HEADER) + .addMethod(MethodSpec.constructorBuilder() + .addModifiers(PRIVATE) + .build() + ); + } + + @Override + protected TypeSpec getTypeSpec() { + TypeName tagKeyType = ParameterizedTypeName.get(TagKey.class, this.entry.apiClass()); + + TypeSpec.Builder typeBuilder = this.keyHolderType(); + MethodSpec.Builder createMethod = this.createMethod(tagKeyType); + + Registry registry = this.entry.registry(); + + AtomicBoolean allExperimental = new AtomicBoolean(true); + registry.getTagNames().sorted(Formatting.alphabeticKeyOrder(tagKey -> tagKey.location().getPath())).forEach(tagKey -> { + String fieldName = Formatting.formatKeyAsField(tagKey.location().getPath()); + FieldSpec.Builder fieldBuilder = FieldSpec.builder(tagKeyType, fieldName, PUBLIC, STATIC, FINAL) + .initializer("$N(key($S))", createMethod.build(), tagKey.location().getPath()) + .addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), "#" + tagKey.location()); + + String featureFlagName = Main.EXPERIMENTAL_TAGS.get(tagKey); + if (featureFlagName != null) { + fieldBuilder.addAnnotations(experimentalAnnotations(SingleFlagHolder.fromVanillaName(featureFlagName))); + } else { + allExperimental.set(false); + } + typeBuilder.addField(fieldBuilder.build()); + }); + if (allExperimental.get()) { + typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); + createMethod.addAnnotation(EXPERIMENTAL_API_ANNOTATION); + } else { + typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API + } + return typeBuilder.addMethod(createMethod.build()).build(); + } + + @Override + protected JavaFile.Builder file(JavaFile.Builder builder) { + return builder.addStaticImport(Key.class, "key"); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/Annotations.java b/paper-generator/src/main/java/io/papermc/generator/utils/Annotations.java new file mode 100644 index 0000000000..e7488cc4e9 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/Annotations.java @@ -0,0 +1,68 @@ +package io.papermc.generator.utils; + +import com.squareup.javapoet.AnnotationSpec; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.paper.generated.GeneratedFrom; +import java.util.List; +import net.minecraft.SharedConstants; +import org.bukkit.MinecraftExperimental; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public final class Annotations { + + public static List experimentalAnnotations(SingleFlagHolder requiredFeature) { + AnnotationSpec.Builder builder = AnnotationSpec.builder(MinecraftExperimental.class); + builder.addMember("value", "$T.$L", MinecraftExperimental.Requires.class, requiredFeature.asAnnotationMember().name()); + + return List.of( + AnnotationSpec.builder(ApiStatus.Experimental.class).build(), + builder.build() + ); + } + + public static AnnotationSpec deprecatedVersioned(@Nullable String version, boolean forRemoval) { + AnnotationSpec.Builder annotationSpec = AnnotationSpec.builder(Deprecated.class); + if (forRemoval) { + annotationSpec.addMember("forRemoval", "$L", true); + } + if (version != null) { + annotationSpec.addMember("since", "$S", version); + } + + return annotationSpec.build(); + } + + public static AnnotationSpec scheduledRemoval(String version) { + return AnnotationSpec.builder(ApiStatus.ScheduledForRemoval.class) + .addMember("inVersion", "$S", version) + .build(); + } + + public static AnnotationSpec suppressWarnings(String... values) { + AnnotationSpec.Builder builder = AnnotationSpec.builder(SuppressWarnings.class); + for (String value : values) { + builder.addMember("value", "$S", value); + } + return builder.build(); + } + + @ApiStatus.Experimental + public static final AnnotationSpec EXPERIMENTAL_API_ANNOTATION = AnnotationSpec.builder(ApiStatus.Experimental.class).build(); + public static final AnnotationSpec NULL_MARKED = AnnotationSpec.builder(NullMarked.class).build(); + public static final AnnotationSpec OVERRIDE = AnnotationSpec.builder(Override.class).build(); + private static final AnnotationSpec SUPPRESS_WARNINGS = suppressWarnings("unused", "SpellCheckingInspection"); + public static final AnnotationSpec GENERATED_FROM = AnnotationSpec.builder(GeneratedFrom.class) + .addMember("value", "$S", SharedConstants.getCurrentVersion().getName()) + .build(); + public static final Iterable CLASS_HEADER = List.of( + SUPPRESS_WARNINGS, + NULL_MARKED, + GENERATED_FROM + ); + + private Annotations() { + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/BlockEntityMapping.java b/paper-generator/src/main/java/io/papermc/generator/utils/BlockEntityMapping.java new file mode 100644 index 0000000000..10e3b96c4b --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/BlockEntityMapping.java @@ -0,0 +1,37 @@ +package io.papermc.generator.utils; + +import com.google.common.base.CaseFormat; +import com.google.common.collect.ImmutableMap; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.Map; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.block.entity.BlockEntityType; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class BlockEntityMapping { + + // if this become painful/too weird like the blockdata just rename the impl directly again + private static final Map RENAMES = ImmutableMap.builder() + .put("CraftFurnace", "CraftFurnaceFurnace") + .put("CraftMobSpawner", "CraftCreatureSpawner") + .put("CraftPiston", "CraftMovingPiston") + .put("CraftTrappedChest", "CraftChest") // not really a rename + .build(); + + public static final Map>, String> MAPPING; + + static { + Map>, String> mapping = new IdentityHashMap<>(); + BuiltInRegistries.BLOCK_ENTITY_TYPE.registryKeySet().forEach(key -> { + String name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, key.location().getPath()); + String implName = "Craft".concat(name); + + mapping.put(key, RENAMES.getOrDefault(implName, implName)); + }); + + MAPPING = Collections.unmodifiableMap(mapping); + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/BlockStateMapping.java b/paper-generator/src/main/java/io/papermc/generator/utils/BlockStateMapping.java new file mode 100644 index 0000000000..dcfda994b2 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/BlockStateMapping.java @@ -0,0 +1,507 @@ +package io.papermc.generator.utils; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.Multimap; +import com.google.common.reflect.TypeToken; +import com.mojang.datafixers.util.Either; +import io.papermc.generator.types.craftblockdata.property.holder.VirtualField; +import java.lang.reflect.Field; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.BiConsumer; +import net.minecraft.core.Direction; +import net.minecraft.core.FrontAndTop; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.level.block.AbstractFurnaceBlock; +import net.minecraft.world.level.block.BigDripleafStemBlock; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.CommandBlock; +import net.minecraft.world.level.block.IronBarsBlock; +import net.minecraft.world.level.block.NoteBlock; +import net.minecraft.world.level.block.PipeBlock; +import net.minecraft.world.level.block.StructureBlock; +import net.minecraft.world.level.block.WallBlock; +import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerState; +import net.minecraft.world.level.block.entity.vault.VaultState; +import net.minecraft.world.level.block.state.properties.AttachFace; +import net.minecraft.world.level.block.state.properties.BambooLeaves; +import net.minecraft.world.level.block.state.properties.BedPart; +import net.minecraft.world.level.block.state.properties.BellAttachType; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.ChestType; +import net.minecraft.world.level.block.state.properties.ComparatorMode; +import net.minecraft.world.level.block.state.properties.DoorHingeSide; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; +import net.minecraft.world.level.block.state.properties.DripstoneThickness; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.level.block.state.properties.Half; +import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; +import net.minecraft.world.level.block.state.properties.PistonType; +import net.minecraft.world.level.block.state.properties.Property; +import net.minecraft.world.level.block.state.properties.RailShape; +import net.minecraft.world.level.block.state.properties.RedstoneSide; +import net.minecraft.world.level.block.state.properties.SculkSensorPhase; +import net.minecraft.world.level.block.state.properties.SlabType; +import net.minecraft.world.level.block.state.properties.StairsShape; +import net.minecraft.world.level.block.state.properties.StructureMode; +import net.minecraft.world.level.block.state.properties.Tilt; +import net.minecraft.world.level.block.state.properties.WallSide; +import org.bukkit.Axis; +import org.bukkit.Instrument; +import org.bukkit.block.BlockFace; +import org.bukkit.block.Orientation; +import org.bukkit.block.data.Ageable; +import org.bukkit.block.data.AnaloguePowerable; +import org.bukkit.block.data.Bisected; +import org.bukkit.block.data.Brushable; +import org.bukkit.block.data.Directional; +import org.bukkit.block.data.FaceAttachable; +import org.bukkit.block.data.Hangable; +import org.bukkit.block.data.Hatchable; +import org.bukkit.block.data.Levelled; +import org.bukkit.block.data.Lightable; +import org.bukkit.block.data.MultipleFacing; +import org.bukkit.block.data.Openable; +import org.bukkit.block.data.Orientable; +import org.bukkit.block.data.Powerable; +import org.bukkit.block.data.Rail; +import org.bukkit.block.data.Rotatable; +import org.bukkit.block.data.Snowable; +import org.bukkit.block.data.Waterlogged; +import org.bukkit.block.data.type.Bamboo; +import org.bukkit.block.data.type.Bed; +import org.bukkit.block.data.type.Bell; +import org.bukkit.block.data.type.BigDripleaf; +import org.bukkit.block.data.type.Chest; +import org.bukkit.block.data.type.Comparator; +import org.bukkit.block.data.type.Door; +import org.bukkit.block.data.type.Dripleaf; +import org.bukkit.block.data.type.Fence; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.block.data.type.PointedDripstone; +import org.bukkit.block.data.type.RedstoneRail; +import org.bukkit.block.data.type.RedstoneWire; +import org.bukkit.block.data.type.SculkSensor; +import org.bukkit.block.data.type.Slab; +import org.bukkit.block.data.type.Stairs; +import org.bukkit.block.data.type.Switch; +import org.bukkit.block.data.type.TechnicalPiston; +import org.bukkit.block.data.type.TrialSpawner; +import org.bukkit.block.data.type.Vault; +import org.bukkit.block.data.type.Wall; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public final class BlockStateMapping { + + public static final String PIPE_FIELD_NAME = "PROPERTY_BY_DIRECTION"; + + public record BlockData(String implName, @Nullable Class api, + Collection> properties, Map, Field> propertyFields, + Multimap, Property> complexPropertyFields) { + } + + private static final Map API_RENAMES = ImmutableMap.builder() + .put("SnowLayer", "Snow") + .put("StainedGlassPane", "GlassPane") // weird that this one implements glass pane but not the regular glass pane + .put("CeilingHangingSign", "HangingSign") + .put("RedStoneWire", "RedstoneWire") + .put("TripWire", "Tripwire") + .put("TripWireHook", "TripwireHook") + .put("Tnt", "TNT") + .put("BambooStalk", "Bamboo") + .put("Farm", "Farmland") + .put("ChiseledBookShelf", "ChiseledBookshelf") + .put("StandingSign", "Sign") + .put("FenceGate", "Gate") + .build(); + + private static final Set> BLOCK_SUFFIX_INTENDED = Set.of( + CommandBlock.class, + StructureBlock.class, + NoteBlock.class + ); + + // virtual data that doesn't exist as constant in the source but still organized this way in the api + public static final ImmutableMultimap, VirtualField> VIRTUAL_NODES = ImmutableMultimap., VirtualField>builder() + .put(WallBlock.class, + VirtualField.createMap("PROPERTY_BY_FACE", BlockFace.class, new TypeToken>() {}, "HEIGHT") + .withValues(List.of( + WallBlock.EAST_WALL, + WallBlock.NORTH_WALL, + WallBlock.SOUTH_WALL, + WallBlock.WEST_WALL + )).make()) + .build(); + + public static final Map, Field> FALLBACK_GENERIC_FIELDS; + + static { + Map, Field> fallbackGenericFields = new HashMap<>(); + fetchProperties(BlockStateProperties.class, (field, property) -> fallbackGenericFields.put(property, field), null); + FALLBACK_GENERIC_FIELDS = Collections.unmodifiableMap(fallbackGenericFields); + } + + public static final Map, BlockData> MAPPING; + + static { + Map, Collection>> specialBlocks = new IdentityHashMap<>(); + for (Block block : BuiltInRegistries.BLOCK) { + if (!block.getStateDefinition().getProperties().isEmpty()) { + specialBlocks.put(block.getClass(), block.getStateDefinition().getProperties()); + } + } + + Map, BlockData> map = new IdentityHashMap<>(); + for (Map.Entry, Collection>> entry : specialBlocks.entrySet()) { + Class specialBlock = entry.getKey(); + + Collection> properties = new ArrayList<>(entry.getValue()); + + Map, Field> propertyFields = new HashMap<>(properties.size()); + Multimap, Property> complexPropertyFields = ArrayListMultimap.create(); + + fetchProperties(specialBlock, (field, property) -> { + if (properties.contains(property)) { + propertyFields.put(property, field); + } + }, (field, property) -> { + if (field.getName().equals(BlockStateMapping.PIPE_FIELD_NAME) && + PipeBlock.PROPERTY_BY_DIRECTION.containsValue(property)) { // need another check to avoid conflict with redstone connection + // handled later with further check + return; + } + + if (properties.remove(property)) { // handle those separately and only count if the property was in the state definition + complexPropertyFields.put(Either.left(field), property); + } + }); + + // multiple facing + List> commonPipeProperties = new ArrayList<>(properties); + commonPipeProperties.retainAll(PipeBlock.PROPERTY_BY_DIRECTION.values()); + if (commonPipeProperties.size() >= 2) { + Field field = fetchPipeFieldMap(specialBlock); + if (field != null) { + properties.removeAll(commonPipeProperties); + complexPropertyFields.putAll(Either.left(field), commonPipeProperties); + } + } + + // virtual nodes + if (VIRTUAL_NODES.containsKey(specialBlock)) { + for (VirtualField virtualField : VIRTUAL_NODES.get(specialBlock)) { + for (Property property : virtualField.values()) { + if (properties.remove(property)) { + complexPropertyFields.put(Either.right(virtualField), property); + } else { + throw new IllegalStateException("Unhandled virtual node " + virtualField.name() + " for " + property); + } + } + } + } + + String apiName = formatApiName(specialBlock); + String implName = "Craft".concat(apiName); // before renames + + apiName = Formatting.stripWordOfCamelCaseName(apiName, "Base", true); + apiName = API_RENAMES.getOrDefault(apiName, apiName); + + Class api = ClassHelper.classOr("org.bukkit.block.data.type." + apiName, null); + if (api == null) { + Class directParent = specialBlock.getSuperclass(); + if (specialBlocks.containsKey(directParent)) { + // if the properties are the same then always consider the parent + // check deeper in the tree? + if (specialBlocks.get(directParent).equals(entry.getValue())) { + String parentApiName = formatApiName(directParent); + parentApiName = Formatting.stripWordOfCamelCaseName(parentApiName, "Base", true); + parentApiName = API_RENAMES.getOrDefault(parentApiName, parentApiName); + api = ClassHelper.classOr("org.bukkit.block.data.type." + parentApiName, api); + } + } + } + if (api == null) { // todo remove this part + if (AbstractFurnaceBlock.class.isAssignableFrom(specialBlock)) { + api = Furnace.class; // for smoker and blast furnace + } else if (specialBlock == BigDripleafStemBlock.class) { + api = Dripleaf.class; + } else if (specialBlock == IronBarsBlock.class) { + api = Fence.class; // for glass pane (regular) and iron bars + } + } + + map.put(specialBlock, new BlockData(implName, api, properties, propertyFields, complexPropertyFields)); + } + MAPPING = Collections.unmodifiableMap(map); + } + + private static final Map> NAME_TO_DATA = Map.of( + BlockStateProperties.AGE_1.getName(), Ageable.class, + BlockStateProperties.LEVEL.getName(), Levelled.class + ); + + private static final Map, Class> PROPERTY_TO_DATA = ImmutableMap., Class>builder() + // levelled and ageable are done using the property name + .put(BlockStateProperties.POWER, AnaloguePowerable.class) + .put(BlockStateProperties.HALF, Bisected.class) + .put(BlockStateProperties.DOUBLE_BLOCK_HALF, Bisected.class) + .put(BlockStateProperties.DUSTED, Brushable.class) + .put(BlockStateProperties.FACING, Directional.class) + .put(BlockStateProperties.HORIZONTAL_FACING, Directional.class) + .put(BlockStateProperties.ATTACH_FACE, FaceAttachable.class) + .put(BlockStateProperties.HANGING, Hangable.class) + .put(BlockStateProperties.HATCH, Hatchable.class) + .put(BlockStateProperties.LIT, Lightable.class) + // multiple facing is done by matching two or more pipe block properties + .put(BlockStateProperties.OPEN, Openable.class) + .put(BlockStateProperties.HORIZONTAL_AXIS, Orientable.class) + .put(BlockStateProperties.AXIS, Orientable.class) + .put(BlockStateProperties.POWERED, Powerable.class) + .put(BlockStateProperties.RAIL_SHAPE, Rail.class) + .put(BlockStateProperties.RAIL_SHAPE_STRAIGHT, Rail.class) + .put(BlockStateProperties.ROTATION_16, Rotatable.class) + .put(BlockStateProperties.SNOWY, Snowable.class) + .put(BlockStateProperties.WATERLOGGED, Waterlogged.class) + .build(); + + private static final Map, Class> MAIN_PROPERTY_TO_DATA = Map.of( + BlockStateProperties.PISTON_TYPE, TechnicalPiston.class, + BlockStateProperties.STAIRS_SHAPE, Stairs.class + ); + + public static final Map>, Class>> ENUM_BRIDGE = ImmutableMap.>, Class>>builder() + .put(DoorHingeSide.class, Door.Hinge.class) + .put(SlabType.class, Slab.Type.class) + .put(StructureMode.class, org.bukkit.block.data.type.StructureBlock.Mode.class) + .put(DripstoneThickness.class, PointedDripstone.Thickness.class) + .put(WallSide.class, Wall.Height.class) + .put(BellAttachType.class, Bell.Attachment.class) + .put(NoteBlockInstrument.class, Instrument.class) + .put(StairsShape.class, Stairs.Shape.class) + .put(Direction.class, BlockFace.class) + .put(ComparatorMode.class, Comparator.Mode.class) + .put(PistonType.class, TechnicalPiston.Type.class) + .put(BedPart.class, Bed.Part.class) + .put(Half.class, Bisected.Half.class) + .put(AttachFace.class, FaceAttachable.AttachedFace.class) + .put(RailShape.class, Rail.Shape.class) + .put(SculkSensorPhase.class, SculkSensor.Phase.class) + .put(DoubleBlockHalf.class, Bisected.Half.class) + .put(Tilt.class, BigDripleaf.Tilt.class) + .put(ChestType.class, Chest.Type.class) + .put(RedstoneSide.class, RedstoneWire.Connection.class) + .put(Direction.Axis.class, Axis.class) + .put(BambooLeaves.class, Bamboo.Leaves.class) + .put(TrialSpawnerState.class, TrialSpawner.State.class) + .put(FrontAndTop.class, Orientation.class) + .put(VaultState.class, Vault.State.class) + .build(); + + /* + TODO: + clear paper api list now generated/remove patches not needed anymore + remove some patches: + - Add-missing-block-data-API + remove scrap of old spigot tooling (archetype) + */ + public static @Nullable Class getBestSuitedApiClass(Class block) { + if (!MAPPING.containsKey(block)) { + return null; + } + + return getBestSuitedApiClass(MAPPING.get(block)); + } + + public static @Nullable Class getBestSuitedApiClass(BlockData data) { + if (data.api() != null) { + return data.api(); + } + + int pipeProps = 0; + Set> extensions = new LinkedHashSet<>(); + for (Property property : data.properties()) { + if (MAIN_PROPERTY_TO_DATA.containsKey(property)) { + return MAIN_PROPERTY_TO_DATA.get(property); + } + + if (NAME_TO_DATA.containsKey(property.getName())) { + extensions.add(NAME_TO_DATA.get(property.getName())); + continue; + } + + if (PROPERTY_TO_DATA.containsKey(property)) { + extensions.add(PROPERTY_TO_DATA.get(property)); + continue; + } + + if (PipeBlock.PROPERTY_BY_DIRECTION.containsValue(property)) { + pipeProps++; + } + } + + if (!extensions.isEmpty()) { + if (isExactly(extensions, Switch.class)) { + return Switch.class; + } + if (isExactly(extensions, RedstoneRail.class)) { + return RedstoneRail.class; + } + + return extensions.iterator().next(); + } + + for (Property property : data.complexPropertyFields().values()) { + if (PipeBlock.PROPERTY_BY_DIRECTION.containsValue(property)) { + pipeProps++; + } + } + + if (pipeProps >= 2) { + return MultipleFacing.class; + } + return null; + } + + private static boolean isExactly(Set> extensions, Class globClass) { + return extensions.equals(ClassHelper.getAllInterfaces(globClass, org.bukkit.block.data.BlockData.class, new HashSet<>())); + } + + private static String formatApiName(Class specialBlock) { + String apiName = specialBlock.getSimpleName(); + if (!BLOCK_SUFFIX_INTENDED.contains(specialBlock)) { + return apiName.substring(0, apiName.length() - "Block".length()); + } + return apiName; + } + + private static @Nullable Field fetchPipeFieldMap(Class block) { + Field field = null; + Class searchClass = block; + do { + try { + field = searchClass.getDeclaredField(PIPE_FIELD_NAME); + } catch (NoSuchFieldException ignored) { + } + searchClass = searchClass.getSuperclass(); + } while (field == null && searchClass != Block.class); + + if (field == null) { + return null; + } + + if (!ClassHelper.isStaticConstant(field, 0)) { + return null; + } + + if (Map.class.isAssignableFrom(field.getType()) && field.getGenericType() instanceof ParameterizedType complexType) { + Type[] args = complexType.getActualTypeArguments(); + if (args.length == 2 && args[0] == Direction.class && args[1] == BooleanProperty.class) { + if (field.trySetAccessible()) { + try { + List properties = new ArrayList<>(((Map) field.get(null)).values()); + int originalSize = properties.size(); + properties.retainAll(PipeBlock.PROPERTY_BY_DIRECTION.values()); + if (properties.size() != originalSize) { + return null; + } + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + return field; + } + } + return null; + } + + private static boolean handleComplexType(Field field, BiConsumer> complexCallback) throws IllegalAccessException { + if (field.getType().isArray() && Property.class.isAssignableFrom(field.getType().getComponentType())) { + if (!field.trySetAccessible()) { + return true; + } + + for (Property property : (Property[]) field.get(null)) { + complexCallback.accept(field, property); + } + return true; + } + if (Iterable.class.isAssignableFrom(field.getType()) && field.getGenericType() instanceof ParameterizedType complexType) { + Type[] args = complexType.getActualTypeArguments(); + if (args.length == 1 && Property.class.isAssignableFrom(ClassHelper.eraseType(args[0]))) { + if (!field.trySetAccessible()) { + return true; + } + + for (Property property : (Iterable>) field.get(null)) { + complexCallback.accept(field, property); + } + } + return true; + } + if (Map.class.isAssignableFrom(field.getType()) && field.getGenericType() instanceof ParameterizedType complexType) { + if (!field.trySetAccessible()) { + return true; + } + + Type[] args = complexType.getActualTypeArguments(); + if (args.length == 2 && Property.class.isAssignableFrom(ClassHelper.eraseType(args[1]))) { + for (Property property : ((Map>) field.get(null)).values()) { + complexCallback.accept(field, property); + } + return true; + } + } + return false; + } + + private static void fetchProperties(Class block, BiConsumer> simpleCallback, @Nullable BiConsumer> complexCallback) { + try { + for (Field field : block.getDeclaredFields()) { + if (ClassHelper.isStaticConstant(field, 0)) { + if (complexCallback != null && handleComplexType(field, complexCallback)) { + continue; + } + + if (!Property.class.isAssignableFrom(field.getType())) { + continue; + } + + if (field.trySetAccessible()) { + Property property = ((Property) field.get(null)); + simpleCallback.accept(field, property); + } + } + } + } catch (ReflectiveOperationException ex) { + throw new RuntimeException(ex); + } + + if (block.isInterface()) { + return; + } + + // look deeper + if (block.getSuperclass() != null && block.getSuperclass() != Block.class) { + fetchProperties(block.getSuperclass(), simpleCallback, complexCallback); + } + for (Class ext : block.getInterfaces()) { + fetchProperties(ext, simpleCallback, complexCallback); + } + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/ClassHelper.java b/paper-generator/src/main/java/io/papermc/generator/utils/ClassHelper.java new file mode 100644 index 0000000000..a34b1825c6 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/ClassHelper.java @@ -0,0 +1,72 @@ +package io.papermc.generator.utils; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.Set; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public final class ClassHelper { + + public static Set> getAllInterfaces(Class clazz, Class ignored, Set> interfaces) { + Class[] classes = clazz.getInterfaces(); + interfaces.addAll(Arrays.asList(classes)); + for (Class farClass : classes) { + if (farClass == ignored) { + continue; + } + getAllInterfaces(farClass, ignored, interfaces); + } + interfaces.remove(ignored); + return interfaces; + } + + public static @Nullable Type getNestedTypeParameter(Type type, @Nullable Class... classes) { + for (Class clazz : classes) { + if (!(type instanceof ParameterizedType complexType)) { + return null; + } + + Type[] types = complexType.getActualTypeArguments(); + if (types.length != 1) { + return null; + } + + if (clazz == null || eraseType(types[0]) == clazz) { + type = types[0]; + } + } + + return type; + } + + public static Class eraseType(Type type) { + if (type instanceof Class clazz) { + return clazz; + } + if (type instanceof ParameterizedType complexType) { + return eraseType(complexType.getRawType()); + } + throw new UnsupportedOperationException("Don't know how to turn " + type + " into its erased type!"); + } + + public static boolean isStaticConstant(Field field, int extraFlags) { + int flags = extraFlags | Modifier.STATIC | Modifier.FINAL; + return (field.getModifiers() & flags) == flags; + } + + public static Class classOr(String className, Class defaultClass) { + try { + return (Class) Class.forName(className); + } catch (ClassNotFoundException ignored) { + return defaultClass; + } + } + + private ClassHelper() { + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/CommonVariable.java b/paper-generator/src/main/java/io/papermc/generator/utils/CommonVariable.java new file mode 100644 index 0000000000..55ea8c742f --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/CommonVariable.java @@ -0,0 +1,10 @@ +package io.papermc.generator.utils; + +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class CommonVariable { + + public static final String INDEX = "index"; + public static final String MAP_ENTRY = "entry"; +} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/utils/Formatting.java b/paper-generator/src/main/java/io/papermc/generator/utils/Formatting.java similarity index 51% rename from paper-api-generator/src/main/java/io/papermc/generator/utils/Formatting.java rename to paper-generator/src/main/java/io/papermc/generator/utils/Formatting.java index 0006e07c53..b3c76078c6 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/Formatting.java +++ b/paper-generator/src/main/java/io/papermc/generator/utils/Formatting.java @@ -1,25 +1,35 @@ package io.papermc.generator.utils; -import java.util.Map; -import java.util.Optional; -import org.apache.commons.lang3.math.NumberUtils; import java.util.Comparator; import java.util.Locale; +import java.util.Optional; import java.util.OptionalInt; import java.util.function.Function; import java.util.regex.Pattern; +import java.util.stream.IntStream; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import org.apache.commons.lang3.math.NumberUtils; +import org.jspecify.annotations.NullMarked; +@NullMarked public final class Formatting { private static final Pattern ILLEGAL_FIELD_CHARACTERS = Pattern.compile("[.-/]"); - private static final Map MANUAL_OVERRIDES = Map.of( - "5", "five", - "11", "eleven", - "13", "thirteen" - ); public static String formatKeyAsField(String path) { - return ILLEGAL_FIELD_CHARACTERS.matcher(MANUAL_OVERRIDES.getOrDefault(path, path).toUpperCase(Locale.ROOT)).replaceAll("_"); + return ILLEGAL_FIELD_CHARACTERS.matcher(path.toUpperCase(Locale.ENGLISH)).replaceAll("_"); + } + + public static String formatTagFieldPrefix(String name, ResourceKey> registryKey) { + if (registryKey == Registries.BLOCK) { + return ""; + } + if (registryKey == Registries.GAME_EVENT) { + return "GAME_EVENT_"; // Paper doesn't follow the format (should be GAME_EVENTS_) (pre 1.21) + } + return name.toUpperCase(Locale.ENGLISH) + "_"; } public static Optional formatTagKey(String tagDir, String resourcePath) { @@ -31,6 +41,38 @@ public final class Formatting { return Optional.of(resourcePath.substring(tagsIndex + tagDir.length() + 1, dotIndex)); // namespace/tags/registry_key/[tag_key].json } + public static String asCode(Enum enumValue) { + return enumValue.getClass().getSimpleName() + "." + enumValue.name(); + } + + public static String[] asCode(int... values) { + return IntStream.of(values).mapToObj(Integer::toString).toArray(String[]::new); + } + + public static String stripWordOfCamelCaseName(String name, String word, boolean onlyOnce) { + String newName = name; + int startIndex = 0; + while (true) { + int baseIndex = newName.indexOf(word, startIndex); + if (baseIndex == -1) { + return newName; + } + + if ((baseIndex > 0 && !Character.isLowerCase(newName.charAt(baseIndex - 1))) || + (baseIndex + word.length() < newName.length() && !Character.isUpperCase(newName.charAt(baseIndex + word.length())))) { + startIndex = baseIndex + word.length(); + continue; + } + + newName = newName.substring(0, baseIndex) + newName.substring(baseIndex + word.length()); + startIndex = baseIndex; + if (onlyOnce) { + break; + } + } + return newName; + } + public static Comparator ALPHABETIC_KEY_ORDER = alphabeticKeyOrder(path -> path); public static Comparator alphabeticKeyOrder(Function mapper) { diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/Javadocs.java b/paper-generator/src/main/java/io/papermc/generator/utils/Javadocs.java new file mode 100644 index 0000000000..4c52440793 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/Javadocs.java @@ -0,0 +1,44 @@ +package io.papermc.generator.utils; + +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class Javadocs { + + public static String getVersionDependentClassHeader(String objectIdentifier, String headerIdentifier) { + return """ + Vanilla %s for %s. + + @apiNote The fields provided here are a direct representation of + what is available from the vanilla game source. They may be + changed (including removals) on any Minecraft version + bump, so cross-version compatibility is not provided on the + same level as it is on most of the other API. + """.formatted(objectIdentifier, headerIdentifier); + } + + public static String getVersionDependentField(String headerIdentifier) { + return """ + %s + + @apiNote This field is version-dependant and may be removed in future Minecraft versions + """.formatted(headerIdentifier); + } + + public static final String CREATE_TYPED_KEY_JAVADOC = """ + Creates a typed key for {@link $T} in the registry {@code $L}. + + @param key the value's key in the registry + @return a new typed key + """; + + public static final String CREATED_TAG_KEY_JAVADOC = """ + Creates a tag key for {@link $T} in the registry {@code $L}. + + @param key the tag key's key + @return a new tag key + """; + + private Javadocs() { + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/NamingManager.java b/paper-generator/src/main/java/io/papermc/generator/utils/NamingManager.java new file mode 100644 index 0000000000..d5ca379ae7 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/NamingManager.java @@ -0,0 +1,141 @@ +package io.papermc.generator.utils; + +import com.google.common.base.CaseFormat; +import java.util.Optional; +import java.util.function.Predicate; +import javax.lang.model.SourceVersion; +import org.jetbrains.annotations.Contract; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public class NamingManager { + + private final @Nullable AccessKeyword accessKeyword; + private final String baseName; + private final String lowerCamelName, upperCamelName; + + public NamingManager(NamingManager.@Nullable AccessKeyword accessKeyword, CaseFormat format, String baseName) { + this.accessKeyword = accessKeyword; // this is a little bit too restrictive for extra data hmm + this.baseName = baseName; + this.upperCamelName = format.to(CaseFormat.UPPER_CAMEL, baseName); + this.lowerCamelName = format.to(CaseFormat.LOWER_CAMEL, baseName); + } + + public String getVariableName() { + return this.lowerCamelName; + } + + public String getMethodBaseName() { + return this.upperCamelName; + } + + public NameWrapper getMethodNameWrapper() { + return NameWrapper.wrap("get", this.upperCamelName); + } + + public NameWrapper getVariableNameWrapper() { + return NameWrapper.wrap("", this.lowerCamelName); + } + + public NameWrapper getterName(Predicate keywordPredicate) { + return accessName(keywordPredicate, AccessKeyword::get, "get"); + } + + public NameWrapper setterName(Predicate keywordPredicate) { + return accessName(keywordPredicate, AccessKeyword::set, "set"); + } + + public String simpleGetterName(Predicate keywordPredicate) { + return getterName(keywordPredicate).concat(); + } + + public String simpleSetterName(Predicate keywordPredicate) { + return setterName(keywordPredicate).concat(); + } + + private NameWrapper accessName(Predicate keywordPredicate, KeywordFetcher keywordFetcher, String fallbackKeyword) { + final String name; + String accessKeyword; + if (keywordPredicate.test(this.baseName)) { + accessKeyword = Optional.ofNullable(this.accessKeyword).flatMap(keywordFetcher::fetch).orElse(fallbackKeyword); + name = this.upperCamelName; + } else { + accessKeyword = ""; + name = this.lowerCamelName; + } + return NameWrapper.wrap(accessKeyword, name); + } + + public String paramName(Class type) { + final String paramName; + if (type.isPrimitive()) { + paramName = this.lowerCamelName; + } else { + paramName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, type.getSimpleName()); + } + return ensureValidName(paramName); + } + + public static String ensureValidName(String name) { + if (!SourceVersion.isIdentifier(name) || SourceVersion.isKeyword(name)) { + return "_" + name; + } + return name; + } + + public static class NameWrapper { + + private final String keyword; + private final String name; + private String preValue = "", postValue = ""; + + private NameWrapper(String keyword, String name) { + this.keyword = keyword; + this.name = name; + } + + public static NameWrapper wrap(String keyword, String name) { + return new NameWrapper(keyword, name); + } + + @Contract(value = "_ -> this", mutates = "this") + public NameWrapper pre(String value) { + this.preValue = value; + return this; + } + + @Contract(value = "_ -> this", mutates = "this") + public NameWrapper post(String value) { + this.postValue = value; + return this; + } + + public String concat() { + String finalName = this.keyword + this.preValue + this.name + this.postValue; + this.preValue = this.postValue = ""; // reset + return ensureValidName(finalName); + } + } + + @FunctionalInterface + private interface KeywordFetcher { + + Optional fetch(AccessKeyword accessKeyword); + } + + public static AccessKeyword keywordGet(String keyword) { + return new AccessKeyword(Optional.of(keyword), Optional.empty()); + } + + public static AccessKeyword keywordSet(String keyword) { + return new AccessKeyword(Optional.empty(), Optional.of(keyword)); + } + + public static AccessKeyword keywordGetSet(String getter, String setter) { + return new AccessKeyword(Optional.of(getter), Optional.of(setter)); + } + + public record AccessKeyword(Optional get, Optional set) { + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/RegistryUtils.java b/paper-generator/src/main/java/io/papermc/generator/utils/RegistryUtils.java new file mode 100644 index 0000000000..b6954a4413 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/RegistryUtils.java @@ -0,0 +1,44 @@ +package io.papermc.generator.utils; + +import com.google.common.collect.Sets; +import io.papermc.generator.utils.experimental.CollectingContext; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.core.Registry; +import net.minecraft.core.RegistrySetBuilder; +import net.minecraft.data.registries.VanillaRegistries; +import net.minecraft.resources.ResourceKey; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public class RegistryUtils { + + private static final Map>, RegistrySetBuilder.RegistryBootstrap> VANILLA_REGISTRY_ENTRIES = VanillaRegistries.BUILDER.entries.stream() + .collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap)); + + private static final Map>, RegistrySetBuilder.RegistryBootstrap> EXPERIMENTAL_REGISTRY_ENTRIES = Collections.emptyMap(); // Update for Experimental API + + @SuppressWarnings("unchecked") + public static Set> collectExperimentalDataDrivenKeys(Registry registry) { + RegistrySetBuilder.@Nullable RegistryBootstrap experimentalBootstrap = (RegistrySetBuilder.RegistryBootstrap) EXPERIMENTAL_REGISTRY_ENTRIES.get(registry.key()); + if (experimentalBootstrap == null) { + return Collections.emptySet(); + } + Set> experimental = Collections.newSetFromMap(new IdentityHashMap<>()); + CollectingContext experimentalCollector = new CollectingContext<>(experimental, registry); + experimentalBootstrap.run(experimentalCollector); + + RegistrySetBuilder.@Nullable RegistryBootstrap vanillaBootstrap = (RegistrySetBuilder.RegistryBootstrap) VANILLA_REGISTRY_ENTRIES.get(registry.key()); + if (vanillaBootstrap != null) { + Set> vanilla = Collections.newSetFromMap(new IdentityHashMap<>()); + CollectingContext vanillaCollector = new CollectingContext<>(vanilla, registry); + vanillaBootstrap.run(vanillaCollector); + return Sets.difference(experimental, vanilla); + } + return experimental; + } +} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/utils/CollectingContext.java b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/CollectingContext.java similarity index 50% rename from paper-api-generator/src/main/java/io/papermc/generator/utils/CollectingContext.java rename to paper-generator/src/main/java/io/papermc/generator/utils/experimental/CollectingContext.java index bb0687aa24..aacc498c2a 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/CollectingContext.java +++ b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/CollectingContext.java @@ -1,4 +1,4 @@ -package io.papermc.generator.utils; +package io.papermc.generator.utils.experimental; import com.mojang.serialization.Lifecycle; import io.papermc.generator.Main; @@ -8,21 +8,20 @@ import net.minecraft.core.HolderGetter; import net.minecraft.core.Registry; import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.resources.ResourceKey; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.framework.qual.DefaultQualifier; +import org.jspecify.annotations.NullMarked; -@DefaultQualifier(NonNull.class) +@NullMarked public record CollectingContext(Set> registered, Registry registry) implements BootstrapContext { @Override - public Holder.Reference register(final ResourceKey resourceKey, final @NonNull T t, final Lifecycle lifecycle) { - this.registered.add(resourceKey); - return Holder.Reference.createStandAlone(this.registry.holderOwner(), resourceKey); + public Holder.Reference register(ResourceKey key, T value, Lifecycle lifecycle) { + this.registered.add(key); + return Holder.Reference.createStandAlone(this.registry.holderOwner(), key); } @Override - public HolderGetter lookup(final ResourceKey> resourceKey) { - return Main.REGISTRY_ACCESS.registryOrThrow(resourceKey).asLookup(); + public HolderGetter lookup(ResourceKey> key) { + return Main.REGISTRY_ACCESS.lookupOrThrow(key); } } diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolder.java b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolder.java new file mode 100644 index 0000000000..a6c9ad76f0 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolder.java @@ -0,0 +1,16 @@ +package io.papermc.generator.utils.experimental; + +import net.minecraft.world.flag.FeatureFlag; +import net.minecraft.world.flag.FeatureFlagSet; +import net.minecraft.world.flag.FeatureFlags; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface FlagHolder { + + default FeatureFlagSet flagSet() { + return FeatureFlags.REGISTRY.subset(this.flag()); + } + + FeatureFlag flag(); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolders.java b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolders.java new file mode 100644 index 0000000000..a495e45206 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolders.java @@ -0,0 +1,25 @@ +package io.papermc.generator.utils.experimental; + +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; +import net.minecraft.Util; +import net.minecraft.world.flag.FeatureFlag; +import net.minecraft.world.flag.FeatureFlags; +import org.bukkit.MinecraftExperimental; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked +public class FlagHolders { + + public static final @Nullable SingleFlagHolder NEXT_UPDATE = null/*SingleFlagHolder.fromValue(FeatureFlags.UPDATE_1_22)*/; + public static final SingleFlagHolder BUNDLE = SingleFlagHolder.fromValue(FeatureFlags.BUNDLE); + public static final SingleFlagHolder TRADE_REBALANCE = SingleFlagHolder.fromValue(FeatureFlags.TRADE_REBALANCE); + + static final Map ANNOTATION_EQUIVALENT = Util.make(new HashMap(), map -> { + //map.put(NEXT_UPDATE, MinecraftExperimental.Requires.UPDATE_1_22); + map.put(BUNDLE, MinecraftExperimental.Requires.BUNDLE); + map.put(TRADE_REBALANCE, MinecraftExperimental.Requires.TRADE_REBALANCE); + }).entrySet().stream().collect(Collectors.toMap(entry -> entry.getKey().flag(), Map.Entry::getValue)); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/experimental/SingleFlagHolder.java b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/SingleFlagHolder.java new file mode 100644 index 0000000000..e8e267225b --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/SingleFlagHolder.java @@ -0,0 +1,49 @@ +package io.papermc.generator.utils.experimental; + +import com.google.common.base.Preconditions; +import com.google.common.collect.HashBiMap; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.flag.FeatureFlag; +import net.minecraft.world.flag.FeatureFlagSet; +import net.minecraft.world.flag.FeatureFlags; +import org.bukkit.MinecraftExperimental; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public record SingleFlagHolder(FeatureFlag flag) implements FlagHolder { // todo support multiple flags? + + private static final Map FEATURE_FLAG_CACHE = new HashMap<>(); + private static final Map FEATURE_FLAG_NAME = HashBiMap.create(FeatureFlags.REGISTRY.names).inverse(); + + public static SingleFlagHolder fromValue(FeatureFlag flag) { + return new SingleFlagHolder(flag); + } + + public static SingleFlagHolder fromSet(FeatureFlagSet standaloneSet) { + Preconditions.checkArgument(Long.bitCount(standaloneSet.mask) == 1, "Flag set size must be equals to 1."); + + for (FeatureFlag flag : FeatureFlags.REGISTRY.names.values()) { + if (standaloneSet.contains(flag)) { + return fromValue(flag); + } + } + + throw new IllegalStateException(); + } + + public static SingleFlagHolder fromVanillaName(String name) { + return fromValue(FEATURE_FLAG_CACHE.computeIfAbsent(name, key -> { + return FeatureFlags.REGISTRY.names.get(ResourceLocation.withDefaultNamespace(key)); + })); + } + + public MinecraftExperimental.Requires asAnnotationMember() { + MinecraftExperimental.Requires annotationMember = FlagHolders.ANNOTATION_EQUIVALENT.get(this.flag); + if (annotationMember == null) { + throw new UnsupportedOperationException("Don't know that feature flag : " + FEATURE_FLAG_NAME.get(this.flag)); + } + return annotationMember; + } +} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/utils/TagCollector.java b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/TagCollector.java similarity index 93% rename from paper-api-generator/src/main/java/io/papermc/generator/utils/TagCollector.java rename to paper-generator/src/main/java/io/papermc/generator/utils/experimental/TagCollector.java index 2c537dba93..e54f9c09b3 100644 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/TagCollector.java +++ b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/TagCollector.java @@ -1,9 +1,10 @@ -package io.papermc.generator.utils; +package io.papermc.generator.utils.experimental; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import com.mojang.logging.LogUtils; import io.papermc.generator.Main; +import io.papermc.generator.utils.Formatting; import java.util.Collections; import java.util.IdentityHashMap; import java.util.Map; @@ -18,15 +19,17 @@ import net.minecraft.server.packs.PackType; import net.minecraft.server.packs.repository.BuiltInPackSource; import net.minecraft.server.packs.resources.MultiPackResourceManager; import net.minecraft.tags.TagKey; +import org.jspecify.annotations.NullMarked; import org.slf4j.Logger; // collect all the tags by grabbing the json from the data-packs // another (probably) way is to hook into the data generator like the typed keys generator +@NullMarked public final class TagCollector { private static final Logger LOGGER = LogUtils.getLogger(); - public static Map, String> grabExperimental(final MultiPackResourceManager resourceManager) { + public static Map, String> grabExperimental(MultiPackResourceManager resourceManager) { Map, String> result = new IdentityHashMap<>(); // collect all vanilla tags diff --git a/paper-generator/src/test/java/io/papermc/generator/BlockStatePropertyTest.java b/paper-generator/src/test/java/io/papermc/generator/BlockStatePropertyTest.java new file mode 100644 index 0000000000..ee4d64893d --- /dev/null +++ b/paper-generator/src/test/java/io/papermc/generator/BlockStatePropertyTest.java @@ -0,0 +1,72 @@ +package io.papermc.generator; + +import io.papermc.generator.utils.BlockStateMapping; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Collections; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.Set; +import net.minecraft.SharedConstants; +import net.minecraft.server.Bootstrap; +import net.minecraft.world.level.block.ChiseledBookShelfBlock; +import net.minecraft.world.level.block.PipeBlock; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.fail; + +public class BlockStatePropertyTest { + + private static Set>> ENUM_PROPERTY_VALUES; + + @BeforeAll + public static void getAllProperties() { + // bootstrap + SharedConstants.tryDetectVersion(); + Bootstrap.bootStrap(); + Bootstrap.validate(); + + // get all properties + Set>> enumPropertyValues = Collections.newSetFromMap(new IdentityHashMap<>()); + try { + for (Field field : BlockStateProperties.class.getDeclaredFields()) { + int mod = field.getModifiers(); + if (Modifier.isStatic(mod) & Modifier.isFinal(mod) & Modifier.isPublic(mod)) { + if (!EnumProperty.class.isAssignableFrom(field.getType())) { + continue; + } + + EnumProperty property = ((EnumProperty) field.get(null)); + enumPropertyValues.add(property.getValueClass()); + } + } + ENUM_PROPERTY_VALUES = Collections.unmodifiableSet(enumPropertyValues); + } catch (ReflectiveOperationException ex) { + throw new RuntimeException(ex); + } + } + + { + // reference test + // if renamed should change DataPropertyWriter#FIELD_TO_BASE_NAME + var a = ChiseledBookShelfBlock.SLOT_OCCUPIED_PROPERTIES; + var b = PipeBlock.PROPERTY_BY_DIRECTION; + } + + @Test + public void testBridge() { + Set missingApisEquivalent = new HashSet<>(); + for (Class> value : ENUM_PROPERTY_VALUES) { + if (!BlockStateMapping.ENUM_BRIDGE.containsKey(value)) { + missingApisEquivalent.add(value.getCanonicalName()); + } + } + + if (!missingApisEquivalent.isEmpty()) { + fail("Missing some api equivalent in the blockstate mapping enum bridge (BlockStateMapping#ENUM_BRIDGE) : " + String.join(", ", missingApisEquivalent)); + } + } +} diff --git a/paper-api-generator/src/test/java/io/papermc/generator/MobGoalConverterTest.java b/paper-generator/src/test/java/io/papermc/generator/MobGoalConverterTest.java similarity index 100% rename from paper-api-generator/src/test/java/io/papermc/generator/MobGoalConverterTest.java rename to paper-generator/src/test/java/io/papermc/generator/MobGoalConverterTest.java index 9bc9f6b400..487bc9ec62 100644 --- a/paper-api-generator/src/test/java/io/papermc/generator/MobGoalConverterTest.java +++ b/paper-generator/src/test/java/io/papermc/generator/MobGoalConverterTest.java @@ -3,11 +3,11 @@ package io.papermc.generator; import io.github.classgraph.ClassGraph; import io.github.classgraph.ScanResult; import io.papermc.generator.types.goal.MobGoalNames; +import java.util.ArrayList; +import java.util.List; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Mob; import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import java.util.List; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.fail; diff --git a/paper-generator/src/test/java/io/papermc/generator/rewriter/OldGeneratedCodeTest.java b/paper-generator/src/test/java/io/papermc/generator/rewriter/OldGeneratedCodeTest.java new file mode 100644 index 0000000000..fae4d2acf3 --- /dev/null +++ b/paper-generator/src/test/java/io/papermc/generator/rewriter/OldGeneratedCodeTest.java @@ -0,0 +1,118 @@ +package io.papermc.generator.rewriter; + +import io.papermc.generator.Rewriters; +import io.papermc.generator.rewriter.registration.PaperPatternSourceSetRewriter; +import io.papermc.generator.rewriter.utils.Annotations; +import io.papermc.paper.generated.GeneratedFrom; +import io.papermc.typewriter.IndentUnit; +import io.papermc.typewriter.SourceFile; +import io.papermc.typewriter.SourceRewriter; +import io.papermc.typewriter.parser.StringReader; +import io.papermc.typewriter.replace.CommentMarker; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import io.papermc.typewriter.replace.SearchReplaceRewriterBase; +import java.io.BufferedReader; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import net.minecraft.SharedConstants; + +import static io.papermc.typewriter.replace.CommentMarker.EMPTY_MARKER; +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class OldGeneratedCodeTest { + + private static final String CURRENT_VERSION; + + static { + SharedConstants.tryDetectVersion(); + CURRENT_VERSION = SharedConstants.getCurrentVersion().getName(); + } + + public static void main(String[] args) throws IOException { + PaperPatternSourceSetRewriter apiSourceSet = new PaperPatternSourceSetRewriter(Path.of(args[0])); + PaperPatternSourceSetRewriter serverSourceSet = new PaperPatternSourceSetRewriter(Path.of(args[1])); + + Rewriters.bootstrap(apiSourceSet, serverSourceSet); + + checkOutdated(apiSourceSet); + checkOutdated(serverSourceSet); + } + + private static void checkOutdated(PaperPatternSourceSetRewriter sourceSetRewriter) throws IOException { + IndentUnit globalIndentUnit = sourceSetRewriter.getMetadata().indentUnit();; + for (Map.Entry entry : sourceSetRewriter.getRewriters().entrySet()) { + SourceRewriter rewriter = entry.getValue(); + if (!(rewriter instanceof SearchReplaceRewriterBase srt) || + srt.getRewriters().stream().noneMatch(SearchReplaceRewriter::hasGeneratedComment)) { + continue; + } + + SourceFile file = entry.getKey(); + Path path = sourceSetRewriter.getAlternateOutput().resolve(file.path()); + if (Files.notExists(path)) { // todo (softspoon): remove after + continue; + } + + IndentUnit indentUnit = file.indentUnit().orElse(globalIndentUnit); + Set rewriters = new HashSet<>(srt.getRewriters()); + try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)) { + int lineCount = 0; + while (true) { + String line = reader.readLine(); + if (line == null) { + break; + } + lineCount++; + if (line.isEmpty()) { + continue; + } + + StringReader lineIterator = new StringReader(line); + CommentMarker marker = srt.searchMarker(lineIterator, null, indentUnit, rewriters, true); + if (marker != EMPTY_MARKER) { + int startIndentSize = marker.indentSize(); + if (startIndentSize % indentUnit.size() != 0) { + continue; + } + + String nextLine = reader.readLine(); + if (nextLine == null) { + break; + } + lineCount++; + if (nextLine.isEmpty()) { + continue; + } + + StringReader nextLineIterator = new StringReader(nextLine); + int indentSize = nextLineIterator.skipChars(indentUnit.character()); + if (indentSize != startIndentSize) { + continue; + } + + String generatedComment = "// %s ".formatted(Annotations.annotationStyle(GeneratedFrom.class)); + if (nextLineIterator.trySkipString(generatedComment) && nextLineIterator.canRead()) { + String generatedVersion = nextLineIterator.getRemaining(); + assertEquals(CURRENT_VERSION, generatedVersion, + "Code at line %d in %s is marked as being generated in version %s when the current version is %s".formatted( + lineCount, file.mainClass().canonicalName(), + generatedVersion, CURRENT_VERSION)); + + if (!marker.owner().getOptions().multipleOperation()) { + rewriters.remove(marker.owner()); + if (rewriters.isEmpty()) { + break; + } + } + } + } + } + } + } + } +} diff --git a/paper-generator/wideners.at b/paper-generator/wideners.at new file mode 100644 index 0000000000..fca29e464e --- /dev/null +++ b/paper-generator/wideners.at @@ -0,0 +1,17 @@ +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; +public net/minecraft/world/level/material/MapColor MATERIAL_COLORS +public net/minecraft/world/level/block/FireBlock igniteOdds +public net/minecraft/world/level/block/state/properties/IntegerProperty min +public net/minecraft/util/datafix/fixes/BannerPatternFormatFix PATTERN_ID_MAP + +# for auto-marking experimental stuff +public net/minecraft/core/RegistrySetBuilder entries +public net/minecraft/core/RegistrySetBuilder$RegistryStub +public net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER +public net/minecraft/data/registries/VanillaRegistries BUILDER +public net/minecraft/world/flag/FeatureFlagRegistry names +public net/minecraft/world/flag/FeatureFlagSet mask +public net/minecraft/world/entity/npc/VillagerTrades$TreasureMapForEmeralds +public net/minecraft/world/entity/npc/VillagerTrades$TreasureMapForEmeralds destination +public net/minecraft/world/entity/npc/VillagerTrades$TreasureMapForEmeralds destinationType +public net/minecraft/world/entity/npc/VillagerTrades$TypeSpecificTrade diff --git a/patches/api/0004-Code-Generation.patch b/patches/api/0004-Code-Generation.patch index c19456fe12..387d0bb266 100644 --- a/patches/api/0004-Code-Generation.patch +++ b/patches/api/0004-Code-Generation.patch @@ -7,7 +7,7 @@ Currently includes generated key holder classes for types used in the Registry Modification API diff --git a/build.gradle.kts b/build.gradle.kts -index 8c7a5be5193ae397ec324d78566edce90608ed57..877ea06c0ea8c8c0c73d23fbb996f6692c100d98 100644 +index 8c7a5be5193ae397ec324d78566edce90608ed57..edd22e085771a119108fcdb5963f898fbc7130fa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ @@ -23,16 +23,16 @@ index 8c7a5be5193ae397ec324d78566edce90608ed57..877ea06c0ea8c8c0c73d23fbb996f669 } +// Paper start -+val generatedApiPath: java.nio.file.Path = rootProject.projectDir.toPath().resolve("paper-api-generator/generated") ++val generatedApiDir: File = rootProject.file("paper-generator/generatedApi") +idea { + module { -+ generatedSourceDirs.add(generatedApiPath.toFile()) ++ generatedSourceDirs.add(generatedApiDir) + } +} +sourceSets { + main { + java { -+ srcDir(generatedApiPath) ++ srcDir(generatedApiDir) + } + } +} @@ -54,8 +54,8 @@ index 8c7a5be5193ae397ec324d78566edce90608ed57..877ea06c0ea8c8c0c73d23fbb996f669 +} +tasks.check { + dependsOn(scanJarForOldGeneratedCode) ++ dependsOn(":paper-generator:scanOldGeneratedSourceCode") +} -+// Paper end diff --git a/src/main/java/io/papermc/paper/generated/GeneratedFrom.java b/src/main/java/io/papermc/paper/generated/GeneratedFrom.java new file mode 100644 index 0000000000000000000000000000000000000000..2512dba27edfdccbc4430815b6cba048e3d93484 diff --git a/patches/api/0495-fix-memory-keys-use-of-generics.patch b/patches/api/0495-fix-memory-keys-use-of-generics.patch new file mode 100644 index 0000000000..e80a876774 --- /dev/null +++ b/patches/api/0495-fix-memory-keys-use-of-generics.patch @@ -0,0 +1,69 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Wed, 11 Sep 2024 20:24:30 +0200 +Subject: [PATCH] fix memory keys use of generics + + +diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java +index d81f687cba38ec930c555b001afc0df93c21731b..16bc5fc536a89866c348f18ddc4a93b3982bbd78 100644 +--- a/src/main/java/org/bukkit/Registry.java ++++ b/src/main/java/org/bukkit/Registry.java +@@ -279,23 +279,23 @@ public interface Registry extends Iterable { + * + * @see MemoryKey + */ +- Registry MEMORY_MODULE_TYPE = new Registry() { ++ Registry> MEMORY_MODULE_TYPE = new Registry<>() { + + @NotNull + @Override +- public Iterator iterator() { ++ public Iterator> iterator() { + return MemoryKey.values().iterator(); + } + + @Nullable + @Override +- public MemoryKey get(@NotNull NamespacedKey key) { ++ public MemoryKey get(@NotNull NamespacedKey key) { + return MemoryKey.getByKey(key); + } + + @NotNull + @Override +- public Stream stream() { ++ public Stream> stream() { + return StreamSupport.stream(spliterator(), false); + } + }; +diff --git a/src/main/java/org/bukkit/entity/memory/MemoryKey.java b/src/main/java/org/bukkit/entity/memory/MemoryKey.java +index d615c006c9153fb65024241604b744fbfc383efc..b757aed1bde330d8720a900f8e0877f77ef14c4a 100644 +--- a/src/main/java/org/bukkit/entity/memory/MemoryKey.java ++++ b/src/main/java/org/bukkit/entity/memory/MemoryKey.java +@@ -44,7 +44,7 @@ public final class MemoryKey implements Keyed { + return tClass; + } + +- private static final Map MEMORY_KEYS = new HashMap<>(); ++ private static final Map> MEMORY_KEYS = new HashMap<>(); + // + public static final MemoryKey HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class); + public static final MemoryKey POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class); +@@ -86,7 +86,7 @@ public final class MemoryKey implements Keyed { + * available under that key + */ + @Nullable +- public static MemoryKey getByKey(@NotNull NamespacedKey namespacedKey) { ++ public static MemoryKey getByKey(@NotNull NamespacedKey namespacedKey) { + return MEMORY_KEYS.get(namespacedKey); + } + +@@ -96,7 +96,7 @@ public final class MemoryKey implements Keyed { + * @return the memoryKeys + */ + @NotNull +- public static Set values() { ++ public static Set> values() { + return new HashSet<>(MEMORY_KEYS.values()); + } + } diff --git a/patches/api/0496-Code-generation-marker-stub.patch b/patches/api/0496-Code-generation-marker-stub.patch new file mode 100644 index 0000000000..bf1b61d677 --- /dev/null +++ b/patches/api/0496-Code-generation-marker-stub.patch @@ -0,0 +1,1081 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Wed, 14 Feb 2024 19:33:27 +0100 +Subject: [PATCH] Code generation marker stub + + +diff --git a/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java b/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java +index b32ae215e976bcfcdd86b03037de61b3d896f57c..87fc88c5386a4c3749348456554a0d4ad8201ca0 100644 +--- a/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java ++++ b/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java +@@ -16,8 +16,10 @@ import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create; + @ApiStatus.Experimental + public final class RegistryEvents { + ++ // Paper start - Generated/RegistryEvents + public static final RegistryEventProvider GAME_EVENT = create(RegistryKey.GAME_EVENT); + public static final RegistryEventProvider ENCHANTMENT = create(RegistryKey.ENCHANTMENT); ++ // Paper end - Generated/RegistryEvents + + private RegistryEvents() { + } +diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java +index e57e34064262b90221b0621f1d13e9705e68421a..5c2bc2a135042ffdb1f33091de9a9d906cc8474e 100644 +--- a/src/main/java/org/bukkit/Art.java ++++ b/src/main/java/org/bukkit/Art.java +@@ -11,6 +11,7 @@ import org.jetbrains.annotations.Nullable; + * Represents the art on a painting + */ + public enum Art implements Keyed { ++ // Paper start - Generated/Art + KEBAB(0, 1, 1), + AZTEC(1, 1, 1), + ALBAN(2, 1, 1), +@@ -61,6 +62,7 @@ public enum Art implements Keyed { + POND(47, 3, 4), + SUNFLOWERS(48, 3, 3), + TIDES(49, 3, 3); ++ // Paper end - Generated/Art + + private final int id, width, height; + private final NamespacedKey key; +diff --git a/src/main/java/org/bukkit/FeatureFlag.java b/src/main/java/org/bukkit/FeatureFlag.java +index b5e87480b6a1d064547e4e608f3d402825931a00..e5eb7c875bf789650f120d54e759369296d7e258 100644 +--- a/src/main/java/org/bukkit/FeatureFlag.java ++++ b/src/main/java/org/bukkit/FeatureFlag.java +@@ -15,6 +15,7 @@ import org.jetbrains.annotations.ApiStatus; + public interface FeatureFlag extends Keyed { + + // Paper start - overhaul FeatureFlag API ++ // Paper start - Generated/FeatureFlag + /** + * The {@code vanilla} feature flag. + */ +@@ -31,6 +32,7 @@ public interface FeatureFlag extends Keyed { + */ + @ApiStatus.Experimental // Paper - add missing annotation + FeatureFlag TRADE_REBALANCE = create("trade_rebalance"); ++ // Paper end - Generated/FeatureFlag + + @Deprecated(since = "1.20") + FeatureFlag UPDATE_1_20 = deprecated("update_1_20"); +diff --git a/src/main/java/org/bukkit/Fluid.java b/src/main/java/org/bukkit/Fluid.java +index 7202b44a65e8699cf64329e441e83d4dd1779c19..ebcef7cdbcd402010af13d9fb055b3a3f6ce665e 100644 +--- a/src/main/java/org/bukkit/Fluid.java ++++ b/src/main/java/org/bukkit/Fluid.java +@@ -8,6 +8,7 @@ import org.jetbrains.annotations.NotNull; + */ + public enum Fluid implements Keyed { + ++ // Paper start - Generated/Fluid + // Paper start + /** + * No fluid. +@@ -30,6 +31,7 @@ public enum Fluid implements Keyed { + * Flowing lava. + */ + FLOWING_LAVA; ++ // Paper end - Generated/Fluid + + private final NamespacedKey key; + +diff --git a/src/main/java/org/bukkit/GameEvent.java b/src/main/java/org/bukkit/GameEvent.java +index 4583092c2d1ffe95be2831c5d5f0e904283ab762..4267873c3666f0d64f769dccfba3fd1a2a99cbb5 100644 +--- a/src/main/java/org/bukkit/GameEvent.java ++++ b/src/main/java/org/bukkit/GameEvent.java +@@ -12,6 +12,7 @@ import org.jetbrains.annotations.Nullable; + */ + public abstract class GameEvent implements Keyed { + ++ // Paper start - Generated/GameEvent + public static final GameEvent BLOCK_ACTIVATE = getEvent("block_activate"); + public static final GameEvent BLOCK_ATTACH = getEvent("block_attach"); + public static final GameEvent BLOCK_CHANGE = getEvent("block_change"); +@@ -21,42 +22,18 @@ public abstract class GameEvent implements Keyed { + public static final GameEvent BLOCK_DETACH = getEvent("block_detach"); + public static final GameEvent BLOCK_OPEN = getEvent("block_open"); + public static final GameEvent BLOCK_PLACE = getEvent("block_place"); +- @Deprecated +- public static final GameEvent BLOCK_PRESS = getEvent("block_activate"); +- @Deprecated +- public static final GameEvent BLOCK_SWITCH = getEvent("block_activate"); +- @Deprecated +- public static final GameEvent BLOCK_UNPRESS = getEvent("block_deactivate"); +- @Deprecated +- public static final GameEvent BLOCK_UNSWITCH = getEvent("block_deactivate"); + public static final GameEvent CONTAINER_CLOSE = getEvent("container_close"); + public static final GameEvent CONTAINER_OPEN = getEvent("container_open"); +- @Deprecated +- public static final GameEvent DISPENSE_FAIL = getEvent("block_activate"); + public static final GameEvent DRINK = getEvent("drink"); +- @Deprecated +- public static final GameEvent DRINKING_FINISH = getEvent("drink"); + public static final GameEvent EAT = getEvent("eat"); +- @Deprecated +- public static final GameEvent ELYTRA_FREE_FALL = getEvent("elytra_glide"); + public static final GameEvent ELYTRA_GLIDE = getEvent("elytra_glide"); + public static final GameEvent ENTITY_DAMAGE = getEvent("entity_damage"); +- @Deprecated +- public static final GameEvent ENTITY_DAMAGED = getEvent("entity_damage"); + public static final GameEvent ENTITY_DIE = getEvent("entity_die"); + public static final GameEvent ENTITY_DISMOUNT = getEvent("entity_dismount"); +- @Deprecated +- public static final GameEvent ENTITY_DYING = getEvent("entity_die"); + public static final GameEvent ENTITY_INTERACT = getEvent("entity_interact"); + public static final GameEvent ENTITY_MOUNT = getEvent("entity_mount"); +- @Deprecated +- public static final GameEvent ENTITY_KILLED = getEvent("entity_die"); + public static final GameEvent ENTITY_PLACE = getEvent("entity_place"); + public static final GameEvent ENTITY_ACTION = getEvent("entity_action"); +- @Deprecated +- public static final GameEvent ENTITY_ROAR = getEvent("entity_action"); +- @Deprecated +- public static final GameEvent ENTITY_SHAKE = getEvent("entity_action"); + public static final GameEvent EQUIP = getEvent("equip"); + public static final GameEvent EXPLODE = getEvent("explode"); + public static final GameEvent FLAP = getEvent("flap"); +@@ -69,34 +46,18 @@ public abstract class GameEvent implements Keyed { + public static final GameEvent JUKEBOX_PLAY = getEvent("jukebox_play"); + public static final GameEvent JUKEBOX_STOP_PLAY = getEvent("jukebox_stop_play"); + public static final GameEvent LIGHTNING_STRIKE = getEvent("lightning_strike"); +- @Deprecated +- public static final GameEvent MOB_INTERACT = getEvent("entity_interact"); + public static final GameEvent NOTE_BLOCK_PLAY = getEvent("note_block_play"); +- @Deprecated +- public static final GameEvent PISTON_CONTRACT = getEvent("block_deactivate"); +- @Deprecated +- public static final GameEvent PISTON_EXTEND = getEvent("block_activate"); + public static final GameEvent PRIME_FUSE = getEvent("prime_fuse"); + public static final GameEvent PROJECTILE_LAND = getEvent("projectile_land"); + public static final GameEvent PROJECTILE_SHOOT = getEvent("projectile_shoot"); +- @Deprecated +- public static final GameEvent RAVAGER_ROAR = getEvent("entity_action"); +- @Deprecated +- public static final GameEvent RING_BELL = getEvent("block_change"); + public static final GameEvent SCULK_SENSOR_TENDRILS_CLICKING = getEvent("sculk_sensor_tendrils_clicking"); + public static final GameEvent SHEAR = getEvent("shear"); + public static final GameEvent SHRIEK = getEvent("shriek"); +- @Deprecated +- public static final GameEvent SHULKER_CLOSE = getEvent("container_close"); +- @Deprecated +- public static final GameEvent SHULKER_OPEN = getEvent("container_open"); + public static final GameEvent SPLASH = getEvent("splash"); + public static final GameEvent STEP = getEvent("step"); + public static final GameEvent SWIM = getEvent("swim"); + public static final GameEvent TELEPORT = getEvent("teleport"); + public static final GameEvent UNEQUIP = getEvent("unequip"); +- @Deprecated +- public static final GameEvent WOLF_SHAKING = getEvent("entity_action"); + public static final GameEvent RESONATE_1 = getEvent("resonate_1"); + public static final GameEvent RESONATE_2 = getEvent("resonate_2"); + public static final GameEvent RESONATE_3 = getEvent("resonate_3"); +@@ -112,6 +73,47 @@ public abstract class GameEvent implements Keyed { + public static final GameEvent RESONATE_13 = getEvent("resonate_13"); + public static final GameEvent RESONATE_14 = getEvent("resonate_14"); + public static final GameEvent RESONATE_15 = getEvent("resonate_15"); ++ // Paper end - Generated/GameEvent ++ @Deprecated ++ public static final GameEvent BLOCK_PRESS = getEvent("block_activate"); ++ @Deprecated ++ public static final GameEvent BLOCK_SWITCH = getEvent("block_activate"); ++ @Deprecated ++ public static final GameEvent BLOCK_UNPRESS = getEvent("block_deactivate"); ++ @Deprecated ++ public static final GameEvent BLOCK_UNSWITCH = getEvent("block_deactivate"); ++ @Deprecated ++ public static final GameEvent DISPENSE_FAIL = getEvent("block_activate"); ++ @Deprecated ++ public static final GameEvent DRINKING_FINISH = getEvent("drink"); ++ @Deprecated ++ public static final GameEvent ELYTRA_FREE_FALL = getEvent("elytra_glide"); ++ @Deprecated ++ public static final GameEvent ENTITY_DAMAGED = getEvent("entity_damage"); ++ @Deprecated ++ public static final GameEvent ENTITY_DYING = getEvent("entity_die"); ++ @Deprecated ++ public static final GameEvent ENTITY_KILLED = getEvent("entity_die"); ++ @Deprecated ++ public static final GameEvent ENTITY_ROAR = getEvent("entity_action"); ++ @Deprecated ++ public static final GameEvent ENTITY_SHAKE = getEvent("entity_action"); ++ @Deprecated ++ public static final GameEvent MOB_INTERACT = getEvent("entity_interact"); ++ @Deprecated ++ public static final GameEvent PISTON_CONTRACT = getEvent("block_deactivate"); ++ @Deprecated ++ public static final GameEvent PISTON_EXTEND = getEvent("block_activate"); ++ @Deprecated ++ public static final GameEvent RAVAGER_ROAR = getEvent("entity_action"); ++ @Deprecated ++ public static final GameEvent RING_BELL = getEvent("block_change"); ++ @Deprecated ++ public static final GameEvent SHULKER_CLOSE = getEvent("container_close"); ++ @Deprecated ++ public static final GameEvent SHULKER_OPEN = getEvent("container_open"); ++ @Deprecated ++ public static final GameEvent WOLF_SHAKING = getEvent("entity_action"); + + /** + * Returns a {@link GameEvent} by a {@link NamespacedKey}. +diff --git a/src/main/java/org/bukkit/JukeboxSong.java b/src/main/java/org/bukkit/JukeboxSong.java +index bf487bd9a9fb627c15c7f5e0c623441d367e7c80..977613fd129664f0d9b878f15824d7e948e99727 100644 +--- a/src/main/java/org/bukkit/JukeboxSong.java ++++ b/src/main/java/org/bukkit/JukeboxSong.java +@@ -10,6 +10,7 @@ import org.jetbrains.annotations.NotNull; + @ApiStatus.Experimental + public interface JukeboxSong extends Keyed, Translatable { + ++ // Paper start - Generated/JukeboxSong + public static final JukeboxSong THIRTEEN = get("13"); + public static final JukeboxSong CAT = get("cat"); + public static final JukeboxSong BLOCKS = get("blocks"); +@@ -29,6 +30,7 @@ public interface JukeboxSong extends Keyed, Translatable { + public static final JukeboxSong PRECIPICE = get("precipice"); + public static final JukeboxSong CREATOR = get("creator"); + public static final JukeboxSong CREATOR_MUSIC_BOX = get("creator_music_box"); ++ // Paper end - Generated/JukeboxSong + + @NotNull + private static JukeboxSong get(@NotNull String s) { +diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java +index de469f32dd9a01e0e2fde016044a783dde0c5b98..6804c57158944775d0db9219e9ae10e235d7a6fd 100644 +--- a/src/main/java/org/bukkit/Material.java ++++ b/src/main/java/org/bukkit/Material.java +@@ -132,6 +132,7 @@ import org.jetbrains.annotations.Nullable; + @SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper + public enum Material implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper + // ++ // Paper start - Generated/Items + AIR(9648, 0), + STONE(22948), + GRANITE(21091), +@@ -3678,6 +3679,9 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla + BIG_DRIPLEAF_STEM(13167, Dripleaf.class), + POTTED_AZALEA_BUSH(20430), + POTTED_FLOWERING_AZALEA_BUSH(10609), ++ // Paper end - Generated/Items ++ // Paper start - Generated/Blocks ++ // Paper end - Generated/Blocks + // ----- Legacy Separator ----- + @Deprecated + LEGACY_AIR(0, 0), +@@ -5021,6 +5025,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla + } + switch (this) { + // ++ // Paper start - Generated/Material#isTransparent + case ACACIA_BUTTON: + case ACACIA_SAPLING: + case ACTIVATOR_RAIL: +@@ -5148,6 +5153,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla + case YELLOW_CARPET: + case ZOMBIE_HEAD: + case ZOMBIE_WALL_HEAD: ++ // Paper end - Generated/Material#isTransparent + // ----- Legacy Separator ----- + case LEGACY_AIR: + case LEGACY_SAPLING: +@@ -5378,6 +5384,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla + Preconditions.checkArgument(isItem(), "The Material is not an item!"); + switch (this) { + // ++ // Paper start - Generated/Material#getEquipmentSlot + case CARVED_PUMPKIN: + case CHAINMAIL_HELMET: + case CREEPER_HEAD: +@@ -5442,6 +5449,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla + return EquipmentSlot.BODY; + default: + return EquipmentSlot.HAND; ++ // Paper end - Generated/Material#getEquipmentSlot + // + } + } +diff --git a/src/main/java/org/bukkit/MusicInstrument.java b/src/main/java/org/bukkit/MusicInstrument.java +index 98fdfc8978fea1937e31a7427433a1927d42ec7d..34abd37bdaf0414a9355c8c1848e43705988d43a 100644 +--- a/src/main/java/org/bukkit/MusicInstrument.java ++++ b/src/main/java/org/bukkit/MusicInstrument.java +@@ -9,6 +9,7 @@ import org.jetbrains.annotations.Nullable; + + public abstract class MusicInstrument implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - translation keys + ++ // Paper start - Generated/MusicInstrument + public static final MusicInstrument PONDER_GOAT_HORN = getInstrument("ponder_goat_horn"); + public static final MusicInstrument SING_GOAT_HORN = getInstrument("sing_goat_horn"); + public static final MusicInstrument SEEK_GOAT_HORN = getInstrument("seek_goat_horn"); +@@ -17,6 +18,7 @@ public abstract class MusicInstrument implements Keyed, net.kyori.adventure.tran + public static final MusicInstrument CALL_GOAT_HORN = getInstrument("call_goat_horn"); + public static final MusicInstrument YEARN_GOAT_HORN = getInstrument("yearn_goat_horn"); + public static final MusicInstrument DREAM_GOAT_HORN = getInstrument("dream_goat_horn"); ++ // Paper end - Generated/MusicInstrument + + /** + * Returns a {@link MusicInstrument} by a {@link NamespacedKey}. +diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java +index 7a35120c82b88774de777d3c3176ef553a8e9244..b4299022ea8c1d78af0b8d3ae0c3842c9bea7d86 100644 +--- a/src/main/java/org/bukkit/Sound.java ++++ b/src/main/java/org/bukkit/Sound.java +@@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull; + */ + public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Paper - implement Sound.Type + ++ // Paper start - Generated/Sound + AMBIENT_BASALT_DELTAS_ADDITIONS("ambient.basalt_deltas.additions"), + AMBIENT_BASALT_DELTAS_LOOP("ambient.basalt_deltas.loop"), + AMBIENT_BASALT_DELTAS_MOOD("ambient.basalt_deltas.mood"), +@@ -1629,6 +1630,7 @@ public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Pa + UI_TOAST_OUT("ui.toast.out"), + WEATHER_RAIN("weather.rain"), + WEATHER_RAIN_ABOVE("weather.rain.above"); ++ // Paper end - Generated/Sound + + private final NamespacedKey key; + +diff --git a/src/main/java/org/bukkit/Statistic.java b/src/main/java/org/bukkit/Statistic.java +index 4ce888688d04eb0c4b2261a6474df870e7d2bb00..9e6d231b783fcb54c63cb80f12b598e6b5615f08 100644 +--- a/src/main/java/org/bukkit/Statistic.java ++++ b/src/main/java/org/bukkit/Statistic.java +@@ -7,6 +7,7 @@ import org.jetbrains.annotations.NotNull; + * Represents a countable statistic, which is tracked by the server. + */ + public enum Statistic implements Keyed { ++ // Paper start - Generated/StatisticCustom + DAMAGE_DEALT, + DAMAGE_TAKEN, + DEATHS, +@@ -92,7 +93,10 @@ public enum Statistic implements Keyed { + INTERACT_WITH_GRINDSTONE, + TARGET_HIT, + INTERACT_WITH_SMITHING_TABLE, ++ // Paper end - Generated/StatisticCustom ++ // Paper start - Generated/StatisticType + STRIDER_ONE_CM; ++ // Paper end - Generated/StatisticType + + private final Type type; + private final NamespacedKey key; +diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java +index 8bfec649f7c6dda956bc388a21b489f3565ff384..d90d67b631fd79ccea0c5aed48143cfaeb88ad96 100644 +--- a/src/main/java/org/bukkit/Tag.java ++++ b/src/main/java/org/bukkit/Tag.java +@@ -19,6 +19,7 @@ import org.jetbrains.annotations.NotNull; + */ + public interface Tag extends Keyed { + ++ // Paper start - Generated/Tag + /** + * Key for the built in block registry. + */ +@@ -53,11 +54,6 @@ public interface Tag extends Keyed { + * Vanilla block tag representing all colors of carpet. + */ + Tag WOOL_CARPETS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wool_carpets"), Material.class); +- /** +- * @deprecated {@link #WOOL_CARPETS}. +- */ +- @Deprecated +- Tag CARPETS = WOOL_CARPETS; + /** + * Vanilla block tag representing all wooden doors. + */ +@@ -807,24 +803,10 @@ public interface Tag extends Keyed { + * Vanilla item tag representing all piglin food. + */ + Tag ITEMS_PIGLIN_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("piglin_food"), Material.class); +- /** +- * Vanilla item tag representing all piglin food. +- * +- * @deprecated use {@link #ITEMS_PIGLIN_FOOD} +- */ +- @Deprecated +- Tag PIGLIN_FOOD = ITEMS_PIGLIN_FOOD; + /** + * Vanilla item tag representing all fox food. + */ + Tag ITEMS_FOX_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("fox_food"), Material.class); +- /** +- * Vanilla item tag representing all fox food. +- * +- * @deprecated use {@link #ITEMS_FOX_FOOD} +- */ +- @Deprecated +- Tag FOX_FOOD = ITEMS_FOX_FOOD; + /** + * Vanilla item tag representing all cow food. + */ +@@ -1058,15 +1040,6 @@ public interface Tag extends Keyed { + * Vanilla item tag representing all items which break decorated pots. + */ + Tag ITEMS_BREAKS_DECORATED_POTS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("breaks_decorated_pots"), Material.class); +- /** +- * Vanilla item tag representing all tools. +- * +- * @deprecated removed in Minecraft 1.20.5. Do not use. Will be removed at a later date. Until then, +- * this constant now acts as a reference to {@link #ITEMS_BREAKS_DECORATED_POTS} which largely shares +- * the same contents of the old "minecraft:tools" tag. +- */ +- @Deprecated(forRemoval = true) +- Tag ITEMS_TOOLS = ITEMS_BREAKS_DECORATED_POTS; + /** + * Vanilla item tag representing all seeds planteable by villagers. + */ +@@ -1156,13 +1129,6 @@ public interface Tag extends Keyed { + * the wearer. + */ + Tag FREEZE_IMMUNE_WEARABLES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("freeze_immune_wearables"), Material.class); +- /** +- * Vanilla item tag representing all items which tempt axolotls. +- * +- * @deprecated use {@link #ITEMS_AXOLOTL_FOOD} +- */ +- @Deprecated +- Tag AXOLOTL_TEMPT_ITEMS = ITEMS_AXOLOTL_FOOD; + /** + * Vanilla item tag representing all items which are preferred for + * harvesting clusters (unused). +@@ -1244,12 +1210,6 @@ public interface Tag extends Keyed { + * Vanilla tag representing entities which deflect projectiles. + */ + Tag ENTITY_TYPES_DEFLECTS_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("deflects_projectiles"), EntityType.class); +- /** +- * Vanilla tag representing entities which deflect arrows. +- * @deprecated use {@link #ENTITY_TYPES_DEFLECTS_PROJECTILES} +- */ +- @Deprecated +- Tag ENTITY_TYPES_DEFLECTS_ARROWS = ENTITY_TYPES_DEFLECTS_PROJECTILES; + /** + * Vanilla tag representing entities which can turn in boats. + */ +@@ -1333,6 +1293,48 @@ public interface Tag extends Keyed { + */ + Tag GAME_EVENT_ALLAY_CAN_LISTEN = Bukkit.getTag(REGISTRY_GAME_EVENTS, NamespacedKey.minecraft("allay_can_listen"), GameEvent.class); + // Paper end ++ // Paper end - Generated/Tag ++ /** ++ * @deprecated {@link #WOOL_CARPETS}. ++ */ ++ @Deprecated ++ Tag CARPETS = WOOL_CARPETS; ++ /** ++ * Vanilla item tag representing all piglin food. ++ * ++ * @deprecated use {@link #ITEMS_PIGLIN_FOOD} ++ */ ++ @Deprecated ++ Tag PIGLIN_FOOD = ITEMS_PIGLIN_FOOD; ++ /** ++ * Vanilla item tag representing all fox food. ++ * ++ * @deprecated use {@link #ITEMS_FOX_FOOD} ++ */ ++ @Deprecated ++ Tag FOX_FOOD = ITEMS_FOX_FOOD; ++ /** ++ * Vanilla item tag representing all tools. ++ * ++ * @deprecated removed in Minecraft 1.20.5. Do not use. Will be removed at a later date. Until then, ++ * this constant now acts as a reference to {@link #ITEMS_BREAKS_DECORATED_POTS} which largely shares ++ * the same contents of the old "minecraft:tools" tag. ++ */ ++ @Deprecated(forRemoval = true) ++ Tag ITEMS_TOOLS = ITEMS_BREAKS_DECORATED_POTS; ++ /** ++ * Vanilla item tag representing all items which tempt axolotls. ++ * ++ * @deprecated use {@link #ITEMS_AXOLOTL_FOOD} ++ */ ++ @Deprecated ++ Tag AXOLOTL_TEMPT_ITEMS = ITEMS_AXOLOTL_FOOD; ++ /** ++ * Vanilla tag representing entities which deflect arrows. ++ * @deprecated use {@link #ENTITY_TYPES_DEFLECTS_PROJECTILES} ++ */ ++ @Deprecated ++ Tag ENTITY_TYPES_DEFLECTS_ARROWS = ENTITY_TYPES_DEFLECTS_PROJECTILES; + + /** + * Returns whether or not this tag has an entry for the specified item. +diff --git a/src/main/java/org/bukkit/attribute/Attribute.java b/src/main/java/org/bukkit/attribute/Attribute.java +index 947874c0172b690e7752e49b7bec64e0c0308515..0c62f84f94de9147d5adce773e890406f8f62b46 100644 +--- a/src/main/java/org/bukkit/attribute/Attribute.java ++++ b/src/main/java/org/bukkit/attribute/Attribute.java +@@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull; + */ + public enum Attribute implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations + ++ // Paper start - Generated/Attribute + /** + * Maximum health of an Entity. + */ +@@ -135,6 +136,7 @@ public enum Attribute implements Keyed, Translatable, net.kyori.adventure.transl + * Chance of a zombie to spawn reinforcements. + */ + ZOMBIE_SPAWN_REINFORCEMENTS("zombie.spawn_reinforcements"); ++ // Paper end - Generated/Attribute + + private final NamespacedKey key; + +diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java +index 5d8fa5b39a5d50cca48ba63af3a84b80f279b649..c6ea69c0d05aef5a29b758dbd3ea4c84a7587f6b 100644 +--- a/src/main/java/org/bukkit/block/Biome.java ++++ b/src/main/java/org/bukkit/block/Biome.java +@@ -9,6 +9,7 @@ import org.jetbrains.annotations.NotNull; + * Holds all accepted Biomes in the default server + */ + public enum Biome implements Keyed, net.kyori.adventure.translation.Translatable { // Paper ++ // Paper start - Generated/Biome + OCEAN, + PLAINS, + DESERT, +@@ -73,6 +74,7 @@ public enum Biome implements Keyed, net.kyori.adventure.translation.Translatable + JAGGED_PEAKS, + STONY_PEAKS, + CHERRY_GROVE, ++ // Paper end - Generated/Biome + /** + * Represents a custom Biome + */ +diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java +index e85bdd92466ee9bfcf8a82614ad09c1e2963731b..a3bc3b50ca16f1715eb97b0d6e92a1842d499b15 100644 +--- a/src/main/java/org/bukkit/block/BlockType.java ++++ b/src/main/java/org/bukkit/block/BlockType.java +@@ -179,6 +179,7 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran + } + + // ++ // Paper start - Generated/BlockType + BlockType.Typed AIR = getBlockType("air"); + BlockType.Typed STONE = getBlockType("stone"); + BlockType.Typed GRANITE = getBlockType("granite"); +@@ -3295,7 +3296,7 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran + * BlockData: {@link TrialSpawner} + */ + BlockType.Typed TRIAL_SPAWNER = getBlockType("trial_spawner"); +- ++ // Paper end - Generated/BlockType + // + + @NotNull +diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java +index fdd315d94983f8440b5399cef9194e92f22d6895..fed47d2062707e16bba5bce04695b02489cad974 100644 +--- a/src/main/java/org/bukkit/block/banner/PatternType.java ++++ b/src/main/java/org/bukkit/block/banner/PatternType.java +@@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + + public interface PatternType extends OldEnum, Keyed { ++ // Paper start - Generated/PatternType + PatternType BASE = getType("base"); + PatternType SQUARE_BOTTOM_LEFT = getType("square_bottom_left"); + PatternType SQUARE_BOTTOM_RIGHT = getType("square_bottom_right"); +@@ -55,6 +56,7 @@ public interface PatternType extends OldEnum, Keyed { + PatternType PIGLIN = getType("piglin"); + PatternType FLOW = getType("flow"); + PatternType GUSTER = getType("guster"); ++ // Paper end - Generated/PatternType + + // Paper start - deprecate getKey + /** +diff --git a/src/main/java/org/bukkit/damage/DamageType.java b/src/main/java/org/bukkit/damage/DamageType.java +index 387f04a8201d62ab86450de043772049212a8bce..dd9e572b871705a8c49bf6c8fe357490c499c361 100644 +--- a/src/main/java/org/bukkit/damage/DamageType.java ++++ b/src/main/java/org/bukkit/damage/DamageType.java +@@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull; + @ApiStatus.Experimental + public interface DamageType extends Keyed, Translatable { + ++ // Paper start - Generated/DamageType + public static final DamageType IN_FIRE = getDamageType("in_fire"); + public static final DamageType CAMPFIRE = getDamageType("campfire"); + public static final DamageType LIGHTNING_BOLT = getDamageType("lightning_bolt"); +@@ -67,6 +68,7 @@ public interface DamageType extends Keyed, Translatable { + public static final DamageType OUTSIDE_BORDER = getDamageType("outside_border"); + public static final DamageType GENERIC_KILL = getDamageType("generic_kill"); + DamageType WIND_CHARGE = getDamageType("wind_charge"); // Paper ++ // Paper end - Generated/DamageType + + @NotNull + private static DamageType getDamageType(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java +index d80524fe32672a8b8940d1028abf22026dace8d2..dbcb4ce0442eacf7400ecc0f73ab06903215c37a 100644 +--- a/src/main/java/org/bukkit/entity/Boat.java ++++ b/src/main/java/org/bukkit/entity/Boat.java +@@ -136,6 +136,7 @@ public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Pa + * Represents the type of boats. + */ + public enum Type { ++ // Paper start - Generated/BoatType + OAK(Material.OAK_PLANKS), + SPRUCE(Material.SPRUCE_PLANKS), + BIRCH(Material.BIRCH_PLANKS), +@@ -146,6 +147,7 @@ public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Pa + MANGROVE(Material.MANGROVE_PLANKS), + BAMBOO(Material.BAMBOO_PLANKS), + ; ++ // Paper end - Generated/BoatType + + private final Material materialBlock; + +@@ -170,11 +172,13 @@ public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Pa + public enum Status { + + NOT_IN_WORLD, // Paper ++ // Paper start - Generated/BoatStatus + IN_WATER, + UNDER_WATER, + UNDER_FLOWING_WATER, + ON_LAND, + IN_AIR; ++ // Paper end - Generated/BoatStatus + } + + // Paper start +diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java +index 22b7f9c2450698b0cf0807880a3d779a0b4f1c37..171ef5bc6c47fd15f32088705d838b63de1354df 100644 +--- a/src/main/java/org/bukkit/entity/Cat.java ++++ b/src/main/java/org/bukkit/entity/Cat.java +@@ -52,6 +52,7 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC + */ + interface Type extends OldEnum, Keyed { + ++ // Paper start - Generated/CatType + Type TABBY = getType("tabby"); + Type BLACK = getType("black"); + Type RED = getType("red"); +@@ -63,6 +64,7 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC + Type WHITE = getType("white"); + Type JELLIE = getType("jellie"); + Type ALL_BLACK = getType("all_black"); ++ // Paper end - Generated/CatType + + @NotNull + private static Type getType(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java +index a78e1c431a6ea46ba7c44880e25a871f473bef41..0eb0c1e855d1444aa116acf6a2776c82292d85b9 100644 +--- a/src/main/java/org/bukkit/entity/EntityType.java ++++ b/src/main/java/org/bukkit/entity/EntityType.java +@@ -26,6 +26,7 @@ import org.jetbrains.annotations.Nullable; + public enum EntityType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - translatable + + // These strings MUST match the strings in nms.EntityTypes and are case sensitive. ++ // Paper start - Generated/EntityType + /** + * An item resting on the ground. + *

+@@ -302,6 +303,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans + */ + LIGHTNING_BOLT("lightning_bolt", LightningStrike.class, -1), + PLAYER("player", Player.class, -1, false), ++ // Paper end - Generated/EntityType + /** + * An unknown entity without an Entity Class + */ +diff --git a/src/main/java/org/bukkit/entity/Fox.java b/src/main/java/org/bukkit/entity/Fox.java +index 473a7e36ad64f866d1d2e09e2ecb2e9881668faf..1fb12e0bc77247e9f6562bb7a8d0ff35eecb54a9 100644 +--- a/src/main/java/org/bukkit/entity/Fox.java ++++ b/src/main/java/org/bukkit/entity/Fox.java +@@ -89,8 +89,10 @@ public interface Fox extends Animals, Sittable { + * Represents the various different fox types there are. + */ + public enum Type { ++ // Paper start - Generated/FoxType + RED, + SNOW; ++ // Paper end - Generated/FoxType + } + + // Paper start - Add more fox behavior API +diff --git a/src/main/java/org/bukkit/entity/Frog.java b/src/main/java/org/bukkit/entity/Frog.java +index 28a255f3a906c3988c7463a9469288fe586073a8..edce02e9445e198fdf83a8b700665e24058b1238 100644 +--- a/src/main/java/org/bukkit/entity/Frog.java ++++ b/src/main/java/org/bukkit/entity/Frog.java +@@ -50,6 +50,7 @@ public interface Frog extends Animals { + */ + interface Variant extends OldEnum, Keyed { + ++ // Paper start - Generated/FrogVariant + /** + * Temperate (brown-orange) frog. + */ +@@ -62,6 +63,7 @@ public interface Frog extends Animals { + * Cold (green) frog. + */ + Variant COLD = getVariant("cold"); ++ // Paper end - Generated/FrogVariant + + @NotNull + private static Variant getVariant(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/entity/Panda.java b/src/main/java/org/bukkit/entity/Panda.java +index 4f06870cc8d8aab93aa83b1b8165e6714884372c..16f2df7517006441d12926aff8745d6cc4dd6760 100644 +--- a/src/main/java/org/bukkit/entity/Panda.java ++++ b/src/main/java/org/bukkit/entity/Panda.java +@@ -201,6 +201,7 @@ public interface Panda extends Animals, Sittable { + + public enum Gene { + ++ // Paper start - Generated/PandaGene + NORMAL(false), + LAZY(false), + WORRIED(false), +@@ -208,6 +209,7 @@ public interface Panda extends Animals, Sittable { + BROWN(true), + WEAK(true), + AGGRESSIVE(false); ++ // Paper end - Generated/PandaGene + + private final boolean recessive; + +diff --git a/src/main/java/org/bukkit/entity/Sniffer.java b/src/main/java/org/bukkit/entity/Sniffer.java +index 15a0a733b0e5804655b5957cbf20831290d52a08..53228454d68eb57f6f0e70760ac02fd7998312f8 100644 +--- a/src/main/java/org/bukkit/entity/Sniffer.java ++++ b/src/main/java/org/bukkit/entity/Sniffer.java +@@ -74,6 +74,7 @@ public interface Sniffer extends Animals { + * Represents the current state of the Sniffer. + */ + public enum State { ++ // Paper start - Generated/SnifferState + IDLING, + FEELING_HAPPY, + SCENTING, +@@ -81,5 +82,6 @@ public interface Sniffer extends Animals { + SEARCHING, + DIGGING, + RISING; ++ // Paper end - Generated/SnifferState + } + } +diff --git a/src/main/java/org/bukkit/entity/TropicalFish.java b/src/main/java/org/bukkit/entity/TropicalFish.java +index 84bba32e80d755f094975b667f1bf2a132087f4f..4fec7b3bbeae7ab0538f3de6e83faa9c5aa0b8ad 100644 +--- a/src/main/java/org/bukkit/entity/TropicalFish.java ++++ b/src/main/java/org/bukkit/entity/TropicalFish.java +@@ -60,6 +60,7 @@ public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { / + */ + public static enum Pattern { + ++ // Paper start - Generated/TropicalFishPattern + KOB, + SUNSTREAK, + SNOOPER, +@@ -72,5 +73,6 @@ public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { / + BLOCKFISH, + BETTY, + CLAYFISH; ++ // Paper end - Generated/TropicalFishPattern + } + } +diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java +index db5c7434a7e529727b556f314d5cd8e0534114fe..b69e21a23f5cc442a6c1b94e4656a9148c43a976 100644 +--- a/src/main/java/org/bukkit/entity/Villager.java ++++ b/src/main/java/org/bukkit/entity/Villager.java +@@ -171,6 +171,7 @@ public interface Villager extends AbstractVillager { + */ + interface Type extends OldEnum, Keyed { + ++ // Paper start - Generated/VillagerType + Type DESERT = getType("desert"); + Type JUNGLE = getType("jungle"); + Type PLAINS = getType("plains"); +@@ -178,6 +179,7 @@ public interface Villager extends AbstractVillager { + Type SNOW = getType("snow"); + Type SWAMP = getType("swamp"); + Type TAIGA = getType("taiga"); ++ // Paper end - Generated/VillagerType + + @NotNull + private static Type getType(@NotNull String key) { +@@ -218,6 +220,7 @@ public interface Villager extends AbstractVillager { + */ + interface Profession extends OldEnum, Keyed, net.kyori.adventure.translation.Translatable { + ++ // Paper start - Generated/VillagerProfession + Profession NONE = getProfession("none"); + /** + * Armorer profession. Wears a black apron. Armorers primarily trade for +@@ -289,6 +292,7 @@ public interface Villager extends AbstractVillager { + * trade for iron and diamond weapons, sometimes enchanted. + */ + Profession WEAPONSMITH = getProfession("weaponsmith"); ++ // Paper end - Generated/VillagerProfession + + @NotNull + private static Profession getProfession(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java +index 4b84c04675775e2a606630b00de8afe51665cebc..263e65af2ed3818215802de75034fe503b3d9445 100644 +--- a/src/main/java/org/bukkit/entity/Wolf.java ++++ b/src/main/java/org/bukkit/entity/Wolf.java +@@ -94,6 +94,7 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar + */ + interface Variant extends Keyed { + ++ // Paper start - Generated/WolfVariant + Variant PALE = getVariant("pale"); + Variant SPOTTED = getVariant("spotted"); + Variant SNOWY = getVariant("snowy"); +@@ -103,6 +104,7 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar + Variant WOODS = getVariant("woods"); + Variant CHESTNUT = getVariant("chestnut"); + Variant STRIPED = getVariant("striped"); ++ // Paper end - Generated/WolfVariant + + @NotNull + private static Variant getVariant(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/entity/memory/MemoryKey.java b/src/main/java/org/bukkit/entity/memory/MemoryKey.java +index b757aed1bde330d8720a900f8e0877f77ef14c4a..6903f9c0e78ea64612ac55bac88c15467e73bcdc 100644 +--- a/src/main/java/org/bukkit/entity/memory/MemoryKey.java ++++ b/src/main/java/org/bukkit/entity/memory/MemoryKey.java +@@ -46,6 +46,7 @@ public final class MemoryKey implements Keyed { + + private static final Map> MEMORY_KEYS = new HashMap<>(); + // ++ // Paper start - Generated/MemoryKey + public static final MemoryKey HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class); + public static final MemoryKey POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class); + public static final MemoryKey JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("job_site"), Location.class); +@@ -69,6 +70,7 @@ public final class MemoryKey implements Keyed { + public static final MemoryKey LIKED_NOTEBLOCK_POSITION = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock"), Location.class); + public static final MemoryKey LIKED_NOTEBLOCK_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock_cooldown_ticks"), Integer.class); + public static final MemoryKey ITEM_PICKUP_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("item_pickup_cooldown_ticks"), Integer.class); ++ // Paper end - Generated/MemoryKey + /** + * @deprecated this constant uses the wrong generic type, the sniffer now stores different positions + * from possibly different worlds. Use the relevant methods in {@link org.bukkit.entity.Sniffer} directly +diff --git a/src/main/java/org/bukkit/generator/structure/Structure.java b/src/main/java/org/bukkit/generator/structure/Structure.java +index 978054ee364f9a3330525b9b50da5325ebb6ef57..59bef108595b755a0ba49edbb758a26eac44c28c 100644 +--- a/src/main/java/org/bukkit/generator/structure/Structure.java ++++ b/src/main/java/org/bukkit/generator/structure/Structure.java +@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull; + */ + public abstract class Structure implements Keyed { + ++ // Paper start - Generated/Structure + public static final Structure PILLAGER_OUTPOST = getStructure("pillager_outpost"); + public static final Structure MINESHAFT = getStructure("mineshaft"); + public static final Structure MINESHAFT_MESA = getStructure("mineshaft_mesa"); +@@ -48,6 +49,7 @@ public abstract class Structure implements Keyed { + public static final Structure ANCIENT_CITY = getStructure("ancient_city"); + public static final Structure TRAIL_RUINS = getStructure("trail_ruins"); + public static final Structure TRIAL_CHAMBERS = getStructure("trial_chambers"); ++ // Paper end - Generated/Structure + + private static Structure getStructure(String name) { + return Registry.STRUCTURE.get(NamespacedKey.minecraft(name)); +diff --git a/src/main/java/org/bukkit/generator/structure/StructureType.java b/src/main/java/org/bukkit/generator/structure/StructureType.java +index 2f908d5545d76ea25e26f6a4be579460512b5faf..77a03c7c35da902a802a90a41d8583172a9ca992 100644 +--- a/src/main/java/org/bukkit/generator/structure/StructureType.java ++++ b/src/main/java/org/bukkit/generator/structure/StructureType.java +@@ -14,6 +14,7 @@ import org.bukkit.Registry; + */ + public abstract class StructureType implements Keyed { + ++ // Paper start - Generated/StructureType + public static final StructureType BURIED_TREASURE = getStructureType("buried_treasure"); + public static final StructureType DESERT_PYRAMID = getStructureType("desert_pyramid"); + public static final StructureType END_CITY = getStructureType("end_city"); +@@ -30,6 +31,7 @@ public abstract class StructureType implements Keyed { + public static final StructureType STRONGHOLD = getStructureType("stronghold"); + public static final StructureType SWAMP_HUT = getStructureType("swamp_hut"); + public static final StructureType WOODLAND_MANSION = getStructureType("woodland_mansion"); ++ // Paper end - Generated/StructureType + + private static StructureType getStructureType(String name) { + return Registry.STRUCTURE_TYPE.get(NamespacedKey.minecraft(name)); +diff --git a/src/main/java/org/bukkit/inventory/ItemRarity.java b/src/main/java/org/bukkit/inventory/ItemRarity.java +index cbce835ed6d44e5b8c9aaae4e36a77f8e5bed45f..4bac8e092bc59405a9bba15e62b513cc643078c4 100644 +--- a/src/main/java/org/bukkit/inventory/ItemRarity.java ++++ b/src/main/java/org/bukkit/inventory/ItemRarity.java +@@ -6,6 +6,7 @@ package org.bukkit.inventory; + */ + public enum ItemRarity { + ++ // Paper start - Generated/ItemRarity + /** + * White item name. + */ +@@ -22,6 +23,7 @@ public enum ItemRarity { + * Light purple item name. + */ + EPIC(net.kyori.adventure.text.format.NamedTextColor.LIGHT_PURPLE); // Paper ++ // Paper end - Generated/ItemRarity + // Paper start - improve ItemRarity + private final net.kyori.adventure.text.format.NamedTextColor color; + ItemRarity(final net.kyori.adventure.text.format.NamedTextColor color) { +diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java +index 5b4449f63595193efcd1329b9df0558cfaa2c7b2..8b53141a72c312a5cc821fc88eda72358e14d1a0 100644 +--- a/src/main/java/org/bukkit/inventory/ItemType.java ++++ b/src/main/java/org/bukkit/inventory/ItemType.java +@@ -90,6 +90,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans + } + + // ++ // Paper start - Generated/ItemType + /** + * Air does not have any ItemMeta + */ +@@ -2111,7 +2112,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans + ItemType.Typed OMINOUS_BOTTLE = getItemType("ominous_bottle"); + ItemType.Typed BREEZE_ROD = getItemType("breeze_rod"); + +- ++ // Paper end - Generated/ItemType + // + + @NotNull +diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java +index 9e98625d42199c169f79335bb6231ec355c3b930..95b85b3f4e3b9cf99342aaa03d31534dc6dca807 100644 +--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java ++++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java +@@ -11,6 +11,7 @@ import org.bukkit.Translatable; + */ + public interface TrimMaterial extends Keyed, Translatable { + ++ // Paper start - Generated/TrimMaterial + /** + * {@link Material#QUARTZ}. + */ +@@ -51,6 +52,12 @@ public interface TrimMaterial extends Keyed, Translatable { + * {@link Material#AMETHYST_SHARD}. + */ + public static final TrimMaterial AMETHYST = Registry.TRIM_MATERIAL.get(NamespacedKey.minecraft("amethyst")); ++ // Paper end - Generated/TrimMaterial ++ ++ private static TrimMaterial getTrimMaterial(String name) { ++ NamespacedKey key = NamespacedKey.minecraft(name); ++ return io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.TRIM_MATERIAL).get(key); ++ } + + // Paper start - adventure + /** +diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java +index b84e495cb4bb4f833b6193c72ae241f0c69d491c..5b1afd2e882c704373bc675551c6e75ffd6870d3 100644 +--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java ++++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java +@@ -11,6 +11,7 @@ import org.bukkit.Translatable; + */ + public interface TrimPattern extends Keyed, Translatable { + ++ // Paper start - Generated/TrimPattern + /** + * {@link Material#SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE}. + */ +@@ -83,6 +84,12 @@ public interface TrimPattern extends Keyed, Translatable { + * {@link Material#BOLT_ARMOR_TRIM_SMITHING_TEMPLATE}. + */ + public static final TrimPattern BOLT = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft("bolt")); ++ // Paper end - Generated/TrimPattern ++ ++ private static TrimPattern getTrimPattern(String name) { ++ NamespacedKey key = NamespacedKey.minecraft(name); ++ return io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.TRIM_PATTERN).get(key); ++ } + + // Paper start - adventure + /** +diff --git a/src/main/java/org/bukkit/inventory/recipe/CookingBookCategory.java b/src/main/java/org/bukkit/inventory/recipe/CookingBookCategory.java +index 9990a7abf8f910ff5da45b6e5d94902e825e2096..54cd8b54e9516f6d900f9a550fc220063b494166 100644 +--- a/src/main/java/org/bukkit/inventory/recipe/CookingBookCategory.java ++++ b/src/main/java/org/bukkit/inventory/recipe/CookingBookCategory.java +@@ -5,7 +5,9 @@ package org.bukkit.inventory.recipe; + */ + public enum CookingBookCategory { + ++ // Paper start - Generated/CookingBookCategory + FOOD, + BLOCKS, + MISC; ++ // Paper end - Generated/CookingBookCategory + } +diff --git a/src/main/java/org/bukkit/inventory/recipe/CraftingBookCategory.java b/src/main/java/org/bukkit/inventory/recipe/CraftingBookCategory.java +index 09a6a1b9b9ffb1e269bdaa1efc19cd8bedc2b499..3eecca87f204dcaebf580b7284859c4300057715 100644 +--- a/src/main/java/org/bukkit/inventory/recipe/CraftingBookCategory.java ++++ b/src/main/java/org/bukkit/inventory/recipe/CraftingBookCategory.java +@@ -5,8 +5,10 @@ package org.bukkit.inventory.recipe; + */ + public enum CraftingBookCategory { + ++ // Paper start - Generated/CraftingBookCategory + BUILDING, + REDSTONE, + EQUIPMENT, + MISC; ++ // Paper end - Generated/CraftingBookCategory + } +diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java +index a5efc52e68c602d84dc0948246a1665448344930..0c31adac142c1f8ca94f36434a7e95403a3de422 100644 +--- a/src/main/java/org/bukkit/map/MapCursor.java ++++ b/src/main/java/org/bukkit/map/MapCursor.java +@@ -287,6 +287,7 @@ public final class MapCursor { + */ + public interface Type extends OldEnum, Keyed { + ++ // Paper start - Generated/MapCursorType + Type PLAYER = getType("player"); + Type FRAME = getType("frame"); + Type RED_MARKER = getType("red_marker"); +@@ -336,6 +337,7 @@ public final class MapCursor { + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation + Type SWAMP_HUT = getType("swamp_hut"); + Type TRIAL_CHAMBERS = getType("trial_chambers"); ++ // Paper end - Generated/MapCursorType + + @NotNull + private static Type getType(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java +index c80faa079eca1564847070f0338fc98024639829..825b6c7b4e6b24f8d49da7b44f37e8a5ddc2e2c1 100644 +--- a/src/main/java/org/bukkit/map/MapPalette.java ++++ b/src/main/java/org/bukkit/map/MapPalette.java +@@ -41,6 +41,7 @@ public final class MapPalette { + + @NotNull + static final Color[] colors = { ++ // Paper start - Generated/MapPalette#colors + c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), + c(89, 125, 39), c(109, 153, 48), c(127, 178, 56), c(67, 94, 29), + c(174, 164, 115), c(213, 201, 140), c(247, 233, 163), c(130, 123, 86), +@@ -103,6 +104,7 @@ public final class MapPalette { + c(70, 70, 70), c(86, 86, 86), c(100, 100, 100), c(52, 52, 52), + c(152, 123, 103), c(186, 150, 126), c(216, 175, 147), c(114, 92, 77), + c(89, 117, 105), c(109, 144, 129), c(127, 167, 150), c(67, 88, 79) ++ // Paper end - Generated/MapPalette#colors + }; + + // Interface +diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java +index c82cc9d9db5cb0e0e3c02f6a9564fc935ee594aa..5b465cfc67553762bc1eb9c8d594c70becbcba42 100644 +--- a/src/main/java/org/bukkit/potion/PotionType.java ++++ b/src/main/java/org/bukkit/potion/PotionType.java +@@ -15,6 +15,7 @@ import org.jetbrains.annotations.Nullable; + * the Creative mode inventory + */ + public enum PotionType implements Keyed, io.papermc.paper.world.flag.FeatureDependant { // Paper - feature flag API ++ // Paper start - Generated/PotionType + WATER("water"), + MUNDANE("mundane"), + THICK("thick"), +@@ -62,6 +63,7 @@ public enum PotionType implements Keyed, io.papermc.paper.world.flag.FeatureDepe + OOZING("oozing"), + INFESTED("infested"), + ; ++ // Paper end - Generated/PotionType + + private final NamespacedKey key; + private final Supplier internalPotionDataSupplier; +diff --git a/src/main/java/org/bukkit/scoreboard/DisplaySlot.java b/src/main/java/org/bukkit/scoreboard/DisplaySlot.java +index 21cd2ba659504c3a1eb95226539a5701d0c324db..3f6044892ad17bb99786e0009c937d294e90aa09 100644 +--- a/src/main/java/org/bukkit/scoreboard/DisplaySlot.java ++++ b/src/main/java/org/bukkit/scoreboard/DisplaySlot.java +@@ -6,6 +6,7 @@ import net.kyori.adventure.text.format.NamedTextColor; // Paper + */ + public enum DisplaySlot { + // Paper start ++ // Paper start - Generated/DisplaySlot + BELOW_NAME("below_name"), + PLAYER_LIST("list"), + SIDEBAR("sidebar"), +@@ -25,6 +26,7 @@ public enum DisplaySlot { + SIDEBAR_TEAM_LIGHT_PURPLE(NamedTextColor.LIGHT_PURPLE), + SIDEBAR_TEAM_YELLOW(NamedTextColor.YELLOW), + SIDEBAR_TEAM_WHITE(NamedTextColor.WHITE); ++ // Paper end - Generated/DisplaySlot + + public static final net.kyori.adventure.util.Index NAMES = net.kyori.adventure.util.Index.create(DisplaySlot.class, DisplaySlot::getId); + diff --git a/patches/api/0497-cleanup-block-data.patch b/patches/api/0497-cleanup-block-data.patch new file mode 100644 index 0000000000..7aaf091419 --- /dev/null +++ b/patches/api/0497-cleanup-block-data.patch @@ -0,0 +1,325 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Sun, 3 Mar 2024 16:02:25 +0100 +Subject: [PATCH] cleanup block data + + +diff --git a/src/main/java/org/bukkit/block/Orientation.java b/src/main/java/org/bukkit/block/Orientation.java +new file mode 100644 +index 0000000000000000000000000000000000000000..f6b25ac08db75d4ddec498295b932d8efccdcfd4 +--- /dev/null ++++ b/src/main/java/org/bukkit/block/Orientation.java +@@ -0,0 +1,20 @@ ++package org.bukkit.block; ++ ++/** ++ * Represents the face and the direction of a block ++ */ ++public enum Orientation { ++ ++ DOWN_EAST, ++ DOWN_NORTH, ++ DOWN_SOUTH, ++ DOWN_WEST, ++ UP_EAST, ++ UP_NORTH, ++ UP_SOUTH, ++ UP_WEST, ++ WEST_UP, ++ EAST_UP, ++ NORTH_UP, ++ SOUTH_UP; ++} +diff --git a/src/main/java/org/bukkit/block/data/type/CaveVinesPlant.java b/src/main/java/org/bukkit/block/data/type/CaveVinesPlant.java +index a7f75a98e018c63280f49aff1654ed1baea1f97f..2255ed831d0779d140cca5a6ec04f4db5c27ef9f 100644 +--- a/src/main/java/org/bukkit/block/data/type/CaveVinesPlant.java ++++ b/src/main/java/org/bukkit/block/data/type/CaveVinesPlant.java +@@ -11,8 +11,21 @@ public interface CaveVinesPlant extends BlockData { + * Gets the value of the 'berries' property. + * + * @return the 'berries' value ++ * @deprecated bad name, use {@link #hasBerries()} + */ +- boolean isBerries(); ++ // Paper start ++ @Deprecated ++ default boolean isBerries() { ++ return this.hasBerries(); ++ } ++ ++ /** ++ * Gets the value of the 'berries' property. ++ * ++ * @return the 'berries' value ++ */ ++ boolean hasBerries(); ++ // Paper end + + /** + * Sets the value of the 'berries' property. +diff --git a/src/main/java/org/bukkit/block/data/type/Crafter.java b/src/main/java/org/bukkit/block/data/type/Crafter.java +index c15fdf9e82cf1793bdcaa9a3a031c9cfa05541bc..d685b38b80cdb40cc061414a9a0bc911a36dd990 100644 +--- a/src/main/java/org/bukkit/block/data/type/Crafter.java ++++ b/src/main/java/org/bukkit/block/data/type/Crafter.java +@@ -48,18 +48,23 @@ public interface Crafter extends BlockData { + * @return the 'orientation' value + */ + @NotNull +- Orientation getOrientation(); ++ org.bukkit.block.Orientation getOrientation(); // Paper + + /** + * Sets the value of the 'orientation' property. + * + * @param orientation the new 'orientation' value + */ +- void setOrientation(@NotNull Orientation orientation); ++ void setOrientation(@NotNull org.bukkit.block.Orientation orientation); // Paper + + /** + * The directions the Crafter can be oriented. ++ * ++ * @deprecated this property is not specific to the Crafter, use ++ * {@link org.bukkit.block.Orientation} instead. All references ++ * to this enum will be redirected to that enum at runtime. + */ ++ @Deprecated // Paper + public enum Orientation { + + DOWN_EAST, +diff --git a/src/main/java/org/bukkit/block/data/type/DecoratedPot.java b/src/main/java/org/bukkit/block/data/type/DecoratedPot.java +index b3d290dbfdcbadcbadcb54e6b414e423eba80cc6..66bf4d33d432d4ed7b3de47ceb860d2e68050d99 100644 +--- a/src/main/java/org/bukkit/block/data/type/DecoratedPot.java ++++ b/src/main/java/org/bukkit/block/data/type/DecoratedPot.java +@@ -6,14 +6,16 @@ import org.bukkit.block.data.Waterlogged; + public interface DecoratedPot extends Directional, Waterlogged { + // Paper start - add missing block data api + /** +- * @return whether the pot is cracked ++ * Gets the value of the 'cracked' property. ++ * ++ * @return the 'cracked' value + */ + public boolean isCracked(); + + /** +- * Set whether the pot is cracked. ++ * Sets the value of the 'cracked' property. + * +- * @param cracked whether the pot is cracked ++ * @param cracked the new 'cracked' value + */ + public void setCracked(boolean cracked); + // Paper end - add missing block data api +diff --git a/src/main/java/org/bukkit/block/data/type/Jigsaw.java b/src/main/java/org/bukkit/block/data/type/Jigsaw.java +index c70c755cdb36c8afc70988340b061c39c492e14e..9517465a535231e29b0c9b4740f548051a9924d8 100644 +--- a/src/main/java/org/bukkit/block/data/type/Jigsaw.java ++++ b/src/main/java/org/bukkit/block/data/type/Jigsaw.java +@@ -14,18 +14,23 @@ public interface Jigsaw extends BlockData { + * @return the 'orientation' value + */ + @NotNull +- Orientation getOrientation(); ++ org.bukkit.block.Orientation getOrientation(); // Paper + + /** + * Sets the value of the 'orientation' property. + * + * @param orientation the new 'orientation' value + */ +- void setOrientation(@NotNull Orientation orientation); ++ void setOrientation(@NotNull org.bukkit.block.Orientation orientation); // Paper + + /** + * The directions the Jigsaw can be oriented. ++ * ++ * @deprecated this property is not specific to the Jigsaw, use ++ * {@link org.bukkit.block.Orientation} instead. All references ++ * to this enum will be redirected to that enum at runtime. + */ ++ @Deprecated // Paper + public enum Orientation { + + DOWN_EAST, +diff --git a/src/main/java/org/bukkit/block/data/type/Jukebox.java b/src/main/java/org/bukkit/block/data/type/Jukebox.java +index 5e37136207e939c6278c6c2589051fc34eca3496..e599824cc4e9c6e32cf37c2301bb767e4bc67dd9 100644 +--- a/src/main/java/org/bukkit/block/data/type/Jukebox.java ++++ b/src/main/java/org/bukkit/block/data/type/Jukebox.java +@@ -14,4 +14,13 @@ public interface Jukebox extends BlockData { + * @return the 'has_record' value + */ + boolean hasRecord(); ++ ++ // Paper start - missing api ++ /** ++ * Sets the value of the 'has_record' property. ++ * ++ * @param hasRecord the new 'has_record' value ++ */ ++ void setHasRecord(boolean hasRecord); ++ // Paper end - missing api + } +diff --git a/src/main/java/org/bukkit/block/data/type/Lectern.java b/src/main/java/org/bukkit/block/data/type/Lectern.java +index 11b4a173f96e8c7cd92ef0146c3b0cca91e87c90..229577b82b917c7c4aa0e1b8ce66c832c5aca004 100644 +--- a/src/main/java/org/bukkit/block/data/type/Lectern.java ++++ b/src/main/java/org/bukkit/block/data/type/Lectern.java +@@ -15,4 +15,13 @@ public interface Lectern extends Directional, Powerable { + * @return the 'has_book' value + */ + boolean hasBook(); ++ ++ // Paper start - missing api ++ /** ++ * Sets the value of the 'has_book' property. ++ * ++ * @param hasBook the new 'has_book' value ++ */ ++ void setHasBook(boolean hasBook); ++ // Paper end - missing api + } +diff --git a/src/main/java/org/bukkit/block/data/type/SculkSensor.java b/src/main/java/org/bukkit/block/data/type/SculkSensor.java +index 1af390e2ec3b8d8943c58e64edf8869b1820110f..4d779b676e81bd4cb79a8d8ee56436f2fabff5c0 100644 +--- a/src/main/java/org/bukkit/block/data/type/SculkSensor.java ++++ b/src/main/java/org/bukkit/block/data/type/SculkSensor.java +@@ -13,16 +13,43 @@ public interface SculkSensor extends AnaloguePowerable, Waterlogged { + * Gets the value of the 'sculk_sensor_phase' property. + * + * @return the 'sculk_sensor_phase' value ++ * @deprecated bad name, use {@link #getSculkSensorPhase()} + */ + @NotNull +- Phase getPhase(); ++ // Paper start ++ @Deprecated ++ default Phase getPhase() { ++ return this.getSculkSensorPhase(); ++ } ++ // Paper end ++ ++ /** ++ * Sets the value of the 'sculk_sensor_phase' property. ++ * ++ * @param phase the new 'sculk_sensor_phase' value ++ * @deprecated bad name, use {@link #setSculkSensorPhase(Phase)} ++ */ ++ // Paper start ++ @Deprecated ++ default void setPhase(@NotNull Phase phase) { ++ this.setSculkSensorPhase(phase); ++ } ++ ++ /** ++ * Gets the value of the 'sculk_sensor_phase' property. ++ * ++ * @return the 'sculk_sensor_phase' value ++ */ ++ @NotNull ++ Phase getSculkSensorPhase(); + + /** + * Sets the value of the 'sculk_sensor_phase' property. + * + * @param phase the new 'sculk_sensor_phase' value + */ +- void setPhase(@NotNull Phase phase); ++ void setSculkSensorPhase(@NotNull Phase phase); ++ // Paper end + + /** + * The Phase of the sensor. +diff --git a/src/main/java/org/bukkit/block/data/type/Switch.java b/src/main/java/org/bukkit/block/data/type/Switch.java +index d91a07c7bcb36b3810bb2db89afef1eefd89253d..f00587773935b72d61d05acffb9c1ec865642c1e 100644 +--- a/src/main/java/org/bukkit/block/data/type/Switch.java ++++ b/src/main/java/org/bukkit/block/data/type/Switch.java +@@ -7,6 +7,13 @@ import org.jetbrains.annotations.NotNull; + + public interface Switch extends Directional, FaceAttachable, Powerable { + ++ // Paper start ++ @NotNull ++ AttachedFace getAttachedFace(); ++ ++ void setAttachedFace(@NotNull AttachedFace face); ++ // Paper end ++ + /** + * Gets the value of the 'face' property. + * +@@ -14,8 +21,12 @@ public interface Switch extends Directional, FaceAttachable, Powerable { + * @deprecated use {@link #getAttachedFace()} + */ + @NotNull ++ // Paper start + @Deprecated +- Face getFace(); ++ default Face getFace() { ++ return Face.valueOf(this.getAttachedFace().name()); ++ } ++ // Paper end + + /** + * Sets the value of the 'face' property. +@@ -23,8 +34,12 @@ public interface Switch extends Directional, FaceAttachable, Powerable { + * @param face the new 'face' value + * @deprecated use {@link #setAttachedFace(AttachedFace)} + */ ++ // Paper start + @Deprecated +- void setFace(@NotNull Face face); ++ default void setFace(@NotNull Face face) { ++ this.setAttachedFace(AttachedFace.valueOf(face.name())); ++ } ++ // Paper end + + /** + * The face to which a switch type block is stuck. +diff --git a/src/main/java/org/bukkit/block/data/type/Vault.java b/src/main/java/org/bukkit/block/data/type/Vault.java +index 87e46dfb951b6e4b753af7c31efd444e549052b9..a112287376a152089d9d2e2e7bfe8f16da28fbfb 100644 +--- a/src/main/java/org/bukkit/block/data/type/Vault.java ++++ b/src/main/java/org/bukkit/block/data/type/Vault.java +@@ -14,16 +14,43 @@ public interface Vault extends Directional { + * Gets the value of the 'vault_state' property. + * + * @return the 'vault_state' value ++ * @deprecated use {@link #getVaultState()} + */ + @NotNull +- State getTrialSpawnerState(); ++ // Paper start ++ @Deprecated ++ default State getTrialSpawnerState() { ++ return this.getVaultState(); ++ } ++ // Paper end ++ ++ /** ++ * Sets the value of the 'vault_state' property. ++ * ++ * @param state the new 'vault_state' value ++ * @deprecated use {@link #setVaultState(State)} ++ */ ++ // Paper start ++ @Deprecated ++ default void setTrialSpawnerState(@NotNull State state) { ++ this.setVaultState(state); ++ } ++ ++ /** ++ * Gets the value of the 'vault_state' property. ++ * ++ * @return the 'vault_state' value ++ */ ++ @NotNull ++ State getVaultState(); + + /** + * Sets the value of the 'vault_state' property. + * + * @param state the new 'vault_state' value + */ +- void setTrialSpawnerState(@NotNull State state); ++ void setVaultState(@NotNull State state); ++ // Paper end + + /** + * Gets the value of the 'ominous' property. diff --git a/patches/server/0004-Test-changes.patch b/patches/server/0004-Test-changes.patch index 97ddef9404..0585edd028 100644 --- a/patches/server/0004-Test-changes.patch +++ b/patches/server/0004-Test-changes.patch @@ -338,6 +338,18 @@ index 0000000000000000000000000000000000000000..6cbf11c898439834cffb99ef84e5df14 +public @interface MethodParameterSource { + String[] value() default {}; +} +diff --git a/src/test/java/org/bukkit/MaterialTest.java b/src/test/java/org/bukkit/MaterialTest.java +index 40b540a382f8c64a59a8df637e2c4c0b60ab3af9..c0d576d7cacf2a71a5922f9e959b5e15db2cfcc6 100644 +--- a/src/test/java/org/bukkit/MaterialTest.java ++++ b/src/test/java/org/bukkit/MaterialTest.java +@@ -51,6 +51,7 @@ public class MaterialTest extends AbstractTestingBase { + } + + @Test ++ @org.junit.jupiter.api.Disabled // Paper - order is now alphabetically + public void verifyMaterialOrder() { + List expectedOrder = new ArrayList<>(Material.values().length); + diff --git a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java index ebcb65cb74acdb9d1bcf2b4b3551a2dc6d809bc9..7d9dbed7281099b78d7f898885b37cdcfe8b099f 100644 --- a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java diff --git a/patches/server/0353-Implement-Mob-Goal-API.patch b/patches/server/0353-Implement-Mob-Goal-API.patch index a3f61fbfbf..fa2791402d 100644 --- a/patches/server/0353-Implement-Mob-Goal-API.patch +++ b/patches/server/0353-Implement-Mob-Goal-API.patch @@ -18,159 +18,37 @@ index e7c00486bd831578008c02fcda13f3a555e6a2f1..688e901b75e95941e0101cc7d0c4effa testImplementation("org.mockito:mockito-core:5.11.0") diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java new file mode 100644 -index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd853df055f +index 0000000000000000000000000000000000000000..07a20ffc5a87993aeac3fbb5965f11a013be77a1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -@@ -0,0 +1,377 @@ +@@ -0,0 +1,240 @@ +package com.destroystokyo.paper.entity.ai; + +import com.destroystokyo.paper.entity.RangedEntity; -+import com.google.common.collect.BiMap; -+import com.google.common.collect.HashBiMap; -+import io.papermc.paper.util.ObfHelper; ++import com.google.common.base.CaseFormat; +import java.lang.reflect.Constructor; +import java.util.EnumSet; +import java.util.HashMap; -+import java.util.HashSet; +import java.util.Map; -+import java.util.Set; -+import net.minecraft.world.entity.FlyingMob; -+import net.minecraft.world.entity.PathfinderMob; -+import net.minecraft.world.entity.TamableAnimal; ++import io.papermc.paper.entity.SchoolableFish; ++import io.papermc.paper.util.ObfHelper; +import net.minecraft.world.entity.ai.goal.Goal; -+import net.minecraft.world.entity.ambient.AmbientCreature; -+import net.minecraft.world.entity.animal.AbstractFish; -+import net.minecraft.world.entity.animal.AbstractGolem; -+import net.minecraft.world.entity.animal.AbstractSchoolingFish; -+import net.minecraft.world.entity.animal.Animal; -+import net.minecraft.world.entity.animal.Pufferfish; -+import net.minecraft.world.entity.animal.ShoulderRidingEntity; -+import net.minecraft.world.entity.animal.SnowGolem; -+import net.minecraft.world.entity.animal.WaterAnimal; -+import net.minecraft.world.entity.animal.camel.Camel; -+import net.minecraft.world.entity.animal.horse.AbstractChestedHorse; -+import net.minecraft.world.entity.boss.wither.WitherBoss; -+import net.minecraft.world.entity.monster.AbstractIllager; -+import net.minecraft.world.entity.monster.EnderMan; -+import net.minecraft.world.entity.monster.PatrollingMonster; +import net.minecraft.world.entity.monster.RangedAttackMob; -+import net.minecraft.world.entity.monster.SpellcasterIllager; -+import net.minecraft.world.entity.monster.ZombifiedPiglin; -+import net.minecraft.world.entity.monster.breeze.Breeze; -+import net.minecraft.world.entity.monster.piglin.AbstractPiglin; ++import org.apache.commons.lang3.math.NumberUtils; +import org.bukkit.NamespacedKey; -+import org.bukkit.entity.AbstractHorse; -+import org.bukkit.entity.AbstractSkeleton; -+import org.bukkit.entity.AbstractVillager; -+import org.bukkit.entity.Ageable; -+import org.bukkit.entity.Ambient; -+import org.bukkit.entity.Animals; -+import org.bukkit.entity.Bat; -+import org.bukkit.entity.Bee; -+import org.bukkit.entity.Blaze; -+import org.bukkit.entity.Cat; -+import org.bukkit.entity.CaveSpider; -+import org.bukkit.entity.ChestedHorse; -+import org.bukkit.entity.Chicken; -+import org.bukkit.entity.Cod; -+import org.bukkit.entity.Cow; -+import org.bukkit.entity.Creature; -+import org.bukkit.entity.Creeper; -+import org.bukkit.entity.Dolphin; -+import org.bukkit.entity.Donkey; -+import org.bukkit.entity.Drowned; -+import org.bukkit.entity.ElderGuardian; -+import org.bukkit.entity.EnderDragon; -+import org.bukkit.entity.Enderman; -+import org.bukkit.entity.Endermite; -+import org.bukkit.entity.Evoker; -+import org.bukkit.entity.Fish; -+import org.bukkit.entity.Flying; -+import org.bukkit.entity.Fox; -+import org.bukkit.entity.Ghast; -+import org.bukkit.entity.Giant; -+import org.bukkit.entity.Golem; -+import org.bukkit.entity.Guardian; -+import org.bukkit.entity.Hoglin; -+import org.bukkit.entity.Horse; -+import org.bukkit.entity.Husk; -+import org.bukkit.entity.Illager; -+import org.bukkit.entity.Illusioner; -+import org.bukkit.entity.IronGolem; -+import org.bukkit.entity.Llama; -+import org.bukkit.entity.MagmaCube; -+import org.bukkit.entity.Mob; -+import org.bukkit.entity.Monster; -+import org.bukkit.entity.Mule; -+import org.bukkit.entity.MushroomCow; -+import org.bukkit.entity.Ocelot; -+import org.bukkit.entity.Panda; -+import org.bukkit.entity.Parrot; -+import org.bukkit.entity.Phantom; -+import org.bukkit.entity.Pig; -+import org.bukkit.entity.PigZombie; -+import org.bukkit.entity.Piglin; -+import org.bukkit.entity.PiglinAbstract; -+import org.bukkit.entity.PiglinBrute; -+import org.bukkit.entity.Pillager; -+import org.bukkit.entity.PolarBear; -+import org.bukkit.entity.PufferFish; -+import org.bukkit.entity.Rabbit; -+import org.bukkit.entity.Raider; -+import org.bukkit.entity.Ravager; -+import org.bukkit.entity.Salmon; -+import org.bukkit.entity.Sheep; -+import org.bukkit.entity.Shulker; -+import org.bukkit.entity.Silverfish; -+import org.bukkit.entity.Skeleton; -+import org.bukkit.entity.SkeletonHorse; -+import org.bukkit.entity.Slime; -+import org.bukkit.entity.Snowman; -+import org.bukkit.entity.Spellcaster; -+import org.bukkit.entity.Spider; -+import org.bukkit.entity.Squid; -+import org.bukkit.entity.Stray; -+import org.bukkit.entity.Strider; -+import org.bukkit.entity.Tameable; -+import org.bukkit.entity.TraderLlama; -+import org.bukkit.entity.TropicalFish; -+import org.bukkit.entity.Turtle; -+import org.bukkit.entity.Vex; -+import org.bukkit.entity.Villager; -+import org.bukkit.entity.Vindicator; -+import org.bukkit.entity.WanderingTrader; -+import org.bukkit.entity.WaterMob; -+import org.bukkit.entity.Witch; -+import org.bukkit.entity.Wither; -+import org.bukkit.entity.WitherSkeleton; -+import org.bukkit.entity.Wolf; -+import org.bukkit.entity.Zoglin; -+import org.bukkit.entity.Zombie; -+import org.bukkit.entity.ZombieHorse; -+import org.bukkit.entity.ZombieVillager; ++import org.bukkit.entity.*; + +public class MobGoalHelper { + -+ private static final BiMap deobfuscationMap = HashBiMap.create(); + private static final Map, Class> entityClassCache = new HashMap<>(); + private static final Map, Class> bukkitMap = new HashMap<>(); + -+ static final Set ignored = new HashSet<>(); -+ + static { -+ // TODO these kinda should be checked on each release, in case obfuscation changes -+ deobfuscationMap.put("abstract_skeleton_1", "abstract_skeleton_melee"); -+ -+ ignored.add("goal_selector_1"); -+ ignored.add("goal_selector_2"); -+ ignored.add("selector_1"); -+ ignored.add("selector_2"); -+ ignored.add("wrapped"); -+ ++ // + bukkitMap.put(net.minecraft.world.entity.Mob.class, Mob.class); + bukkitMap.put(net.minecraft.world.entity.AgeableMob.class, Ageable.class); -+ bukkitMap.put(AmbientCreature.class, Ambient.class); -+ bukkitMap.put(Animal.class, Animals.class); ++ bukkitMap.put(net.minecraft.world.entity.ambient.AmbientCreature.class, Ambient.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.Animal.class, Animals.class); + bukkitMap.put(net.minecraft.world.entity.ambient.Bat.class, Bat.class); + bukkitMap.put(net.minecraft.world.entity.animal.Bee.class, Bee.class); + bukkitMap.put(net.minecraft.world.entity.monster.Blaze.class, Blaze.class); @@ -179,51 +57,51 @@ index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd8 + bukkitMap.put(net.minecraft.world.entity.animal.Chicken.class, Chicken.class); + bukkitMap.put(net.minecraft.world.entity.animal.Cod.class, Cod.class); + bukkitMap.put(net.minecraft.world.entity.animal.Cow.class, Cow.class); -+ bukkitMap.put(PathfinderMob.class, Creature.class); ++ bukkitMap.put(net.minecraft.world.entity.PathfinderMob.class, Creature.class); + bukkitMap.put(net.minecraft.world.entity.monster.Creeper.class, Creeper.class); + bukkitMap.put(net.minecraft.world.entity.animal.Dolphin.class, Dolphin.class); + bukkitMap.put(net.minecraft.world.entity.monster.Drowned.class, Drowned.class); + bukkitMap.put(net.minecraft.world.entity.boss.enderdragon.EnderDragon.class, EnderDragon.class); -+ bukkitMap.put(EnderMan.class, Enderman.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.EnderMan.class, Enderman.class); + bukkitMap.put(net.minecraft.world.entity.monster.Endermite.class, Endermite.class); + bukkitMap.put(net.minecraft.world.entity.monster.Evoker.class, Evoker.class); -+ bukkitMap.put(AbstractFish.class, Fish.class); -+ bukkitMap.put(AbstractSchoolingFish.class, Fish.class); // close enough -+ bukkitMap.put(FlyingMob.class, Flying.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.AbstractFish.class, Fish.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.AbstractSchoolingFish.class, SchoolableFish.class); ++ bukkitMap.put(net.minecraft.world.entity.FlyingMob.class, Flying.class); + bukkitMap.put(net.minecraft.world.entity.animal.Fox.class, Fox.class); + bukkitMap.put(net.minecraft.world.entity.monster.Ghast.class, Ghast.class); + bukkitMap.put(net.minecraft.world.entity.monster.Giant.class, Giant.class); -+ bukkitMap.put(AbstractGolem.class, Golem.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.AbstractGolem.class, Golem.class); + bukkitMap.put(net.minecraft.world.entity.monster.Guardian.class, Guardian.class); + bukkitMap.put(net.minecraft.world.entity.monster.ElderGuardian.class, ElderGuardian.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.Horse.class, Horse.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.AbstractHorse.class, AbstractHorse.class); -+ bukkitMap.put(AbstractChestedHorse.class, ChestedHorse.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.horse.AbstractChestedHorse.class, ChestedHorse.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.Donkey.class, Donkey.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.Mule.class, Mule.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.SkeletonHorse.class, SkeletonHorse.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.ZombieHorse.class, ZombieHorse.class); -+ bukkitMap.put(Camel.class, org.bukkit.entity.Camel.class); -+ bukkitMap.put(AbstractIllager.class, Illager.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.camel.Camel.class, org.bukkit.entity.Camel.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.AbstractIllager.class, Illager.class); + bukkitMap.put(net.minecraft.world.entity.monster.Illusioner.class, Illusioner.class); -+ bukkitMap.put(SpellcasterIllager.class, Spellcaster.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.SpellcasterIllager.class, Spellcaster.class); + bukkitMap.put(net.minecraft.world.entity.animal.IronGolem.class, IronGolem.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.Llama.class, Llama.class); + bukkitMap.put(net.minecraft.world.entity.animal.horse.TraderLlama.class, TraderLlama.class); + bukkitMap.put(net.minecraft.world.entity.monster.MagmaCube.class, MagmaCube.class); + bukkitMap.put(net.minecraft.world.entity.monster.Monster.class, Monster.class); -+ bukkitMap.put(PatrollingMonster.class, Raider.class); // close enough ++ bukkitMap.put(net.minecraft.world.entity.monster.PatrollingMonster.class, Raider.class); // close enough + bukkitMap.put(net.minecraft.world.entity.animal.MushroomCow.class, MushroomCow.class); + bukkitMap.put(net.minecraft.world.entity.animal.Ocelot.class, Ocelot.class); + bukkitMap.put(net.minecraft.world.entity.animal.Panda.class, Panda.class); + bukkitMap.put(net.minecraft.world.entity.animal.Parrot.class, Parrot.class); -+ bukkitMap.put(ShoulderRidingEntity.class, Parrot.class); // close enough ++ bukkitMap.put(net.minecraft.world.entity.animal.ShoulderRidingEntity.class, Parrot.class); // close enough + bukkitMap.put(net.minecraft.world.entity.monster.Phantom.class, Phantom.class); + bukkitMap.put(net.minecraft.world.entity.animal.Pig.class, Pig.class); -+ bukkitMap.put(ZombifiedPiglin.class, PigZombie.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.ZombifiedPiglin.class, PigZombie.class); + bukkitMap.put(net.minecraft.world.entity.monster.Pillager.class, Pillager.class); + bukkitMap.put(net.minecraft.world.entity.animal.PolarBear.class, PolarBear.class); -+ bukkitMap.put(Pufferfish.class, PufferFish.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.Pufferfish.class, PufferFish.class); + bukkitMap.put(net.minecraft.world.entity.animal.Rabbit.class, Rabbit.class); + bukkitMap.put(net.minecraft.world.entity.raid.Raider.class, Raider.class); + bukkitMap.put(net.minecraft.world.entity.monster.Ravager.class, Ravager.class); @@ -236,10 +114,10 @@ index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd8 + bukkitMap.put(net.minecraft.world.entity.monster.Stray.class, Stray.class); + bukkitMap.put(net.minecraft.world.entity.monster.WitherSkeleton.class, WitherSkeleton.class); + bukkitMap.put(net.minecraft.world.entity.monster.Slime.class, Slime.class); -+ bukkitMap.put(SnowGolem.class, Snowman.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.SnowGolem.class, Snowman.class); + bukkitMap.put(net.minecraft.world.entity.monster.Spider.class, Spider.class); + bukkitMap.put(net.minecraft.world.entity.animal.Squid.class, Squid.class); -+ bukkitMap.put(TamableAnimal.class, Tameable.class); ++ bukkitMap.put(net.minecraft.world.entity.TamableAnimal.class, Tameable.class); + bukkitMap.put(net.minecraft.world.entity.animal.TropicalFish.class, TropicalFish.class); + bukkitMap.put(net.minecraft.world.entity.animal.Turtle.class, Turtle.class); + bukkitMap.put(net.minecraft.world.entity.monster.Vex.class, Vex.class); @@ -247,69 +125,71 @@ index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd8 + bukkitMap.put(net.minecraft.world.entity.npc.AbstractVillager.class, AbstractVillager.class); + bukkitMap.put(net.minecraft.world.entity.npc.WanderingTrader.class, WanderingTrader.class); + bukkitMap.put(net.minecraft.world.entity.monster.Vindicator.class, Vindicator.class); -+ bukkitMap.put(WaterAnimal.class, WaterMob.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.WaterAnimal.class, WaterMob.class); + bukkitMap.put(net.minecraft.world.entity.monster.Witch.class, Witch.class); -+ bukkitMap.put(WitherBoss.class, Wither.class); ++ bukkitMap.put(net.minecraft.world.entity.boss.wither.WitherBoss.class, Wither.class); + bukkitMap.put(net.minecraft.world.entity.animal.Wolf.class, Wolf.class); + bukkitMap.put(net.minecraft.world.entity.monster.Zombie.class, Zombie.class); + bukkitMap.put(net.minecraft.world.entity.monster.Husk.class, Husk.class); + bukkitMap.put(net.minecraft.world.entity.monster.ZombieVillager.class, ZombieVillager.class); + bukkitMap.put(net.minecraft.world.entity.monster.hoglin.Hoglin.class, Hoglin.class); + bukkitMap.put(net.minecraft.world.entity.monster.piglin.Piglin.class, Piglin.class); -+ bukkitMap.put(AbstractPiglin.class, PiglinAbstract.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.piglin.AbstractPiglin.class, PiglinAbstract.class); + bukkitMap.put(net.minecraft.world.entity.monster.piglin.PiglinBrute.class, PiglinBrute.class); + bukkitMap.put(net.minecraft.world.entity.monster.Strider.class, Strider.class); + bukkitMap.put(net.minecraft.world.entity.monster.Zoglin.class, Zoglin.class); -+ bukkitMap.put(net.minecraft.world.entity.GlowSquid.class, org.bukkit.entity.GlowSquid.class); -+ bukkitMap.put(net.minecraft.world.entity.animal.axolotl.Axolotl.class, org.bukkit.entity.Axolotl.class); -+ bukkitMap.put(net.minecraft.world.entity.animal.goat.Goat.class, org.bukkit.entity.Goat.class); -+ bukkitMap.put(net.minecraft.world.entity.animal.frog.Frog.class, org.bukkit.entity.Frog.class); -+ bukkitMap.put(net.minecraft.world.entity.animal.frog.Tadpole.class, org.bukkit.entity.Tadpole.class); -+ bukkitMap.put(net.minecraft.world.entity.monster.warden.Warden.class, org.bukkit.entity.Warden.class); -+ bukkitMap.put(net.minecraft.world.entity.animal.allay.Allay.class, org.bukkit.entity.Allay.class); -+ bukkitMap.put(net.minecraft.world.entity.animal.sniffer.Sniffer.class, org.bukkit.entity.Sniffer.class); -+ bukkitMap.put(Breeze.class, org.bukkit.entity.Breeze.class); -+ bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, org.bukkit.entity.Armadillo.class); -+ bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, org.bukkit.entity.Bogged.class); ++ bukkitMap.put(net.minecraft.world.entity.GlowSquid.class, GlowSquid.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.axolotl.Axolotl.class, Axolotl.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.goat.Goat.class, Goat.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.frog.Frog.class, Frog.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.frog.Tadpole.class, Tadpole.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.warden.Warden.class, Warden.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.allay.Allay.class, Allay.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.sniffer.Sniffer.class, Sniffer.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.breeze.Breeze.class, Breeze.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, Armadillo.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, Bogged.class); ++ // + } + -+ public static String getUsableName(Class clazz) { -+ String name = io.papermc.paper.util.MappingEnvironment.reobf() ? ObfHelper.INSTANCE.deobfClassName(clazz.getName()) : clazz.getName(); -+ name = name.substring(name.lastIndexOf(".") + 1); -+ boolean flag = false; -+ // inner classes -+ if (name.contains("$")) { -+ String cut = name.substring(name.indexOf("$") + 1); -+ if (cut.length() <= 2) { -+ name = name.replace("Entity", ""); -+ name = name.replace("$", "_"); -+ flag = true; -+ } else { -+ // mapped, wooo -+ name = cut; -+ } -+ } -+ name = name.replace("PathfinderGoal", ""); -+ name = name.replace("TargetGoal", ""); -+ name = name.replace("Goal", ""); -+ StringBuilder sb = new StringBuilder(); -+ for (char c : name.toCharArray()) { -+ if (c >= 'A' && c <= 'Z') { -+ sb.append("_"); -+ sb.append(Character.toLowerCase(c)); -+ } else { -+ sb.append(c); -+ } -+ } -+ name = sb.toString(); -+ name = name.replaceFirst("_", ""); ++ private static final Map deobfuscationMap = new HashMap<>(); + -+ if (flag && !deobfuscationMap.containsKey(name.toLowerCase(java.util.Locale.ROOT)) && !ignored.contains(name)) { -+ System.out.println("need to map " + clazz.getName() + " (" + name.toLowerCase(java.util.Locale.ROOT) + ")"); ++ static { ++ // TODO these kinda should be checked on each release, in case obfuscation changes ++ deobfuscationMap.put("abstract_skeleton_1", "abstract_skeleton_melee"); ++ } ++ ++ private static String getPathName(String name) { ++ String pathName = name.substring(name.lastIndexOf('.') + 1); ++ boolean needDeobfMap = false; ++ ++ // inner classes ++ int firstInnerDelimiter = pathName.indexOf('$'); ++ if (firstInnerDelimiter != -1) { ++ String innerClassName = pathName.substring(firstInnerDelimiter + 1); ++ for (String nestedClass : innerClassName.split("\\$")) { ++ if (NumberUtils.isDigits(nestedClass)) { ++ needDeobfMap = true; ++ break; ++ } ++ } ++ if (!needDeobfMap) { ++ pathName = innerClassName; ++ } ++ pathName = pathName.replace('$', '_'); ++ // mapped, wooo! ++ } ++ ++ pathName = pathName.replace("TargetGoal", ""); ++ pathName = pathName.replace("Goal", ""); ++ pathName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, pathName); ++ ++ if (needDeobfMap && !deobfuscationMap.containsKey(pathName)) { ++ System.err.println("need to map " + name + " (" + pathName + ")"); + } + + // did we rename this key? -+ return deobfuscationMap.getOrDefault(name, name); ++ return deobfuscationMap.getOrDefault(pathName, pathName); + } + + public static EnumSet vanillaToPaper(Goal goal) { @@ -323,20 +203,14 @@ index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd8 + } + + public static GoalType vanillaToPaper(Goal.Flag type) { -+ switch (type) { -+ case MOVE: -+ return GoalType.MOVE; -+ case LOOK: -+ return GoalType.LOOK; -+ case JUMP: -+ return GoalType.JUMP; -+ case UNKNOWN_BEHAVIOR: -+ return GoalType.UNKNOWN_BEHAVIOR; -+ case TARGET: -+ return GoalType.TARGET; -+ default: -+ throw new IllegalArgumentException("Unknown vanilla mob goal type " + type.name()); -+ } ++ return switch (type) { ++ case MOVE -> GoalType.MOVE; ++ case LOOK -> GoalType.LOOK; ++ case JUMP -> GoalType.JUMP; ++ case UNKNOWN_BEHAVIOR -> GoalType.UNKNOWN_BEHAVIOR; ++ case TARGET -> GoalType.TARGET; ++ default -> throw new IllegalArgumentException("Unknown vanilla mob goal type " + type.name()); ++ }; + } + + public static EnumSet paperToVanilla(EnumSet types) { @@ -348,55 +222,44 @@ index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd8 + } + + public static Goal.Flag paperToVanilla(GoalType type) { -+ switch (type) { -+ case MOVE: -+ return Goal.Flag.MOVE; -+ case LOOK: -+ return Goal.Flag.LOOK; -+ case JUMP: -+ return Goal.Flag.JUMP; -+ case UNKNOWN_BEHAVIOR: -+ return Goal.Flag.UNKNOWN_BEHAVIOR; -+ case TARGET: -+ return Goal.Flag.TARGET; -+ default: -+ throw new IllegalArgumentException("Unknown paper mob goal type " + type.name()); -+ } ++ return switch (type) { ++ case MOVE -> Goal.Flag.MOVE; ++ case LOOK -> Goal.Flag.LOOK; ++ case JUMP -> Goal.Flag.JUMP; ++ case UNKNOWN_BEHAVIOR -> Goal.Flag.UNKNOWN_BEHAVIOR; ++ case TARGET -> Goal.Flag.TARGET; ++ default -> throw new IllegalArgumentException("Unknown paper mob goal type " + type.name()); ++ }; + } + + public static GoalKey getKey(Class goalClass) { -+ String name = getUsableName(goalClass); -+ if (ignored.contains(name)) { -+ //noinspection unchecked -+ return (GoalKey) GoalKey.of(Mob.class, NamespacedKey.minecraft(name)); -+ } ++ String name = getPathName(io.papermc.paper.util.MappingEnvironment.reobf() ? ObfHelper.INSTANCE.deobfClassName(goalClass.getName()) : goalClass.getName()); + return GoalKey.of(getEntity(goalClass), NamespacedKey.minecraft(name)); + } + -+ public static Class getEntity(Class goalClass) { ++ private static Class getEntity(Class goalClass) { + //noinspection unchecked + return (Class) entityClassCache.computeIfAbsent(goalClass, key -> { + for (Constructor ctor : key.getDeclaredConstructors()) { -+ for (int i = 0; i < ctor.getParameterCount(); i++) { -+ Class param = ctor.getParameterTypes()[i]; ++ for (Class param : ctor.getParameterTypes()) { + if (net.minecraft.world.entity.Mob.class.isAssignableFrom(param)) { + //noinspection unchecked -+ return toBukkitClass((Class) param); ++ Class bukkitClass = toBukkitClass((Class) param); ++ if (bukkitClass == null) { ++ throw new RuntimeException("Can't figure out applicable bukkit entity for nms entity " + param); // maybe just return Mob? ++ } ++ return bukkitClass; + } else if (RangedAttackMob.class.isAssignableFrom(param)) { + return RangedEntity.class; + } + } + } -+ throw new RuntimeException("Can't figure out applicable entity for mob goal " + goalClass); // maybe just return EntityInsentient? ++ throw new RuntimeException("Can't figure out applicable entity for mob goal " + goalClass); // maybe just return Mob? + }); + } + + public static Class toBukkitClass(Class nmsClass) { -+ Class bukkitClass = bukkitMap.get(nmsClass); -+ if (bukkitClass == null) { -+ throw new RuntimeException("Can't figure out applicable bukkit entity for nms entity " + nmsClass); // maybe just return Mob? -+ } -+ return bukkitClass; ++ return bukkitMap.get(nmsClass); + } +} diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java @@ -797,3 +660,46 @@ index 6ea6e3280015a31a1679a874ca63c90be8252a86..48c3d926682dd72ba476b4afc9e44e01 + } // Paper end } +diff --git a/src/test/java/io/papermc/paper/entity/ai/MobGoalConverterTest.java b/src/test/java/io/papermc/paper/entity/ai/MobGoalConverterTest.java +new file mode 100644 +index 0000000000000000000000000000000000000000..b020f795846d98f5464b390008be8815e892f9e8 +--- /dev/null ++++ b/src/test/java/io/papermc/paper/entity/ai/MobGoalConverterTest.java +@@ -0,0 +1,37 @@ ++package io.papermc.paper.entity.ai; ++ ++import com.destroystokyo.paper.entity.ai.MobGoalHelper; ++import io.github.classgraph.ClassGraph; ++import io.github.classgraph.ScanResult; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.Mob; ++import org.junit.jupiter.api.Test; ++import java.util.ArrayList; ++import java.util.List; ++ ++import static org.junit.jupiter.api.Assertions.assertFalse; ++import static org.junit.jupiter.api.Assertions.fail; ++ ++public class MobGoalConverterTest { ++ ++ @Test ++ public void testBukkitMap() { ++ List> classes; ++ try (ScanResult scanResult = new ClassGraph().enableAllInfo().whitelistPackages(Entity.class.getPackageName()).scan()) { ++ classes = scanResult.getSubclasses(Mob.class.getName()).loadClasses(Mob.class); ++ } ++ assertFalse(classes.isEmpty(), "There are supposed to be more than 0 mob classes!"); ++ ++ List missingClasses = new ArrayList<>(); ++ for (Class nmsClass : classes) { ++ Class bukkitClass = MobGoalHelper.toBukkitClass(nmsClass); ++ if (bukkitClass == null) { ++ missingClasses.add(nmsClass.getCanonicalName()); ++ } ++ } ++ ++ if (!missingClasses.isEmpty()) { ++ fail("Missing some entity classes in the bukkit map (MobGoalHelper): " + String.join(", ", missingClasses)); ++ } ++ } ++} diff --git a/patches/server/0557-Missing-Entity-API.patch b/patches/server/0557-Missing-Entity-API.patch index 14e5128e24..2c63ae6e2c 100644 --- a/patches/server/0557-Missing-Entity-API.patch +++ b/patches/server/0557-Missing-Entity-API.patch @@ -44,19 +44,6 @@ Co-authored-by: FireInstall Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com> Co-authored-by: TotalledZebra -diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -index c99eafab2103c7f5bca7ffba68a10bd853df055f..f7241c5292f1c012404eea11256813fbc2c2df1a 100644 ---- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -@@ -164,7 +164,7 @@ public class MobGoalHelper { - bukkitMap.put(net.minecraft.world.entity.monster.Endermite.class, Endermite.class); - bukkitMap.put(net.minecraft.world.entity.monster.Evoker.class, Evoker.class); - bukkitMap.put(AbstractFish.class, Fish.class); -- bukkitMap.put(AbstractSchoolingFish.class, Fish.class); // close enough -+ bukkitMap.put(AbstractSchoolingFish.class, io.papermc.paper.entity.SchoolableFish.class); - bukkitMap.put(FlyingMob.class, Flying.class); - bukkitMap.put(net.minecraft.world.entity.animal.Fox.class, Fox.class); - bukkitMap.put(net.minecraft.world.entity.monster.Ghast.class, Ghast.class); diff --git a/src/main/java/io/papermc/paper/entity/PaperSchoolableFish.java b/src/main/java/io/papermc/paper/entity/PaperSchoolableFish.java new file mode 100644 index 0000000000000000000000000000000000000000..41bf71d116ffc5431586ce54abba7f8def6c1dcf diff --git a/patches/server/1065-move-spigot-scrap.patch b/patches/server/1065-move-spigot-scrap.patch new file mode 100644 index 0000000000..202f8012f0 --- /dev/null +++ b/patches/server/1065-move-spigot-scrap.patch @@ -0,0 +1,331 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Fri, 1 Mar 2024 22:51:14 +0100 +Subject: [PATCH] move spigot scrap + + +diff --git a/build.gradle.kts b/build.gradle.kts +index 648281575eb8d45a5c06549eb3d0f517c086fe64..12b3cad1ee40fdd9c4386debe9d8af178d274ba2 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -3,6 +3,7 @@ import java.time.Instant + + plugins { + java ++ idea // Paper + `maven-publish` + } + +@@ -184,6 +185,20 @@ fun TaskContainer.registerRunTask( + block(this) + } + ++// Paper start ++sourceSets.main { ++ java { ++ exclude("excluded/**") ++ } ++} ++ ++idea { ++ module { ++ excludeDirs.add(projectDir.resolve("src/main/java/excluded")) ++ } ++} ++// Paper end ++ + val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatMap { it.elements } + .zip(configurations.vanillaServer.map { it.singleFile.absolutePath }) { runtime, vanilla -> + runtime.filterNot { it.asFile.absolutePath == vanilla } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftAgeable.java b/src/main/java/excluded/spigot/block/data/CraftAgeable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftAgeable.java +rename to src/main/java/excluded/spigot/block/data/CraftAgeable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftAnaloguePowerable.java b/src/main/java/excluded/spigot/block/data/CraftAnaloguePowerable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftAnaloguePowerable.java +rename to src/main/java/excluded/spigot/block/data/CraftAnaloguePowerable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftAttachable.java b/src/main/java/excluded/spigot/block/data/CraftAttachable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftAttachable.java +rename to src/main/java/excluded/spigot/block/data/CraftAttachable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBisected.java b/src/main/java/excluded/spigot/block/data/CraftBisected.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftBisected.java +rename to src/main/java/excluded/spigot/block/data/CraftBisected.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBrushable.java b/src/main/java/excluded/spigot/block/data/CraftBrushable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftBrushable.java +rename to src/main/java/excluded/spigot/block/data/CraftBrushable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftDirectional.java b/src/main/java/excluded/spigot/block/data/CraftDirectional.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftDirectional.java +rename to src/main/java/excluded/spigot/block/data/CraftDirectional.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftFaceAttachable.java b/src/main/java/excluded/spigot/block/data/CraftFaceAttachable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftFaceAttachable.java +rename to src/main/java/excluded/spigot/block/data/CraftFaceAttachable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftHangable.java b/src/main/java/excluded/spigot/block/data/CraftHangable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftHangable.java +rename to src/main/java/excluded/spigot/block/data/CraftHangable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftHatchable.java b/src/main/java/excluded/spigot/block/data/CraftHatchable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftHatchable.java +rename to src/main/java/excluded/spigot/block/data/CraftHatchable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftLevelled.java b/src/main/java/excluded/spigot/block/data/CraftLevelled.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftLevelled.java +rename to src/main/java/excluded/spigot/block/data/CraftLevelled.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftLightable.java b/src/main/java/excluded/spigot/block/data/CraftLightable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftLightable.java +rename to src/main/java/excluded/spigot/block/data/CraftLightable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftMultipleFacing.java b/src/main/java/excluded/spigot/block/data/CraftMultipleFacing.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftMultipleFacing.java +rename to src/main/java/excluded/spigot/block/data/CraftMultipleFacing.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftOpenable.java b/src/main/java/excluded/spigot/block/data/CraftOpenable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftOpenable.java +rename to src/main/java/excluded/spigot/block/data/CraftOpenable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftOrientable.java b/src/main/java/excluded/spigot/block/data/CraftOrientable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftOrientable.java +rename to src/main/java/excluded/spigot/block/data/CraftOrientable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftPowerable.java b/src/main/java/excluded/spigot/block/data/CraftPowerable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftPowerable.java +rename to src/main/java/excluded/spigot/block/data/CraftPowerable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftRail.java b/src/main/java/excluded/spigot/block/data/CraftRail.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftRail.java +rename to src/main/java/excluded/spigot/block/data/CraftRail.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftRotatable.java b/src/main/java/excluded/spigot/block/data/CraftRotatable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftRotatable.java +rename to src/main/java/excluded/spigot/block/data/CraftRotatable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftSnowable.java b/src/main/java/excluded/spigot/block/data/CraftSnowable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftSnowable.java +rename to src/main/java/excluded/spigot/block/data/CraftSnowable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftWaterlogged.java b/src/main/java/excluded/spigot/block/data/CraftWaterlogged.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/CraftWaterlogged.java +rename to src/main/java/excluded/spigot/block/data/CraftWaterlogged.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBamboo.java b/src/main/java/excluded/spigot/block/data/type/CraftBamboo.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBamboo.java +rename to src/main/java/excluded/spigot/block/data/type/CraftBamboo.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java b/src/main/java/excluded/spigot/block/data/type/CraftBed.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java +rename to src/main/java/excluded/spigot/block/data/type/CraftBed.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBeehive.java b/src/main/java/excluded/spigot/block/data/type/CraftBeehive.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBeehive.java +rename to src/main/java/excluded/spigot/block/data/type/CraftBeehive.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBell.java b/src/main/java/excluded/spigot/block/data/type/CraftBell.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBell.java +rename to src/main/java/excluded/spigot/block/data/type/CraftBell.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBigDripleaf.java b/src/main/java/excluded/spigot/block/data/type/CraftBigDripleaf.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBigDripleaf.java +rename to src/main/java/excluded/spigot/block/data/type/CraftBigDripleaf.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBrewingStand.java b/src/main/java/excluded/spigot/block/data/type/CraftBrewingStand.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBrewingStand.java +rename to src/main/java/excluded/spigot/block/data/type/CraftBrewingStand.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBrushable.java b/src/main/java/excluded/spigot/block/data/type/CraftBrushable.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBrushable.java +rename to src/main/java/excluded/spigot/block/data/type/CraftBrushable.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBubbleColumn.java b/src/main/java/excluded/spigot/block/data/type/CraftBubbleColumn.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBubbleColumn.java +rename to src/main/java/excluded/spigot/block/data/type/CraftBubbleColumn.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCake.java b/src/main/java/excluded/spigot/block/data/type/CraftCake.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCake.java +rename to src/main/java/excluded/spigot/block/data/type/CraftCake.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCampfire.java b/src/main/java/excluded/spigot/block/data/type/CraftCampfire.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCampfire.java +rename to src/main/java/excluded/spigot/block/data/type/CraftCampfire.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCandle.java b/src/main/java/excluded/spigot/block/data/type/CraftCandle.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCandle.java +rename to src/main/java/excluded/spigot/block/data/type/CraftCandle.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCaveVinesPlant.java b/src/main/java/excluded/spigot/block/data/type/CraftCaveVinesPlant.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCaveVinesPlant.java +rename to src/main/java/excluded/spigot/block/data/type/CraftCaveVinesPlant.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftChest.java b/src/main/java/excluded/spigot/block/data/type/CraftChest.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftChest.java +rename to src/main/java/excluded/spigot/block/data/type/CraftChest.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftChiseledBookshelf.java b/src/main/java/excluded/spigot/block/data/type/CraftChiseledBookshelf.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftChiseledBookshelf.java +rename to src/main/java/excluded/spigot/block/data/type/CraftChiseledBookshelf.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCommandBlock.java b/src/main/java/excluded/spigot/block/data/type/CraftCommandBlock.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCommandBlock.java +rename to src/main/java/excluded/spigot/block/data/type/CraftCommandBlock.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftComparator.java b/src/main/java/excluded/spigot/block/data/type/CraftComparator.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftComparator.java +rename to src/main/java/excluded/spigot/block/data/type/CraftComparator.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCrafter.java b/src/main/java/excluded/spigot/block/data/type/CraftCrafter.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftCrafter.java +rename to src/main/java/excluded/spigot/block/data/type/CraftCrafter.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftDaylightDetector.java b/src/main/java/excluded/spigot/block/data/type/CraftDaylightDetector.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftDaylightDetector.java +rename to src/main/java/excluded/spigot/block/data/type/CraftDaylightDetector.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftDispenser.java b/src/main/java/excluded/spigot/block/data/type/CraftDispenser.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftDispenser.java +rename to src/main/java/excluded/spigot/block/data/type/CraftDispenser.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftDoor.java b/src/main/java/excluded/spigot/block/data/type/CraftDoor.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftDoor.java +rename to src/main/java/excluded/spigot/block/data/type/CraftDoor.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftEndPortalFrame.java b/src/main/java/excluded/spigot/block/data/type/CraftEndPortalFrame.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftEndPortalFrame.java +rename to src/main/java/excluded/spigot/block/data/type/CraftEndPortalFrame.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftFarmland.java b/src/main/java/excluded/spigot/block/data/type/CraftFarmland.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftFarmland.java +rename to src/main/java/excluded/spigot/block/data/type/CraftFarmland.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftGate.java b/src/main/java/excluded/spigot/block/data/type/CraftGate.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftGate.java +rename to src/main/java/excluded/spigot/block/data/type/CraftGate.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftHopper.java b/src/main/java/excluded/spigot/block/data/type/CraftHopper.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftHopper.java +rename to src/main/java/excluded/spigot/block/data/type/CraftHopper.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftJigsaw.java b/src/main/java/excluded/spigot/block/data/type/CraftJigsaw.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftJigsaw.java +rename to src/main/java/excluded/spigot/block/data/type/CraftJigsaw.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftJukebox.java b/src/main/java/excluded/spigot/block/data/type/CraftJukebox.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftJukebox.java +rename to src/main/java/excluded/spigot/block/data/type/CraftJukebox.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftLeaves.java b/src/main/java/excluded/spigot/block/data/type/CraftLeaves.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftLeaves.java +rename to src/main/java/excluded/spigot/block/data/type/CraftLeaves.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftLectern.java b/src/main/java/excluded/spigot/block/data/type/CraftLectern.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftLectern.java +rename to src/main/java/excluded/spigot/block/data/type/CraftLectern.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftNoteBlock.java b/src/main/java/excluded/spigot/block/data/type/CraftNoteBlock.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftNoteBlock.java +rename to src/main/java/excluded/spigot/block/data/type/CraftNoteBlock.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftPinkPetals.java b/src/main/java/excluded/spigot/block/data/type/CraftPinkPetals.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftPinkPetals.java +rename to src/main/java/excluded/spigot/block/data/type/CraftPinkPetals.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftPiston.java b/src/main/java/excluded/spigot/block/data/type/CraftPiston.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftPiston.java +rename to src/main/java/excluded/spigot/block/data/type/CraftPiston.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftPistonHead.java b/src/main/java/excluded/spigot/block/data/type/CraftPistonHead.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftPistonHead.java +rename to src/main/java/excluded/spigot/block/data/type/CraftPistonHead.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftPointedDripstone.java b/src/main/java/excluded/spigot/block/data/type/CraftPointedDripstone.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftPointedDripstone.java +rename to src/main/java/excluded/spigot/block/data/type/CraftPointedDripstone.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftRedstoneWire.java b/src/main/java/excluded/spigot/block/data/type/CraftRedstoneWire.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftRedstoneWire.java +rename to src/main/java/excluded/spigot/block/data/type/CraftRedstoneWire.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftRepeater.java b/src/main/java/excluded/spigot/block/data/type/CraftRepeater.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftRepeater.java +rename to src/main/java/excluded/spigot/block/data/type/CraftRepeater.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftRespawnAnchor.java b/src/main/java/excluded/spigot/block/data/type/CraftRespawnAnchor.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftRespawnAnchor.java +rename to src/main/java/excluded/spigot/block/data/type/CraftRespawnAnchor.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSapling.java b/src/main/java/excluded/spigot/block/data/type/CraftSapling.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSapling.java +rename to src/main/java/excluded/spigot/block/data/type/CraftSapling.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftScaffolding.java b/src/main/java/excluded/spigot/block/data/type/CraftScaffolding.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftScaffolding.java +rename to src/main/java/excluded/spigot/block/data/type/CraftScaffolding.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSculkCatalyst.java b/src/main/java/excluded/spigot/block/data/type/CraftSculkCatalyst.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSculkCatalyst.java +rename to src/main/java/excluded/spigot/block/data/type/CraftSculkCatalyst.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSculkSensor.java b/src/main/java/excluded/spigot/block/data/type/CraftSculkSensor.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSculkSensor.java +rename to src/main/java/excluded/spigot/block/data/type/CraftSculkSensor.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSculkShrieker.java b/src/main/java/excluded/spigot/block/data/type/CraftSculkShrieker.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSculkShrieker.java +rename to src/main/java/excluded/spigot/block/data/type/CraftSculkShrieker.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSeaPickle.java b/src/main/java/excluded/spigot/block/data/type/CraftSeaPickle.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSeaPickle.java +rename to src/main/java/excluded/spigot/block/data/type/CraftSeaPickle.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSlab.java b/src/main/java/excluded/spigot/block/data/type/CraftSlab.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSlab.java +rename to src/main/java/excluded/spigot/block/data/type/CraftSlab.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSnow.java b/src/main/java/excluded/spigot/block/data/type/CraftSnow.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSnow.java +rename to src/main/java/excluded/spigot/block/data/type/CraftSnow.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftStairs.java b/src/main/java/excluded/spigot/block/data/type/CraftStairs.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftStairs.java +rename to src/main/java/excluded/spigot/block/data/type/CraftStairs.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftStructureBlock.java b/src/main/java/excluded/spigot/block/data/type/CraftStructureBlock.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftStructureBlock.java +rename to src/main/java/excluded/spigot/block/data/type/CraftStructureBlock.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSwitch.java b/src/main/java/excluded/spigot/block/data/type/CraftSwitch.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftSwitch.java +rename to src/main/java/excluded/spigot/block/data/type/CraftSwitch.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTNT.java b/src/main/java/excluded/spigot/block/data/type/CraftTNT.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTNT.java +rename to src/main/java/excluded/spigot/block/data/type/CraftTNT.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTechnicalPiston.java b/src/main/java/excluded/spigot/block/data/type/CraftTechnicalPiston.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTechnicalPiston.java +rename to src/main/java/excluded/spigot/block/data/type/CraftTechnicalPiston.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTrialSpawner.java b/src/main/java/excluded/spigot/block/data/type/CraftTrialSpawner.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTrialSpawner.java +rename to src/main/java/excluded/spigot/block/data/type/CraftTrialSpawner.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTripwire.java b/src/main/java/excluded/spigot/block/data/type/CraftTripwire.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTripwire.java +rename to src/main/java/excluded/spigot/block/data/type/CraftTripwire.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTurtleEgg.java b/src/main/java/excluded/spigot/block/data/type/CraftTurtleEgg.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftTurtleEgg.java +rename to src/main/java/excluded/spigot/block/data/type/CraftTurtleEgg.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftVault.java b/src/main/java/excluded/spigot/block/data/type/CraftVault.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftVault.java +rename to src/main/java/excluded/spigot/block/data/type/CraftVault.java +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftWall.java b/src/main/java/excluded/spigot/block/data/type/CraftWall.java +similarity index 100% +rename from src/main/java/org/bukkit/craftbukkit/block/data/type/CraftWall.java +rename to src/main/java/excluded/spigot/block/data/type/CraftWall.java diff --git a/patches/server/1066-cleanup-block-data.patch b/patches/server/1066-cleanup-block-data.patch new file mode 100644 index 0000000000..9131a74840 --- /dev/null +++ b/patches/server/1066-cleanup-block-data.patch @@ -0,0 +1,3462 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Sun, 3 Mar 2024 15:51:47 +0100 +Subject: [PATCH] cleanup block data + + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +index 0daa0bf7e56aa7228d89867500cb780b37f06541..4ca987f83d78aaf2ea7be451b1cb4afefa85feda 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -354,6 +354,13 @@ public class CraftBlockData implements BlockData { + return state.max; + } + ++ public static final BlockFace[] ROTATION_CYCLE = { ++ BlockFace.SOUTH, BlockFace.SOUTH_SOUTH_WEST, BlockFace.SOUTH_WEST, BlockFace.WEST_SOUTH_WEST, ++ BlockFace.WEST, BlockFace.WEST_NORTH_WEST, BlockFace.NORTH_WEST, BlockFace.NORTH_NORTH_WEST, ++ BlockFace.NORTH, BlockFace.NORTH_NORTH_EAST, BlockFace.NORTH_EAST, BlockFace.EAST_NORTH_EAST, ++ BlockFace.EAST, BlockFace.EAST_SOUTH_EAST, BlockFace.SOUTH_EAST, BlockFace.SOUTH_SOUTH_EAST ++ }; ++ + // + private static final Map, Function> MAP = new HashMap<>(); + +@@ -363,9 +370,9 @@ public class CraftBlockData implements BlockData { + register(net.minecraft.world.level.block.BigDripleafBlock.class, org.bukkit.craftbukkit.block.impl.CraftBigDripleaf::new); + register(net.minecraft.world.level.block.BigDripleafStemBlock.class, org.bukkit.craftbukkit.block.impl.CraftBigDripleafStem::new); + register(net.minecraft.world.level.block.AnvilBlock.class, org.bukkit.craftbukkit.block.impl.CraftAnvil::new); +- register(net.minecraft.world.level.block.BambooStalkBlock.class, org.bukkit.craftbukkit.block.impl.CraftBamboo::new); ++ register(net.minecraft.world.level.block.BambooStalkBlock.class, org.bukkit.craftbukkit.block.impl.CraftBambooStalk::new); + register(net.minecraft.world.level.block.BannerBlock.class, org.bukkit.craftbukkit.block.impl.CraftBanner::new); +- register(net.minecraft.world.level.block.WallBannerBlock.class, org.bukkit.craftbukkit.block.impl.CraftBannerWall::new); ++ register(net.minecraft.world.level.block.WallBannerBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallBanner::new); + register(net.minecraft.world.level.block.BarrelBlock.class, org.bukkit.craftbukkit.block.impl.CraftBarrel::new); + register(net.minecraft.world.level.block.BarrierBlock.class, org.bukkit.craftbukkit.block.impl.CraftBarrier::new); + register(net.minecraft.world.level.block.BedBlock.class, org.bukkit.craftbukkit.block.impl.CraftBed::new); +@@ -375,52 +382,52 @@ public class CraftBlockData implements BlockData { + register(net.minecraft.world.level.block.BlastFurnaceBlock.class, org.bukkit.craftbukkit.block.impl.CraftBlastFurnace::new); + register(net.minecraft.world.level.block.BrewingStandBlock.class, org.bukkit.craftbukkit.block.impl.CraftBrewingStand::new); + register(net.minecraft.world.level.block.BubbleColumnBlock.class, org.bukkit.craftbukkit.block.impl.CraftBubbleColumn::new); +- register(net.minecraft.world.level.block.ButtonBlock.class, org.bukkit.craftbukkit.block.impl.CraftButtonAbstract::new); ++ register(net.minecraft.world.level.block.ButtonBlock.class, org.bukkit.craftbukkit.block.impl.CraftButton::new); + register(net.minecraft.world.level.block.CactusBlock.class, org.bukkit.craftbukkit.block.impl.CraftCactus::new); + register(net.minecraft.world.level.block.CakeBlock.class, org.bukkit.craftbukkit.block.impl.CraftCake::new); + register(net.minecraft.world.level.block.CampfireBlock.class, org.bukkit.craftbukkit.block.impl.CraftCampfire::new); +- register(net.minecraft.world.level.block.CarrotBlock.class, org.bukkit.craftbukkit.block.impl.CraftCarrots::new); ++ register(net.minecraft.world.level.block.CarrotBlock.class, org.bukkit.craftbukkit.block.impl.CraftCarrot::new); + register(net.minecraft.world.level.block.ChainBlock.class, org.bukkit.craftbukkit.block.impl.CraftChain::new); + register(net.minecraft.world.level.block.ChestBlock.class, org.bukkit.craftbukkit.block.impl.CraftChest::new); +- register(net.minecraft.world.level.block.TrappedChestBlock.class, org.bukkit.craftbukkit.block.impl.CraftChestTrapped::new); ++ register(net.minecraft.world.level.block.TrappedChestBlock.class, org.bukkit.craftbukkit.block.impl.CraftTrappedChest::new); + register(net.minecraft.world.level.block.ChorusFlowerBlock.class, org.bukkit.craftbukkit.block.impl.CraftChorusFlower::new); +- register(net.minecraft.world.level.block.ChorusPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftChorusFruit::new); +- register(net.minecraft.world.level.block.WallBlock.class, org.bukkit.craftbukkit.block.impl.CraftCobbleWall::new); ++ register(net.minecraft.world.level.block.ChorusPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftChorusPlant::new); ++ register(net.minecraft.world.level.block.WallBlock.class, org.bukkit.craftbukkit.block.impl.CraftWall::new); + register(net.minecraft.world.level.block.CocoaBlock.class, org.bukkit.craftbukkit.block.impl.CraftCocoa::new); +- register(net.minecraft.world.level.block.CommandBlock.class, org.bukkit.craftbukkit.block.impl.CraftCommand::new); ++ register(net.minecraft.world.level.block.CommandBlock.class, org.bukkit.craftbukkit.block.impl.CraftCommandBlock::new); + register(net.minecraft.world.level.block.ComposterBlock.class, org.bukkit.craftbukkit.block.impl.CraftComposter::new); + register(net.minecraft.world.level.block.ConduitBlock.class, org.bukkit.craftbukkit.block.impl.CraftConduit::new); +- register(net.minecraft.world.level.block.BaseCoralPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralDead::new); ++ register(net.minecraft.world.level.block.BaseCoralPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftBaseCoralPlant::new); + register(net.minecraft.world.level.block.CoralFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralFan::new); +- register(net.minecraft.world.level.block.BaseCoralFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanAbstract::new); +- register(net.minecraft.world.level.block.CoralWallFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanWall::new); +- register(net.minecraft.world.level.block.BaseCoralWallFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanWallAbstract::new); ++ register(net.minecraft.world.level.block.BaseCoralFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftBaseCoralFan::new); ++ register(net.minecraft.world.level.block.CoralWallFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralWallFan::new); ++ register(net.minecraft.world.level.block.BaseCoralWallFanBlock.class, org.bukkit.craftbukkit.block.impl.CraftBaseCoralWallFan::new); + register(net.minecraft.world.level.block.CoralPlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftCoralPlant::new); +- register(net.minecraft.world.level.block.CropBlock.class, org.bukkit.craftbukkit.block.impl.CraftCrops::new); ++ register(net.minecraft.world.level.block.CropBlock.class, org.bukkit.craftbukkit.block.impl.CraftCrop::new); + register(net.minecraft.world.level.block.DaylightDetectorBlock.class, org.bukkit.craftbukkit.block.impl.CraftDaylightDetector::new); +- register(net.minecraft.world.level.block.SnowyDirtBlock.class, org.bukkit.craftbukkit.block.impl.CraftDirtSnow::new); ++ register(net.minecraft.world.level.block.SnowyDirtBlock.class, org.bukkit.craftbukkit.block.impl.CraftSnowyDirt::new); + register(net.minecraft.world.level.block.DispenserBlock.class, org.bukkit.craftbukkit.block.impl.CraftDispenser::new); + register(net.minecraft.world.level.block.DoorBlock.class, org.bukkit.craftbukkit.block.impl.CraftDoor::new); + register(net.minecraft.world.level.block.DropperBlock.class, org.bukkit.craftbukkit.block.impl.CraftDropper::new); + register(net.minecraft.world.level.block.EndRodBlock.class, org.bukkit.craftbukkit.block.impl.CraftEndRod::new); + register(net.minecraft.world.level.block.EnderChestBlock.class, org.bukkit.craftbukkit.block.impl.CraftEnderChest::new); +- register(net.minecraft.world.level.block.EndPortalFrameBlock.class, org.bukkit.craftbukkit.block.impl.CraftEnderPortalFrame::new); ++ register(net.minecraft.world.level.block.EndPortalFrameBlock.class, org.bukkit.craftbukkit.block.impl.CraftEndPortalFrame::new); + register(net.minecraft.world.level.block.FenceBlock.class, org.bukkit.craftbukkit.block.impl.CraftFence::new); + register(net.minecraft.world.level.block.FenceGateBlock.class, org.bukkit.craftbukkit.block.impl.CraftFenceGate::new); + register(net.minecraft.world.level.block.FireBlock.class, org.bukkit.craftbukkit.block.impl.CraftFire::new); +- register(net.minecraft.world.level.block.StandingSignBlock.class, org.bukkit.craftbukkit.block.impl.CraftFloorSign::new); +- register(net.minecraft.world.level.block.LiquidBlock.class, org.bukkit.craftbukkit.block.impl.CraftFluids::new); +- register(net.minecraft.world.level.block.FurnaceBlock.class, org.bukkit.craftbukkit.block.impl.CraftFurnaceFurace::new); ++ register(net.minecraft.world.level.block.StandingSignBlock.class, org.bukkit.craftbukkit.block.impl.CraftStandingSign::new); ++ register(net.minecraft.world.level.block.LiquidBlock.class, org.bukkit.craftbukkit.block.impl.CraftLiquid::new); ++ register(net.minecraft.world.level.block.FurnaceBlock.class, org.bukkit.craftbukkit.block.impl.CraftFurnace::new); + register(net.minecraft.world.level.block.GlazedTerracottaBlock.class, org.bukkit.craftbukkit.block.impl.CraftGlazedTerracotta::new); + register(net.minecraft.world.level.block.GrassBlock.class, org.bukkit.craftbukkit.block.impl.CraftGrass::new); + register(net.minecraft.world.level.block.GrindstoneBlock.class, org.bukkit.craftbukkit.block.impl.CraftGrindstone::new); + register(net.minecraft.world.level.block.HayBlock.class, org.bukkit.craftbukkit.block.impl.CraftHay::new); + register(net.minecraft.world.level.block.HopperBlock.class, org.bukkit.craftbukkit.block.impl.CraftHopper::new); + register(net.minecraft.world.level.block.HugeMushroomBlock.class, org.bukkit.craftbukkit.block.impl.CraftHugeMushroom::new); +- register(net.minecraft.world.level.block.FrostedIceBlock.class, org.bukkit.craftbukkit.block.impl.CraftIceFrost::new); ++ register(net.minecraft.world.level.block.FrostedIceBlock.class, org.bukkit.craftbukkit.block.impl.CraftFrostedIce::new); + register(net.minecraft.world.level.block.IronBarsBlock.class, org.bukkit.craftbukkit.block.impl.CraftIronBars::new); + register(net.minecraft.world.level.block.JigsawBlock.class, org.bukkit.craftbukkit.block.impl.CraftJigsaw::new); +- register(net.minecraft.world.level.block.JukeboxBlock.class, org.bukkit.craftbukkit.block.impl.CraftJukeBox::new); ++ register(net.minecraft.world.level.block.JukeboxBlock.class, org.bukkit.craftbukkit.block.impl.CraftJukebox::new); + register(net.minecraft.world.level.block.KelpBlock.class, org.bukkit.craftbukkit.block.impl.CraftKelp::new); + register(net.minecraft.world.level.block.LadderBlock.class, org.bukkit.craftbukkit.block.impl.CraftLadder::new); + register(net.minecraft.world.level.block.LanternBlock.class, org.bukkit.craftbukkit.block.impl.CraftLantern::new); +@@ -428,62 +435,62 @@ public class CraftBlockData implements BlockData { + register(net.minecraft.world.level.block.LecternBlock.class, org.bukkit.craftbukkit.block.impl.CraftLectern::new); + register(net.minecraft.world.level.block.LeverBlock.class, org.bukkit.craftbukkit.block.impl.CraftLever::new); + register(net.minecraft.world.level.block.LoomBlock.class, org.bukkit.craftbukkit.block.impl.CraftLoom::new); +- register(net.minecraft.world.level.block.DetectorRailBlock.class, org.bukkit.craftbukkit.block.impl.CraftMinecartDetector::new); +- register(net.minecraft.world.level.block.RailBlock.class, org.bukkit.craftbukkit.block.impl.CraftMinecartTrack::new); +- register(net.minecraft.world.level.block.MyceliumBlock.class, org.bukkit.craftbukkit.block.impl.CraftMycel::new); ++ register(net.minecraft.world.level.block.DetectorRailBlock.class, org.bukkit.craftbukkit.block.impl.CraftDetectorRail::new); ++ register(net.minecraft.world.level.block.RailBlock.class, org.bukkit.craftbukkit.block.impl.CraftRail::new); ++ register(net.minecraft.world.level.block.MyceliumBlock.class, org.bukkit.craftbukkit.block.impl.CraftMycelium::new); + register(net.minecraft.world.level.block.NetherWartBlock.class, org.bukkit.craftbukkit.block.impl.CraftNetherWart::new); +- register(net.minecraft.world.level.block.NoteBlock.class, org.bukkit.craftbukkit.block.impl.CraftNote::new); ++ register(net.minecraft.world.level.block.NoteBlock.class, org.bukkit.craftbukkit.block.impl.CraftNoteBlock::new); + register(net.minecraft.world.level.block.ObserverBlock.class, org.bukkit.craftbukkit.block.impl.CraftObserver::new); +- register(net.minecraft.world.level.block.NetherPortalBlock.class, org.bukkit.craftbukkit.block.impl.CraftPortal::new); +- register(net.minecraft.world.level.block.PotatoBlock.class, org.bukkit.craftbukkit.block.impl.CraftPotatoes::new); ++ register(net.minecraft.world.level.block.NetherPortalBlock.class, org.bukkit.craftbukkit.block.impl.CraftNetherPortal::new); ++ register(net.minecraft.world.level.block.PotatoBlock.class, org.bukkit.craftbukkit.block.impl.CraftPotato::new); + register(net.minecraft.world.level.block.PoweredRailBlock.class, org.bukkit.craftbukkit.block.impl.CraftPoweredRail::new); +- register(net.minecraft.world.level.block.PressurePlateBlock.class, org.bukkit.craftbukkit.block.impl.CraftPressurePlateBinary::new); +- register(net.minecraft.world.level.block.WeightedPressurePlateBlock.class, org.bukkit.craftbukkit.block.impl.CraftPressurePlateWeighted::new); +- register(net.minecraft.world.level.block.CarvedPumpkinBlock.class, org.bukkit.craftbukkit.block.impl.CraftPumpkinCarved::new); +- register(net.minecraft.world.level.block.ComparatorBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneComparator::new); ++ register(net.minecraft.world.level.block.PressurePlateBlock.class, org.bukkit.craftbukkit.block.impl.CraftPressurePlate::new); ++ register(net.minecraft.world.level.block.WeightedPressurePlateBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeightedPressurePlate::new); ++ register(net.minecraft.world.level.block.CarvedPumpkinBlock.class, org.bukkit.craftbukkit.block.impl.CraftCarvedPumpkin::new); ++ register(net.minecraft.world.level.block.ComparatorBlock.class, org.bukkit.craftbukkit.block.impl.CraftComparator::new); + register(net.minecraft.world.level.block.RedstoneLampBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneLamp::new); +- register(net.minecraft.world.level.block.RedStoneOreBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneOre::new); ++ register(net.minecraft.world.level.block.RedStoneOreBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedStoneOre::new); + register(net.minecraft.world.level.block.RedstoneTorchBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneTorch::new); +- register(net.minecraft.world.level.block.RedstoneWallTorchBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneTorchWall::new); +- register(net.minecraft.world.level.block.RedStoneWireBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneWire::new); +- register(net.minecraft.world.level.block.SugarCaneBlock.class, org.bukkit.craftbukkit.block.impl.CraftReed::new); ++ register(net.minecraft.world.level.block.RedstoneWallTorchBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedstoneWallTorch::new); ++ register(net.minecraft.world.level.block.RedStoneWireBlock.class, org.bukkit.craftbukkit.block.impl.CraftRedStoneWire::new); ++ register(net.minecraft.world.level.block.SugarCaneBlock.class, org.bukkit.craftbukkit.block.impl.CraftSugarCane::new); + register(net.minecraft.world.level.block.RepeaterBlock.class, org.bukkit.craftbukkit.block.impl.CraftRepeater::new); + register(net.minecraft.world.level.block.RespawnAnchorBlock.class, org.bukkit.craftbukkit.block.impl.CraftRespawnAnchor::new); +- register(net.minecraft.world.level.block.RotatedPillarBlock.class, org.bukkit.craftbukkit.block.impl.CraftRotatable::new); ++ register(net.minecraft.world.level.block.RotatedPillarBlock.class, org.bukkit.craftbukkit.block.impl.CraftRotatedPillar::new); + register(net.minecraft.world.level.block.SaplingBlock.class, org.bukkit.craftbukkit.block.impl.CraftSapling::new); + register(net.minecraft.world.level.block.ScaffoldingBlock.class, org.bukkit.craftbukkit.block.impl.CraftScaffolding::new); + register(net.minecraft.world.level.block.SeaPickleBlock.class, org.bukkit.craftbukkit.block.impl.CraftSeaPickle::new); + register(net.minecraft.world.level.block.ShulkerBoxBlock.class, org.bukkit.craftbukkit.block.impl.CraftShulkerBox::new); + register(net.minecraft.world.level.block.SkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftSkull::new); +- register(net.minecraft.world.level.block.PlayerHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftSkullPlayer::new); +- register(net.minecraft.world.level.block.PlayerWallHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftSkullPlayerWall::new); +- register(net.minecraft.world.level.block.WallSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftSkullWall::new); ++ register(net.minecraft.world.level.block.PlayerHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftPlayerHead::new); ++ register(net.minecraft.world.level.block.PlayerWallHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftPlayerWallHead::new); ++ register(net.minecraft.world.level.block.WallSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallSkull::new); + register(net.minecraft.world.level.block.SmokerBlock.class, org.bukkit.craftbukkit.block.impl.CraftSmoker::new); +- register(net.minecraft.world.level.block.SnowLayerBlock.class, org.bukkit.craftbukkit.block.impl.CraftSnow::new); +- register(net.minecraft.world.level.block.FarmBlock.class, org.bukkit.craftbukkit.block.impl.CraftSoil::new); ++ register(net.minecraft.world.level.block.SnowLayerBlock.class, org.bukkit.craftbukkit.block.impl.CraftSnowLayer::new); ++ register(net.minecraft.world.level.block.FarmBlock.class, org.bukkit.craftbukkit.block.impl.CraftFarm::new); + register(net.minecraft.world.level.block.StainedGlassPaneBlock.class, org.bukkit.craftbukkit.block.impl.CraftStainedGlassPane::new); +- register(net.minecraft.world.level.block.StairBlock.class, org.bukkit.craftbukkit.block.impl.CraftStairs::new); ++ register(net.minecraft.world.level.block.StairBlock.class, org.bukkit.craftbukkit.block.impl.CraftStair::new); + register(net.minecraft.world.level.block.StemBlock.class, org.bukkit.craftbukkit.block.impl.CraftStem::new); +- register(net.minecraft.world.level.block.AttachedStemBlock.class, org.bukkit.craftbukkit.block.impl.CraftStemAttached::new); +- register(net.minecraft.world.level.block.SlabBlock.class, org.bukkit.craftbukkit.block.impl.CraftStepAbstract::new); ++ register(net.minecraft.world.level.block.AttachedStemBlock.class, org.bukkit.craftbukkit.block.impl.CraftAttachedStem::new); ++ register(net.minecraft.world.level.block.SlabBlock.class, org.bukkit.craftbukkit.block.impl.CraftSlab::new); + register(net.minecraft.world.level.block.StonecutterBlock.class, org.bukkit.craftbukkit.block.impl.CraftStonecutter::new); +- register(net.minecraft.world.level.block.StructureBlock.class, org.bukkit.craftbukkit.block.impl.CraftStructure::new); ++ register(net.minecraft.world.level.block.StructureBlock.class, org.bukkit.craftbukkit.block.impl.CraftStructureBlock::new); + register(net.minecraft.world.level.block.SweetBerryBushBlock.class, org.bukkit.craftbukkit.block.impl.CraftSweetBerryBush::new); +- register(net.minecraft.world.level.block.TntBlock.class, org.bukkit.craftbukkit.block.impl.CraftTNT::new); +- register(net.minecraft.world.level.block.DoublePlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftTallPlant::new); +- register(net.minecraft.world.level.block.TallFlowerBlock.class, org.bukkit.craftbukkit.block.impl.CraftTallPlantFlower::new); ++ register(net.minecraft.world.level.block.TntBlock.class, org.bukkit.craftbukkit.block.impl.CraftTnt::new); ++ register(net.minecraft.world.level.block.DoublePlantBlock.class, org.bukkit.craftbukkit.block.impl.CraftDoublePlant::new); ++ register(net.minecraft.world.level.block.TallFlowerBlock.class, org.bukkit.craftbukkit.block.impl.CraftTallFlower::new); + register(net.minecraft.world.level.block.TargetBlock.class, org.bukkit.craftbukkit.block.impl.CraftTarget::new); +- register(net.minecraft.world.level.block.WallTorchBlock.class, org.bukkit.craftbukkit.block.impl.CraftTorchWall::new); +- register(net.minecraft.world.level.block.TrapDoorBlock.class, org.bukkit.craftbukkit.block.impl.CraftTrapdoor::new); +- register(net.minecraft.world.level.block.TripWireBlock.class, org.bukkit.craftbukkit.block.impl.CraftTripwire::new); +- register(net.minecraft.world.level.block.TripWireHookBlock.class, org.bukkit.craftbukkit.block.impl.CraftTripwireHook::new); ++ register(net.minecraft.world.level.block.WallTorchBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallTorch::new); ++ register(net.minecraft.world.level.block.TrapDoorBlock.class, org.bukkit.craftbukkit.block.impl.CraftTrapDoor::new); ++ register(net.minecraft.world.level.block.TripWireBlock.class, org.bukkit.craftbukkit.block.impl.CraftTripWire::new); ++ register(net.minecraft.world.level.block.TripWireHookBlock.class, org.bukkit.craftbukkit.block.impl.CraftTripWireHook::new); + register(net.minecraft.world.level.block.TurtleEggBlock.class, org.bukkit.craftbukkit.block.impl.CraftTurtleEgg::new); + register(net.minecraft.world.level.block.TwistingVinesBlock.class, org.bukkit.craftbukkit.block.impl.CraftTwistingVines::new); + register(net.minecraft.world.level.block.VineBlock.class, org.bukkit.craftbukkit.block.impl.CraftVine::new); + register(net.minecraft.world.level.block.WallSignBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallSign::new); + register(net.minecraft.world.level.block.WeepingVinesBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeepingVines::new); + register(net.minecraft.world.level.block.WitherSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftWitherSkull::new); +- register(net.minecraft.world.level.block.WitherWallSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftWitherSkullWall::new); ++ register(net.minecraft.world.level.block.WitherWallSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftWitherWallSkull::new); + register(net.minecraft.world.level.block.BrushableBlock.class, org.bukkit.craftbukkit.block.impl.CraftBrushable::new); + register(net.minecraft.world.level.block.CalibratedSculkSensorBlock.class, org.bukkit.craftbukkit.block.impl.CraftCalibratedSculkSensor::new); + register(net.minecraft.world.level.block.CandleBlock.class, org.bukkit.craftbukkit.block.impl.CraftCandle::new); +@@ -529,9 +536,9 @@ public class CraftBlockData implements BlockData { + register(net.minecraft.world.level.block.WeatheringCopperSlabBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperSlab::new); + register(net.minecraft.world.level.block.WeatheringCopperStairBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperStair::new); + register(net.minecraft.world.level.block.WeatheringCopperTrapDoorBlock.class, org.bukkit.craftbukkit.block.impl.CraftWeatheringCopperTrapDoor::new); +- register(net.minecraft.world.level.block.piston.PistonBaseBlock.class, org.bukkit.craftbukkit.block.impl.CraftPiston::new); +- register(net.minecraft.world.level.block.piston.PistonHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftPistonExtension::new); +- register(net.minecraft.world.level.block.piston.MovingPistonBlock.class, org.bukkit.craftbukkit.block.impl.CraftPistonMoving::new); ++ register(net.minecraft.world.level.block.piston.PistonBaseBlock.class, org.bukkit.craftbukkit.block.impl.CraftPistonBase::new); ++ register(net.minecraft.world.level.block.piston.PistonHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftPistonHead::new); ++ register(net.minecraft.world.level.block.piston.MovingPistonBlock.class, org.bukkit.craftbukkit.block.impl.CraftMovingPiston::new); + // + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStemAttached.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftAttachedStem.java +similarity index 69% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftStemAttached.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftAttachedStem.java +index 6da1ae7a8f938468843d4af5bd43c4f61497d7fe..071ac26f9b54dccd75b0a7f475b97d69f6b1d51f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStemAttached.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftAttachedStem.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftStemAttached extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { ++public final class CraftAttachedStem extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { + +- public CraftStemAttached() { ++ public CraftAttachedStem() { + super(); + } + +- public CraftStemAttached(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftAttachedStem(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftStemAttached extends org.bukkit.craftbukkit.block.data.C + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftStemAttached.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftAttachedStem.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftStemAttached.FACING, facing); ++ this.set(CraftAttachedStem.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftStemAttached.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftAttachedStem.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBamboo.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBambooStalk.java +similarity index 64% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftBamboo.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftBambooStalk.java +index ef37065539d5884300d62c3103763a31af35b653..eb3f6644ad98506b1f16d4f82a14f95811d6022a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBamboo.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBambooStalk.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftBamboo extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Bamboo, org.bukkit.block.data.Ageable, org.bukkit.block.data.type.Sapling { ++public final class CraftBambooStalk extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Bamboo, org.bukkit.block.data.Ageable, org.bukkit.block.data.type.Sapling { + +- public CraftBamboo() { ++ public CraftBambooStalk() { + super(); + } + +- public CraftBamboo(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftBambooStalk(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftBamboo extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public org.bukkit.block.data.type.Bamboo.Leaves getLeaves() { +- return this.get(CraftBamboo.LEAVES, org.bukkit.block.data.type.Bamboo.Leaves.class); ++ return this.get(CraftBambooStalk.LEAVES, org.bukkit.block.data.type.Bamboo.Leaves.class); + } + + @Override + public void setLeaves(org.bukkit.block.data.type.Bamboo.Leaves leaves) { +- this.set(CraftBamboo.LEAVES, leaves); ++ this.set(CraftBambooStalk.LEAVES, leaves); + } + + // org.bukkit.craftbukkit.block.data.CraftAgeable +@@ -33,17 +33,17 @@ public final class CraftBamboo extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public int getAge() { +- return this.get(CraftBamboo.AGE); ++ return this.get(CraftBambooStalk.AGE); + } + + @Override + public void setAge(int age) { +- this.set(CraftBamboo.AGE, age); ++ this.set(CraftBambooStalk.AGE, age); + } + + @Override + public int getMaximumAge() { +- return getMax(CraftBamboo.AGE); ++ return getMax(CraftBambooStalk.AGE); + } + + // org.bukkit.craftbukkit.block.data.type.CraftSapling +@@ -52,16 +52,16 @@ public final class CraftBamboo extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public int getStage() { +- return this.get(CraftBamboo.STAGE); ++ return this.get(CraftBambooStalk.STAGE); + } + + @Override + public void setStage(int stage) { +- this.set(CraftBamboo.STAGE, stage); ++ this.set(CraftBambooStalk.STAGE, stage); + } + + @Override + public int getMaximumStage() { +- return getMax(CraftBamboo.STAGE); ++ return getMax(CraftBambooStalk.STAGE); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanAbstract.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralFan.java +similarity index 57% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanAbstract.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralFan.java +index 88c371ca28fb02d71bbfe3746bd75538963d14a6..22641798645cf85372b69ddb7fed0bcb61f6cf2b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanAbstract.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralFan.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftCoralFanAbstract extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged { ++public final class CraftBaseCoralFan extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged { + +- public CraftCoralFanAbstract() { ++ public CraftBaseCoralFan() { + super(); + } + +- public CraftCoralFanAbstract(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftBaseCoralFan(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,11 +19,11 @@ public final class CraftCoralFanAbstract extends org.bukkit.craftbukkit.block.da + + @Override + public boolean isWaterlogged() { +- return this.get(CraftCoralFanAbstract.WATERLOGGED); ++ return this.get(CraftBaseCoralFan.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftCoralFanAbstract.WATERLOGGED, waterlogged); ++ this.set(CraftBaseCoralFan.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralDead.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralPlant.java +similarity index 58% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralDead.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralPlant.java +index 927ee9b69af1cab84775114c0a6e089271cdf144..500d821e2293ac1a62c40075c55bd8537bf00020 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralDead.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralPlant.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftCoralDead extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged { ++public final class CraftBaseCoralPlant extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged { + +- public CraftCoralDead() { ++ public CraftBaseCoralPlant() { + super(); + } + +- public CraftCoralDead(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftBaseCoralPlant(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,11 +19,11 @@ public final class CraftCoralDead extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public boolean isWaterlogged() { +- return this.get(CraftCoralDead.WATERLOGGED); ++ return this.get(CraftBaseCoralPlant.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftCoralDead.WATERLOGGED, waterlogged); ++ this.set(CraftBaseCoralPlant.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWallAbstract.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralWallFan.java +similarity index 57% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWallAbstract.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralWallFan.java +index b1715fcac88c7aad3f707e819036986d93af35f1..b0d5ba7f32b68a008375e89444aad078045ed7d1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWallAbstract.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBaseCoralWallFan.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftCoralFanWallAbstract extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CoralWallFan, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { ++public final class CraftBaseCoralWallFan extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CoralWallFan, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { + +- public CraftCoralFanWallAbstract() { ++ public CraftBaseCoralWallFan() { + super(); + } + +- public CraftCoralFanWallAbstract(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftBaseCoralWallFan(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,17 +19,17 @@ public final class CraftCoralFanWallAbstract extends org.bukkit.craftbukkit.bloc + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftCoralFanWallAbstract.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftBaseCoralWallFan.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftCoralFanWallAbstract.FACING, facing); ++ this.set(CraftBaseCoralWallFan.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftCoralFanWallAbstract.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftBaseCoralWallFan.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -38,11 +38,11 @@ public final class CraftCoralFanWallAbstract extends org.bukkit.craftbukkit.bloc + + @Override + public boolean isWaterlogged() { +- return this.get(CraftCoralFanWallAbstract.WATERLOGGED); ++ return this.get(CraftBaseCoralWallFan.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftCoralFanWallAbstract.WATERLOGGED, waterlogged); ++ this.set(CraftBaseCoralWallFan.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftButtonAbstract.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftButton.java +similarity index 63% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftButtonAbstract.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftButton.java +index e71fd199fd8eb7472c6f41908e2e711a338587c7..09e177b66648e03be53c758893ab71d380e96bc1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftButtonAbstract.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftButton.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftButtonAbstract extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Switch, org.bukkit.block.data.Directional, org.bukkit.block.data.FaceAttachable, org.bukkit.block.data.Powerable { ++public final class CraftButton extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Switch, org.bukkit.block.data.Directional, org.bukkit.block.data.FaceAttachable, org.bukkit.block.data.Powerable { + +- public CraftButtonAbstract() { ++ public CraftButton() { + super(); + } + +- public CraftButtonAbstract(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftButton(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftButtonAbstract extends org.bukkit.craftbukkit.block.data + + @Override + public org.bukkit.block.data.type.Switch.Face getFace() { +- return this.get(CraftButtonAbstract.FACE, org.bukkit.block.data.type.Switch.Face.class); ++ return this.get(CraftButton.FACE, org.bukkit.block.data.type.Switch.Face.class); + } + + @Override + public void setFace(org.bukkit.block.data.type.Switch.Face face) { +- this.set(CraftButtonAbstract.FACE, face); ++ this.set(CraftButton.FACE, face); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,17 +33,17 @@ public final class CraftButtonAbstract extends org.bukkit.craftbukkit.block.data + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftButtonAbstract.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftButton.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftButtonAbstract.FACING, facing); ++ this.set(CraftButton.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftButtonAbstract.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftButton.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftFaceAttachable +@@ -52,12 +52,12 @@ public final class CraftButtonAbstract extends org.bukkit.craftbukkit.block.data + + @Override + public org.bukkit.block.data.FaceAttachable.AttachedFace getAttachedFace() { +- return this.get(CraftButtonAbstract.ATTACH_FACE, org.bukkit.block.data.FaceAttachable.AttachedFace.class); ++ return this.get(CraftButton.ATTACH_FACE, org.bukkit.block.data.FaceAttachable.AttachedFace.class); + } + + @Override + public void setAttachedFace(org.bukkit.block.data.FaceAttachable.AttachedFace face) { +- this.set(CraftButtonAbstract.ATTACH_FACE, face); ++ this.set(CraftButton.ATTACH_FACE, face); + } + + // org.bukkit.craftbukkit.block.data.CraftPowerable +@@ -66,11 +66,11 @@ public final class CraftButtonAbstract extends org.bukkit.craftbukkit.block.data + + @Override + public boolean isPowered() { +- return this.get(CraftButtonAbstract.POWERED); ++ return this.get(CraftButton.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftButtonAbstract.POWERED, powered); ++ this.set(CraftButton.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCalibratedSculkSensor.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCalibratedSculkSensor.java +index decacf616d9c6f269890d5d4801775714eef4501..e438a66ca44451d78447479329e0ab860192f056 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCalibratedSculkSensor.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCalibratedSculkSensor.java +@@ -37,12 +37,12 @@ public final class CraftCalibratedSculkSensor extends org.bukkit.craftbukkit.blo + private static final net.minecraft.world.level.block.state.properties.EnumProperty PHASE = getEnum(net.minecraft.world.level.block.CalibratedSculkSensorBlock.class, "sculk_sensor_phase"); + + @Override +- public org.bukkit.block.data.type.SculkSensor.Phase getPhase() { ++ public org.bukkit.block.data.type.SculkSensor.Phase getSculkSensorPhase() { + return this.get(CraftCalibratedSculkSensor.PHASE, org.bukkit.block.data.type.SculkSensor.Phase.class); + } + + @Override +- public void setPhase(org.bukkit.block.data.type.SculkSensor.Phase phase) { ++ public void setSculkSensorPhase(org.bukkit.block.data.type.SculkSensor.Phase phase) { + this.set(CraftCalibratedSculkSensor.PHASE, phase); + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarrots.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarrot.java +similarity index 59% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarrots.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarrot.java +index 270416eb51c4aac676969bf51d8a719f2d5da0ac..1673cddda58db8c5c30f74fabc7f6d5729007274 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarrots.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarrot.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftCarrots extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { ++public final class CraftCarrot extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { + +- public CraftCarrots() { ++ public CraftCarrot() { + super(); + } + +- public CraftCarrots(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftCarrot(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftCarrots extends org.bukkit.craftbukkit.block.data.CraftB + + @Override + public int getAge() { +- return this.get(CraftCarrots.AGE); ++ return this.get(CraftCarrot.AGE); + } + + @Override + public void setAge(int age) { +- this.set(CraftCarrots.AGE, age); ++ this.set(CraftCarrot.AGE, age); + } + + @Override + public int getMaximumAge() { +- return getMax(CraftCarrots.AGE); ++ return getMax(CraftCarrot.AGE); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPumpkinCarved.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarvedPumpkin.java +similarity index 69% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftPumpkinCarved.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarvedPumpkin.java +index ddd573ae55dfbad98465b34432760fadbc97047f..70656fee95457ae367aa4b9cbe657698ec777636 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPumpkinCarved.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCarvedPumpkin.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftPumpkinCarved extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { ++public final class CraftCarvedPumpkin extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { + +- public CraftPumpkinCarved() { ++ public CraftCarvedPumpkin() { + super(); + } + +- public CraftPumpkinCarved(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftCarvedPumpkin(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftPumpkinCarved extends org.bukkit.craftbukkit.block.data. + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftPumpkinCarved.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftCarvedPumpkin.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftPumpkinCarved.FACING, facing); ++ this.set(CraftCarvedPumpkin.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftPumpkinCarved.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftCarvedPumpkin.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCaveVines.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCaveVines.java +index 5b387ce833e27298f85618fa922362e613aa9913..d038315271d3a2fa1ffe503c1fad48587079fc4d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCaveVines.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCaveVines.java +@@ -37,7 +37,7 @@ public final class CraftCaveVines extends org.bukkit.craftbukkit.block.data.Craf + private static final net.minecraft.world.level.block.state.properties.BooleanProperty BERRIES = getBoolean(net.minecraft.world.level.block.CaveVinesBlock.class, "berries"); + + @Override +- public boolean isBerries() { ++ public boolean hasBerries() { + return this.get(CraftCaveVines.BERRIES); + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCaveVinesPlant.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCaveVinesPlant.java +index b8c199bfbe5bd7a965f408404e752a5c017e7fa5..bc1b127e7973df62e2f2b542dd8232409ad2d231 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCaveVinesPlant.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCaveVinesPlant.java +@@ -18,7 +18,7 @@ public final class CraftCaveVinesPlant extends org.bukkit.craftbukkit.block.data + private static final net.minecraft.world.level.block.state.properties.BooleanProperty BERRIES = getBoolean(net.minecraft.world.level.block.CaveVinesPlantBlock.class, "berries"); + + @Override +- public boolean isBerries() { ++ public boolean hasBerries() { + return this.get(CraftCaveVinesPlant.BERRIES); + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftChorusFruit.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftChorusPlant.java +similarity index 81% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftChorusFruit.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftChorusPlant.java +index 60190a7ce9ff4fff8f926534977305801c746ba0..4078776393950e8df8ddc4dbb3f2d8ee3fe230d3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftChorusFruit.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftChorusPlant.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftChorusFruit extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.MultipleFacing { ++public final class CraftChorusPlant extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.MultipleFacing { + +- public CraftChorusFruit() { ++ public CraftChorusPlant() { + super(); + } + +- public CraftChorusFruit(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftChorusPlant(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -21,7 +21,7 @@ public final class CraftChorusFruit extends org.bukkit.craftbukkit.block.data.Cr + + @Override + public boolean hasFace(org.bukkit.block.BlockFace face) { +- net.minecraft.world.level.block.state.properties.BooleanProperty state = CraftChorusFruit.FACES[face.ordinal()]; ++ net.minecraft.world.level.block.state.properties.BooleanProperty state = CraftChorusPlant.FACES[face.ordinal()]; + if (state == null) { + throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces."); + } +@@ -30,7 +30,7 @@ public final class CraftChorusFruit extends org.bukkit.craftbukkit.block.data.Cr + + @Override + public void setFace(org.bukkit.block.BlockFace face, boolean has) { +- net.minecraft.world.level.block.state.properties.BooleanProperty state = CraftChorusFruit.FACES[face.ordinal()]; ++ net.minecraft.world.level.block.state.properties.BooleanProperty state = CraftChorusPlant.FACES[face.ordinal()]; + if (state == null) { + throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces."); + } +@@ -41,8 +41,8 @@ public final class CraftChorusFruit extends org.bukkit.craftbukkit.block.data.Cr + public java.util.Set getFaces() { + com.google.common.collect.ImmutableSet.Builder faces = com.google.common.collect.ImmutableSet.builder(); + +- for (int i = 0; i < CraftChorusFruit.FACES.length; i++) { +- if (CraftChorusFruit.FACES[i] != null && this.get(CraftChorusFruit.FACES[i])) { ++ for (int i = 0; i < CraftChorusPlant.FACES.length; i++) { ++ if (CraftChorusPlant.FACES[i] != null && this.get(CraftChorusPlant.FACES[i])) { + faces.add(org.bukkit.block.BlockFace.values()[i]); + } + } +@@ -54,8 +54,8 @@ public final class CraftChorusFruit extends org.bukkit.craftbukkit.block.data.Cr + public java.util.Set getAllowedFaces() { + com.google.common.collect.ImmutableSet.Builder faces = com.google.common.collect.ImmutableSet.builder(); + +- for (int i = 0; i < CraftChorusFruit.FACES.length; i++) { +- if (CraftChorusFruit.FACES[i] != null) { ++ for (int i = 0; i < CraftChorusPlant.FACES.length; i++) { ++ if (CraftChorusPlant.FACES[i] != null) { + faces.add(org.bukkit.block.BlockFace.values()[i]); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCommand.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCommandBlock.java +similarity index 61% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftCommand.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftCommandBlock.java +index 14a788410c91c4f45d26dc806fb3f01ee8010324..2e69af960276c0832f672e925d8cd6bcdff35a60 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCommand.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCommandBlock.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftCommand extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CommandBlock, org.bukkit.block.data.Directional { ++public final class CraftCommandBlock extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CommandBlock, org.bukkit.block.data.Directional { + +- public CraftCommand() { ++ public CraftCommandBlock() { + super(); + } + +- public CraftCommand(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftCommandBlock(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftCommand extends org.bukkit.craftbukkit.block.data.CraftB + + @Override + public boolean isConditional() { +- return this.get(CraftCommand.CONDITIONAL); ++ return this.get(CraftCommandBlock.CONDITIONAL); + } + + @Override + public void setConditional(boolean conditional) { +- this.set(CraftCommand.CONDITIONAL, conditional); ++ this.set(CraftCommandBlock.CONDITIONAL, conditional); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,16 +33,16 @@ public final class CraftCommand extends org.bukkit.craftbukkit.block.data.CraftB + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftCommand.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftCommandBlock.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftCommand.FACING, facing); ++ this.set(CraftCommandBlock.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftCommand.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftCommandBlock.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneComparator.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComparator.java +similarity index 61% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneComparator.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftComparator.java +index d3d68ae06eb9faff0511f8d7c250ff9433285fb6..65bf4337c2505145551fe677ace57904aec8f898 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneComparator.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComparator.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftRedstoneComparator extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Comparator, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { ++public final class CraftComparator extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Comparator, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { + +- public CraftRedstoneComparator() { ++ public CraftComparator() { + super(); + } + +- public CraftRedstoneComparator(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftComparator(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftRedstoneComparator extends org.bukkit.craftbukkit.block. + + @Override + public org.bukkit.block.data.type.Comparator.Mode getMode() { +- return this.get(CraftRedstoneComparator.MODE, org.bukkit.block.data.type.Comparator.Mode.class); ++ return this.get(CraftComparator.MODE, org.bukkit.block.data.type.Comparator.Mode.class); + } + + @Override + public void setMode(org.bukkit.block.data.type.Comparator.Mode mode) { +- this.set(CraftRedstoneComparator.MODE, mode); ++ this.set(CraftComparator.MODE, mode); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,17 +33,17 @@ public final class CraftRedstoneComparator extends org.bukkit.craftbukkit.block. + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftRedstoneComparator.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftComparator.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftRedstoneComparator.FACING, facing); ++ this.set(CraftComparator.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftRedstoneComparator.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftComparator.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftPowerable +@@ -52,11 +52,11 @@ public final class CraftRedstoneComparator extends org.bukkit.craftbukkit.block. + + @Override + public boolean isPowered() { +- return this.get(CraftRedstoneComparator.POWERED); ++ return this.get(CraftComparator.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftRedstoneComparator.POWERED, powered); ++ this.set(CraftComparator.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralWallFan.java +similarity index 73% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWall.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralWallFan.java +index 0928c60c29a32336db3a6f0a623da516542315d6..970669c8bdf5b060ea3aa934dc0939a03253dbb2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWall.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralWallFan.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftCoralFanWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CoralWallFan, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { ++public final class CraftCoralWallFan extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CoralWallFan, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { + +- public CraftCoralFanWall() { ++ public CraftCoralWallFan() { + super(); + } + +- public CraftCoralFanWall(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftCoralWallFan(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,17 +19,17 @@ public final class CraftCoralFanWall extends org.bukkit.craftbukkit.block.data.C + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftCoralFanWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftCoralWallFan.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftCoralFanWall.FACING, facing); ++ this.set(CraftCoralWallFan.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftCoralFanWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftCoralWallFan.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -38,11 +38,11 @@ public final class CraftCoralFanWall extends org.bukkit.craftbukkit.block.data.C + + @Override + public boolean isWaterlogged() { +- return this.get(CraftCoralFanWall.WATERLOGGED); ++ return this.get(CraftCoralWallFan.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftCoralFanWall.WATERLOGGED, waterlogged); ++ this.set(CraftCoralWallFan.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrafter.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrafter.java +index 78b8a7cda5171cd10fdc8f0986b62052cd7b9c88..458e9a835723d65f8b0afecd2c31180b56d3cdf4 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrafter.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrafter.java +@@ -40,12 +40,12 @@ public final class CraftCrafter extends org.bukkit.craftbukkit.block.data.CraftB + } + + @Override +- public org.bukkit.block.data.type.Crafter.Orientation getOrientation() { +- return this.get(CraftCrafter.ORIENTATION, org.bukkit.block.data.type.Crafter.Orientation.class); ++ public org.bukkit.block.Orientation getOrientation() { ++ return this.get(CraftCrafter.ORIENTATION, org.bukkit.block.Orientation.class); + } + + @Override +- public void setOrientation(org.bukkit.block.data.type.Crafter.Orientation orientation) { ++ public void setOrientation(org.bukkit.block.Orientation orientation) { + this.set(CraftCrafter.ORIENTATION, orientation); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftReed.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrop.java +similarity index 65% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftReed.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrop.java +index 4d613c6703895db2a6ad07c38d8c3e6443c1680a..89913249e79547733e8021933e3b34d5e0cfa6a8 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftReed.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrop.java +@@ -3,32 +3,32 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftReed extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { ++public final class CraftCrop extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { + +- public CraftReed() { ++ public CraftCrop() { + super(); + } + +- public CraftReed(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftCrop(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + + // org.bukkit.craftbukkit.block.data.CraftAgeable + +- private static final net.minecraft.world.level.block.state.properties.IntegerProperty AGE = getInteger(net.minecraft.world.level.block.SugarCaneBlock.class, "age"); ++ private static final net.minecraft.world.level.block.state.properties.IntegerProperty AGE = getInteger(net.minecraft.world.level.block.CropBlock.class, "age"); + + @Override + public int getAge() { +- return this.get(CraftReed.AGE); ++ return this.get(CraftCrop.AGE); + } + + @Override + public void setAge(int age) { +- this.set(CraftReed.AGE, age); ++ this.set(CraftCrop.AGE, age); + } + + @Override + public int getMaximumAge() { +- return getMax(CraftReed.AGE); ++ return getMax(CraftCrop.AGE); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMinecartDetector.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftDetectorRail.java +similarity index 61% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftMinecartDetector.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftDetectorRail.java +index a462ef71becae4a720d766277c19c70a7239794e..7c7daa7af629e755955284581f5ec736e28fa38f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMinecartDetector.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftDetectorRail.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftMinecartDetector extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.RedstoneRail, org.bukkit.block.data.Powerable, org.bukkit.block.data.Rail, org.bukkit.block.data.Waterlogged { ++public final class CraftDetectorRail extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.RedstoneRail, org.bukkit.block.data.Powerable, org.bukkit.block.data.Rail, org.bukkit.block.data.Waterlogged { + +- public CraftMinecartDetector() { ++ public CraftDetectorRail() { + super(); + } + +- public CraftMinecartDetector(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftDetectorRail(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftMinecartDetector extends org.bukkit.craftbukkit.block.da + + @Override + public boolean isPowered() { +- return this.get(CraftMinecartDetector.POWERED); ++ return this.get(CraftDetectorRail.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftMinecartDetector.POWERED, powered); ++ this.set(CraftDetectorRail.POWERED, powered); + } + + // org.bukkit.craftbukkit.block.data.CraftRail +@@ -33,17 +33,17 @@ public final class CraftMinecartDetector extends org.bukkit.craftbukkit.block.da + + @Override + public org.bukkit.block.data.Rail.Shape getShape() { +- return this.get(CraftMinecartDetector.SHAPE, org.bukkit.block.data.Rail.Shape.class); ++ return this.get(CraftDetectorRail.SHAPE, org.bukkit.block.data.Rail.Shape.class); + } + + @Override + public void setShape(org.bukkit.block.data.Rail.Shape shape) { +- this.set(CraftMinecartDetector.SHAPE, shape); ++ this.set(CraftDetectorRail.SHAPE, shape); + } + + @Override + public java.util.Set getShapes() { +- return this.getValues(CraftMinecartDetector.SHAPE, org.bukkit.block.data.Rail.Shape.class); ++ return this.getValues(CraftDetectorRail.SHAPE, org.bukkit.block.data.Rail.Shape.class); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -52,11 +52,11 @@ public final class CraftMinecartDetector extends org.bukkit.craftbukkit.block.da + + @Override + public boolean isWaterlogged() { +- return this.get(CraftMinecartDetector.WATERLOGGED); ++ return this.get(CraftDetectorRail.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftMinecartDetector.WATERLOGGED, waterlogged); ++ this.set(CraftDetectorRail.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallPlant.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftDoublePlant.java +similarity index 58% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallPlant.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftDoublePlant.java +index 0bbe254ba2fc19fb43cec2c8fe4a2dc3386d8da7..b34d99f1f37ed53da22b8b2bb792ea5bc66bd39b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallPlant.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftDoublePlant.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftTallPlant extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Bisected { ++public final class CraftDoublePlant extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Bisected { + +- public CraftTallPlant() { ++ public CraftDoublePlant() { + super(); + } + +- public CraftTallPlant(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftDoublePlant(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,11 +19,11 @@ public final class CraftTallPlant extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { +- return this.get(CraftTallPlant.HALF, org.bukkit.block.data.Bisected.Half.class); ++ return this.get(CraftDoublePlant.HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(org.bukkit.block.data.Bisected.Half half) { +- this.set(CraftTallPlant.HALF, half); ++ this.set(CraftDoublePlant.HALF, half); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftEnderPortalFrame.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftEndPortalFrame.java +similarity index 60% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftEnderPortalFrame.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftEndPortalFrame.java +index d1959292a5e9d68dcf65ef03af376b47daa39c8b..c9d6b45a32f81584052803bf191af995a1f440f4 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftEnderPortalFrame.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftEndPortalFrame.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftEnderPortalFrame extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.EndPortalFrame, org.bukkit.block.data.Directional { ++public final class CraftEndPortalFrame extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.EndPortalFrame, org.bukkit.block.data.Directional { + +- public CraftEnderPortalFrame() { ++ public CraftEndPortalFrame() { + super(); + } + +- public CraftEnderPortalFrame(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftEndPortalFrame(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftEnderPortalFrame extends org.bukkit.craftbukkit.block.da + + @Override + public boolean hasEye() { +- return this.get(CraftEnderPortalFrame.EYE); ++ return this.get(CraftEndPortalFrame.EYE); + } + + @Override + public void setEye(boolean eye) { +- this.set(CraftEnderPortalFrame.EYE, eye); ++ this.set(CraftEndPortalFrame.EYE, eye); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,16 +33,16 @@ public final class CraftEnderPortalFrame extends org.bukkit.craftbukkit.block.da + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftEnderPortalFrame.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftEndPortalFrame.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftEnderPortalFrame.FACING, facing); ++ this.set(CraftEndPortalFrame.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftEnderPortalFrame.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftEndPortalFrame.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSoil.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFarm.java +similarity index 69% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftSoil.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftFarm.java +index 56f701e9f088a3bd4579b9a093ef7ee0bce11f95..939c464c07b5c23aed1f884cbbc52f0417f0534b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSoil.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFarm.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftSoil extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Farmland { ++public final class CraftFarm extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Farmland { + +- public CraftSoil() { ++ public CraftFarm() { + super(); + } + +- public CraftSoil(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftFarm(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftSoil extends org.bukkit.craftbukkit.block.data.CraftBloc + + @Override + public int getMoisture() { +- return this.get(CraftSoil.MOISTURE); ++ return this.get(CraftFarm.MOISTURE); + } + + @Override + public void setMoisture(int moisture) { +- this.set(CraftSoil.MOISTURE, moisture); ++ this.set(CraftFarm.MOISTURE, moisture); + } + + @Override + public int getMaximumMoisture() { +- return getMax(CraftSoil.MOISTURE); ++ return getMax(CraftFarm.MOISTURE); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftIceFrost.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFrostedIce.java +similarity index 58% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftIceFrost.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftFrostedIce.java +index 85367beeccdc127e4798b0f626d40209586074d6..4a1a3df5460a0f8b82cc86d84f98179d9722b169 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftIceFrost.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFrostedIce.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftIceFrost extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { ++public final class CraftFrostedIce extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { + +- public CraftIceFrost() { ++ public CraftFrostedIce() { + super(); + } + +- public CraftIceFrost(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftFrostedIce(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftIceFrost extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public int getAge() { +- return this.get(CraftIceFrost.AGE); ++ return this.get(CraftFrostedIce.AGE); + } + + @Override + public void setAge(int age) { +- this.set(CraftIceFrost.AGE, age); ++ this.set(CraftFrostedIce.AGE, age); + } + + @Override + public int getMaximumAge() { +- return getMax(CraftIceFrost.AGE); ++ return getMax(CraftFrostedIce.AGE); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFurnaceFurace.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFurnace.java +similarity index 60% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftFurnaceFurace.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftFurnace.java +index 5698cb115ba6dcf50686bb8cfb82e97d6afecd9f..74b7a975885730d6015edf128c6de558a01760e3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFurnaceFurace.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFurnace.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftFurnaceFurace extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Furnace, org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable { ++public final class CraftFurnace extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Furnace, org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable { + +- public CraftFurnaceFurace() { ++ public CraftFurnace() { + super(); + } + +- public CraftFurnaceFurace(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftFurnace(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,17 +19,17 @@ public final class CraftFurnaceFurace extends org.bukkit.craftbukkit.block.data. + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftFurnaceFurace.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftFurnace.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftFurnaceFurace.FACING, facing); ++ this.set(CraftFurnace.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftFurnaceFurace.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftFurnace.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftLightable +@@ -38,11 +38,11 @@ public final class CraftFurnaceFurace extends org.bukkit.craftbukkit.block.data. + + @Override + public boolean isLit() { +- return this.get(CraftFurnaceFurace.LIT); ++ return this.get(CraftFurnace.LIT); + } + + @Override + public void setLit(boolean lit) { +- this.set(CraftFurnaceFurace.LIT, lit); ++ this.set(CraftFurnace.LIT, lit); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftJigsaw.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftJigsaw.java +index 12237538df404ebe6820418be0151ade2d6715f0..bc02aa25d3899c1dfdd3f9c2ccd217e69518f273 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftJigsaw.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftJigsaw.java +@@ -18,12 +18,12 @@ public final class CraftJigsaw extends org.bukkit.craftbukkit.block.data.CraftBl + private static final net.minecraft.world.level.block.state.properties.EnumProperty ORIENTATION = getEnum(net.minecraft.world.level.block.JigsawBlock.class, "orientation"); + + @Override +- public org.bukkit.block.data.type.Jigsaw.Orientation getOrientation() { +- return this.get(CraftJigsaw.ORIENTATION, org.bukkit.block.data.type.Jigsaw.Orientation.class); ++ public org.bukkit.block.Orientation getOrientation() { ++ return this.get(CraftJigsaw.ORIENTATION, org.bukkit.block.Orientation.class); + } + + @Override +- public void setOrientation(org.bukkit.block.data.type.Jigsaw.Orientation orientation) { ++ public void setOrientation(org.bukkit.block.Orientation orientation) { + this.set(CraftJigsaw.ORIENTATION, orientation); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftJukeBox.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftJukebox.java +similarity index 62% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftJukeBox.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftJukebox.java +index 3e37557bf63597908949c6f8bbb2478cdb0557f3..42a113f262ac6e65b1e333ff18be9ee430e98e22 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftJukeBox.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftJukebox.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftJukeBox extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Jukebox { ++public final class CraftJukebox extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Jukebox { + +- public CraftJukeBox() { ++ public CraftJukebox() { + super(); + } + +- public CraftJukeBox(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftJukebox(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,6 +19,11 @@ public final class CraftJukeBox extends org.bukkit.craftbukkit.block.data.CraftB + + @Override + public boolean hasRecord() { +- return this.get(CraftJukeBox.HAS_RECORD); ++ return this.get(CraftJukebox.HAS_RECORD); ++ } ++ ++ @Override ++ public void setHasRecord(boolean hasRecord) { ++ this.set(CraftJukebox.HAS_RECORD, hasRecord); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLectern.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLectern.java +index ee53b1520825b935f60cdb3fc271f6cc911b56ee..958cc06ba16cc6b81845163a8ea10957ee771e6f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLectern.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLectern.java +@@ -22,6 +22,11 @@ public final class CraftLectern extends org.bukkit.craftbukkit.block.data.CraftB + return this.get(CraftLectern.HAS_BOOK); + } + ++ @Override ++ public void setHasBook(boolean hasBook) { ++ this.set(CraftLectern.HAS_BOOK, hasBook); ++ } ++ + // org.bukkit.craftbukkit.block.data.CraftDirectional + + private static final net.minecraft.world.level.block.state.properties.EnumProperty FACING = getEnum(net.minecraft.world.level.block.LecternBlock.class, "facing"); +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFluids.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLiquid.java +similarity index 69% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftFluids.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftLiquid.java +index 1af5fe48c5861077555e6bdeb6312859b7b37eb2..0441597d0836b35e59fcecdc638876437cf803e6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFluids.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLiquid.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftFluids extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Levelled { ++public final class CraftLiquid extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Levelled { + +- public CraftFluids() { ++ public CraftLiquid() { + super(); + } + +- public CraftFluids(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftLiquid(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,23 +19,23 @@ public final class CraftFluids extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public int getLevel() { +- return this.get(CraftFluids.LEVEL); ++ return this.get(CraftLiquid.LEVEL); + } + + @Override + public void setLevel(int level) { +- this.set(CraftFluids.LEVEL, level); ++ this.set(CraftLiquid.LEVEL, level); + } + + @Override + public int getMaximumLevel() { +- return getMax(CraftFluids.LEVEL); ++ return getMax(CraftLiquid.LEVEL); + } + + // Paper start + @Override + public int getMinimumLevel() { +- return getMin(CraftFluids.LEVEL); ++ return getMin(CraftLiquid.LEVEL); + } + // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonMoving.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMovingPiston.java +similarity index 74% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonMoving.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftMovingPiston.java +index 497843a5e6bfd8f9dc811b38cf469bb062a2ec8e..f3caf6d682a5d3c76d9a69432bbbb391b8d49668 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonMoving.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMovingPiston.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftPistonMoving extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TechnicalPiston, org.bukkit.block.data.Directional { ++public final class CraftMovingPiston extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TechnicalPiston, org.bukkit.block.data.Directional { + +- public CraftPistonMoving() { ++ public CraftMovingPiston() { + super(); + } + +- public CraftPistonMoving(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftMovingPiston(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftPistonMoving extends org.bukkit.craftbukkit.block.data.C + + @Override + public org.bukkit.block.data.type.TechnicalPiston.Type getType() { +- return this.get(CraftPistonMoving.TYPE, org.bukkit.block.data.type.TechnicalPiston.Type.class); ++ return this.get(CraftMovingPiston.TYPE, org.bukkit.block.data.type.TechnicalPiston.Type.class); + } + + @Override + public void setType(org.bukkit.block.data.type.TechnicalPiston.Type type) { +- this.set(CraftPistonMoving.TYPE, type); ++ this.set(CraftMovingPiston.TYPE, type); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,16 +33,16 @@ public final class CraftPistonMoving extends org.bukkit.craftbukkit.block.data.C + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftPistonMoving.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftMovingPiston.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftPistonMoving.FACING, facing); ++ this.set(CraftMovingPiston.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftPistonMoving.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftMovingPiston.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftDirtSnow.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMycelium.java +similarity index 65% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftDirtSnow.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftMycelium.java +index a2d3b1f7a7990db003b6f0ceeb5c16c23b2f516b..ea49a048e2018cba136fc65c4921314881ff8faa 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftDirtSnow.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMycelium.java +@@ -3,27 +3,27 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftDirtSnow extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Snowable { ++public final class CraftMycelium extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Snowable { + +- public CraftDirtSnow() { ++ public CraftMycelium() { + super(); + } + +- public CraftDirtSnow(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftMycelium(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + + // org.bukkit.craftbukkit.block.data.CraftSnowable + +- private static final net.minecraft.world.level.block.state.properties.BooleanProperty SNOWY = getBoolean(net.minecraft.world.level.block.SnowyDirtBlock.class, "snowy"); ++ private static final net.minecraft.world.level.block.state.properties.BooleanProperty SNOWY = getBoolean(net.minecraft.world.level.block.MyceliumBlock.class, "snowy"); + + @Override + public boolean isSnowy() { +- return this.get(CraftDirtSnow.SNOWY); ++ return this.get(CraftMycelium.SNOWY); + } + + @Override + public void setSnowy(boolean snowy) { +- this.set(CraftDirtSnow.SNOWY, snowy); ++ this.set(CraftMycelium.SNOWY, snowy); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPortal.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftNetherPortal.java +similarity index 57% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftPortal.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftNetherPortal.java +index 0f182381c1c098cd1bdc91c239731f2e8b4eeef1..834c0aff8fd6d04fc92a1b4423ffb7ed80f8d518 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPortal.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftNetherPortal.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftPortal extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Orientable { ++public final class CraftNetherPortal extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Orientable { + +- public CraftPortal() { ++ public CraftNetherPortal() { + super(); + } + +- public CraftPortal(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftNetherPortal(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftPortal extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public org.bukkit.Axis getAxis() { +- return this.get(CraftPortal.AXIS, org.bukkit.Axis.class); ++ return this.get(CraftNetherPortal.AXIS, org.bukkit.Axis.class); + } + + @Override + public void setAxis(org.bukkit.Axis axis) { +- this.set(CraftPortal.AXIS, axis); ++ this.set(CraftNetherPortal.AXIS, axis); + } + + @Override + public java.util.Set getAxes() { +- return this.getValues(CraftPortal.AXIS, org.bukkit.Axis.class); ++ return this.getValues(CraftNetherPortal.AXIS, org.bukkit.Axis.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftNote.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftNoteBlock.java +similarity index 64% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftNote.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftNoteBlock.java +index 60675e55191f8d68ee7694eaad7393604cd2bc4a..94c67d73270d79858d75e21fb5afa59af5124d94 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftNote.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftNoteBlock.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftNote extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.NoteBlock, org.bukkit.block.data.Powerable { ++public final class CraftNoteBlock extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.NoteBlock, org.bukkit.block.data.Powerable { + +- public CraftNote() { ++ public CraftNoteBlock() { + super(); + } + +- public CraftNote(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftNoteBlock(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -20,22 +20,22 @@ public final class CraftNote extends org.bukkit.craftbukkit.block.data.CraftBloc + + @Override + public org.bukkit.Instrument getInstrument() { +- return this.get(CraftNote.INSTRUMENT, org.bukkit.Instrument.class); ++ return this.get(CraftNoteBlock.INSTRUMENT, org.bukkit.Instrument.class); + } + + @Override + public void setInstrument(org.bukkit.Instrument instrument) { +- this.set(CraftNote.INSTRUMENT, instrument); ++ this.set(CraftNoteBlock.INSTRUMENT, instrument); + } + + @Override + public org.bukkit.Note getNote() { +- return new org.bukkit.Note(this.get(CraftNote.NOTE)); ++ return new org.bukkit.Note(this.get(CraftNoteBlock.NOTE)); + } + + @Override + public void setNote(org.bukkit.Note note) { +- this.set(CraftNote.NOTE, (int) note.getId()); ++ this.set(CraftNoteBlock.NOTE, (int) note.getId()); + } + + // org.bukkit.craftbukkit.block.data.CraftPowerable +@@ -44,11 +44,11 @@ public final class CraftNote extends org.bukkit.craftbukkit.block.data.CraftBloc + + @Override + public boolean isPowered() { +- return this.get(CraftNote.POWERED); ++ return this.get(CraftNoteBlock.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftNote.POWERED, powered); ++ this.set(CraftNoteBlock.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPiston.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonBase.java +similarity index 62% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftPiston.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonBase.java +index f31db7daf2b9369aa3a93e83a5878c7db5cbee11..68aa984c3a2beb90b33e8185bc816e4121b3b616 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPiston.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonBase.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftPiston extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Piston, org.bukkit.block.data.Directional { ++public final class CraftPistonBase extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Piston, org.bukkit.block.data.Directional { + +- public CraftPiston() { ++ public CraftPistonBase() { + super(); + } + +- public CraftPiston(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftPistonBase(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftPiston extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public boolean isExtended() { +- return this.get(CraftPiston.EXTENDED); ++ return this.get(CraftPistonBase.EXTENDED); + } + + @Override + public void setExtended(boolean extended) { +- this.set(CraftPiston.EXTENDED, extended); ++ this.set(CraftPistonBase.EXTENDED, extended); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,16 +33,16 @@ public final class CraftPiston extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftPiston.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftPistonBase.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftPiston.FACING, facing); ++ this.set(CraftPistonBase.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftPiston.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftPistonBase.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonExtension.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonHead.java +similarity index 62% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonExtension.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonHead.java +index 21b6d3c11c454b7fb3d021423d8b40893e391406..965e110e453173bbeae11614d2a2987a1bec4a00 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonExtension.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPistonHead.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftPistonExtension extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.PistonHead, org.bukkit.block.data.type.TechnicalPiston, org.bukkit.block.data.Directional { ++public final class CraftPistonHead extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.PistonHead, org.bukkit.block.data.type.TechnicalPiston, org.bukkit.block.data.Directional { + +- public CraftPistonExtension() { ++ public CraftPistonHead() { + super(); + } + +- public CraftPistonExtension(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftPistonHead(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftPistonExtension extends org.bukkit.craftbukkit.block.dat + + @Override + public boolean isShort() { +- return this.get(CraftPistonExtension.SHORT); ++ return this.get(CraftPistonHead.SHORT); + } + + @Override + public void setShort(boolean _short) { +- this.set(CraftPistonExtension.SHORT, _short); ++ this.set(CraftPistonHead.SHORT, _short); + } + + // org.bukkit.craftbukkit.block.data.type.CraftTechnicalPiston +@@ -33,12 +33,12 @@ public final class CraftPistonExtension extends org.bukkit.craftbukkit.block.dat + + @Override + public org.bukkit.block.data.type.TechnicalPiston.Type getType() { +- return this.get(CraftPistonExtension.TYPE, org.bukkit.block.data.type.TechnicalPiston.Type.class); ++ return this.get(CraftPistonHead.TYPE, org.bukkit.block.data.type.TechnicalPiston.Type.class); + } + + @Override + public void setType(org.bukkit.block.data.type.TechnicalPiston.Type type) { +- this.set(CraftPistonExtension.TYPE, type); ++ this.set(CraftPistonHead.TYPE, type); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -47,16 +47,16 @@ public final class CraftPistonExtension extends org.bukkit.craftbukkit.block.dat + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftPistonExtension.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftPistonHead.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftPistonExtension.FACING, facing); ++ this.set(CraftPistonHead.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftPistonExtension.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftPistonHead.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayer.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPlayerHead.java +similarity index 87% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayer.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftPlayerHead.java +index 9f956fd19c8fe3466da17ab7b48ff94f8d24bb2c..16902337f1a1e17279be3b5ae7ed921d406190bb 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPlayerHead.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftSkullPlayer extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Skull, org.bukkit.block.data.Powerable, org.bukkit.block.data.Rotatable { ++public final class CraftPlayerHead extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Skull, org.bukkit.block.data.Powerable, org.bukkit.block.data.Rotatable { + +- public CraftSkullPlayer() { ++ public CraftPlayerHead() { + super(); + } + +- public CraftSkullPlayer(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftPlayerHead(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftSkullPlayer extends org.bukkit.craftbukkit.block.data.Cr + + @Override + public boolean isPowered() { +- return this.get(CraftSkullPlayer.POWERED); ++ return this.get(CraftPlayerHead.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftSkullPlayer.POWERED, powered); ++ this.set(CraftPlayerHead.POWERED, powered); + } + + // org.bukkit.craftbukkit.block.data.CraftRotatable +@@ -33,7 +33,7 @@ public final class CraftSkullPlayer extends org.bukkit.craftbukkit.block.data.Cr + + @Override + public org.bukkit.block.BlockFace getRotation() { +- int data = this.get(CraftSkullPlayer.ROTATION); ++ int data = this.get(CraftPlayerHead.ROTATION); + switch (data) { + case 0x0: + return org.bukkit.block.BlockFace.SOUTH; +@@ -127,6 +127,6 @@ public final class CraftSkullPlayer extends org.bukkit.craftbukkit.block.data.Cr + default: + throw new IllegalArgumentException("Illegal rotation " + rotation); + } +- this.set(CraftSkullPlayer.ROTATION, val); ++ this.set(CraftPlayerHead.ROTATION, val); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayerWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPlayerWallHead.java +similarity index 59% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayerWall.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftPlayerWallHead.java +index c73be942b038f13956838447a6eac7a4f637dbd9..346aad242a5b8c2213ef7df5c721ac98a6a65a14 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullPlayerWall.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPlayerWallHead.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftSkullPlayerWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { ++public final class CraftPlayerWallHead extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { + +- public CraftSkullPlayerWall() { ++ public CraftPlayerWallHead() { + super(); + } + +- public CraftSkullPlayerWall(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftPlayerWallHead(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,17 +19,17 @@ public final class CraftSkullPlayerWall extends org.bukkit.craftbukkit.block.dat + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftSkullPlayerWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftPlayerWallHead.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftSkullPlayerWall.FACING, facing); ++ this.set(CraftPlayerWallHead.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftSkullPlayerWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftPlayerWallHead.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftPowerable +@@ -38,11 +38,11 @@ public final class CraftSkullPlayerWall extends org.bukkit.craftbukkit.block.dat + + @Override + public boolean isPowered() { +- return this.get(CraftSkullPlayerWall.POWERED); ++ return this.get(CraftPlayerWallHead.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftSkullPlayerWall.POWERED, powered); ++ this.set(CraftPlayerWallHead.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPotatoes.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPotato.java +similarity index 59% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftPotatoes.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftPotato.java +index ee3faab6b3d2371579dfdb619c1aae2109e22211..ebd28af68a7ecc8e02b492aee37d7d428f265a8d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPotatoes.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPotato.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftPotatoes extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { ++public final class CraftPotato extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { + +- public CraftPotatoes() { ++ public CraftPotato() { + super(); + } + +- public CraftPotatoes(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftPotato(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftPotatoes extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public int getAge() { +- return this.get(CraftPotatoes.AGE); ++ return this.get(CraftPotato.AGE); + } + + @Override + public void setAge(int age) { +- this.set(CraftPotatoes.AGE, age); ++ this.set(CraftPotato.AGE, age); + } + + @Override + public int getMaximumAge() { +- return getMax(CraftPotatoes.AGE); ++ return getMax(CraftPotato.AGE); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlateBinary.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlate.java +similarity index 56% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlateBinary.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlate.java +index 05c7662f441cbbc9d6b82a169dbfc6a7f9093d4d..ca5f1977a8fd54f53d7ada152a9a1a5bc3c1c690 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlateBinary.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlate.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftPressurePlateBinary extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Powerable { ++public final class CraftPressurePlate extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Powerable { + +- public CraftPressurePlateBinary() { ++ public CraftPressurePlate() { + super(); + } + +- public CraftPressurePlateBinary(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftPressurePlate(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,11 +19,11 @@ public final class CraftPressurePlateBinary extends org.bukkit.craftbukkit.block + + @Override + public boolean isPowered() { +- return this.get(CraftPressurePlateBinary.POWERED); ++ return this.get(CraftPressurePlate.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftPressurePlateBinary.POWERED, powered); ++ this.set(CraftPressurePlate.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMinecartTrack.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRail.java +similarity index 60% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftMinecartTrack.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftRail.java +index f58d2af86a2cd0363ceb8caa094a93cf2ecaced6..944ded791d331a5498d62461beb70730368b129a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMinecartTrack.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRail.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftMinecartTrack extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Rail, org.bukkit.block.data.Waterlogged { ++public final class CraftRail extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Rail, org.bukkit.block.data.Waterlogged { + +- public CraftMinecartTrack() { ++ public CraftRail() { + super(); + } + +- public CraftMinecartTrack(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftRail(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,17 +19,17 @@ public final class CraftMinecartTrack extends org.bukkit.craftbukkit.block.data. + + @Override + public org.bukkit.block.data.Rail.Shape getShape() { +- return this.get(CraftMinecartTrack.SHAPE, org.bukkit.block.data.Rail.Shape.class); ++ return this.get(CraftRail.SHAPE, org.bukkit.block.data.Rail.Shape.class); + } + + @Override + public void setShape(org.bukkit.block.data.Rail.Shape shape) { +- this.set(CraftMinecartTrack.SHAPE, shape); ++ this.set(CraftRail.SHAPE, shape); + } + + @Override + public java.util.Set getShapes() { +- return this.getValues(CraftMinecartTrack.SHAPE, org.bukkit.block.data.Rail.Shape.class); ++ return this.getValues(CraftRail.SHAPE, org.bukkit.block.data.Rail.Shape.class); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -38,11 +38,11 @@ public final class CraftMinecartTrack extends org.bukkit.craftbukkit.block.data. + + @Override + public boolean isWaterlogged() { +- return this.get(CraftMinecartTrack.WATERLOGGED); ++ return this.get(CraftRail.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftMinecartTrack.WATERLOGGED, waterlogged); ++ this.set(CraftRail.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneOre.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedStoneOre.java +similarity index 70% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneOre.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedStoneOre.java +index 5069c1ba0752eec6d4f9dcbd08c666d2869cc1e1..637ac1dcd4eb2e2dc6de8c4b51ccb5d3be259489 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneOre.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedStoneOre.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftRedstoneOre extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Lightable { ++public final class CraftRedStoneOre extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Lightable { + +- public CraftRedstoneOre() { ++ public CraftRedStoneOre() { + super(); + } + +- public CraftRedstoneOre(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftRedStoneOre(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,11 +19,11 @@ public final class CraftRedstoneOre extends org.bukkit.craftbukkit.block.data.Cr + + @Override + public boolean isLit() { +- return this.get(CraftRedstoneOre.LIT); ++ return this.get(CraftRedStoneOre.LIT); + } + + @Override + public void setLit(boolean lit) { +- this.set(CraftRedstoneOre.LIT, lit); ++ this.set(CraftRedStoneOre.LIT, lit); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneWire.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedStoneWire.java +similarity index 77% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneWire.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedStoneWire.java +index 009be1c9a485933242a00107f442e4dfa31fe798..6fb40bdfb95aec79cd5e0ceec648afceb4f5b7f5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneWire.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedStoneWire.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftRedstoneWire extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.RedstoneWire, org.bukkit.block.data.AnaloguePowerable { ++public final class CraftRedStoneWire extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.RedstoneWire, org.bukkit.block.data.AnaloguePowerable { + +- public CraftRedstoneWire() { ++ public CraftRedStoneWire() { + super(); + } + +- public CraftRedstoneWire(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftRedStoneWire(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -24,13 +24,13 @@ public final class CraftRedstoneWire extends org.bukkit.craftbukkit.block.data.C + public org.bukkit.block.data.type.RedstoneWire.Connection getFace(org.bukkit.block.BlockFace face) { + switch (face) { + case NORTH: +- return this.get(CraftRedstoneWire.NORTH, org.bukkit.block.data.type.RedstoneWire.Connection.class); ++ return this.get(CraftRedStoneWire.NORTH, org.bukkit.block.data.type.RedstoneWire.Connection.class); + case EAST: +- return this.get(CraftRedstoneWire.EAST, org.bukkit.block.data.type.RedstoneWire.Connection.class); ++ return this.get(CraftRedStoneWire.EAST, org.bukkit.block.data.type.RedstoneWire.Connection.class); + case SOUTH: +- return this.get(CraftRedstoneWire.SOUTH, org.bukkit.block.data.type.RedstoneWire.Connection.class); ++ return this.get(CraftRedStoneWire.SOUTH, org.bukkit.block.data.type.RedstoneWire.Connection.class); + case WEST: +- return this.get(CraftRedstoneWire.WEST, org.bukkit.block.data.type.RedstoneWire.Connection.class); ++ return this.get(CraftRedStoneWire.WEST, org.bukkit.block.data.type.RedstoneWire.Connection.class); + default: + throw new IllegalArgumentException("Cannot have face " + face); + } +@@ -40,16 +40,16 @@ public final class CraftRedstoneWire extends org.bukkit.craftbukkit.block.data.C + public void setFace(org.bukkit.block.BlockFace face, org.bukkit.block.data.type.RedstoneWire.Connection connection) { + switch (face) { + case NORTH: +- this.set(CraftRedstoneWire.NORTH, connection); ++ this.set(CraftRedStoneWire.NORTH, connection); + break; + case EAST: +- this.set(CraftRedstoneWire.EAST, connection); ++ this.set(CraftRedStoneWire.EAST, connection); + break; + case SOUTH: +- this.set(CraftRedstoneWire.SOUTH, connection); ++ this.set(CraftRedStoneWire.SOUTH, connection); + break; + case WEST: +- this.set(CraftRedstoneWire.WEST, connection); ++ this.set(CraftRedStoneWire.WEST, connection); + break; + default: + throw new IllegalArgumentException("Cannot have face " + face); +@@ -67,16 +67,16 @@ public final class CraftRedstoneWire extends org.bukkit.craftbukkit.block.data.C + + @Override + public int getPower() { +- return this.get(CraftRedstoneWire.POWER); ++ return this.get(CraftRedStoneWire.POWER); + } + + @Override + public void setPower(int power) { +- this.set(CraftRedstoneWire.POWER, power); ++ this.set(CraftRedStoneWire.POWER, power); + } + + @Override + public int getMaximumPower() { +- return getMax(CraftRedstoneWire.POWER); ++ return getMax(CraftRedStoneWire.POWER); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneTorchWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneWallTorch.java +similarity index 73% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneTorchWall.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneWallTorch.java +index 4df2452825bfc852f62ccb6133a702cae11a4cab..10a038bdf849d6ebbc1600d23bbfa10a38d0ca81 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneTorchWall.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRedstoneWallTorch.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftRedstoneTorchWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.RedstoneWallTorch, org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable { ++public final class CraftRedstoneWallTorch extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.RedstoneWallTorch, org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable { + +- public CraftRedstoneTorchWall() { ++ public CraftRedstoneWallTorch() { + super(); + } + +- public CraftRedstoneTorchWall(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftRedstoneWallTorch(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,17 +19,17 @@ public final class CraftRedstoneTorchWall extends org.bukkit.craftbukkit.block.d + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftRedstoneTorchWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftRedstoneWallTorch.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftRedstoneTorchWall.FACING, facing); ++ this.set(CraftRedstoneWallTorch.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftRedstoneTorchWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftRedstoneWallTorch.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftLightable +@@ -38,11 +38,11 @@ public final class CraftRedstoneTorchWall extends org.bukkit.craftbukkit.block.d + + @Override + public boolean isLit() { +- return this.get(CraftRedstoneTorchWall.LIT); ++ return this.get(CraftRedstoneWallTorch.LIT); + } + + @Override + public void setLit(boolean lit) { +- this.set(CraftRedstoneTorchWall.LIT, lit); ++ this.set(CraftRedstoneWallTorch.LIT, lit); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRotatable.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRotatedPillar.java +similarity index 56% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftRotatable.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftRotatedPillar.java +index 4f28a405db6c0d1acc0b1a8bc5a1aca3ef392ad0..c745efc498ddd97e6fa6911c928e2891a6d64ed9 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRotatable.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftRotatedPillar.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftRotatable extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Orientable { ++public final class CraftRotatedPillar extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Orientable { + +- public CraftRotatable() { ++ public CraftRotatedPillar() { + super(); + } + +- public CraftRotatable(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftRotatedPillar(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftRotatable extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public org.bukkit.Axis getAxis() { +- return this.get(CraftRotatable.AXIS, org.bukkit.Axis.class); ++ return this.get(CraftRotatedPillar.AXIS, org.bukkit.Axis.class); + } + + @Override + public void setAxis(org.bukkit.Axis axis) { +- this.set(CraftRotatable.AXIS, axis); ++ this.set(CraftRotatedPillar.AXIS, axis); + } + + @Override + public java.util.Set getAxes() { +- return this.getValues(CraftRotatable.AXIS, org.bukkit.Axis.class); ++ return this.getValues(CraftRotatedPillar.AXIS, org.bukkit.Axis.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSculkSensor.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSculkSensor.java +index 10eb0ac019bcd6944206f73715a0f160f6fd6b87..0d5265dbcbdaa86dcc72eade5c55ae9c27525712 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSculkSensor.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSculkSensor.java +@@ -18,12 +18,12 @@ public final class CraftSculkSensor extends org.bukkit.craftbukkit.block.data.Cr + private static final net.minecraft.world.level.block.state.properties.EnumProperty PHASE = getEnum(net.minecraft.world.level.block.SculkSensorBlock.class, "sculk_sensor_phase"); + + @Override +- public org.bukkit.block.data.type.SculkSensor.Phase getPhase() { ++ public org.bukkit.block.data.type.SculkSensor.Phase getSculkSensorPhase() { + return this.get(CraftSculkSensor.PHASE, org.bukkit.block.data.type.SculkSensor.Phase.class); + } + + @Override +- public void setPhase(org.bukkit.block.data.type.SculkSensor.Phase phase) { ++ public void setSculkSensorPhase(org.bukkit.block.data.type.SculkSensor.Phase phase) { + this.set(CraftSculkSensor.PHASE, phase); + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStepAbstract.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSlab.java +similarity index 62% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftStepAbstract.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftSlab.java +index a0d01902c4b1d412f4cd89e159010f0e47707cf6..00af54ef2db16723def8db57ea26698863b7a96d 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStepAbstract.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSlab.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftStepAbstract extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Slab, org.bukkit.block.data.Waterlogged { ++public final class CraftSlab extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Slab, org.bukkit.block.data.Waterlogged { + +- public CraftStepAbstract() { ++ public CraftSlab() { + super(); + } + +- public CraftStepAbstract(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftSlab(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftStepAbstract extends org.bukkit.craftbukkit.block.data.C + + @Override + public org.bukkit.block.data.type.Slab.Type getType() { +- return this.get(CraftStepAbstract.TYPE, org.bukkit.block.data.type.Slab.Type.class); ++ return this.get(CraftSlab.TYPE, org.bukkit.block.data.type.Slab.Type.class); + } + + @Override + public void setType(org.bukkit.block.data.type.Slab.Type type) { +- this.set(CraftStepAbstract.TYPE, type); ++ this.set(CraftSlab.TYPE, type); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -33,11 +33,11 @@ public final class CraftStepAbstract extends org.bukkit.craftbukkit.block.data.C + + @Override + public boolean isWaterlogged() { +- return this.get(CraftStepAbstract.WATERLOGGED); ++ return this.get(CraftSlab.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftStepAbstract.WATERLOGGED, waterlogged); ++ this.set(CraftSlab.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnow.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnowLayer.java +similarity index 58% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnow.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnowLayer.java +index ff340637f1bb2f2b8cf49b5f148ef26f94ced896..16df033301bab44b67770f688c53b163a7afb956 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnow.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnowLayer.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftSnow extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Snow { ++public final class CraftSnowLayer extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Snow { + +- public CraftSnow() { ++ public CraftSnowLayer() { + super(); + } + +- public CraftSnow(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftSnowLayer(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,21 +19,21 @@ public final class CraftSnow extends org.bukkit.craftbukkit.block.data.CraftBloc + + @Override + public int getLayers() { +- return this.get(CraftSnow.LAYERS); ++ return this.get(CraftSnowLayer.LAYERS); + } + + @Override + public void setLayers(int layers) { +- this.set(CraftSnow.LAYERS, layers); ++ this.set(CraftSnowLayer.LAYERS, layers); + } + + @Override + public int getMinimumLayers() { +- return getMin(CraftSnow.LAYERS); ++ return getMin(CraftSnowLayer.LAYERS); + } + + @Override + public int getMaximumLayers() { +- return getMax(CraftSnow.LAYERS); ++ return getMax(CraftSnowLayer.LAYERS); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMycel.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnowyDirt.java +similarity index 54% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftMycel.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnowyDirt.java +index ec10c721e83f159c8e51e0d982436fbe04682593..ac25e74a2a91d1f367181dcc6b0adb590aa9dc0e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMycel.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSnowyDirt.java +@@ -3,27 +3,27 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftMycel extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Snowable { ++public final class CraftSnowyDirt extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Snowable { + +- public CraftMycel() { ++ public CraftSnowyDirt() { + super(); + } + +- public CraftMycel(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftSnowyDirt(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + + // org.bukkit.craftbukkit.block.data.CraftSnowable + +- private static final net.minecraft.world.level.block.state.properties.BooleanProperty SNOWY = getBoolean(net.minecraft.world.level.block.MyceliumBlock.class, "snowy"); ++ private static final net.minecraft.world.level.block.state.properties.BooleanProperty SNOWY = getBoolean(net.minecraft.world.level.block.SnowyDirtBlock.class, "snowy"); + + @Override + public boolean isSnowy() { +- return this.get(CraftMycel.SNOWY); ++ return this.get(CraftSnowyDirt.SNOWY); + } + + @Override + public void setSnowy(boolean snowy) { +- this.set(CraftMycel.SNOWY, snowy); ++ this.set(CraftSnowyDirt.SNOWY, snowy); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStairs.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStair.java +similarity index 66% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftStairs.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftStair.java +index 4cec82549632c1696ae01be717f2f4c1b281ae6d..f3e8837e4cff869ba366d8ea9ced6ff0863199e7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStairs.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStair.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftStairs extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Stairs, org.bukkit.block.data.Bisected, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { ++public final class CraftStair extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Stairs, org.bukkit.block.data.Bisected, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { + +- public CraftStairs() { ++ public CraftStair() { + super(); + } + +- public CraftStairs(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftStair(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftStairs extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public org.bukkit.block.data.type.Stairs.Shape getShape() { +- return this.get(CraftStairs.SHAPE, org.bukkit.block.data.type.Stairs.Shape.class); ++ return this.get(CraftStair.SHAPE, org.bukkit.block.data.type.Stairs.Shape.class); + } + + @Override + public void setShape(org.bukkit.block.data.type.Stairs.Shape shape) { +- this.set(CraftStairs.SHAPE, shape); ++ this.set(CraftStair.SHAPE, shape); + } + + // org.bukkit.craftbukkit.block.data.CraftBisected +@@ -33,12 +33,12 @@ public final class CraftStairs extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { +- return this.get(CraftStairs.HALF, org.bukkit.block.data.Bisected.Half.class); ++ return this.get(CraftStair.HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(org.bukkit.block.data.Bisected.Half half) { +- this.set(CraftStairs.HALF, half); ++ this.set(CraftStair.HALF, half); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -47,17 +47,17 @@ public final class CraftStairs extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftStairs.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftStair.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftStairs.FACING, facing); ++ this.set(CraftStair.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftStairs.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftStair.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -66,11 +66,11 @@ public final class CraftStairs extends org.bukkit.craftbukkit.block.data.CraftBl + + @Override + public boolean isWaterlogged() { +- return this.get(CraftStairs.WATERLOGGED); ++ return this.get(CraftStair.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftStairs.WATERLOGGED, waterlogged); ++ this.set(CraftStair.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFloorSign.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStandingSign.java +similarity index 87% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftFloorSign.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftStandingSign.java +index 6c5c012370710265c747904112b37ec7f6ce8761..41152d0ac0ea3f3fc4079f114709c84a8b692a49 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFloorSign.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStandingSign.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftFloorSign extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Sign, org.bukkit.block.data.Rotatable, org.bukkit.block.data.Waterlogged { ++public final class CraftStandingSign extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Sign, org.bukkit.block.data.Rotatable, org.bukkit.block.data.Waterlogged { + +- public CraftFloorSign() { ++ public CraftStandingSign() { + super(); + } + +- public CraftFloorSign(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftStandingSign(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,7 +19,7 @@ public final class CraftFloorSign extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public org.bukkit.block.BlockFace getRotation() { +- int data = this.get(CraftFloorSign.ROTATION); ++ int data = this.get(CraftStandingSign.ROTATION); + switch (data) { + case 0x0: + return org.bukkit.block.BlockFace.SOUTH; +@@ -113,7 +113,7 @@ public final class CraftFloorSign extends org.bukkit.craftbukkit.block.data.Craf + default: + throw new IllegalArgumentException("Illegal rotation " + rotation); + } +- this.set(CraftFloorSign.ROTATION, val); ++ this.set(CraftStandingSign.ROTATION, val); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -122,11 +122,11 @@ public final class CraftFloorSign extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public boolean isWaterlogged() { +- return this.get(CraftFloorSign.WATERLOGGED); ++ return this.get(CraftStandingSign.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftFloorSign.WATERLOGGED, waterlogged); ++ this.set(CraftStandingSign.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStructure.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStructureBlock.java +similarity index 57% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftStructure.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftStructureBlock.java +index f505d440b9453c96e41d05adf5f5fc236539f7b9..45aed7a3279d005064d80501316aa3be64895dba 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStructure.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftStructureBlock.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftStructure extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.StructureBlock { ++public final class CraftStructureBlock extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.StructureBlock { + +- public CraftStructure() { ++ public CraftStructureBlock() { + super(); + } + +- public CraftStructure(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftStructureBlock(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,11 +19,11 @@ public final class CraftStructure extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public org.bukkit.block.data.type.StructureBlock.Mode getMode() { +- return this.get(CraftStructure.MODE, org.bukkit.block.data.type.StructureBlock.Mode.class); ++ return this.get(CraftStructureBlock.MODE, org.bukkit.block.data.type.StructureBlock.Mode.class); + } + + @Override + public void setMode(org.bukkit.block.data.type.StructureBlock.Mode mode) { +- this.set(CraftStructure.MODE, mode); ++ this.set(CraftStructureBlock.MODE, mode); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrops.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSugarCane.java +similarity index 54% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrops.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftSugarCane.java +index d186de7098a63a8667c39ff1749f65d6ab82e4e8..3f1b875a98b4d624b90a322f6fabd00a722f0345 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCrops.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSugarCane.java +@@ -3,32 +3,32 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftCrops extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { ++public final class CraftSugarCane extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable { + +- public CraftCrops() { ++ public CraftSugarCane() { + super(); + } + +- public CraftCrops(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftSugarCane(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + + // org.bukkit.craftbukkit.block.data.CraftAgeable + +- private static final net.minecraft.world.level.block.state.properties.IntegerProperty AGE = getInteger(net.minecraft.world.level.block.CropBlock.class, "age"); ++ private static final net.minecraft.world.level.block.state.properties.IntegerProperty AGE = getInteger(net.minecraft.world.level.block.SugarCaneBlock.class, "age"); + + @Override + public int getAge() { +- return this.get(CraftCrops.AGE); ++ return this.get(CraftSugarCane.AGE); + } + + @Override + public void setAge(int age) { +- this.set(CraftCrops.AGE, age); ++ this.set(CraftSugarCane.AGE, age); + } + + @Override + public int getMaximumAge() { +- return getMax(CraftCrops.AGE); ++ return getMax(CraftSugarCane.AGE); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallPlantFlower.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallFlower.java +similarity index 57% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallPlantFlower.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallFlower.java +index f13cdcd3aff45c8294d6e2ca3ff227dd8781f5ef..5f9df4aaec27d5a8e2972ce5430e1bfb95ccd975 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallPlantFlower.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTallFlower.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftTallPlantFlower extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Bisected { ++public final class CraftTallFlower extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Bisected { + +- public CraftTallPlantFlower() { ++ public CraftTallFlower() { + super(); + } + +- public CraftTallPlantFlower(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftTallFlower(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,11 +19,11 @@ public final class CraftTallPlantFlower extends org.bukkit.craftbukkit.block.dat + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { +- return this.get(CraftTallPlantFlower.HALF, org.bukkit.block.data.Bisected.Half.class); ++ return this.get(CraftTallFlower.HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(org.bukkit.block.data.Bisected.Half half) { +- this.set(CraftTallPlantFlower.HALF, half); ++ this.set(CraftTallFlower.HALF, half); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTNT.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTnt.java +similarity index 71% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftTNT.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftTnt.java +index 75fc4fe97763f526062bfabc61e5816fcc04929b..24980a4d1625c62d67b1e04b1a29dec23aeac739 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTNT.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTnt.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftTNT extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TNT { ++public final class CraftTnt extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TNT { + +- public CraftTNT() { ++ public CraftTnt() { + super(); + } + +- public CraftTNT(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftTnt(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,11 +19,11 @@ public final class CraftTNT extends org.bukkit.craftbukkit.block.data.CraftBlock + + @Override + public boolean isUnstable() { +- return this.get(CraftTNT.UNSTABLE); ++ return this.get(CraftTnt.UNSTABLE); + } + + @Override + public void setUnstable(boolean unstable) { +- this.set(CraftTNT.UNSTABLE, unstable); ++ this.set(CraftTnt.UNSTABLE, unstable); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrapdoor.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrapDoor.java +similarity index 76% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrapdoor.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrapDoor.java +index 5e88ff74bb5dbc3b8e85295b0edd069ada24e640..6604035d08e03b34b29bca2a375856cf0887b833 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrapdoor.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrapDoor.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftTrapdoor extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TrapDoor, org.bukkit.block.data.Bisected, org.bukkit.block.data.Directional, org.bukkit.block.data.Openable, org.bukkit.block.data.Powerable, org.bukkit.block.data.Waterlogged { ++public final class CraftTrapDoor extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TrapDoor, org.bukkit.block.data.Bisected, org.bukkit.block.data.Directional, org.bukkit.block.data.Openable, org.bukkit.block.data.Powerable, org.bukkit.block.data.Waterlogged { + +- public CraftTrapdoor() { ++ public CraftTrapDoor() { + super(); + } + +- public CraftTrapdoor(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftTrapDoor(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftTrapdoor extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public org.bukkit.block.data.Bisected.Half getHalf() { +- return this.get(CraftTrapdoor.HALF, org.bukkit.block.data.Bisected.Half.class); ++ return this.get(CraftTrapDoor.HALF, org.bukkit.block.data.Bisected.Half.class); + } + + @Override + public void setHalf(org.bukkit.block.data.Bisected.Half half) { +- this.set(CraftTrapdoor.HALF, half); ++ this.set(CraftTrapDoor.HALF, half); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,17 +33,17 @@ public final class CraftTrapdoor extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftTrapdoor.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftTrapDoor.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftTrapdoor.FACING, facing); ++ this.set(CraftTrapDoor.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftTrapdoor.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftTrapDoor.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftOpenable +@@ -52,12 +52,12 @@ public final class CraftTrapdoor extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public boolean isOpen() { +- return this.get(CraftTrapdoor.OPEN); ++ return this.get(CraftTrapDoor.OPEN); + } + + @Override + public void setOpen(boolean open) { +- this.set(CraftTrapdoor.OPEN, open); ++ this.set(CraftTrapDoor.OPEN, open); + } + + // org.bukkit.craftbukkit.block.data.CraftPowerable +@@ -66,12 +66,12 @@ public final class CraftTrapdoor extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public boolean isPowered() { +- return this.get(CraftTrapdoor.POWERED); ++ return this.get(CraftTrapDoor.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftTrapdoor.POWERED, powered); ++ this.set(CraftTrapDoor.POWERED, powered); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -80,11 +80,11 @@ public final class CraftTrapdoor extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public boolean isWaterlogged() { +- return this.get(CraftTrapdoor.WATERLOGGED); ++ return this.get(CraftTrapDoor.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftTrapdoor.WATERLOGGED, waterlogged); ++ this.set(CraftTrapDoor.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftChestTrapped.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrappedChest.java +similarity index 74% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftChestTrapped.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrappedChest.java +index b24a40c084c566c91d862cd57aa97305e511bd68..7f5d3dc1e108c1a9d2be4265a94e6536f396cbb7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftChestTrapped.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTrappedChest.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftChestTrapped extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Chest, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { ++public final class CraftTrappedChest extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Chest, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { + +- public CraftChestTrapped() { ++ public CraftTrappedChest() { + super(); + } + +- public CraftChestTrapped(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftTrappedChest(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftChestTrapped extends org.bukkit.craftbukkit.block.data.C + + @Override + public org.bukkit.block.data.type.Chest.Type getType() { +- return this.get(CraftChestTrapped.TYPE, org.bukkit.block.data.type.Chest.Type.class); ++ return this.get(CraftTrappedChest.TYPE, org.bukkit.block.data.type.Chest.Type.class); + } + + @Override + public void setType(org.bukkit.block.data.type.Chest.Type type) { +- this.set(CraftChestTrapped.TYPE, type); ++ this.set(CraftTrappedChest.TYPE, type); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,17 +33,17 @@ public final class CraftChestTrapped extends org.bukkit.craftbukkit.block.data.C + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftChestTrapped.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftTrappedChest.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftChestTrapped.FACING, facing); ++ this.set(CraftTrappedChest.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftChestTrapped.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftTrappedChest.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -52,11 +52,11 @@ public final class CraftChestTrapped extends org.bukkit.craftbukkit.block.data.C + + @Override + public boolean isWaterlogged() { +- return this.get(CraftChestTrapped.WATERLOGGED); ++ return this.get(CraftTrappedChest.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftChestTrapped.WATERLOGGED, waterlogged); ++ this.set(CraftTrappedChest.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripwire.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripWire.java +similarity index 81% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripwire.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripWire.java +index 83375648cc8fa6a531663297a5042651a6ce75c6..12fb3a3886e8c2b55736ee7c7f182ebb65a81e7a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripwire.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripWire.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Tripwire, org.bukkit.block.data.Attachable, org.bukkit.block.data.MultipleFacing, org.bukkit.block.data.Powerable { ++public final class CraftTripWire extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Tripwire, org.bukkit.block.data.Attachable, org.bukkit.block.data.MultipleFacing, org.bukkit.block.data.Powerable { + +- public CraftTripwire() { ++ public CraftTripWire() { + super(); + } + +- public CraftTripwire(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftTripWire(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public boolean isDisarmed() { +- return this.get(CraftTripwire.DISARMED); ++ return this.get(CraftTripWire.DISARMED); + } + + @Override + public void setDisarmed(boolean disarmed) { +- this.set(CraftTripwire.DISARMED, disarmed); ++ this.set(CraftTripWire.DISARMED, disarmed); + } + + // org.bukkit.craftbukkit.block.data.CraftAttachable +@@ -33,12 +33,12 @@ public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public boolean isAttached() { +- return this.get(CraftTripwire.ATTACHED); ++ return this.get(CraftTripWire.ATTACHED); + } + + @Override + public void setAttached(boolean attached) { +- this.set(CraftTripwire.ATTACHED, attached); ++ this.set(CraftTripWire.ATTACHED, attached); + } + + // org.bukkit.craftbukkit.block.data.CraftMultipleFacing +@@ -49,7 +49,7 @@ public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public boolean hasFace(org.bukkit.block.BlockFace face) { +- net.minecraft.world.level.block.state.properties.BooleanProperty state = CraftTripwire.FACES[face.ordinal()]; ++ net.minecraft.world.level.block.state.properties.BooleanProperty state = CraftTripWire.FACES[face.ordinal()]; + if (state == null) { + throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces."); + } +@@ -58,7 +58,7 @@ public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public void setFace(org.bukkit.block.BlockFace face, boolean has) { +- net.minecraft.world.level.block.state.properties.BooleanProperty state = CraftTripwire.FACES[face.ordinal()]; ++ net.minecraft.world.level.block.state.properties.BooleanProperty state = CraftTripWire.FACES[face.ordinal()]; + if (state == null) { + throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces."); + } +@@ -69,8 +69,8 @@ public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.Craft + public java.util.Set getFaces() { + com.google.common.collect.ImmutableSet.Builder faces = com.google.common.collect.ImmutableSet.builder(); + +- for (int i = 0; i < CraftTripwire.FACES.length; i++) { +- if (CraftTripwire.FACES[i] != null && this.get(CraftTripwire.FACES[i])) { ++ for (int i = 0; i < CraftTripWire.FACES.length; i++) { ++ if (CraftTripWire.FACES[i] != null && this.get(CraftTripWire.FACES[i])) { + faces.add(org.bukkit.block.BlockFace.values()[i]); + } + } +@@ -82,8 +82,8 @@ public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.Craft + public java.util.Set getAllowedFaces() { + com.google.common.collect.ImmutableSet.Builder faces = com.google.common.collect.ImmutableSet.builder(); + +- for (int i = 0; i < CraftTripwire.FACES.length; i++) { +- if (CraftTripwire.FACES[i] != null) { ++ for (int i = 0; i < CraftTripWire.FACES.length; i++) { ++ if (CraftTripWire.FACES[i] != null) { + faces.add(org.bukkit.block.BlockFace.values()[i]); + } + } +@@ -97,11 +97,11 @@ public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.Craft + + @Override + public boolean isPowered() { +- return this.get(CraftTripwire.POWERED); ++ return this.get(CraftTripWire.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftTripwire.POWERED, powered); ++ this.set(CraftTripWire.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripwireHook.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripWireHook.java +similarity index 74% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripwireHook.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripWireHook.java +index e072799d84d44dbda5f854735d01d436107c5b48..4efbb9e402425d764d48ce1987e47ffa65534f67 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripwireHook.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTripWireHook.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftTripwireHook extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TripwireHook, org.bukkit.block.data.Attachable, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { ++public final class CraftTripWireHook extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TripwireHook, org.bukkit.block.data.Attachable, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { + +- public CraftTripwireHook() { ++ public CraftTripWireHook() { + super(); + } + +- public CraftTripwireHook(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftTripWireHook(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,12 +19,12 @@ public final class CraftTripwireHook extends org.bukkit.craftbukkit.block.data.C + + @Override + public boolean isAttached() { +- return this.get(CraftTripwireHook.ATTACHED); ++ return this.get(CraftTripWireHook.ATTACHED); + } + + @Override + public void setAttached(boolean attached) { +- this.set(CraftTripwireHook.ATTACHED, attached); ++ this.set(CraftTripWireHook.ATTACHED, attached); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional +@@ -33,17 +33,17 @@ public final class CraftTripwireHook extends org.bukkit.craftbukkit.block.data.C + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftTripwireHook.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftTripWireHook.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftTripwireHook.FACING, facing); ++ this.set(CraftTripWireHook.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftTripwireHook.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftTripWireHook.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftPowerable +@@ -52,11 +52,11 @@ public final class CraftTripwireHook extends org.bukkit.craftbukkit.block.data.C + + @Override + public boolean isPowered() { +- return this.get(CraftTripwireHook.POWERED); ++ return this.get(CraftTripWireHook.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftTripwireHook.POWERED, powered); ++ this.set(CraftTripWireHook.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftVault.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftVault.java +index 4c62caba7dff6538309cac46861fed047223bb5f..5817af460bd0f90f6df4f5436e9d3ccbc37fbb09 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftVault.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftVault.java +@@ -19,12 +19,12 @@ public final class CraftVault extends org.bukkit.craftbukkit.block.data.CraftBlo + private static final net.minecraft.world.level.block.state.properties.BooleanProperty OMINOUS = getBoolean(net.minecraft.world.level.block.VaultBlock.class, "ominous"); + + @Override +- public org.bukkit.block.data.type.Vault.State getTrialSpawnerState() { ++ public org.bukkit.block.data.type.Vault.State getVaultState() { + return this.get(CraftVault.VAULT_STATE, org.bukkit.block.data.type.Vault.State.class); + } + + @Override +- public void setTrialSpawnerState(org.bukkit.block.data.type.Vault.State state) { ++ public void setVaultState(org.bukkit.block.data.type.Vault.State state) { + this.set(CraftVault.VAULT_STATE, state); + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCobbleWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWall.java +similarity index 69% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftCobbleWall.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftWall.java +index f860bb309a64e104aa52d76f967cd7c2bedd8e99..e2808406f9a97ad017d7fc149be70708ebfbc6bc 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCobbleWall.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWall.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftCobbleWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Wall, org.bukkit.block.data.Waterlogged { ++public final class CraftWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Wall, org.bukkit.block.data.Waterlogged { + +- public CraftCobbleWall() { ++ public CraftWall() { + super(); + } + +- public CraftCobbleWall(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftWall(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -22,22 +22,22 @@ public final class CraftCobbleWall extends org.bukkit.craftbukkit.block.data.Cra + + @Override + public boolean isUp() { +- return this.get(CraftCobbleWall.UP); ++ return this.get(CraftWall.UP); + } + + @Override + public void setUp(boolean up) { +- this.set(CraftCobbleWall.UP, up); ++ this.set(CraftWall.UP, up); + } + + @Override + public org.bukkit.block.data.type.Wall.Height getHeight(org.bukkit.block.BlockFace face) { +- return this.get(CraftCobbleWall.HEIGHTS[face.ordinal()], org.bukkit.block.data.type.Wall.Height.class); ++ return this.get(CraftWall.HEIGHTS[face.ordinal()], org.bukkit.block.data.type.Wall.Height.class); + } + + @Override + public void setHeight(org.bukkit.block.BlockFace face, org.bukkit.block.data.type.Wall.Height height) { +- this.set(CraftCobbleWall.HEIGHTS[face.ordinal()], height); ++ this.set(CraftWall.HEIGHTS[face.ordinal()], height); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged +@@ -46,11 +46,11 @@ public final class CraftCobbleWall extends org.bukkit.craftbukkit.block.data.Cra + + @Override + public boolean isWaterlogged() { +- return this.get(CraftCobbleWall.WATERLOGGED); ++ return this.get(CraftWall.WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { +- this.set(CraftCobbleWall.WATERLOGGED, waterlogged); ++ this.set(CraftWall.WATERLOGGED, waterlogged); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBannerWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallBanner.java +similarity index 69% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftBannerWall.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallBanner.java +index 03f2ca67841ba5b6e653eea132ec030fdf2f09b2..8ba57dcad453e54467556126ff567ec6e108f49f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBannerWall.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallBanner.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftBannerWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { ++public final class CraftWallBanner extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { + +- public CraftBannerWall() { ++ public CraftWallBanner() { + super(); + } + +- public CraftBannerWall(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftWallBanner(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftBannerWall extends org.bukkit.craftbukkit.block.data.Cra + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftBannerWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftWallBanner.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftBannerWall.FACING, facing); ++ this.set(CraftWallBanner.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftBannerWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftWallBanner.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallSkull.java +similarity index 73% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullWall.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallSkull.java +index 538fd08e8cca8f98cbc3ebabe8d1b44a378a6ac8..4cb07e48c969caf57469b131e72f480929a284d3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftSkullWall.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallSkull.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftSkullWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { ++public final class CraftWallSkull extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { + +- public CraftSkullWall() { ++ public CraftWallSkull() { + super(); + } + +- public CraftSkullWall(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftWallSkull(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,17 +19,17 @@ public final class CraftSkullWall extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftSkullWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftWallSkull.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftSkullWall.FACING, facing); ++ this.set(CraftWallSkull.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftSkullWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftWallSkull.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftPowerable +@@ -38,11 +38,11 @@ public final class CraftSkullWall extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public boolean isPowered() { +- return this.get(CraftSkullWall.POWERED); ++ return this.get(CraftWallSkull.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftSkullWall.POWERED, powered); ++ this.set(CraftWallSkull.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTorchWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallTorch.java +similarity index 69% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftTorchWall.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallTorch.java +index 2d5eefabb2818fc5439591a330da2c7e198f861f..fdfd23ee2d84b7d00a224524f52a011ebcacd305 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftTorchWall.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWallTorch.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftTorchWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { ++public final class CraftWallTorch extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { + +- public CraftTorchWall() { ++ public CraftWallTorch() { + super(); + } + +- public CraftTorchWall(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftWallTorch(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftTorchWall extends org.bukkit.craftbukkit.block.data.Craf + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftTorchWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftWallTorch.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftTorchWall.FACING, facing); ++ this.set(CraftWallTorch.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftTorchWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftWallTorch.FACING, org.bukkit.block.BlockFace.class); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlateWeighted.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWeightedPressurePlate.java +similarity index 67% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlateWeighted.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftWeightedPressurePlate.java +index 0eb4b7bdee1863e8e851fb52301d61d867bbdbbd..8285787110c83e790888b0506a3a8b90ba03f1d0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPressurePlateWeighted.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWeightedPressurePlate.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftPressurePlateWeighted extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.AnaloguePowerable { ++public final class CraftWeightedPressurePlate extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.AnaloguePowerable { + +- public CraftPressurePlateWeighted() { ++ public CraftWeightedPressurePlate() { + super(); + } + +- public CraftPressurePlateWeighted(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftWeightedPressurePlate(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,16 +19,16 @@ public final class CraftPressurePlateWeighted extends org.bukkit.craftbukkit.blo + + @Override + public int getPower() { +- return this.get(CraftPressurePlateWeighted.POWER); ++ return this.get(CraftWeightedPressurePlate.POWER); + } + + @Override + public void setPower(int power) { +- this.set(CraftPressurePlateWeighted.POWER, power); ++ this.set(CraftWeightedPressurePlate.POWER, power); + } + + @Override + public int getMaximumPower() { +- return getMax(CraftPressurePlateWeighted.POWER); ++ return getMax(CraftWeightedPressurePlate.POWER); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkullWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherWallSkull.java +similarity index 72% +rename from src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkullWall.java +rename to src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherWallSkull.java +index b43db5180f1ba0f675f2324fbead4cce88489799..46b4952c914249b8801395f5832cd79ca71fb412 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherSkullWall.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftWitherWallSkull.java +@@ -3,13 +3,13 @@ + */ + package org.bukkit.craftbukkit.block.impl; + +-public final class CraftWitherSkullWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { ++public final class CraftWitherWallSkull extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.WallSkull, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable { + +- public CraftWitherSkullWall() { ++ public CraftWitherWallSkull() { + super(); + } + +- public CraftWitherSkullWall(net.minecraft.world.level.block.state.BlockState state) { ++ public CraftWitherWallSkull(net.minecraft.world.level.block.state.BlockState state) { + super(state); + } + +@@ -19,17 +19,17 @@ public final class CraftWitherSkullWall extends org.bukkit.craftbukkit.block.dat + + @Override + public org.bukkit.block.BlockFace getFacing() { +- return this.get(CraftWitherSkullWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.get(CraftWitherWallSkull.FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { +- this.set(CraftWitherSkullWall.FACING, facing); ++ this.set(CraftWitherWallSkull.FACING, facing); + } + + @Override + public java.util.Set getFaces() { +- return this.getValues(CraftWitherSkullWall.FACING, org.bukkit.block.BlockFace.class); ++ return this.getValues(CraftWitherWallSkull.FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftPowerable +@@ -38,11 +38,11 @@ public final class CraftWitherSkullWall extends org.bukkit.craftbukkit.block.dat + + @Override + public boolean isPowered() { +- return this.get(CraftWitherSkullWall.POWERED); ++ return this.get(CraftWitherWallSkull.POWERED); + } + + @Override + public void setPowered(boolean powered) { +- this.set(CraftWitherSkullWall.POWERED, powered); ++ this.set(CraftWitherWallSkull.POWERED, powered); + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +index cae5c865388aca8041233ca52b25ecf68cd37494..bc850e174661f307b2b262159246b2d8e7f4e0a1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +@@ -76,7 +76,9 @@ public class Commodore { + private static final Map RENAMES = Map.of( + "org/bukkit/entity/TextDisplay$TextAligment", "org/bukkit/entity/TextDisplay$TextAlignment", // SPIGOT-7335 + "org/spigotmc/event/entity/EntityMountEvent", "org/bukkit/event/entity/EntityMountEvent", +- "org/spigotmc/event/entity/EntityDismountEvent", "org/bukkit/event/entity/EntityDismountEvent" ++ "org/spigotmc/event/entity/EntityDismountEvent", "org/bukkit/event/entity/EntityDismountEvent", ++ "org/bukkit/block/data/type/Crafter$Orientation", "org/bukkit/block/Orientation", // Paper ++ "org/bukkit/block/data/type/Jigsaw$Orientation", "org/bukkit/block/Orientation" // Paper + ); + + private static final Map CLASS_TO_INTERFACE = Map.of( diff --git a/patches/server/1067-server-gen-test.patch b/patches/server/1067-server-gen-test.patch new file mode 100644 index 0000000000..f16cf4b44a --- /dev/null +++ b/patches/server/1067-server-gen-test.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Sun, 3 Mar 2024 18:05:10 +0100 +Subject: [PATCH] server gen test + + +diff --git a/build.gradle.kts b/build.gradle.kts +index 12b3cad1ee40fdd9c4386debe9d8af178d274ba2..f06d67177cd0752b0fc732ca5dc11a38d815a97b 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -186,17 +186,31 @@ fun TaskContainer.registerRunTask( + } + + // Paper start ++val generatedServerDir: File = rootProject.file("paper-generator/generatedServer") ++ + sourceSets.main { + java { ++ srcDir(generatedServerDir) + exclude("excluded/**") + } + } + + idea { + module { ++ generatedSourceDirs.add(generatedServerDir) + excludeDirs.add(projectDir.resolve("src/main/java/excluded")) + } + } ++ ++val scanJarForOldGeneratedCode = tasks.register("scanJarForOldGeneratedCode", 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) ++} + // Paper end + + val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatMap { it.elements } diff --git a/patches/server/1068-Code-generation-marker-stub.patch b/patches/server/1068-Code-generation-marker-stub.patch new file mode 100644 index 0000000000..c3d2f10b5a --- /dev/null +++ b/patches/server/1068-Code-generation-marker-stub.patch @@ -0,0 +1,122 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Sat, 16 Mar 2024 18:58:41 +0100 +Subject: [PATCH] Code generation marker stub + + +diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java +index 12220f78ffaf06433ada72fd0c7f22b97d55287d..cddaa44a0e89a81d4dcc4364249c8d83641e590a 100644 +--- a/src/main/java/io/papermc/paper/registry/PaperRegistries.java ++++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java +@@ -71,6 +71,7 @@ public final class PaperRegistries { + private static final Map, RegistryEntry> BY_RESOURCE_KEY; + static { + REGISTRY_ENTRIES = List.of( ++ // Paper start - Generated/RegistryDefinitions + // built-ins + writable(Registries.GAME_EVENT, RegistryKey.GAME_EVENT, GameEvent.class, CraftGameEvent::new, PaperGameEventRegistryEntry.PaperBuilder::new), + entry(Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, StructureType.class, CraftStructureType::new), +@@ -105,6 +106,7 @@ public final class PaperRegistries { + apiOnly(Registries.SOUND_EVENT, RegistryKey.SOUND_EVENT, () -> org.bukkit.Registry.SOUNDS), + apiOnly(Registries.MEMORY_MODULE_TYPE, RegistryKey.MEMORY_MODULE_TYPE, () -> (org.bukkit.Registry>) (org.bukkit.Registry) org.bukkit.Registry.MEMORY_MODULE_TYPE), + apiOnly(Registries.FLUID, RegistryKey.FLUID, () -> org.bukkit.Registry.FLUID) ++ // Paper end - Generated/RegistryDefinitions + ); + final Map, RegistryEntry> byRegistryKey = new IdentityHashMap<>(REGISTRY_ENTRIES.size()); + final Map, RegistryEntry> byResourceKey = new IdentityHashMap<>(REGISTRY_ENTRIES.size()); +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java +index ccee1f637db5b8c34a5c125938edaa1361233e4d..c3c6ac5afe9ac09bcd20d51b8b97295323b644e9 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java +@@ -20,6 +20,7 @@ import org.bukkit.craftbukkit.inventory.CraftItemType; + import org.bukkit.entity.EntityType; + + public enum CraftStatistic { ++ // Paper start - Generated/CraftStatisticCustom + DAMAGE_DEALT(Stats.DAMAGE_DEALT), + DAMAGE_TAKEN(Stats.DAMAGE_TAKEN), + DEATHS(Stats.DEATHS), +@@ -102,7 +103,10 @@ public enum CraftStatistic { + INTERACT_WITH_GRINDSTONE(Stats.INTERACT_WITH_GRINDSTONE), + TARGET_HIT(Stats.TARGET_HIT), + INTERACT_WITH_SMITHING_TABLE(Stats.INTERACT_WITH_SMITHING_TABLE), ++ // Paper end - Generated/CraftStatisticCustom ++ // Paper start - Generated/CraftStatisticType + STRIDER_ONE_CM(Stats.STRIDER_ONE_CM); ++ // Paper end - Generated/CraftStatisticType + private final ResourceLocation minecraftKey; + private final org.bukkit.Statistic bukkit; + private static final BiMap statistics; +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +index b7ff7af2513204b151340538d50a65c850bdb75f..01d340c6420db07c3093d997f6ed6ede79e2443e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +@@ -132,7 +132,7 @@ public final class CraftBlockStates { + // Paper end + + static { +- // Paper start - simplify ++ // Paper start - Generated/CraftBlockEntityStates + register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new); + register(BlockEntityType.HANGING_SIGN, CraftHangingSign.class, CraftHangingSign::new); + register(BlockEntityType.SKULL, CraftSkull.class, CraftSkull::new); +@@ -177,7 +177,7 @@ public final class CraftBlockStates { + register(BlockEntityType.CRAFTER, CraftCrafter.class, CraftCrafter::new); + register(BlockEntityType.TRIAL_SPAWNER, CraftTrialSpawner.class, CraftTrialSpawner::new); + register(BlockEntityType.VAULT, CraftVault.class, CraftVault::new); +- // Paper end ++ // Paper end - Generated/CraftBlockEntityStates + } + + private static void register(Material blockType, BlockStateFactory factory) { +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +index 4ca987f83d78aaf2ea7be451b1cb4afefa85feda..d2462e5aba30ee46bdbe0be22cce47f435ce27e7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -366,6 +366,7 @@ public class CraftBlockData implements BlockData { + + static { + // ++ // Paper start - Generated/CraftBlockData#MAP + register(net.minecraft.world.level.block.AmethystClusterBlock.class, org.bukkit.craftbukkit.block.impl.CraftAmethystCluster::new); + register(net.minecraft.world.level.block.BigDripleafBlock.class, org.bukkit.craftbukkit.block.impl.CraftBigDripleaf::new); + register(net.minecraft.world.level.block.BigDripleafStemBlock.class, org.bukkit.craftbukkit.block.impl.CraftBigDripleafStem::new); +@@ -539,6 +540,7 @@ public class CraftBlockData implements BlockData { + register(net.minecraft.world.level.block.piston.PistonBaseBlock.class, org.bukkit.craftbukkit.block.impl.CraftPistonBase::new); + register(net.minecraft.world.level.block.piston.PistonHeadBlock.class, org.bukkit.craftbukkit.block.impl.CraftPistonHead::new); + register(net.minecraft.world.level.block.piston.MovingPistonBlock.class, org.bukkit.craftbukkit.block.impl.CraftMovingPiston::new); ++ // Paper end - Generated/CraftBlockData#MAP + // + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java +index cb11f0624e4e65aa06bfaaec90729ee536cd53a0..aa3a923a61146702736c9ffb5bdea64b1552efa5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java ++++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java +@@ -14,6 +14,7 @@ import org.bukkit.potion.PotionType; + public class CraftPotionUtil { + + private static final BiMap upgradeable = ImmutableBiMap.builder() ++ // Paper start - Generated/CraftPotionUtil#upgradeable + .put(PotionType.LEAPING, PotionType.STRONG_LEAPING) + .put(PotionType.SWIFTNESS, PotionType.STRONG_SWIFTNESS) + .put(PotionType.HEALING, PotionType.STRONG_HEALING) +@@ -23,8 +24,10 @@ public class CraftPotionUtil { + .put(PotionType.STRENGTH, PotionType.STRONG_STRENGTH) + .put(PotionType.SLOWNESS, PotionType.STRONG_SLOWNESS) + .put(PotionType.TURTLE_MASTER, PotionType.STRONG_TURTLE_MASTER) ++ // Paper end - Generated/CraftPotionUtil#upgradeable + .build(); + private static final BiMap extendable = ImmutableBiMap.builder() ++ // Paper start - Generated/CraftPotionUtil#extendable + .put(PotionType.NIGHT_VISION, PotionType.LONG_NIGHT_VISION) + .put(PotionType.INVISIBILITY, PotionType.LONG_INVISIBILITY) + .put(PotionType.LEAPING, PotionType.LONG_LEAPING) +@@ -38,6 +41,7 @@ public class CraftPotionUtil { + .put(PotionType.WEAKNESS, PotionType.LONG_WEAKNESS) + .put(PotionType.TURTLE_MASTER, PotionType.LONG_TURTLE_MASTER) + .put(PotionType.SLOW_FALLING, PotionType.LONG_SLOW_FALLING) ++ // Paper end - Generated/CraftPotionUtil#extendable + .build(); + + public static PotionType fromBukkit(PotionData data) { diff --git a/patches/server/1069-remove-CraftTropicalFish.CraftPattern.patch b/patches/server/1069-remove-CraftTropicalFish.CraftPattern.patch new file mode 100644 index 0000000000..57f9035eae --- /dev/null +++ b/patches/server/1069-remove-CraftTropicalFish.CraftPattern.patch @@ -0,0 +1,81 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Tue, 19 Mar 2024 19:23:44 +0100 +Subject: [PATCH] remove CraftTropicalFish.CraftPattern + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java +index 9e53c30801c700719c78c0fd521fd615c94e02c8..238ab5c01ad8b5b09f11259cddbafa1d3e0daf05 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java +@@ -1,11 +1,8 @@ + package org.bukkit.craftbukkit.entity; + +-import java.util.HashMap; +-import java.util.Map; + import org.bukkit.DyeColor; + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.entity.TropicalFish; +-import org.bukkit.entity.TropicalFish.Pattern; + + public class CraftTropicalFish extends io.papermc.paper.entity.PaperSchoolableFish implements TropicalFish { // Paper - Schooling Fish API + +@@ -53,48 +50,9 @@ public class CraftTropicalFish extends io.papermc.paper.entity.PaperSchoolableFi + this.getHandle().setPackedVariant(CraftTropicalFish.getData(this.getPatternColor(), this.getBodyColor(), pattern)); + } + +- public static enum CraftPattern { +- KOB(0, false), +- SUNSTREAK(1, false), +- SNOOPER(2, false), +- DASHER(3, false), +- BRINELY(4, false), +- SPOTTY(5, false), +- FLOPPER(0, true), +- STRIPEY(1, true), +- GLITTER(2, true), +- BLOCKFISH(3, true), +- BETTY(4, true), +- CLAYFISH(5, true); +- +- private final int variant; +- private final boolean large; +- +- // +- private static final Map BY_DATA = new HashMap<>(); +- +- static { +- for (CraftPattern type : values()) { +- BY_DATA.put(type.getDataValue(), Pattern.values()[type.ordinal()]); +- } +- } +- +- public static Pattern fromData(int data) { +- return BY_DATA.get(data); +- } +- +- private CraftPattern(int variant, boolean large) { +- this.variant = variant; +- this.large = large; +- } +- +- public int getDataValue() { +- return this.variant << 8 | ((this.large) ? 1 : 0); +- } +- } +- + public static int getData(DyeColor patternColor, DyeColor bodyColor, Pattern type) { +- return patternColor.getWoolData() << 24 | bodyColor.getWoolData() << 16 | CraftPattern.values()[type.ordinal()].getDataValue(); ++ net.minecraft.world.entity.animal.TropicalFish.Pattern pattern = net.minecraft.world.entity.animal.TropicalFish.Pattern.valueOf(type.name()); ++ return patternColor.getWoolData() << 24 | bodyColor.getWoolData() << 16 | pattern.getPackedId(); + } + + public static DyeColor getPatternColor(int data) { +@@ -106,6 +64,6 @@ public class CraftTropicalFish extends io.papermc.paper.entity.PaperSchoolableFi + } + + public static Pattern getPattern(int data) { +- return CraftPattern.fromData(data & 0xFFFF); ++ return Pattern.valueOf(net.minecraft.world.entity.animal.TropicalFish.getPattern(data).name()); + } + } diff --git a/patches/server/1070-remove-fluidstate-mapping.patch b/patches/server/1070-remove-fluidstate-mapping.patch new file mode 100644 index 0000000000..5552050c31 --- /dev/null +++ b/patches/server/1070-remove-fluidstate-mapping.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Thu, 11 Apr 2024 20:49:16 +0200 +Subject: [PATCH] remove fluidstate mapping + + +diff --git a/src/main/java/io/papermc/paper/block/fluid/PaperFluidData.java b/src/main/java/io/papermc/paper/block/fluid/PaperFluidData.java +index 479bc32241ebadf8bbc1080b601f61391ad37fa4..891341025f92090144a91cd5326b1c020ea75315 100644 +--- a/src/main/java/io/papermc/paper/block/fluid/PaperFluidData.java ++++ b/src/main/java/io/papermc/paper/block/fluid/PaperFluidData.java +@@ -88,23 +88,10 @@ public class PaperFluidData implements FluidData { + return "PaperFluidData{" + this.state + "}"; + } + +- /* Registry */ +- private static final Map, Function> MAP = new HashMap<>(); +- static { +- // +- register(LavaFluid.Source.class, PaperFallingFluidData::new); +- register(WaterFluid.Source.class, PaperFallingFluidData::new); +- register(LavaFluid.Flowing.class, PaperFlowingFluidData::new); +- register(WaterFluid.Flowing.class, PaperFlowingFluidData::new); +- // +- } +- +- static void register(final Class fluid, final Function creator) { +- Preconditions.checkState(MAP.put(fluid, creator) == null, "Duplicate mapping %s->%s", fluid, creator); +- MAP.put(fluid, creator); +- } +- + public static PaperFluidData createData(final FluidState state) { +- return MAP.getOrDefault(state.getType().getClass(), PaperFluidData::new).apply(state); ++ if (state.isEmpty()) { ++ return new PaperFluidData(state); ++ } ++ return state.isSource() ? new PaperFallingFluidData(state) : new PaperFlowingFluidData(state); + } + } diff --git a/patches/server/1071-fix-memory-keys-use-of-generics.patch b/patches/server/1071-fix-memory-keys-use-of-generics.patch new file mode 100644 index 0000000000..29251d1b31 --- /dev/null +++ b/patches/server/1071-fix-memory-keys-use-of-generics.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Wed, 11 Sep 2024 20:36:46 +0200 +Subject: [PATCH] fix memory keys use of generics + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryKey.java b/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryKey.java +index 43cd5ef2dce9fb5b82529db2a1a712f6a517cc5c..291a19c39b0a6d2877d6183bbd9ca36578609c53 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryKey.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryKey.java +@@ -17,7 +17,7 @@ public final class CraftMemoryKey { + } + + net.minecraft.core.Registry> registry = CraftRegistry.getMinecraftRegistry(Registries.MEMORY_MODULE_TYPE); +- MemoryKey bukkit = Registry.MEMORY_MODULE_TYPE.get(CraftNamespacedKey.fromMinecraft(registry.getResourceKey(minecraft).orElseThrow().location())); ++ MemoryKey bukkit = (MemoryKey) Registry.MEMORY_MODULE_TYPE.get(CraftNamespacedKey.fromMinecraft(registry.getResourceKey(minecraft).orElseThrow().location())); + + return bukkit; + } diff --git a/patches/server/1072-fixup-Add-registry-entry-and-builders.patch b/patches/server/1072-fixup-Add-registry-entry-and-builders.patch new file mode 100644 index 0000000000..77cdfc03d7 --- /dev/null +++ b/patches/server/1072-fixup-Add-registry-entry-and-builders.patch @@ -0,0 +1,67 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Tue, 24 Sep 2024 13:19:57 +0200 +Subject: [PATCH] fixup! Add registry entry and builders + + +diff --git a/src/test/java/io/papermc/paper/registry/RegistryBuilderTest.java b/src/test/java/io/papermc/paper/registry/RegistryBuilderTest.java +index 2b42726c034f6701c86120d400446f0d868d464b..fe805f6d50e3e4c6ac0fc9540aabd76169faf3b9 100644 +--- a/src/test/java/io/papermc/paper/registry/RegistryBuilderTest.java ++++ b/src/test/java/io/papermc/paper/registry/RegistryBuilderTest.java +@@ -1,39 +1,41 @@ + package io.papermc.paper.registry; + +-import io.papermc.paper.registry.data.PaperEnchantmentRegistryEntry; +-import io.papermc.paper.registry.data.PaperGameEventRegistryEntry; + import io.papermc.paper.registry.data.util.Conversions; +-import java.util.List; + import java.util.Map; ++import java.util.stream.Stream; ++import io.papermc.paper.registry.entry.RegistryEntry; ++import io.papermc.paper.registry.entry.RegistryEntryInfo; ++import io.papermc.paper.registry.legacy.DelayedRegistryEntry; + import net.minecraft.core.Registry; +-import net.minecraft.core.registries.Registries; + import net.minecraft.resources.RegistryOps; + import net.minecraft.resources.ResourceKey; +-import net.minecraft.world.item.enchantment.Enchantment; +-import net.minecraft.world.level.gameevent.GameEvent; ++import org.bukkit.Keyed; + import org.bukkit.support.AbstractTestingBase; + import org.junit.jupiter.params.ParameterizedTest; + import org.junit.jupiter.params.provider.Arguments; + import org.junit.jupiter.params.provider.MethodSource; + + import static org.junit.jupiter.api.Assertions.assertEquals; +-import static org.junit.jupiter.params.provider.Arguments.arguments; + + class RegistryBuilderTest extends AbstractTestingBase { + +- static List registries() { +- return List.of( +- arguments(Registries.ENCHANTMENT, (PaperRegistryBuilder.Filler) PaperEnchantmentRegistryEntry.PaperBuilder::new), +- arguments(Registries.GAME_EVENT, (PaperRegistryBuilder.Filler) PaperGameEventRegistryEntry.PaperBuilder::new) +- ); ++ static Stream registries() { ++ return PaperRegistries.REGISTRY_ENTRIES.stream() ++ .map(RegistryBuilderTest::possiblyUnwrap) ++ .filter(RegistryEntry.BuilderHolder.class::isInstance) ++ .map(Arguments::arguments); ++ } ++ ++ private static RegistryEntryInfo possiblyUnwrap(final RegistryEntryInfo entry) { ++ return entry instanceof final DelayedRegistryEntry delayed ? delayed.delegate() : entry; + } + + @ParameterizedTest + @MethodSource("registries") +- void testEquality(final ResourceKey> resourceKey, final PaperRegistryBuilder.Filler filler) { +- final Registry registry = AbstractTestingBase.REGISTRY_CUSTOM.registryOrThrow(resourceKey); ++ void testEquality(final RegistryEntry.BuilderHolder registryEntry) { ++ final Registry registry = AbstractTestingBase.REGISTRY_CUSTOM.registryOrThrow(registryEntry.mcKey()); + for (final Map.Entry, M> entry : registry.entrySet()) { +- final M built = filler.fill(new Conversions(new RegistryOps.HolderLookupAdapter(AbstractTestingBase.REGISTRY_CUSTOM)), PaperRegistries.fromNms(entry.getKey()), entry.getValue()).build(); ++ final M built = registryEntry.fillBuilder(new Conversions(new RegistryOps.HolderLookupAdapter(AbstractTestingBase.REGISTRY_CUSTOM)), PaperRegistries.fromNms(entry.getKey()), entry.getValue()).build(); + assertEquals(entry.getValue(), built); + } + } diff --git a/settings.gradle.kts b/settings.gradle.kts index eb689c22d8..91585adf85 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -40,7 +40,7 @@ for (name in listOf("Paper-API", "Paper-Server")) { } optionalInclude("test-plugin") -optionalInclude("paper-api-generator") +optionalInclude("paper-generator") fun optionalInclude(name: String, op: (ProjectDescriptor.() -> Unit)? = null) { val settingsFile = file("$name.settings.gradle.kts")