From 85f704e537f776f74ca129bf83412748e3c189d7 Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:00:34 +0200 Subject: [PATCH] Generators Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> --- .editorconfig | 5 +- .gitignore | 2 +- paper-api-generator/build.gradle.kts | 35 - .../java/io/papermc/generator/Generators.java | 92 - .../main/java/io/papermc/generator/Main.java | 93 - .../generator/types/GeneratedKeyType.java | 210 - .../generator/types/GeneratedTagKeyType.java | 138 - .../papermc/generator/utils/Annotations.java | 65 - .../papermc/generator/utils/Formatting.java | 59 - .../io/papermc/generator/utils/Javadocs.java | 27 - .../papermc/generator/utils/TagCollector.java | 79 - paper-generator/.editorconfig | 6 + paper-generator/build.gradle.kts | 62 + .../paper/entity/ai/VanillaGoal.java | 2 +- .../paper/registry/event/RegistryEvents.java | 32 + .../paper/registry/keys/AttributeKeys.java | 2 +- .../registry/keys/BannerPatternKeys.java | 4 +- .../paper/registry/keys/BiomeKeys.java | 4 +- .../paper/registry/keys/BlockTypeKeys.java | 2 +- .../paper/registry/keys/CatVariantKeys.java | 2 +- .../paper/registry/keys/DamageTypeKeys.java | 4 +- .../registry/keys/DataComponentTypeKeys.java | 505 +++ .../paper/registry/keys/EnchantmentKeys.java | 4 +- .../paper/registry/keys/FluidKeys.java | 2 +- .../paper/registry/keys/FrogVariantKeys.java | 2 +- .../paper/registry/keys/GameEventKeys.java | 4 +- .../paper/registry/keys/InstrumentKeys.java | 4 +- .../paper/registry/keys/ItemTypeKeys.java | 2 +- .../paper/registry/keys/JukeboxSongKeys.java | 4 +- .../registry/keys/MapDecorationTypeKeys.java | 2 +- .../paper/registry/keys/MenuTypeKeys.java | 2 +- .../paper/registry/keys/MobEffectKeys.java | 2 +- .../registry/keys/PaintingVariantKeys.java | 4 +- .../paper/registry/keys/SoundEventKeys.java | 2 +- .../paper/registry/keys/StructureKeys.java | 4 +- .../registry/keys/StructureTypeKeys.java | 2 +- .../paper/registry/keys/TrimMaterialKeys.java | 4 +- .../paper/registry/keys/TrimPatternKeys.java | 4 +- .../registry/keys/VillagerProfessionKeys.java | 2 +- .../paper/registry/keys/VillagerTypeKeys.java | 2 +- .../paper/registry/keys/WolfVariantKeys.java | 4 +- .../keys/tags/BannerPatternTagKeys.java | 4 +- .../registry/keys/tags/BiomeTagKeys.java | 4 +- .../registry/keys/tags/BlockTypeTagKeys.java | 4 +- .../registry/keys/tags/CatVariantTagKeys.java | 4 +- .../registry/keys/tags/DamageTypeTagKeys.java | 4 +- .../keys/tags/EnchantmentTagKeys.java | 4 +- .../registry/keys/tags/FluidTagKeys.java | 4 +- .../registry/keys/tags/GameEventTagKeys.java | 4 +- .../registry/keys/tags/InstrumentTagKeys.java | 4 +- .../registry/keys/tags/ItemTypeTagKeys.java | 4 +- .../keys/tags/PaintingVariantTagKeys.java | 4 +- .../registry/keys/tags/StructureTagKeys.java | 4 +- .../generatedApi/org/bukkit/Art.java | 242 ++ .../generatedApi/org/bukkit/FeatureFlag.java | 57 + .../generatedApi/org/bukkit/Fluid.java | 54 + .../generatedApi/org/bukkit/GameEvent.java | 224 + .../generatedApi/org/bukkit/JukeboxSong.java | 67 + .../generatedApi/org/bukkit/Material.java | 3727 +++++++++++++++++ .../org/bukkit/MusicInstrument.java | 79 + .../generatedApi/org/bukkit/Sound.java | 3356 +++++++++++++++ .../generatedApi/org/bukkit/Statistic.java | 180 + .../generatedApi/org/bukkit/Tag.java | 901 ++++ .../org/bukkit/attribute/Attribute.java | 113 + .../generatedApi/org/bukkit/block/Biome.java | 208 + .../org/bukkit/block/BlockType.java | 2623 ++++++++++++ .../org/bukkit/block/banner/PatternType.java | 180 + .../org/bukkit/damage/DamageType.java | 171 + .../generatedApi/org/bukkit/entity/Boat.java | 198 + .../generatedApi/org/bukkit/entity/Cat.java | 140 + .../org/bukkit/entity/EntityType.java | 382 ++ .../generatedApi/org/bukkit/entity/Fox.java | 149 + .../generatedApi/org/bukkit/entity/Frog.java | 90 + .../generatedApi/org/bukkit/entity/Panda.java | 231 + .../org/bukkit/entity/Salmon.java | 37 + .../org/bukkit/entity/Sniffer.java | 88 + .../org/bukkit/entity/TropicalFish.java | 79 + .../org/bukkit/entity/Villager.java | 396 ++ .../generatedApi/org/bukkit/entity/Wolf.java | 122 + .../org/bukkit/entity/memory/MemoryKey.java | 161 + .../bukkit/generator/structure/Structure.java | 109 + .../generator/structure/StructureType.java | 57 + .../org/bukkit/inventory/ItemRarity.java | 31 + .../org/bukkit/inventory/ItemType.java | 3145 ++++++++++++++ .../inventory/meta/trim/TrimMaterial.java | 69 + .../inventory/meta/trim/TrimPattern.java | 85 + .../inventory/recipe/CookingBookCategory.java | 14 + .../recipe/CraftingBookCategory.java | 15 + .../org/bukkit/map/MapCursor.java | 417 ++ .../org/bukkit/map/MapPalette.java | 513 +++ .../org/bukkit/potion/PotionType.java | 171 + .../org/bukkit/scoreboard/DisplaySlot.java | 58 + .../org/bukkit/tag/DamageTypeTags.java | 97 + .../paper/registry/PaperRegistries.java | 174 + .../flag/PaperFeatureFlagProviderImpl.java | 58 + .../bukkit/craftbukkit/CraftStatistic.java | 335 ++ .../craftbukkit/block/CraftBlockStates.java | 336 ++ .../block/data/CraftBlockData.java | 790 ++++ .../block/impl/CraftAmethystCluster.java | 51 + .../craftbukkit/block/impl/CraftAnvil.java | 38 + .../block/impl/CraftAttachedStem.java | 38 + .../block/impl/CraftBambooStalk.java | 65 + .../craftbukkit/block/impl/CraftBanner.java | 35 + .../craftbukkit/block/impl/CraftBarrel.java | 51 + .../craftbukkit/block/impl/CraftBarrier.java | 27 + .../block/impl/CraftBaseCoralFan.java | 27 + .../block/impl/CraftBaseCoralPlant.java | 27 + .../block/impl/CraftBaseCoralWallFan.java | 51 + .../craftbukkit/block/impl/CraftBed.java | 65 + .../craftbukkit/block/impl/CraftBeehive.java | 56 + .../craftbukkit/block/impl/CraftBeetroot.java | 32 + .../craftbukkit/block/impl/CraftBell.java | 65 + .../block/impl/CraftBigDripleaf.java | 65 + .../block/impl/CraftBigDripleafStem.java | 52 + .../block/impl/CraftBlastFurnace.java | 51 + .../block/impl/CraftBrewingStand.java | 45 + .../block/impl/CraftBrushable.java | 32 + .../block/impl/CraftBubbleColumn.java | 27 + .../craftbukkit/block/impl/CraftButton.java | 66 + .../craftbukkit/block/impl/CraftCactus.java | 32 + .../craftbukkit/block/impl/CraftCake.java | 32 + .../impl/CraftCalibratedSculkSensor.java | 83 + .../craftbukkit/block/impl/CraftCampfire.java | 75 + .../craftbukkit/block/impl/CraftCandle.java | 62 + .../block/impl/CraftCandleCake.java | 27 + .../craftbukkit/block/impl/CraftCarrot.java | 32 + .../block/impl/CraftCarvedPumpkin.java | 38 + .../block/impl/CraftCaveVines.java | 45 + .../block/impl/CraftCaveVinesPlant.java | 27 + .../block/impl/CraftCeilingHangingSign.java | 60 + .../craftbukkit/block/impl/CraftChain.java | 50 + .../block/impl/CraftCherryLeaves.java | 62 + .../craftbukkit/block/impl/CraftChest.java | 65 + .../block/impl/CraftChiseledBookShelf.java | 70 + .../block/impl/CraftChorusFlower.java | 32 + .../block/impl/CraftChorusPlant.java | 58 + .../craftbukkit/block/impl/CraftCocoa.java | 56 + .../block/impl/CraftCommandBlock.java | 50 + .../block/impl/CraftComparator.java | 65 + .../block/impl/CraftComposter.java | 37 + .../craftbukkit/block/impl/CraftConduit.java | 27 + .../block/impl/CraftCopperBulb.java | 39 + .../craftbukkit/block/impl/CraftCoralFan.java | 27 + .../block/impl/CraftCoralPlant.java | 27 + .../block/impl/CraftCoralWallFan.java | 51 + .../craftbukkit/block/impl/CraftCrafter.java | 56 + .../block/impl/CraftCreakingHeart.java | 50 + .../craftbukkit/block/impl/CraftCrop.java | 32 + .../block/impl/CraftDaylightDetector.java | 45 + .../block/impl/CraftDecoratedPot.java | 64 + .../block/impl/CraftDetectorRail.java | 62 + .../block/impl/CraftDispenser.java | 51 + .../craftbukkit/block/impl/CraftDoor.java | 91 + .../block/impl/CraftDoublePlant.java | 30 + .../craftbukkit/block/impl/CraftDropper.java | 51 + .../block/impl/CraftEndPortalFrame.java | 51 + .../craftbukkit/block/impl/CraftEndRod.java | 38 + .../block/impl/CraftEnderChest.java | 51 + .../craftbukkit/block/impl/CraftFarm.java | 32 + .../craftbukkit/block/impl/CraftFence.java | 73 + .../block/impl/CraftFenceGate.java | 75 + .../craftbukkit/block/impl/CraftFire.java | 80 + .../block/impl/CraftFrostedIce.java | 32 + .../craftbukkit/block/impl/CraftFurnace.java | 51 + .../block/impl/CraftGlazedTerracotta.java | 38 + .../block/impl/CraftGlowLichen.java | 75 + .../craftbukkit/block/impl/CraftGrass.java | 27 + .../block/impl/CraftGrindstone.java | 53 + .../block/impl/CraftHangingMoss.java | 27 + .../block/impl/CraftHangingRoots.java | 27 + .../craftbukkit/block/impl/CraftHay.java | 37 + .../block/impl/CraftHeavyCore.java | 27 + .../craftbukkit/block/impl/CraftHopper.java | 51 + .../block/impl/CraftHugeMushroom.java | 63 + .../impl/CraftInfestedRotatedPillar.java | 37 + .../craftbukkit/block/impl/CraftIronBars.java | 73 + .../craftbukkit/block/impl/CraftJigsaw.java | 30 + .../craftbukkit/block/impl/CraftJukebox.java | 27 + .../craftbukkit/block/impl/CraftKelp.java | 32 + .../craftbukkit/block/impl/CraftLadder.java | 51 + .../craftbukkit/block/impl/CraftLantern.java | 39 + .../block/impl/CraftLayeredCauldron.java | 37 + .../craftbukkit/block/impl/CraftLeaves.java | 62 + .../craftbukkit/block/impl/CraftLectern.java | 63 + .../craftbukkit/block/impl/CraftLever.java | 66 + .../craftbukkit/block/impl/CraftLight.java | 50 + .../block/impl/CraftLightningRod.java | 63 + .../craftbukkit/block/impl/CraftLiquid.java | 37 + .../craftbukkit/block/impl/CraftLoom.java | 38 + .../block/impl/CraftMangroveLeaves.java | 62 + .../block/impl/CraftMangrovePropagule.java | 75 + .../block/impl/CraftMangroveRoots.java | 27 + .../block/impl/CraftMossyCarpet.java | 65 + .../block/impl/CraftMovingPiston.java | 52 + .../craftbukkit/block/impl/CraftMycelium.java | 27 + .../block/impl/CraftNetherPortal.java | 38 + .../block/impl/CraftNetherWart.java | 32 + .../block/impl/CraftNoteBlock.java | 58 + .../craftbukkit/block/impl/CraftObserver.java | 51 + .../block/impl/CraftPiglinWallSkull.java | 51 + .../block/impl/CraftPinkPetals.java | 61 + .../block/impl/CraftPistonBase.java | 51 + .../block/impl/CraftPistonHead.java | 65 + .../block/impl/CraftPitcherCrop.java | 48 + .../block/impl/CraftPlayerHead.java | 48 + .../block/impl/CraftPlayerWallHead.java | 51 + .../block/impl/CraftPointedDripstone.java | 65 + .../craftbukkit/block/impl/CraftPotato.java | 32 + .../block/impl/CraftPoweredRail.java | 62 + .../block/impl/CraftPressurePlate.java | 27 + .../craftbukkit/block/impl/CraftRail.java | 49 + .../block/impl/CraftRedStoneOre.java | 27 + .../block/impl/CraftRedStoneWire.java | 66 + .../block/impl/CraftRedstoneLamp.java | 27 + .../block/impl/CraftRedstoneTorch.java | 27 + .../block/impl/CraftRedstoneWallTorch.java | 51 + .../craftbukkit/block/impl/CraftRepeater.java | 86 + .../block/impl/CraftRespawnAnchor.java | 32 + .../block/impl/CraftRotatedPillar.java | 37 + .../craftbukkit/block/impl/CraftSapling.java | 32 + .../block/impl/CraftScaffolding.java | 57 + .../block/impl/CraftSculkCatalyst.java | 27 + .../block/impl/CraftSculkSensor.java | 61 + .../block/impl/CraftSculkShrieker.java | 51 + .../block/impl/CraftSculkVein.java | 75 + .../block/impl/CraftSeaPickle.java | 50 + .../block/impl/CraftShulkerBox.java | 38 + .../craftbukkit/block/impl/CraftSkull.java | 48 + .../craftbukkit/block/impl/CraftSlab.java | 43 + .../block/impl/CraftSmallDripleaf.java | 66 + .../craftbukkit/block/impl/CraftSmoker.java | 51 + .../block/impl/CraftSnifferEgg.java | 32 + .../block/impl/CraftSnowLayer.java | 37 + .../block/impl/CraftSnowyDirt.java | 27 + .../block/impl/CraftStainedGlassPane.java | 73 + .../craftbukkit/block/impl/CraftStair.java | 78 + .../block/impl/CraftStandingSign.java | 48 + .../craftbukkit/block/impl/CraftStem.java | 32 + .../block/impl/CraftStonecutter.java | 38 + .../block/impl/CraftStructureBlock.java | 29 + .../block/impl/CraftSugarCane.java | 32 + .../block/impl/CraftSweetBerryBush.java | 32 + .../block/impl/CraftTallFlower.java | 30 + .../block/impl/CraftTallSeagrass.java | 30 + .../craftbukkit/block/impl/CraftTarget.java | 32 + .../craftbukkit/block/impl/CraftTnt.java | 27 + .../block/impl/CraftTorchflowerCrop.java | 32 + .../craftbukkit/block/impl/CraftTrapDoor.java | 88 + .../block/impl/CraftTrappedChest.java | 65 + .../block/impl/CraftTrialSpawner.java | 43 + .../craftbukkit/block/impl/CraftTripWire.java | 97 + .../block/impl/CraftTripWireHook.java | 63 + .../block/impl/CraftTurtleEgg.java | 54 + .../block/impl/CraftTwistingVines.java | 32 + .../craftbukkit/block/impl/CraftVault.java | 66 + .../craftbukkit/block/impl/CraftVine.java | 58 + .../craftbukkit/block/impl/CraftWall.java | 69 + .../block/impl/CraftWallBanner.java | 38 + .../block/impl/CraftWallHangingSign.java | 51 + .../craftbukkit/block/impl/CraftWallSign.java | 51 + .../block/impl/CraftWallSkull.java | 51 + .../block/impl/CraftWallTorch.java | 38 + .../impl/CraftWaterloggedTransparent.java | 27 + .../block/impl/CraftWeatheringCopperBulb.java | 39 + .../block/impl/CraftWeatheringCopperDoor.java | 91 + .../impl/CraftWeatheringCopperGrate.java | 27 + .../block/impl/CraftWeatheringCopperSlab.java | 43 + .../impl/CraftWeatheringCopperStair.java | 78 + .../impl/CraftWeatheringCopperTrapDoor.java | 88 + .../block/impl/CraftWeepingVines.java | 32 + .../impl/CraftWeightedPressurePlate.java | 32 + .../block/impl/CraftWitherSkull.java | 48 + .../block/impl/CraftWitherWallSkull.java | 51 + .../craftbukkit/potion/CraftPotionUtil.java | 104 + .../java/io/papermc/generator/Generators.java | 23 + .../main/java/io/papermc/generator/Main.java | 108 + .../java/io/papermc/generator/Rewriters.java | 198 + .../registry/RegistryBootstrapper.java | 33 + .../generator/registry/RegistryEntries.java | 200 + .../generator/registry/RegistryEntry.java | 192 + .../generator/registry/RegistryKeyField.java | 7 + .../PaperPatternSourceSetRewriter.java | 85 + .../PatternSourceSetRewriter.java | 23 + .../rewriter/registration/RewriterHolder.java | 27 + .../generator/rewriter/types/Types.java | 26 + .../types/registry/EnumRegistryRewriter.java | 80 + .../types/registry/FeatureFlagRewriter.java | 61 + .../registry/PaperFeatureFlagMapping.java | 30 + .../registry/PaperRegistriesRewriter.java | 88 + .../registry/RegistryEventsRewriter.java | 33 + .../types/registry/RegistryFieldRewriter.java | 133 + .../types/registry/RegistryTagRewriter.java | 89 + .../rewriter/types/registry/TagRewriter.java | 89 + .../types/simple/BlockTypeRewriter.java | 27 + .../types/simple/CraftBlockDataMapping.java | 19 + .../simple/CraftBlockEntityStateMapping.java | 21 + .../types/simple/CraftPotionUtilRewriter.java | 32 + .../types/simple/EntityTypeRewriter.java | 169 + .../types/simple/ItemTypeRewriter.java | 27 + .../types/simple/MapPaletteRewriter.java | 30 + .../types/simple/MaterialRewriter.java | 148 + .../types/simple/MemoryKeyRewriter.java | 115 + .../types/simple/StatisticRewriter.java | 170 + .../simple/VillagerProfessionRewriter.java | 136 + .../rewriter/types/simple/package-info.java | 4 + .../generator/rewriter/utils/Annotations.java | 48 + .../types/OverriddenClassGenerator.java | 46 + .../generator/types/SimpleEnumGenerator.java | 30 + .../generator/types/SimpleGenerator.java | 12 +- .../generator/types/SourceGenerator.java | 2 + .../io/papermc/generator/types/Types.java | 14 + .../CraftBlockDataBootstrapper.java | 23 + .../CraftBlockDataGenerator.java | 243 ++ .../property/EnumPropertyWriter.java | 46 + .../property/IntegerPropertyWriter.java | 44 + .../property/PropertyMaker.java | 25 + .../property/PropertyWriter.java | 88 + .../property/appender/AppenderBase.java | 13 + .../property/appender/EnumValuesAppender.java | 45 + .../property/appender/PropertyAppender.java | 12 + .../property/appender/PropertyAppenders.java | 33 + .../property/converter/Converter.java | 13 + .../property/converter/ConverterBase.java | 24 + .../property/converter/Converters.java | 25 + .../property/converter/NoteConverter.java | 37 + .../property/converter/RotationConverter.java | 45 + .../property/holder/DataHolderType.java | 7 + .../property/holder/DataPropertyMaker.java | 31 + .../property/holder/DataPropertyWriter.java | 162 + .../holder/DataPropertyWriterBase.java | 66 + .../holder/VirtualDataPropertyWriter.java | 99 + .../property/holder/VirtualField.java | 72 + .../holder/appender/ArrayAppender.java | 54 + .../holder/appender/DataAppender.java | 18 + .../holder/appender/DataAppenders.java | 24 + .../holder/appender/ListAppender.java | 61 + .../property/holder/appender/MapAppender.java | 58 + .../holder/converter/ArrayConverter.java | 32 + .../holder/converter/DataConverter.java | 18 + .../holder/converter/DataConverters.java | 25 + .../holder/converter/ListConverter.java | 32 + .../holder/converter/MapConverter.java | 45 + .../types/goal/MobGoalGenerator.java | 45 +- .../generator/types/goal/MobGoalNames.java | 284 +- .../types/registry/GeneratedKeyType.java | 139 + .../types/registry/GeneratedTagKeyType.java | 106 + .../papermc/generator/utils/Annotations.java | 48 + .../generator/utils/BlockEntityMapping.java | 37 + .../generator/utils/BlockStateMapping.java | 510 +++ .../papermc/generator/utils/ClassHelper.java | 72 + .../generator/utils/CommonVariable.java | 10 + .../papermc/generator/utils/Formatting.java | 111 + .../io/papermc/generator/utils/Javadocs.java | 44 + .../generator/utils/NamingManager.java | 141 + .../experimental}/CollectingContext.java | 17 +- .../experimental/ExperimentalCollector.java | 134 + .../utils/experimental/FlagHolder.java | 16 + .../utils/experimental/FlagHolders.java | 26 + .../utils/experimental/SingleFlagHolder.java | 49 + .../generator/BlockStatePropertyTest.java | 75 + .../generator/MobGoalConverterTest.java | 12 +- .../generator/RegistryMigrationTest.java | 50 + .../rewriter/OldGeneratedCodeTest.java | 119 + .../wideners.at | 5 + patches/api/0004-Code-Generation.patch | 10 +- ...0501-fix-memory-keys-use-of-generics.patch | 80 + .../0502-Code-generation-marker-stub.patch | 1132 +++++ patches/api/0503-cleanup-block-data.patch | 336 ++ patches/server/0004-Test-changes.patch | 12 + .../server/0350-Implement-Mob-Goal-API.patch | 347 +- patches/server/0552-Missing-Entity-API.patch | 13 - patches/server/1073-move-spigot-scrap.patch | 331 ++ patches/server/1074-cleanup-block-data.patch | 3484 +++++++++++++++ patches/server/1075-server-gen-test.patch | 42 + .../1076-Code-generation-marker-stub.patch | 140 + ...emove-CraftTropicalFish.CraftPattern.patch | 81 + .../1078-remove-fluidstate-mapping.patch | 38 + ...1079-fix-memory-keys-use-of-generics.patch | 19 + settings.gradle.kts | 2 +- 379 files changed, 41617 insertions(+), 1380 deletions(-) delete mode 100644 paper-api-generator/build.gradle.kts delete mode 100644 paper-api-generator/src/main/java/io/papermc/generator/Generators.java delete mode 100644 paper-api-generator/src/main/java/io/papermc/generator/Main.java delete mode 100644 paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java delete mode 100644 paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedTagKeyType.java delete mode 100644 paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java delete mode 100644 paper-api-generator/src/main/java/io/papermc/generator/utils/Formatting.java delete mode 100644 paper-api-generator/src/main/java/io/papermc/generator/utils/Javadocs.java delete mode 100644 paper-api-generator/src/main/java/io/papermc/generator/utils/TagCollector.java create mode 100644 paper-generator/.editorconfig create mode 100644 paper-generator/build.gradle.kts rename {paper-api-generator/generated => paper-generator/generatedApi}/com/destroystokyo/paper/entity/ai/VanillaGoal.java (100%) create mode 100644 paper-generator/generatedApi/io/papermc/paper/registry/event/RegistryEvents.java rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/AttributeKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/BannerPatternKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/BiomeKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/BlockTypeKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/CatVariantKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/DamageTypeKeys.java (99%) create mode 100644 paper-generator/generatedApi/io/papermc/paper/registry/keys/DataComponentTypeKeys.java rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/EnchantmentKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/FluidKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/FrogVariantKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/GameEventKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/InstrumentKeys.java (97%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/ItemTypeKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/JukeboxSongKeys.java (98%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/MenuTypeKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/MobEffectKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/PaintingVariantKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/SoundEventKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/StructureKeys.java (98%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/StructureTypeKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/TrimMaterialKeys.java (97%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/TrimPatternKeys.java (98%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/VillagerProfessionKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/VillagerTypeKeys.java (100%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/WolfVariantKeys.java (97%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java (98%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/BiomeTagKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java (96%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/EnchantmentTagKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/FluidTagKeys.java (97%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java (97%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java (97%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/ItemTypeTagKeys.java (99%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/PaintingVariantTagKeys.java (95%) rename {paper-api-generator/generated => paper-generator/generatedApi}/io/papermc/paper/registry/keys/tags/StructureTagKeys.java (99%) create mode 100644 paper-generator/generatedApi/org/bukkit/Art.java create mode 100644 paper-generator/generatedApi/org/bukkit/FeatureFlag.java create mode 100644 paper-generator/generatedApi/org/bukkit/Fluid.java create mode 100644 paper-generator/generatedApi/org/bukkit/GameEvent.java create mode 100644 paper-generator/generatedApi/org/bukkit/JukeboxSong.java create mode 100644 paper-generator/generatedApi/org/bukkit/Material.java create mode 100644 paper-generator/generatedApi/org/bukkit/MusicInstrument.java create mode 100644 paper-generator/generatedApi/org/bukkit/Sound.java create mode 100644 paper-generator/generatedApi/org/bukkit/Statistic.java create mode 100644 paper-generator/generatedApi/org/bukkit/Tag.java create mode 100644 paper-generator/generatedApi/org/bukkit/attribute/Attribute.java create mode 100644 paper-generator/generatedApi/org/bukkit/block/Biome.java create mode 100644 paper-generator/generatedApi/org/bukkit/block/BlockType.java create mode 100644 paper-generator/generatedApi/org/bukkit/block/banner/PatternType.java create mode 100644 paper-generator/generatedApi/org/bukkit/damage/DamageType.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Boat.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Cat.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/EntityType.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Fox.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Frog.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Panda.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Salmon.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Sniffer.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/TropicalFish.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Villager.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/Wolf.java create mode 100644 paper-generator/generatedApi/org/bukkit/entity/memory/MemoryKey.java create mode 100644 paper-generator/generatedApi/org/bukkit/generator/structure/Structure.java create mode 100644 paper-generator/generatedApi/org/bukkit/generator/structure/StructureType.java create mode 100644 paper-generator/generatedApi/org/bukkit/inventory/ItemRarity.java create mode 100644 paper-generator/generatedApi/org/bukkit/inventory/ItemType.java create mode 100644 paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimMaterial.java create mode 100644 paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimPattern.java create mode 100644 paper-generator/generatedApi/org/bukkit/inventory/recipe/CookingBookCategory.java create mode 100644 paper-generator/generatedApi/org/bukkit/inventory/recipe/CraftingBookCategory.java create mode 100644 paper-generator/generatedApi/org/bukkit/map/MapCursor.java create mode 100644 paper-generator/generatedApi/org/bukkit/map/MapPalette.java create mode 100644 paper-generator/generatedApi/org/bukkit/potion/PotionType.java create mode 100644 paper-generator/generatedApi/org/bukkit/scoreboard/DisplaySlot.java create mode 100644 paper-generator/generatedApi/org/bukkit/tag/DamageTypeTags.java create mode 100644 paper-generator/generatedServer/io/papermc/paper/registry/PaperRegistries.java create mode 100644 paper-generator/generatedServer/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/CraftStatistic.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/CraftBlockStates.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/data/CraftBlockData.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAmethystCluster.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAnvil.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAttachedStem.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBambooStalk.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBanner.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrel.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrier.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralFan.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralPlant.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralWallFan.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBed.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeehive.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeetroot.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBell.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleaf.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleafStem.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBlastFurnace.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBrewingStand.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBrushable.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBubbleColumn.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftButton.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCactus.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCake.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCalibratedSculkSensor.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCampfire.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCandle.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCandleCake.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarrot.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarvedPumpkin.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCaveVines.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCaveVinesPlant.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCeilingHangingSign.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChain.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChest.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChiseledBookShelf.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChorusFlower.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChorusPlant.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCocoa.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCommandBlock.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftComparator.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftComposter.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftConduit.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCopperBulb.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralFan.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralPlant.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralWallFan.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCrafter.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCreakingHeart.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCrop.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDaylightDetector.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDecoratedPot.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDetectorRail.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDispenser.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDoor.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDoublePlant.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDropper.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndPortalFrame.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndRod.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEnderChest.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFarm.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFence.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFenceGate.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFire.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFrostedIce.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFurnace.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlazedTerracotta.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlowLichen.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGrass.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGrindstone.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHangingMoss.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHangingRoots.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHay.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHeavyCore.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHopper.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHugeMushroom.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftInfestedRotatedPillar.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftIronBars.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftJigsaw.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftJukebox.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftKelp.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLadder.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLantern.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLayeredCauldron.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLeaves.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLectern.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLever.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLight.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLightningRod.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLiquid.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLoom.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangrovePropagule.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMangroveRoots.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMossyCarpet.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMovingPiston.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMycelium.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNetherPortal.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNetherWart.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftNoteBlock.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftObserver.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPinkPetals.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonBase.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonHead.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPitcherCrop.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerHead.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerWallHead.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPointedDripstone.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPotato.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPoweredRail.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPressurePlate.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRail.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedStoneOre.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedStoneWire.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneLamp.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneTorch.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneWallTorch.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRepeater.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRespawnAnchor.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRotatedPillar.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSapling.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftScaffolding.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkCatalyst.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkSensor.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkShrieker.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSculkVein.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSeaPickle.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftShulkerBox.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSkull.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSlab.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmallDripleaf.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmoker.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnifferEgg.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnowLayer.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSnowyDirt.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStainedGlassPane.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStair.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStandingSign.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStem.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStonecutter.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStructureBlock.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSugarCane.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSweetBerryBush.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTallFlower.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTallSeagrass.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTarget.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTnt.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTorchflowerCrop.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrapDoor.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrappedChest.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTrialSpawner.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWire.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWireHook.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTurtleEgg.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTwistingVines.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftVault.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftVine.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWall.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallBanner.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallHangingSign.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSign.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSkull.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallTorch.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWaterloggedTransparent.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperBulb.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperDoor.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperGrate.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperSlab.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperStair.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeatheringCopperTrapDoor.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeepingVines.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWeightedPressurePlate.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherSkull.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherWallSkull.java create mode 100644 paper-generator/generatedServer/org/bukkit/craftbukkit/potion/CraftPotionUtil.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/Generators.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/Main.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/Rewriters.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/registry/RegistryBootstrapper.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntries.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntry.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/registry/RegistryKeyField.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/registration/PaperPatternSourceSetRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/registration/PatternSourceSetRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/registration/RewriterHolder.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/Types.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/EnumRegistryRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/FeatureFlagRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/PaperFeatureFlagMapping.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/PaperRegistriesRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryEventsRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryFieldRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryTagRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/TagRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/BlockTypeRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftBlockDataMapping.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftBlockEntityStateMapping.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/CraftPotionUtilRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/EntityTypeRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/ItemTypeRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MapPaletteRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MaterialRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MemoryKeyRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/StatisticRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/VillagerProfessionRewriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/package-info.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/rewriter/utils/Annotations.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/OverriddenClassGenerator.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/SimpleEnumGenerator.java rename {paper-api-generator => paper-generator}/src/main/java/io/papermc/generator/types/SimpleGenerator.java (78%) rename {paper-api-generator => paper-generator}/src/main/java/io/papermc/generator/types/SourceGenerator.java (76%) create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/Types.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/CraftBlockDataBootstrapper.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/CraftBlockDataGenerator.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/EnumPropertyWriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/IntegerPropertyWriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyMaker.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyWriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/AppenderBase.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/EnumValuesAppender.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/PropertyAppender.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/PropertyAppenders.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/ConverterBase.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converters.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/NoteConverter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/RotationConverter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataHolderType.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyMaker.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriterBase.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/VirtualDataPropertyWriter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/VirtualField.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/ArrayAppender.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/DataAppender.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/DataAppenders.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/ListAppender.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/MapAppender.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/ArrayConverter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverters.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/ListConverter.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/MapConverter.java rename {paper-api-generator => paper-generator}/src/main/java/io/papermc/generator/types/goal/MobGoalGenerator.java (76%) rename {paper-api-generator => paper-generator}/src/main/java/io/papermc/generator/types/goal/MobGoalNames.java (51%) create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedKeyType.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedTagKeyType.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/Annotations.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/BlockEntityMapping.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/BlockStateMapping.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/ClassHelper.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/CommonVariable.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/Formatting.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/Javadocs.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/NamingManager.java rename {paper-api-generator/src/main/java/io/papermc/generator/utils => paper-generator/src/main/java/io/papermc/generator/utils/experimental}/CollectingContext.java (51%) create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/experimental/ExperimentalCollector.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolder.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolders.java create mode 100644 paper-generator/src/main/java/io/papermc/generator/utils/experimental/SingleFlagHolder.java create mode 100644 paper-generator/src/test/java/io/papermc/generator/BlockStatePropertyTest.java rename {paper-api-generator => paper-generator}/src/test/java/io/papermc/generator/MobGoalConverterTest.java (74%) create mode 100644 paper-generator/src/test/java/io/papermc/generator/RegistryMigrationTest.java create mode 100644 paper-generator/src/test/java/io/papermc/generator/rewriter/OldGeneratedCodeTest.java rename {paper-api-generator => paper-generator}/wideners.at (57%) create mode 100644 patches/api/0501-fix-memory-keys-use-of-generics.patch create mode 100644 patches/api/0502-Code-generation-marker-stub.patch create mode 100644 patches/api/0503-cleanup-block-data.patch create mode 100644 patches/server/1073-move-spigot-scrap.patch create mode 100644 patches/server/1074-cleanup-block-data.patch create mode 100644 patches/server/1075-server-gen-test.patch create mode 100644 patches/server/1076-Code-generation-marker-stub.patch create mode 100644 patches/server/1077-remove-CraftTropicalFish.CraftPattern.patch create mode 100644 patches/server/1078-remove-fluidstate-mapping.patch create mode 100644 patches/server/1079-fix-memory-keys-use-of-generics.patch 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 62ceb696a5..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.1.0") - 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/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 73e4f70825..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/Generators.java +++ /dev/null @@ -1,92 +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.Art; -import org.bukkit.Fluid; -import org.bukkit.GameEvent; -import org.bukkit.JukeboxSong; -import org.bukkit.MusicInstrument; -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.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, true), - simpleKey("StructureTypeKeys", StructureType.class, Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, 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), - simpleKey("AttributeKeys", Attribute.class, Registries.ATTRIBUTE, RegistryKey.ATTRIBUTE, false), - simpleKey("FluidKeys", Fluid.class, Registries.FLUID, RegistryKey.FLUID, false), - simpleKey("SoundEventKeys", Sound.class, Registries.SOUND_EVENT, RegistryKey.SOUND_EVENT, 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, true), - simpleKey("JukeboxSongKeys", JukeboxSong.class, Registries.JUKEBOX_SONG, RegistryKey.JUKEBOX_SONG, true), - simpleKey("BannerPatternKeys", PatternType.class, Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN, true), - simpleKey("PaintingVariantKeys", Art.class, Registries.PAINTING_VARIANT, RegistryKey.PAINTING_VARIANT, true), - simpleKey("InstrumentKeys", MusicInstrument.class, Registries.INSTRUMENT, RegistryKey.INSTRUMENT, true), - - // tags - simpleTagKey("GameEventTagKeys", GameEvent.class, Registries.GAME_EVENT, RegistryKey.GAME_EVENT), - simpleTagKey("BlockTypeTagKeys", BlockType.class, Registries.BLOCK, RegistryKey.BLOCK), - simpleTagKey("ItemTypeTagKeys", ItemType.class, Registries.ITEM, RegistryKey.ITEM), - simpleTagKey("CatVariantTagKeys", Cat.Type.class, Registries.CAT_VARIANT, RegistryKey.CAT_VARIANT), - simpleTagKey("FluidTagKeys", Fluid.class, Registries.FLUID, RegistryKey.FLUID), - - simpleTagKey("BiomeTagKeys", Biome.class, Registries.BIOME, RegistryKey.BIOME), - simpleTagKey("StructureTagKeys", Structure.class, Registries.STRUCTURE, RegistryKey.STRUCTURE), - simpleTagKey("DamageTypeTagKeys", DamageType.class, Registries.DAMAGE_TYPE, RegistryKey.DAMAGE_TYPE), - simpleTagKey("EnchantmentTagKeys", Enchantment.class, Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT), - simpleTagKey("BannerPatternTagKeys", PatternType.class, Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN), - simpleTagKey("PaintingVariantTagKeys", Art.class, Registries.PAINTING_VARIANT, RegistryKey.PAINTING_VARIANT), - simpleTagKey("InstrumentTagKeys", MusicInstrument.class, Registries.INSTRUMENT, RegistryKey.INSTRUMENT), - 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 129009f519..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/Main.java +++ /dev/null @@ -1,93 +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.List; -import java.util.Map; -import net.minecraft.SharedConstants; -import net.minecraft.commands.Commands; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.LayeredRegistryAccess; -import net.minecraft.core.Registry; -import net.minecraft.core.RegistryAccess; -import net.minecraft.resources.RegistryDataLoader; -import net.minecraft.server.Bootstrap; -import net.minecraft.server.RegistryLayer; -import net.minecraft.server.ReloadableServerResources; -import net.minecraft.server.packs.PackType; -import net.minecraft.server.packs.repository.Pack; -import net.minecraft.server.packs.repository.PackRepository; -import net.minecraft.server.packs.repository.ServerPacksSource; -import net.minecraft.server.packs.resources.MultiPackResourceManager; -import net.minecraft.tags.TagKey; -import net.minecraft.tags.TagLoader; -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(); - final List> pendingTags = TagLoader.loadTagsForExistingRegistries(resourceManager, layers.getLayer(RegistryLayer.STATIC)); - final List> worldGenLayer = TagLoader.buildUpdatedLookups(layers.getAccessForLoading(RegistryLayer.WORLDGEN), pendingTags); - final RegistryAccess.Frozen frozenWorldgenRegistries = RegistryDataLoader.load(resourceManager, worldGenLayer, RegistryDataLoader.WORLDGEN_REGISTRIES); - layers = layers.replaceFrom(RegistryLayer.WORLDGEN, frozenWorldgenRegistries); - REGISTRY_ACCESS = layers.compositeAccess().freeze(); - final ReloadableServerResources reloadableServerResources = ReloadableServerResources.loadResources( - resourceManager, - layers, - pendingTags, - FeatureFlags.VANILLA_SET, - Commands.CommandSelection.DEDICATED, - 0, - MoreExecutors.directExecutor(), - MoreExecutors.directExecutor() - ).join(); - reloadableServerResources.updateStaticRegistryTags(); - 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 624ceae475..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedKeyType.java +++ /dev/null @@ -1,210 +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 javax.lang.model.SourceVersion; -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.core.registries.Registries; -import net.minecraft.data.registries.VanillaRegistries; -import net.minecraft.data.registries.WinterDropRegistries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.flag.FeatureElement; -import net.minecraft.world.flag.FeatureFlags; -import org.bukkit.MinecraftExperimental; -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.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 = WinterDropRegistries.BUILDER.entries.stream() - .collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap)); // 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); - - 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); - 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() - ); - } - - @Deprecated - private static final Map JUKEBOX_SONG_NAMES = Map.of( - "5", "FIVE", - "11", "ELEVEN", - "13", "THIRTEEN" - ); - - @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.lookupOrThrow(this.registryKey); - final Set> experimental = this.collectExperimentalKeys(registry); - - boolean allExperimental = true; - for (final Holder.Reference reference : registry.listElements().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) { - final ResourceKey key = reference.key(); - final String keyPath = key.location().getPath(); - String fieldName = Formatting.formatKeyAsField(keyPath); - if (!SourceVersion.isIdentifier(fieldName) && this.registryKey.equals(Registries.JUKEBOX_SONG) && JUKEBOX_SONG_NAMES.containsKey(fieldName)) { - fieldName = JUKEBOX_SONG_NAMES.get(fieldName); - } - - 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(MinecraftExperimental.Requires.WINTER_DROP)); // 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(); - } - - // todo at some point this should be per feature data pack not all merged - 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.filterElements(v -> { - return v instanceof final FeatureElement featureElement && FeatureFlags.isExperimental(featureElement.requiredFeatures()); // 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 60e15ea64a..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/types/GeneratedTagKeyType.java +++ /dev/null @@ -1,138 +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.Locale; -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.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); - - 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); - 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.lookupOrThrow(this.registryKey); - - final AtomicBoolean allExperimental = new AtomicBoolean(true); - registry.listTagIds().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()); - final String featureFlagName = Main.EXPERIMENTAL_TAGS.get(nmsTagKey); - if (featureFlagName != null) { - fieldBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.valueOf(featureFlagName.toUpperCase(Locale.ENGLISH)))); // 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 977e4a1334..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/Annotations.java +++ /dev/null @@ -1,65 +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.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; -import org.jspecify.annotations.NullMarked; - -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 NULL_MARKED = AnnotationSpec.builder(NullMarked.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, - NULL_MARKED - ); - - private Annotations() { - } -} diff --git a/paper-api-generator/src/main/java/io/papermc/generator/utils/Formatting.java b/paper-api-generator/src/main/java/io/papermc/generator/utils/Formatting.java deleted file mode 100644 index b703a32455..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/Formatting.java +++ /dev/null @@ -1,59 +0,0 @@ -package io.papermc.generator.utils; - -import java.util.Optional; -import org.apache.commons.lang3.math.NumberUtils; -import java.util.Comparator; -import java.util.Locale; -import java.util.OptionalInt; -import java.util.function.Function; -import java.util.regex.Pattern; - -public final class Formatting { - - private static final Pattern ILLEGAL_FIELD_CHARACTERS = Pattern.compile("[.-/]"); - - public static String formatKeyAsField(String path) { - return ILLEGAL_FIELD_CHARACTERS.matcher(path.toUpperCase(Locale.ROOT)).replaceAll("_"); - } - - public static Optional formatTagKey(String tagDir, String resourcePath) { - int tagsIndex = resourcePath.indexOf(tagDir); - int dotIndex = resourcePath.lastIndexOf('.'); - if (tagsIndex == -1 || dotIndex == -1) { - return Optional.empty(); - } - return Optional.of(resourcePath.substring(tagsIndex + tagDir.length() + 1, dotIndex)); // namespace/tags/registry_key/[tag_key].json - } - - public static Comparator ALPHABETIC_KEY_ORDER = alphabeticKeyOrder(path -> path); - - public static Comparator alphabeticKeyOrder(Function mapper) { - return (o1, o2) -> { - String path1 = mapper.apply(o1); - String path2 = mapper.apply(o2); - - OptionalInt trailingInt1 = tryParseTrailingInt(path1); - OptionalInt trailingInt2 = tryParseTrailingInt(path2); - - if (trailingInt1.isPresent() && trailingInt2.isPresent()) { - return Integer.compare(trailingInt1.getAsInt(), trailingInt2.getAsInt()); - } - - return path1.compareTo(path2); - }; - } - - private static OptionalInt tryParseTrailingInt(String path) { - int delimiterIndex = path.lastIndexOf('_'); - if (delimiterIndex != -1) { - String score = path.substring(delimiterIndex + 1); - if (NumberUtils.isDigits(score)) { - return OptionalInt.of(Integer.parseInt(score)); - } - } - return OptionalInt.empty(); - } - - private Formatting() { - } -} 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/src/main/java/io/papermc/generator/utils/TagCollector.java b/paper-api-generator/src/main/java/io/papermc/generator/utils/TagCollector.java deleted file mode 100644 index 546e136b4a..0000000000 --- a/paper-api-generator/src/main/java/io/papermc/generator/utils/TagCollector.java +++ /dev/null @@ -1,79 +0,0 @@ -package io.papermc.generator.utils; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import com.mojang.logging.LogUtils; -import io.papermc.generator.Main; -import java.util.Collections; -import java.util.IdentityHashMap; -import java.util.Map; -import java.util.Set; -import java.util.function.BiConsumer; -import net.minecraft.core.Registry; -import net.minecraft.core.RegistryAccess; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.server.packs.PackResources; -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.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 -public final class TagCollector { - - private static final Logger LOGGER = LogUtils.getLogger(); - - public static Map, String> grabExperimental(final MultiPackResourceManager resourceManager) { - Map, String> result = new IdentityHashMap<>(); - - // collect all vanilla tags - Multimap>, String> vanillaTags = HashMultimap.create(); - PackResources vanillaPack = resourceManager.listPacks() - .filter(packResources -> packResources.packId().equals(BuiltInPackSource.VANILLA_ID)) - .findFirst() - .orElseThrow(); - collectFromPack(vanillaPack, (entry, path) -> vanillaTags.put(entry.key(), path)); - - // then distinct with other data-pack tags to know for sure newly created tags and so experimental one - resourceManager.listPacks().forEach(pack -> { - String packId = pack.packId(); - if (packId.equals(BuiltInPackSource.VANILLA_ID)) return; - - collectFromPack(pack, (entry, path) -> { - if (vanillaTags.get(entry.key()).contains(path)) { - return; - } - - result.put(entry.value().listTagIds() - .filter(tagKey -> tagKey.location().getPath().equals(path)) - .findFirst() - .orElseThrow(), packId); - }); - }); - return Collections.unmodifiableMap(result); - } - - private static void collectFromPack(PackResources pack, BiConsumer, String> output) { - Set namespaces = pack.getNamespaces(PackType.SERVER_DATA); - - for (String namespace : namespaces) { - Main.REGISTRY_ACCESS.registries().forEach(entry -> { - // this is probably expensive but can't find another way around and data-pack loader has similar logic - // the issue is that registry key can have parent/key (and custom folder too) but tag key can also have parent/key so parsing become a mess - // without having at least one of the two values - String tagDir = Registries.tagsDirPath(entry.key()); - pack.listResources(PackType.SERVER_DATA, namespace, tagDir, (id, supplier) -> { - Formatting.formatTagKey(tagDir, id.getPath()).ifPresentOrElse(path -> output.accept(entry, path), () -> { - LOGGER.warn("Unable to parse the path: {}/{}/{}.json in the data-pack {} into a tag key", namespace, tagDir, id.getPath(), pack.packId()); - }); - }); - }); - } - } - - private TagCollector() { - } -} diff --git a/paper-generator/.editorconfig b/paper-generator/.editorconfig new file mode 100644 index 0000000000..789092f7fe --- /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..e2d47ccc15 --- /dev/null +++ b/paper-generator/build.gradle.kts @@ -0,0 +1,62 @@ +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") + +val generate by tasks.registering(JavaExec::class) { + 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()) +} + +generate.configure { + delete(generatedApiPath, generatedServerPath) + // the module depends on paper-api but generate into the project which cause conflict + // ideally this module would only depend on vanilla source in the long + // run +} + +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 100% 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 35dfd25f21..94081fc9a7 100644 --- a/paper-api-generator/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java +++ b/paper-generator/generatedApi/com/destroystokyo/paper/entity/ai/VanillaGoal.java @@ -66,8 +66,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") public interface VanillaGoal extends Goal { GoalKey RANDOM_STAND = create("random_stand", AbstractHorse.class); 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..db615f79ec --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/event/RegistryEvents.java @@ -0,0 +1,32 @@ +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 io.papermc.paper.registry.data.PaintingVariantRegistryEntry; +import org.bukkit.Art; +import org.bukkit.GameEvent; +import org.bukkit.enchantments.Enchantment; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create; + +/** + * Holds providers for {@link RegistryEntryAddEvent} and {@link RegistryFreezeEvent} + * handlers for each applicable registry. + */ +@ApiStatus.Experimental +@NullMarked +public final class RegistryEvents { + + // Paper start - Generated/RegistryEvents + // @GeneratedFrom 1.21.3 + public static final RegistryEventProvider GAME_EVENT = create(RegistryKey.GAME_EVENT); + public static final RegistryEventProvider ENCHANTMENT = create(RegistryKey.ENCHANTMENT); + public static final RegistryEventProvider PAINTING_VARIANT = create(RegistryKey.PAINTING_VARIANT); + // Paper end - Generated/RegistryEvents + + private RegistryEvents() { + } +} diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/AttributeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/AttributeKeys.java similarity index 100% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/AttributeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/AttributeKeys.java index e6a1dd2072..3e7b0e7eaa 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/AttributeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/AttributeKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class AttributeKeys { /** 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 99% 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 33248c48ca..8cd89662e2 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/BannerPatternKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/BannerPatternKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class BannerPatternKeys { /** @@ -332,7 +332,7 @@ 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 diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/BiomeKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/BiomeKeys.java index 1b8d414c6b..18236e614d 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/BiomeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/BiomeKeys.java @@ -24,8 +24,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class BiomeKeys { /** @@ -489,7 +489,7 @@ public final class BiomeKeys { } /** - * Creates a key for {@link Biome} in the registry {@code minecraft:worldgen/biome}. + * Creates a typed 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 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 100% 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 682405c5ce..f383d2f034 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/BlockTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/BlockTypeKeys.java @@ -24,8 +24,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class BlockTypeKeys { /** 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 100% 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 058b207390..cf2e267a0d 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/CatVariantKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/CatVariantKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class CatVariantKeys { /** 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 99% 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 1673093d0d..6acedbc860 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/DamageTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/DamageTypeKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class DamageTypeKeys { /** @@ -374,7 +374,7 @@ 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 diff --git a/paper-generator/generatedApi/io/papermc/paper/registry/keys/DataComponentTypeKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/DataComponentTypeKeys.java new file mode 100644 index 0000000000..ca8e997fe8 --- /dev/null +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/DataComponentTypeKeys.java @@ -0,0 +1,505 @@ +package io.papermc.paper.registry.keys; + +import static net.kyori.adventure.key.Key.key; + +import io.papermc.paper.datacomponent.DataComponentType; +import io.papermc.paper.generated.GeneratedFrom; +import io.papermc.paper.registry.RegistryKey; +import io.papermc.paper.registry.TypedKey; +import net.kyori.adventure.key.Key; +import org.jetbrains.annotations.ApiStatus; +import org.jspecify.annotations.NullMarked; + +/** + * Vanilla keys for {@link RegistryKey#DATA_COMPONENT_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.3") +@ApiStatus.Experimental +public final class DataComponentTypeKeys { + /** + * {@code minecraft:attribute_modifiers} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey ATTRIBUTE_MODIFIERS = create(key("attribute_modifiers")); + + /** + * {@code minecraft:banner_patterns} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey BANNER_PATTERNS = create(key("banner_patterns")); + + /** + * {@code minecraft:base_color} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey BASE_COLOR = create(key("base_color")); + + /** + * {@code minecraft:bees} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey BEES = create(key("bees")); + + /** + * {@code minecraft:block_entity_data} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey BLOCK_ENTITY_DATA = create(key("block_entity_data")); + + /** + * {@code minecraft:block_state} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey BLOCK_STATE = create(key("block_state")); + + /** + * {@code minecraft:bucket_entity_data} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey BUCKET_ENTITY_DATA = create(key("bucket_entity_data")); + + /** + * {@code minecraft:bundle_contents} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey BUNDLE_CONTENTS = create(key("bundle_contents")); + + /** + * {@code minecraft:can_break} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CAN_BREAK = create(key("can_break")); + + /** + * {@code minecraft:can_place_on} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CAN_PLACE_ON = create(key("can_place_on")); + + /** + * {@code minecraft:charged_projectiles} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CHARGED_PROJECTILES = create(key("charged_projectiles")); + + /** + * {@code minecraft:consumable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CONSUMABLE = create(key("consumable")); + + /** + * {@code minecraft:container} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CONTAINER = create(key("container")); + + /** + * {@code minecraft:container_loot} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CONTAINER_LOOT = create(key("container_loot")); + + /** + * {@code minecraft:creative_slot_lock} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CREATIVE_SLOT_LOCK = create(key("creative_slot_lock")); + + /** + * {@code minecraft:custom_data} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CUSTOM_DATA = create(key("custom_data")); + + /** + * {@code minecraft:custom_model_data} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CUSTOM_MODEL_DATA = create(key("custom_model_data")); + + /** + * {@code minecraft:custom_name} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey CUSTOM_NAME = create(key("custom_name")); + + /** + * {@code minecraft:damage} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey DAMAGE = create(key("damage")); + + /** + * {@code minecraft:damage_resistant} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey DAMAGE_RESISTANT = create(key("damage_resistant")); + + /** + * {@code minecraft:death_protection} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey DEATH_PROTECTION = create(key("death_protection")); + + /** + * {@code minecraft:debug_stick_state} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey DEBUG_STICK_STATE = create(key("debug_stick_state")); + + /** + * {@code minecraft:dyed_color} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey DYED_COLOR = create(key("dyed_color")); + + /** + * {@code minecraft:enchantable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey ENCHANTABLE = create(key("enchantable")); + + /** + * {@code minecraft:enchantment_glint_override} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey ENCHANTMENT_GLINT_OVERRIDE = create(key("enchantment_glint_override")); + + /** + * {@code minecraft:enchantments} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey ENCHANTMENTS = create(key("enchantments")); + + /** + * {@code minecraft:entity_data} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey ENTITY_DATA = create(key("entity_data")); + + /** + * {@code minecraft:equippable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey EQUIPPABLE = create(key("equippable")); + + /** + * {@code minecraft:firework_explosion} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey FIREWORK_EXPLOSION = create(key("firework_explosion")); + + /** + * {@code minecraft:fireworks} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey FIREWORKS = create(key("fireworks")); + + /** + * {@code minecraft:food} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey FOOD = create(key("food")); + + /** + * {@code minecraft:glider} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey GLIDER = create(key("glider")); + + /** + * {@code minecraft:hide_additional_tooltip} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey HIDE_ADDITIONAL_TOOLTIP = create(key("hide_additional_tooltip")); + + /** + * {@code minecraft:hide_tooltip} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey HIDE_TOOLTIP = create(key("hide_tooltip")); + + /** + * {@code minecraft:instrument} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey INSTRUMENT = create(key("instrument")); + + /** + * {@code minecraft:intangible_projectile} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey INTANGIBLE_PROJECTILE = create(key("intangible_projectile")); + + /** + * {@code minecraft:item_model} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey ITEM_MODEL = create(key("item_model")); + + /** + * {@code minecraft:item_name} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey ITEM_NAME = create(key("item_name")); + + /** + * {@code minecraft:jukebox_playable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey JUKEBOX_PLAYABLE = create(key("jukebox_playable")); + + /** + * {@code minecraft:lock} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey LOCK = create(key("lock")); + + /** + * {@code minecraft:lodestone_tracker} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey LODESTONE_TRACKER = create(key("lodestone_tracker")); + + /** + * {@code minecraft:lore} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey LORE = create(key("lore")); + + /** + * {@code minecraft:map_color} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey MAP_COLOR = create(key("map_color")); + + /** + * {@code minecraft:map_decorations} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey MAP_DECORATIONS = create(key("map_decorations")); + + /** + * {@code minecraft:map_id} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey MAP_ID = create(key("map_id")); + + /** + * {@code minecraft:map_post_processing} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey MAP_POST_PROCESSING = create(key("map_post_processing")); + + /** + * {@code minecraft:max_damage} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey MAX_DAMAGE = create(key("max_damage")); + + /** + * {@code minecraft:max_stack_size} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey MAX_STACK_SIZE = create(key("max_stack_size")); + + /** + * {@code minecraft:note_block_sound} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey NOTE_BLOCK_SOUND = create(key("note_block_sound")); + + /** + * {@code minecraft:ominous_bottle_amplifier} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey OMINOUS_BOTTLE_AMPLIFIER = create(key("ominous_bottle_amplifier")); + + /** + * {@code minecraft:pot_decorations} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey POT_DECORATIONS = create(key("pot_decorations")); + + /** + * {@code minecraft:potion_contents} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey POTION_CONTENTS = create(key("potion_contents")); + + /** + * {@code minecraft:profile} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey PROFILE = create(key("profile")); + + /** + * {@code minecraft:rarity} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey RARITY = create(key("rarity")); + + /** + * {@code minecraft:recipes} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey RECIPES = create(key("recipes")); + + /** + * {@code minecraft:repair_cost} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey REPAIR_COST = create(key("repair_cost")); + + /** + * {@code minecraft:repairable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey REPAIRABLE = create(key("repairable")); + + /** + * {@code minecraft:stored_enchantments} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey STORED_ENCHANTMENTS = create(key("stored_enchantments")); + + /** + * {@code minecraft:suspicious_stew_effects} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey SUSPICIOUS_STEW_EFFECTS = create(key("suspicious_stew_effects")); + + /** + * {@code minecraft:tool} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey TOOL = create(key("tool")); + + /** + * {@code minecraft:tooltip_style} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey TOOLTIP_STYLE = create(key("tooltip_style")); + + /** + * {@code minecraft:trim} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey TRIM = create(key("trim")); + + /** + * {@code minecraft:unbreakable} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey UNBREAKABLE = create(key("unbreakable")); + + /** + * {@code minecraft:use_cooldown} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey USE_COOLDOWN = create(key("use_cooldown")); + + /** + * {@code minecraft:use_remainder} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey USE_REMAINDER = create(key("use_remainder")); + + /** + * {@code minecraft:writable_book_content} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey WRITABLE_BOOK_CONTENT = create(key("writable_book_content")); + + /** + * {@code minecraft:written_book_content} + * + * @apiNote This field is version-dependant and may be removed in future Minecraft versions + */ + public static final TypedKey WRITTEN_BOOK_CONTENT = create(key("written_book_content")); + + private DataComponentTypeKeys() { + } + + private static TypedKey create(final Key key) { + return TypedKey.create(RegistryKey.DATA_COMPONENT_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 99% 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 9f67994dbb..0453c66f40 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/EnchantmentKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/EnchantmentKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class EnchantmentKeys { /** @@ -325,7 +325,7 @@ public final class EnchantmentKeys { } /** - * Creates a key for {@link Enchantment} in the registry {@code minecraft:enchantment}. + * 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 diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/FluidKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/FluidKeys.java similarity index 100% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/FluidKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/FluidKeys.java index 478a9cc6db..d4ea145f00 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/FluidKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/FluidKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class FluidKeys { /** 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 100% 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 b278c3c154..566703f934 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/FrogVariantKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/FrogVariantKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class FrogVariantKeys { /** 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 99% 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 2092a300a3..1a12ebc6ee 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/GameEventKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/GameEventKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class GameEventKeys { /** @@ -451,7 +451,7 @@ public final class GameEventKeys { } /** - * Creates a key for {@link GameEvent} in the registry {@code minecraft:game_event}. + * 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 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 97% 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 8e340fbf55..aa0feedd7c 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/InstrumentKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/InstrumentKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class InstrumentKeys { /** @@ -87,7 +87,7 @@ public final class InstrumentKeys { } /** - * Creates a key for {@link MusicInstrument} in the registry {@code minecraft:instrument}. + * Creates a typed key for {@link MusicInstrument} in the registry {@code minecraft:instrument}. * * @param key the value's key in the registry * @return a new typed 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 100% 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 34ad745726..e3c1819f5d 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/ItemTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/ItemTypeKeys.java @@ -24,8 +24,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class ItemTypeKeys { /** 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 98% 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 7a8a3a6418..8d1db0c892 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/JukeboxSongKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/JukeboxSongKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class JukeboxSongKeys { /** @@ -164,7 +164,7 @@ 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 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 100% 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 2c898404bc..b42b5af9e6 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MapDecorationTypeKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class MapDecorationTypeKeys { /** 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 100% 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 c74a3c1a15..cdb13ab44c 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/MenuTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MenuTypeKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class MenuTypeKeys { /** 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 100% 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 b9a82ca35b..d82945bee3 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/MobEffectKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/MobEffectKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class MobEffectKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/PaintingVariantKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/PaintingVariantKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/PaintingVariantKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/PaintingVariantKeys.java index 25b2ce3f2d..381104d2cc 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/PaintingVariantKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/PaintingVariantKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class PaintingVariantKeys { /** @@ -381,7 +381,7 @@ public final class PaintingVariantKeys { } /** - * Creates a key for {@link Art} in the registry {@code minecraft:painting_variant}. + * Creates a typed key for {@link Art} in the registry {@code minecraft:painting_variant}. * * @param key the value's key in the registry * @return a new typed key diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/SoundEventKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/SoundEventKeys.java similarity index 100% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/SoundEventKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/SoundEventKeys.java index 74a5475571..073b82087c 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/SoundEventKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/SoundEventKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class SoundEventKeys { /** 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 98% 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 3d9cb6d08d..30ba9ce418 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/StructureKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class StructureKeys { /** @@ -269,7 +269,7 @@ 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 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 100% 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 e4d23e76f8..bb5d976e9d 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/StructureTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/StructureTypeKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class StructureTypeKeys { /** 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 97% 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 504c71575b..230a4d7bb0 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimMaterialKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/TrimMaterialKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class TrimMaterialKeys { /** @@ -101,7 +101,7 @@ 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 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 98% 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 57667f5399..5f60ae65ae 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/TrimPatternKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/TrimPatternKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class TrimPatternKeys { /** @@ -157,7 +157,7 @@ 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 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 100% 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 4490743220..fecf43a413 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/VillagerProfessionKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/VillagerProfessionKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class VillagerProfessionKeys { /** 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 100% 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 d2e2372030..f7a85795c3 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/VillagerTypeKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/VillagerTypeKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class VillagerTypeKeys { /** 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 97% 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 7329a23941..697901756f 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/WolfVariantKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/WolfVariantKeys.java @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class WolfVariantKeys { /** @@ -94,7 +94,7 @@ 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 diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java similarity index 98% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java index 766dd79c0c..2174ed10db 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BannerPatternTagKeys.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#BANNER_PATTERN}. + * 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 @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class BannerPatternTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BiomeTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BiomeTagKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BiomeTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BiomeTagKeys.java index d1aea0f7f8..045f850a37 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BiomeTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BiomeTagKeys.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#BIOME}. + * Vanilla tag 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 @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class BiomeTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java index dcf9dddf97..4a0304b058 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/BlockTypeTagKeys.java @@ -12,7 +12,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#BLOCK}. + * 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 @@ -24,8 +24,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class BlockTypeTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java similarity index 96% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java index 2557a4a3f1..b78016ec56 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/CatVariantTagKeys.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#CAT_VARIANT}. + * 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 @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class CatVariantTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java index 084d2832b5..28896d7b0f 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/DamageTypeTagKeys.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#DAMAGE_TYPE}. + * 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 @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class DamageTypeTagKeys { /** 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 99% 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 a21a200ddd..b3e3fc6c98 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 @@ -12,7 +12,7 @@ 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,8 +24,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class EnchantmentTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/FluidTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/FluidTagKeys.java similarity index 97% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/FluidTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/FluidTagKeys.java index 5574a7813a..6724856dcb 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/FluidTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/FluidTagKeys.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#FLUID}. + * Vanilla tag keys for {@link RegistryKey#FLUID}. * * @apiNote The fields provided here are a direct representation of * what is available from the vanilla game source. They may be @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class FluidTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java similarity index 97% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java index 06209e840b..7aae5bb6c3 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/GameEventTagKeys.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#GAME_EVENT}. + * 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 @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class GameEventTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java similarity index 97% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java index 5a74738058..c900c405ad 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/InstrumentTagKeys.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#INSTRUMENT}. + * 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 @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class InstrumentTagKeys { /** 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 f37b9f659f..b3c292325d 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 @@ -12,7 +12,7 @@ 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 @@ -24,8 +24,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class ItemTypeTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/PaintingVariantTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/PaintingVariantTagKeys.java similarity index 95% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/PaintingVariantTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/PaintingVariantTagKeys.java index 4ca9f37200..bd380b9328 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/PaintingVariantTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/PaintingVariantTagKeys.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#PAINTING_VARIANT}. + * Vanilla tag keys for {@link RegistryKey#PAINTING_VARIANT}. * * @apiNote The fields provided here are a direct representation of * what is available from the vanilla game source. They may be @@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class PaintingVariantTagKeys { /** diff --git a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/StructureTagKeys.java b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/StructureTagKeys.java similarity index 99% rename from paper-api-generator/generated/io/papermc/paper/registry/keys/tags/StructureTagKeys.java rename to paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/StructureTagKeys.java index 7c98210107..976f191c73 100644 --- a/paper-api-generator/generated/io/papermc/paper/registry/keys/tags/StructureTagKeys.java +++ b/paper-generator/generatedApi/io/papermc/paper/registry/keys/tags/StructureTagKeys.java @@ -12,7 +12,7 @@ import org.jetbrains.annotations.ApiStatus; import org.jspecify.annotations.NullMarked; /** - * Vanilla keys for {@link RegistryKey#STRUCTURE}. + * 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 @@ -24,8 +24,8 @@ import org.jspecify.annotations.NullMarked; "unused", "SpellCheckingInspection" }) -@GeneratedFrom("1.21.3") @NullMarked +@GeneratedFrom("1.21.3") @ApiStatus.Experimental public final class StructureTagKeys { /** diff --git a/paper-generator/generatedApi/org/bukkit/Art.java b/paper-generator/generatedApi/org/bukkit/Art.java new file mode 100644 index 0000000000..70bae48829 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Art.java @@ -0,0 +1,242 @@ +package org.bukkit; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Locale; +import org.bukkit.packs.DataPack; +import org.bukkit.util.OldEnum; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents the art on a painting. + *

+ * The arts listed in this interface are present in the default server + * or can be enabled via a {@link FeatureFlag}. + * There may be additional arts present in the server, for example from a {@link DataPack} + * which can be accessed via {@link Registry#ART}. + */ +public interface Art extends OldEnum, Keyed { + // Paper start - Generated/Art + // @GeneratedFrom 1.21.3 + Art ALBAN = getArt("alban"); + + Art AZTEC = getArt("aztec"); + + Art AZTEC2 = getArt("aztec2"); + + Art BACKYARD = getArt("backyard"); + + Art BAROQUE = getArt("baroque"); + + Art BOMB = getArt("bomb"); + + Art BOUQUET = getArt("bouquet"); + + Art BURNING_SKULL = getArt("burning_skull"); + + Art BUST = getArt("bust"); + + Art CAVEBIRD = getArt("cavebird"); + + Art CHANGING = getArt("changing"); + + Art COTAN = getArt("cotan"); + + Art COURBET = getArt("courbet"); + + Art CREEBET = getArt("creebet"); + + Art DONKEY_KONG = getArt("donkey_kong"); + + Art EARTH = getArt("earth"); + + Art ENDBOSS = getArt("endboss"); + + Art FERN = getArt("fern"); + + Art FIGHTERS = getArt("fighters"); + + Art FINDING = getArt("finding"); + + Art FIRE = getArt("fire"); + + Art GRAHAM = getArt("graham"); + + Art HUMBLE = getArt("humble"); + + Art KEBAB = getArt("kebab"); + + Art LOWMIST = getArt("lowmist"); + + Art MATCH = getArt("match"); + + Art MEDITATIVE = getArt("meditative"); + + Art ORB = getArt("orb"); + + Art OWLEMONS = getArt("owlemons"); + + Art PASSAGE = getArt("passage"); + + Art PIGSCENE = getArt("pigscene"); + + Art PLANT = getArt("plant"); + + Art POINTER = getArt("pointer"); + + Art POND = getArt("pond"); + + Art POOL = getArt("pool"); + + Art PRAIRIE_RIDE = getArt("prairie_ride"); + + Art SEA = getArt("sea"); + + Art SKELETON = getArt("skeleton"); + + Art SKULL_AND_ROSES = getArt("skull_and_roses"); + + Art STAGE = getArt("stage"); + + Art SUNFLOWERS = getArt("sunflowers"); + + Art SUNSET = getArt("sunset"); + + Art TIDES = getArt("tides"); + + Art UNPACKED = getArt("unpacked"); + + Art VOID = getArt("void"); + + Art WANDERER = getArt("wanderer"); + + Art WASTELAND = getArt("wasteland"); + + Art WATER = getArt("water"); + + Art WIND = getArt("wind"); + + Art WITHER = getArt("wither"); + // Paper end - Generated/Art + + @NotNull + private static Art getArt(@NotNull String key) { + return Registry.ART.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * Gets the width of the painting, in blocks + * + * @return The width of the painting, in blocks + */ + int getBlockWidth(); + + /** + * Gets the height of the painting, in blocks + * + * @return The height of the painting, in blocks + */ + int getBlockHeight(); + + /** + * Get the ID of this painting. + * + * @return The ID of this painting + * @deprecated Magic value + */ + @Deprecated(since = "1.6.2") + int getId(); + + // 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") + @Override + @NotNull NamespacedKey getKey(); + // Paper end - deprecate getKey + + // Paper start - name and author components, assetId key + /** + * Get the painting's title. + * + * @return the title + */ + net.kyori.adventure.text.@Nullable Component title(); + + /** + * Get the painting's author. + * + * @return the author + */ + net.kyori.adventure.text.@Nullable Component author(); + + /** + * Get the painting's asset id + * + * @return the asset id + */ + net.kyori.adventure.key.@NotNull Key assetId(); + // Paper end - name and author components, assetId key + + /** + * Get a painting by its numeric ID + * + * @param id The ID + * @return The painting + * @deprecated Magic value + */ + @Deprecated(since = "1.6.2") + @Nullable + static Art getById(int id) { + for (Art art : Registry.ART) { + if (id == art.getId()) { + return art; + } + } + + return null; + } + + /** + * Get a painting by its unique name + *

+ * This ignores capitalization + * + * @param name The name + * @return The painting + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @Deprecated(since = "1.21.3") + @Nullable + static Art getByName(@NotNull String name) { + Preconditions.checkArgument(name != null, "Name cannot be null"); + + return Bukkit.getUnsafe().get(Registry.ART, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + } + + /** + * @param name of the art. + * @return the art with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21.3") + static Art valueOf(@NotNull String name) { + Art art = Bukkit.getUnsafe().get(Registry.ART, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(art != null, "No art found with the name %s", name); + return art; + } + + /** + * @return an array of all known arts. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21.3") + static Art[] values() { + return Lists.newArrayList(Registry.ART).toArray(new Art[0]); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/FeatureFlag.java b/paper-generator/generatedApi/org/bukkit/FeatureFlag.java new file mode 100644 index 0000000000..82bcf8ef95 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/FeatureFlag.java @@ -0,0 +1,57 @@ +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.3 + @ApiStatus.Experimental + FeatureFlag MINECART_IMPROVEMENTS = create("minecart_improvements"); + + @ApiStatus.Experimental + FeatureFlag REDSTONE_EXPERIMENTS = create("redstone_experiments"); + + @ApiStatus.Experimental + FeatureFlag TRADE_REBALANCE = create("trade_rebalance"); + + FeatureFlag VANILLA = create("vanilla"); + + @ApiStatus.Experimental + FeatureFlag WINTER_DROP = create("winter_drop"); + // 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..c97b1f89ac --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Fluid.java @@ -0,0 +1,54 @@ +package org.bukkit; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Locale; +import org.bukkit.util.OldEnum; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a fluid type. + */ +public interface Fluid extends OldEnum, Keyed { + + // Paper start - Generated/Fluid + // @GeneratedFrom 1.21.3 + Fluid EMPTY = getFluid("empty"); + + Fluid FLOWING_LAVA = getFluid("flowing_lava"); + + Fluid FLOWING_WATER = getFluid("flowing_water"); + + Fluid LAVA = getFluid("lava"); + + Fluid WATER = getFluid("water"); + // Paper end - Generated/Fluid + + @NotNull + private static Fluid getFluid(@NotNull String key) { + return Registry.FLUID.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * @param name of the fluid. + * @return the fluid with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Fluid valueOf(@NotNull String name) { + Fluid fluid = Bukkit.getUnsafe().get(Registry.FLUID, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(fluid != null, "No fluid found with the name %s", name); + return fluid; + } + + /** + * @return an array of all known fluids. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Fluid[] values() { + return Lists.newArrayList(Registry.FLUID).toArray(new Fluid[0]); + } +} diff --git a/paper-generator/generatedApi/org/bukkit/GameEvent.java b/paper-generator/generatedApi/org/bukkit/GameEvent.java new file mode 100644 index 0000000000..53abdf5677 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/GameEvent.java @@ -0,0 +1,224 @@ +package org.bukkit; + +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.3 + 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) { + return Registry.GAME_EVENT.getOrThrow(NamespacedKey.minecraft(key)); + } + // 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..4aacc7d072 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/JukeboxSong.java @@ -0,0 +1,67 @@ +package org.bukkit; + +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.3 + 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 key) { + return Registry.JUKEBOX_SONG.getOrThrow(NamespacedKey.minecraft(key)); + } + + // 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..b749154070 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Material.java @@ -0,0 +1,3727 @@ +package org.bukkit; + +import com.google.common.base.Preconditions; +import com.google.common.base.Suppliers; +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 java.util.function.Supplier; +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.CreakingHeart; +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.HangingMoss; +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.MossyCarpet; +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.3 + ACACIA_BOAT(-1, 1), + ACACIA_CHEST_BOAT(-1, 1), + AIR(-1), + 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_BUNDLE(-1, 1), + BLACK_DYE(-1), + BLADE_POTTERY_SHERD(-1), + BLAZE_POWDER(-1), + BLAZE_ROD(-1), + BLAZE_SPAWN_EGG(-1), + BLUE_BUNDLE(-1, 1), + BLUE_DYE(-1), + BOGGED_SPAWN_EGG(-1), + BOLT_ARMOR_TRIM_SMITHING_TEMPLATE(-1), + BONE(-1), + BONE_MEAL(-1), + BOOK(-1), + BORDURE_INDENTED_BANNER_PATTERN(-1, 1), + BOW(-1, 1, 384), + BOWL(-1), + BREAD(-1), + BREEZE_ROD(-1), + BREEZE_SPAWN_EGG(-1), + BREWER_POTTERY_SHERD(-1), + BRICK(-1), + BROWN_BUNDLE(-1, 1), + BROWN_DYE(-1), + BRUSH(-1, 1, 64), + BUCKET(-1, 16), + 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), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + CREAKING_SPAWN_EGG(-1), + CREEPER_BANNER_PATTERN(-1, 1), + CREEPER_SPAWN_EGG(-1), + CROSSBOW(-1, 1, 465), + CYAN_BUNDLE(-1, 1), + 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), + DRAGON_BREATH(-1), + END_CRYSTAL(-1), + FIELD_MASONED_BANNER_PATTERN(-1, 1), + FLOW_BANNER_PATTERN(-1, 1), + GLOBE_BANNER_PATTERN(-1, 1), + GOAT_HORN(-1, 1), + IRON_NUGGET(-1), + KNOWLEDGE_BOOK(-1, 1), + LINGERING_POTION(-1, 1), + MUSIC_DISC_5(-1, 1), + DISC_FRAGMENT_5(-1), + DOLPHIN_SPAWN_EGG(-1), + DONKEY_SPAWN_EGG(-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), + 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_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), + GLOW_BERRIES(-1), + GLOW_INK_SAC(-1), + GLOW_ITEM_FRAME(-1), + GLOW_SQUID_SPAWN_EGG(-1), + GLOWSTONE_DUST(-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_BUNDLE(-1, 1), + GRAY_DYE(-1), + GREEN_BUNDLE(-1, 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_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), + 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_BUNDLE(-1, 1), + LIGHT_BLUE_DYE(-1), + LIGHT_GRAY_BUNDLE(-1, 1), + LIGHT_GRAY_DYE(-1), + LIME_BUNDLE(-1, 1), + LIME_DYE(-1), + LLAMA_SPAWN_EGG(-1), + MACE(-1, 1, 500), + MAGENTA_BUNDLE(-1, 1), + 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_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_BUNDLE(-1, 1), + ORANGE_DYE(-1), + PAINTING(-1), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_BOAT(-1, 1), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_CHEST_BOAT(-1, 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_BUNDLE(-1, 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_BUNDLE(-1, 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_BUNDLE(-1, 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_BUNDLE(-1, 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_BUNDLE(-1, 1), + 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.3 + 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), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + CREAKING_HEART(-1, CreakingHeart.class), + 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), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_HANGING_MOSS(-1, HangingMoss.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_MOSS_BLOCK(-1), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_MOSS_CARPET(-1, MossyCarpet.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_BUTTON(-1, Switch.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_DOOR(-1, Door.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_FENCE(-1, Fence.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_FENCE_GATE(-1, Gate.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_HANGING_SIGN(-1, 16, HangingSign.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_LEAVES(-1, Leaves.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_LOG(-1, Orientable.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_PLANKS(-1), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_PRESSURE_PLATE(-1, Powerable.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_SAPLING(-1, Sapling.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_SIGN(-1, 16, Sign.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_SLAB(-1, Slab.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_STAIRS(-1, Stairs.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_TRAPDOOR(-1, TrapDoor.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_WALL_HANGING_SIGN(-1, WallHangingSign.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_WALL_SIGN(-1, 16, WallSign.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_WOOD(-1, Orientable.class), + 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), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + POTTED_PALE_OAK_SAPLING(-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), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + STRIPPED_PALE_OAK_LOG(-1, Orientable.class), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + STRIPPED_PALE_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 final Supplier itemType; + private final Supplier blockType; + + 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); + } + + this.itemType = Suppliers.memoize(() -> { + Material material = this; + if (isLegacy()) { + material = Bukkit.getUnsafe().fromLegacy(new MaterialData(this), true); + } + return Registry.ITEM.get(material.key); + }); + this.blockType = Suppliers.memoize(() -> { + Material material = this; + if (isLegacy()) { + material = Bukkit.getUnsafe().fromLegacy(new MaterialData(this), false); + } + return Registry.BLOCK.get(material.key); + }); + } + + // 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.3 + 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 + @org.jetbrains.annotations.Contract(pure = true) // Paper + public ItemType asItemType() { + return itemType.get(); + } + + /** + * Tries to convert this Material to a block type + * + * @return the converted block type or null + * @apiNote only for internal use + */ + @ApiStatus.Internal + @Nullable + @org.jetbrains.annotations.Contract(pure = true) // Paper + public BlockType asBlockType() { + return blockType.get(); + } + + // Paper start - data component API + /** + * Gets the default value of the data component type for this item type. + * + * @param type the data component type + * @param the value type + * @return the default value or {@code null} if there is none + * @see #hasDefaultData(io.papermc.paper.datacomponent.DataComponentType) for DataComponentType.NonValued + * @throws IllegalArgumentException if {@link #isItem()} is {@code false} + */ + public @Nullable T getDefaultData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued type) { + Preconditions.checkArgument(this.asItemType() != null); + return this.asItemType().getDefaultData(type); + } + + /** + * Checks if the data component type has a default value for this item type. + * + * @param type the data component type + * @return {@code true} if there is a default value + * @throws IllegalArgumentException if {@link #isItem()} is {@code false} + */ + public boolean hasDefaultData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) { + Preconditions.checkArgument(this.asItemType() != null); + return this.asItemType().hasDefaultData(type); + } + + /** + * Gets the default data component types for this item type. + * + * @return an immutable set of data component types + * @throws IllegalArgumentException if {@link #isItem()} is {@code false} + */ + public java.util.@org.jetbrains.annotations.Unmodifiable @NotNull Set getDefaultDataTypes() { + Preconditions.checkArgument(this.asItemType() != null); + return this.asItemType().getDefaultDataTypes(); + } + // Paper end - data component API +} diff --git a/paper-generator/generatedApi/org/bukkit/MusicInstrument.java b/paper-generator/generatedApi/org/bukkit/MusicInstrument.java new file mode 100644 index 0000000000..02e235f1ba --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/MusicInstrument.java @@ -0,0 +1,79 @@ +package org.bukkit; + +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.3 + 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) { + return Registry.INSTRUMENT.getOrThrow(NamespacedKey.minecraft(key)); + } + + // 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#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 - mark translation key as deprecated + /** + * @deprecated this method assumes that the instrument description + * always be a translatable component which is not guaranteed. + */ + @Override + @Deprecated(forRemoval = true) + public abstract @NotNull String translationKey(); + // Paper end - mark translation key as deprecated +} diff --git a/paper-generator/generatedApi/org/bukkit/Sound.java b/paper-generator/generatedApi/org/bukkit/Sound.java new file mode 100644 index 0000000000..f69a4e021d --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/Sound.java @@ -0,0 +1,3356 @@ +package org.bukkit; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import java.util.Locale; +import org.bukkit.packs.DataPack; +import org.bukkit.util.OldEnum; +import org.jetbrains.annotations.NotNull; + +/** + * An interface of Sounds the server is able to send to players. + *

+ * The sounds listed in this interface are present in the default server + * or can be enabled via a {@link FeatureFlag}. + * There may be additional sounds present in the server, for example from a {@link DataPack} + * which can be accessed via {@link Registry#SOUNDS}. + *

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

+ * The Biomes listed in this interface are present in the default server + * or can be enabled via a {@link FeatureFlag}. + * There may be additional biomes present in the server, for example from a {@link DataPack} + * which can be accessed via {@link Registry#BIOME}. + */ +public interface Biome extends OldEnum, Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations + + // Paper start - Generated/Biome + // @GeneratedFrom 1.21.3 + Biome BADLANDS = getBiome("badlands"); + + Biome BAMBOO_JUNGLE = getBiome("bamboo_jungle"); + + Biome BASALT_DELTAS = getBiome("basalt_deltas"); + + Biome BEACH = getBiome("beach"); + + Biome BIRCH_FOREST = getBiome("birch_forest"); + + Biome CHERRY_GROVE = getBiome("cherry_grove"); + + Biome COLD_OCEAN = getBiome("cold_ocean"); + + Biome CRIMSON_FOREST = getBiome("crimson_forest"); + + Biome DARK_FOREST = getBiome("dark_forest"); + + Biome DEEP_COLD_OCEAN = getBiome("deep_cold_ocean"); + + Biome DEEP_DARK = getBiome("deep_dark"); + + Biome DEEP_FROZEN_OCEAN = getBiome("deep_frozen_ocean"); + + Biome DEEP_LUKEWARM_OCEAN = getBiome("deep_lukewarm_ocean"); + + Biome DEEP_OCEAN = getBiome("deep_ocean"); + + Biome DESERT = getBiome("desert"); + + Biome DRIPSTONE_CAVES = getBiome("dripstone_caves"); + + Biome END_BARRENS = getBiome("end_barrens"); + + Biome END_HIGHLANDS = getBiome("end_highlands"); + + Biome END_MIDLANDS = getBiome("end_midlands"); + + Biome ERODED_BADLANDS = getBiome("eroded_badlands"); + + Biome FLOWER_FOREST = getBiome("flower_forest"); + + Biome FOREST = getBiome("forest"); + + Biome FROZEN_OCEAN = getBiome("frozen_ocean"); + + Biome FROZEN_PEAKS = getBiome("frozen_peaks"); + + Biome FROZEN_RIVER = getBiome("frozen_river"); + + Biome GROVE = getBiome("grove"); + + Biome ICE_SPIKES = getBiome("ice_spikes"); + + Biome JAGGED_PEAKS = getBiome("jagged_peaks"); + + Biome JUNGLE = getBiome("jungle"); + + Biome LUKEWARM_OCEAN = getBiome("lukewarm_ocean"); + + Biome LUSH_CAVES = getBiome("lush_caves"); + + Biome MANGROVE_SWAMP = getBiome("mangrove_swamp"); + + Biome MEADOW = getBiome("meadow"); + + Biome MUSHROOM_FIELDS = getBiome("mushroom_fields"); + + Biome NETHER_WASTES = getBiome("nether_wastes"); + + Biome OCEAN = getBiome("ocean"); + + Biome OLD_GROWTH_BIRCH_FOREST = getBiome("old_growth_birch_forest"); + + Biome OLD_GROWTH_PINE_TAIGA = getBiome("old_growth_pine_taiga"); + + Biome OLD_GROWTH_SPRUCE_TAIGA = getBiome("old_growth_spruce_taiga"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + Biome PALE_GARDEN = getBiome("pale_garden"); + + Biome PLAINS = getBiome("plains"); + + Biome RIVER = getBiome("river"); + + Biome SAVANNA = getBiome("savanna"); + + Biome SAVANNA_PLATEAU = getBiome("savanna_plateau"); + + Biome SMALL_END_ISLANDS = getBiome("small_end_islands"); + + Biome SNOWY_BEACH = getBiome("snowy_beach"); + + Biome SNOWY_PLAINS = getBiome("snowy_plains"); + + Biome SNOWY_SLOPES = getBiome("snowy_slopes"); + + Biome SNOWY_TAIGA = getBiome("snowy_taiga"); + + Biome SOUL_SAND_VALLEY = getBiome("soul_sand_valley"); + + Biome SPARSE_JUNGLE = getBiome("sparse_jungle"); + + Biome STONY_PEAKS = getBiome("stony_peaks"); + + Biome STONY_SHORE = getBiome("stony_shore"); + + Biome SUNFLOWER_PLAINS = getBiome("sunflower_plains"); + + Biome SWAMP = getBiome("swamp"); + + Biome TAIGA = getBiome("taiga"); + + Biome THE_END = getBiome("the_end"); + + Biome THE_VOID = getBiome("the_void"); + + Biome WARM_OCEAN = getBiome("warm_ocean"); + + Biome WARPED_FOREST = getBiome("warped_forest"); + + Biome WINDSWEPT_FOREST = getBiome("windswept_forest"); + + Biome WINDSWEPT_GRAVELLY_HILLS = getBiome("windswept_gravelly_hills"); + + Biome WINDSWEPT_HILLS = getBiome("windswept_hills"); + + Biome WINDSWEPT_SAVANNA = getBiome("windswept_savanna"); + + Biome WOODED_BADLANDS = getBiome("wooded_badlands"); + // Paper end - Generated/Biome + + /** + * Represents a custom Biome + * + * @deprecated Biome is no longer an enum, custom biomes will have their own biome instance. + */ + @Deprecated(since = "1.21.3", forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + Biome CUSTOM = Bukkit.getUnsafe().getCustomBiome(); + + @NotNull + private static Biome getBiome(@NotNull String key) { + return Registry.BIOME.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * @param name of the biome. + * @return the biome with the given name. + * @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead. + */ + @NotNull + @Deprecated(since = "1.21.3", forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Biome valueOf(@NotNull String name) { + if ("CUSTOM".equals(name)) { + return Biome.CUSTOM; + } + + Biome biome = Bukkit.getUnsafe().get(Registry.BIOME, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT))); + Preconditions.checkArgument(biome != null, "No biome found with the name %s", name); + return biome; + } + + /** + * @return an array of all known biomes. + * @deprecated use {@link Registry#iterator()}. + */ + @NotNull + @Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils + static Biome[] values() { + return Lists.newArrayList(Registry.BIOME).toArray(new Biome[0]); + } + + // Paper start + @Override + default @NotNull String translationKey() { + return "biome.minecraft." + this.getKey().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..d99155dec6 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/block/BlockType.java @@ -0,0 +1,2623 @@ +package org.bukkit.block; + +import java.util.function.Consumer; +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.MinecraftExperimental; +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.CreakingHeart; +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.HangingMoss; +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.MossyCarpet; +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. + */ +@org.jetbrains.annotations.ApiStatus.Experimental // Paper - data component API - already required for data component API +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.3 + 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"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed CREAKING_HEART = getBlockType("creaking_heart"); + + 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"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_HANGING_MOSS = getBlockType("pale_hanging_moss"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_MOSS_BLOCK = getBlockType("pale_moss_block"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_MOSS_CARPET = getBlockType("pale_moss_carpet"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_BUTTON = getBlockType("pale_oak_button"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_DOOR = getBlockType("pale_oak_door"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_FENCE = getBlockType("pale_oak_fence"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_FENCE_GATE = getBlockType("pale_oak_fence_gate"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_HANGING_SIGN = getBlockType("pale_oak_hanging_sign"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_LEAVES = getBlockType("pale_oak_leaves"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_LOG = getBlockType("pale_oak_log"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_PLANKS = getBlockType("pale_oak_planks"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_PRESSURE_PLATE = getBlockType("pale_oak_pressure_plate"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_SAPLING = getBlockType("pale_oak_sapling"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_SIGN = getBlockType("pale_oak_sign"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_SLAB = getBlockType("pale_oak_slab"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_STAIRS = getBlockType("pale_oak_stairs"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_TRAPDOOR = getBlockType("pale_oak_trapdoor"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_WALL_HANGING_SIGN = getBlockType("pale_oak_wall_hanging_sign"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_WALL_SIGN = getBlockType("pale_oak_wall_sign"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed PALE_OAK_WOOD = getBlockType("pale_oak_wood"); + + 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"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed POTTED_PALE_OAK_SAPLING = getBlockType("potted_pale_oak_sapling"); + + 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"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed STRIPPED_PALE_OAK_LOG = getBlockType("stripped_pale_oak_log"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + BlockType.Typed STRIPPED_PALE_OAK_WOOD = getBlockType("stripped_pale_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) { + // Cast instead of using BlockType#typed, since block type can be a mock during testing and would return null + return (B) Registry.BLOCK.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * 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..1a824cd8ce --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/block/banner/PatternType.java @@ -0,0 +1,180 @@ +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.3 + 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) { + return Registry.BANNER_PATTERN.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * @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..e8ea5c3a23 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/damage/DamageType.java @@ -0,0 +1,171 @@ +package org.bukkit.damage; + +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.3 + 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 ENDER_PEARL = getDamageType("ender_pearl"); + + 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 MACE_SMASH = getDamageType("mace_smash"); + + 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) { + return Registry.DAMAGE_TYPE.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * {@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..5c9ae4871b --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Boat.java @@ -0,0 +1,198 @@ +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 + * @deprecated different boats types are now different entity types + */ + @Deprecated + @NotNull + Type getBoatType(); + + /** + * Sets the type of the boat. + * + * @param type the new type + * @deprecated different boats types are now different entity types + */ + @Deprecated + 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. + * @deprecated different boats types are now different entity types + */ + @Deprecated + public enum Type { + 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), + ; + + 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.3 + 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..14bfecbf98 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Cat.java @@ -0,0 +1,140 @@ +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.3 + 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) { + return Registry.CAT_VARIANT.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * @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..96c1a1d064 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/EntityType.java @@ -0,0 +1,382 @@ +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.MinecraftExperimental; +import org.bukkit.NamespacedKey; +import org.bukkit.Translatable; +import org.bukkit.World; +import org.bukkit.entity.boat.AcaciaBoat; +import org.bukkit.entity.boat.AcaciaChestBoat; +import org.bukkit.entity.boat.BambooChestRaft; +import org.bukkit.entity.boat.BambooRaft; +import org.bukkit.entity.boat.BirchBoat; +import org.bukkit.entity.boat.BirchChestBoat; +import org.bukkit.entity.boat.CherryBoat; +import org.bukkit.entity.boat.CherryChestBoat; +import org.bukkit.entity.boat.DarkOakBoat; +import org.bukkit.entity.boat.DarkOakChestBoat; +import org.bukkit.entity.boat.JungleBoat; +import org.bukkit.entity.boat.JungleChestBoat; +import org.bukkit.entity.boat.MangroveBoat; +import org.bukkit.entity.boat.MangroveChestBoat; +import org.bukkit.entity.boat.OakBoat; +import org.bukkit.entity.boat.OakChestBoat; +import org.bukkit.entity.boat.PaleOakBoat; +import org.bukkit.entity.boat.PaleOakChestBoat; +import org.bukkit.entity.boat.SpruceBoat; +import org.bukkit.entity.boat.SpruceChestBoat; +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.ApiStatus; +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.3 + ACACIA_BOAT("acacia_boat", AcaciaBoat.class, -1), + ACACIA_CHEST_BOAT("acacia_chest_boat", AcaciaChestBoat.class, -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), + BAMBOO_CHEST_RAFT("bamboo_chest_raft", BambooChestRaft.class, -1), + BAMBOO_RAFT("bamboo_raft", BambooRaft.class, -1), + BAT("bat", Bat.class, 65), + BEE("bee", Bee.class, -1), + BIRCH_BOAT("birch_boat", BirchBoat.class, -1), + BIRCH_CHEST_BOAT("birch_chest_boat", BirchChestBoat.class, -1), + BLAZE("blaze", Blaze.class, 61), + BLOCK_DISPLAY("block_display", BlockDisplay.class, -1), + 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), + CHERRY_BOAT("cherry_boat", CherryBoat.class, -1), + CHERRY_CHEST_BOAT("cherry_chest_boat", CherryChestBoat.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), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + CREAKING("creaking", Creaking.class, -1), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + CREAKING_TRANSIENT("creaking_transient", CreakingTransient.class, -1, false), + CREEPER("creeper", Creeper.class, 50), + DARK_OAK_BOAT("dark_oak_boat", DarkOakBoat.class, -1), + DARK_OAK_CHEST_BOAT("dark_oak_chest_boat", DarkOakChestBoat.class, -1), + 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), + JUNGLE_BOAT("jungle_boat", JungleBoat.class, -1), + JUNGLE_CHEST_BOAT("jungle_chest_boat", JungleChestBoat.class, -1), + 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), + MANGROVE_BOAT("mangrove_boat", MangroveBoat.class, -1), + MANGROVE_CHEST_BOAT("mangrove_chest_boat", MangroveChestBoat.class, -1), + MARKER("marker", Marker.class, -1), + MINECART("minecart", Minecart.class, 42), + MOOSHROOM("mooshroom", MushroomCow.class, 96), + MULE("mule", Mule.class, 32), + OAK_BOAT("oak_boat", OakBoat.class, -1), + OAK_CHEST_BOAT("oak_chest_boat", OakChestBoat.class, -1), + OCELOT("ocelot", Ocelot.class, 98), + OMINOUS_ITEM_SPAWNER("ominous_item_spawner", OminousItemSpawner.class, -1), + PAINTING("painting", Painting.class, 9), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_BOAT("pale_oak_boat", PaleOakBoat.class, -1), + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + PALE_OAK_CHEST_BOAT("pale_oak_chest_boat", PaleOakChestBoat.class, -1), + 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), + SPRUCE_BOAT("spruce_boat", SpruceBoat.class, -1), + SPRUCE_CHEST_BOAT("spruce_chest_boat", SpruceChestBoat.class, -1), + 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..50fef0ac47 --- /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.3 + 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..ea5d5d6907 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Frog.java @@ -0,0 +1,90 @@ +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.3 + Variant COLD = getVariant("cold"); + + Variant TEMPERATE = getVariant("temperate"); + + Variant WARM = getVariant("warm"); + // Paper end - Generated/FrogVariant + + @NotNull + private static Variant getVariant(@NotNull String key) { + return Registry.FROG_VARIANT.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * @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..fc388ea4af --- /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.3 + 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/Salmon.java b/paper-generator/generatedApi/org/bukkit/entity/Salmon.java new file mode 100644 index 0000000000..da2309b2c3 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Salmon.java @@ -0,0 +1,37 @@ +package org.bukkit.entity; + +import org.jetbrains.annotations.NotNull; + +/** + * Represents a salmon fish. + */ +public interface Salmon extends io.papermc.paper.entity.SchoolableFish { // Paper - Schooling Fish API + + /** + * Get the variant of this salmon. + * + * @return salmon variant + */ + @NotNull + public Variant getVariant(); + + /** + * Set the variant of this salmon. + * + * @param variant salmon variant + */ + public void setVariant(@NotNull Variant variant); + + /** + * Represents the variant of a salmon - ie its size. + */ + public enum Variant { + + // Paper start - Generated/SalmonVariant + // @GeneratedFrom 1.21.3 + SMALL, + MEDIUM, + LARGE; + // Paper end - Generated/SalmonVariant + } +} 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..184efb54ba --- /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.3 + 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..7be916e116 --- /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.3 + 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..f13ae15eaa --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Villager.java @@ -0,0 +1,396 @@ +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.3 + 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) { + return Registry.VILLAGER_TYPE.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * @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.3 + /** + * 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) { + return Registry.VILLAGER_PROFESSION.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * @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..d7f757caf1 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/entity/Wolf.java @@ -0,0 +1,122 @@ +package org.bukkit.entity; + +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.3 + 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) { + return Registry.WOLF_VARIANT.getOrThrow(NamespacedKey.minecraft(key)); + } + } +} 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..2d5ef8b135 --- /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.3 + 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..617ce2d358 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/generator/structure/Structure.java @@ -0,0 +1,109 @@ +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.3 + 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 + + @NotNull + private static Structure getStructure(@NotNull String name) { + return Registry.STRUCTURE.getOrThrow(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)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)}, + * and {@link io.papermc.paper.registry.RegistryKey#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..47829ef546 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/generator/structure/StructureType.java @@ -0,0 +1,57 @@ +package org.bukkit.generator.structure; + +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.jetbrains.annotations.NotNull; + +/** + * 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.3 + 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 + + @NotNull + private static StructureType getStructureType(@NotNull String name) { + return Registry.STRUCTURE_TYPE.getOrThrow(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..8c27203b05 --- /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.3 + 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..6242d65ade --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/ItemType.java @@ -0,0 +1,3145 @@ +package org.bukkit.inventory; + +import com.google.common.collect.Multimap; +import java.util.function.Consumer; +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.MinecraftExperimental; +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.3 + 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_BUNDLE = getItemType("black_bundle"); + + 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_BUNDLE = getItemType("blue_bundle"); + + 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 BORDURE_INDENTED_BANNER_PATTERN = getItemType("bordure_indented_banner_pattern"); + + 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_BUNDLE = getItemType("brown_bundle"); + + 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"); + + 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"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed CREAKING_HEART = getItemType("creaking_heart"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed CREAKING_SPAWN_EGG = getItemType("creaking_spawn_egg"); + + 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_BUNDLE = getItemType("cyan_bundle"); + + 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 DUNE_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("dune_armor_trim_smithing_template"); + + ItemType.Typed ECHO_SHARD = getItemType("echo_shard"); + + 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 EXPLORER_POTTERY_SHERD = getItemType("explorer_pottery_sherd"); + + ItemType.Typed EXPOSED_COPPER_BULB = getItemType("exposed_copper_bulb"); + + ItemType.Typed EXPOSED_COPPER_GRATE = getItemType("exposed_copper_grate"); + + ItemType.Typed EYE_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("eye_armor_trim_smithing_template"); + + ItemType.Typed FIELD_MASONED_BANNER_PATTERN = getItemType("field_masoned_banner_pattern"); + + ItemType.Typed FIRE_CHARGE = getItemType("fire_charge"); + + ItemType.Typed FIREWORK_ROCKET = getItemType("firework_rocket"); + + ItemType.Typed FIREWORK_STAR = getItemType("firework_star"); + + ItemType.Typed FLETCHING_TABLE = getItemType("fletching_table"); + + 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 FLOWER_POT = getItemType("flower_pot"); + + ItemType.Typed FOX_SPAWN_EGG = getItemType("fox_spawn_egg"); + + ItemType.Typed FRIEND_POTTERY_SHERD = getItemType("friend_pottery_sherd"); + + ItemType.Typed FROG_SPAWN_EGG = getItemType("frog_spawn_egg"); + + ItemType.Typed FROGSPAWN = getItemType("frogspawn"); + + ItemType.Typed GHAST_SPAWN_EGG = getItemType("ghast_spawn_egg"); + + ItemType.Typed GILDED_BLACKSTONE = getItemType("gilded_blackstone"); + + ItemType.Typed GLOBE_BANNER_PATTERN = getItemType("globe_banner_pattern"); + + ItemType.Typed GLOW_BERRIES = getItemType("glow_berries"); + + ItemType.Typed GLOW_ITEM_FRAME = getItemType("glow_item_frame"); + + ItemType.Typed GLOW_SQUID_SPAWN_EGG = getItemType("glow_squid_spawn_egg"); + + ItemType.Typed GOAT_HORN = getItemType("goat_horn"); + + 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 GRAY_CANDLE = getItemType("gray_candle"); + + ItemType.Typed GREEN_BANNER = getItemType("green_banner"); + + ItemType.Typed GREEN_CANDLE = getItemType("green_candle"); + + ItemType.Typed GRINDSTONE = getItemType("grindstone"); + + ItemType.Typed GUARDIAN_SPAWN_EGG = getItemType("guardian_spawn_egg"); + + ItemType.Typed GUSTER_BANNER_PATTERN = getItemType("guster_banner_pattern"); + + ItemType.Typed GUSTER_POTTERY_SHERD = getItemType("guster_pottery_sherd"); + + 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 HOGLIN_SPAWN_EGG = getItemType("hoglin_spawn_egg"); + + ItemType.Typed HONEY_BOTTLE = getItemType("honey_bottle"); + + ItemType.Typed HONEYCOMB = getItemType("honeycomb"); + + ItemType.Typed HONEYCOMB_BLOCK = getItemType("honeycomb_block"); + + ItemType.Typed HORSE_SPAWN_EGG = getItemType("horse_spawn_egg"); + + ItemType.Typed HOST_ARMOR_TRIM_SMITHING_TEMPLATE = getItemType("host_armor_trim_smithing_template"); + + ItemType.Typed HOWL_POTTERY_SHERD = getItemType("howl_pottery_sherd"); + + 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 LANTERN = getItemType("lantern"); + + ItemType.Typed LARGE_AMETHYST_BUD = getItemType("large_amethyst_bud"); + + 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_BLUE_CANDLE = getItemType("light_blue_candle"); + + ItemType.Typed LIGHT_GRAY_BANNER = getItemType("light_gray_banner"); + + ItemType.Typed LIGHT_GRAY_CANDLE = getItemType("light_gray_candle"); + + ItemType.Typed LIME_BANNER = getItemType("lime_banner"); + + ItemType.Typed LIME_CANDLE = getItemType("lime_candle"); + + ItemType.Typed LINGERING_POTION = getItemType("lingering_potion"); + + ItemType.Typed LLAMA_SPAWN_EGG = getItemType("llama_spawn_egg"); + + ItemType.Typed LODESTONE = getItemType("lodestone"); + + ItemType.Typed LOOM = getItemType("loom"); + + ItemType.Typed MACE = getItemType("mace"); + + ItemType.Typed MAGENTA_BANNER = getItemType("magenta_banner"); + + ItemType.Typed MAGENTA_CANDLE = getItemType("magenta_candle"); + + ItemType.Typed MAGMA_CUBE_SPAWN_EGG = getItemType("magma_cube_spawn_egg"); + + ItemType.Typed MAP = getItemType("map"); + + ItemType.Typed MEDIUM_AMETHYST_BUD = getItemType("medium_amethyst_bud"); + + ItemType.Typed MINER_POTTERY_SHERD = getItemType("miner_pottery_sherd"); + + ItemType.Typed MOJANG_BANNER_PATTERN = getItemType("mojang_banner_pattern"); + + ItemType.Typed MOOSHROOM_SPAWN_EGG = getItemType("mooshroom_spawn_egg"); + + ItemType.Typed MOURNER_POTTERY_SHERD = getItemType("mourner_pottery_sherd"); + + 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 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 EXPOSED_CHISELED_COPPER = getItemType("exposed_chiseled_copper"); + + ItemType.Typed EXPOSED_COPPER = getItemType("exposed_copper"); + + ItemType.Typed EXPOSED_COPPER_DOOR = getItemType("exposed_copper_door"); + + 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 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 FLINT = getItemType("flint"); + + ItemType.Typed FLINT_AND_STEEL = getItemType("flint_and_steel"); + + ItemType.Typed FLOWERING_AZALEA = getItemType("flowering_azalea"); + + ItemType.Typed FLOWERING_AZALEA_LEAVES = getItemType("flowering_azalea_leaves"); + + ItemType.Typed FURNACE = getItemType("furnace"); + + ItemType.Typed FURNACE_MINECART = getItemType("furnace_minecart"); + + ItemType.Typed GHAST_TEAR = getItemType("ghast_tear"); + + 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 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 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_BUNDLE = getItemType("gray_bundle"); + + 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_BUNDLE = getItemType("green_bundle"); + + 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 GUNPOWDER = getItemType("gunpowder"); + + ItemType.Typed HANGING_ROOTS = getItemType("hanging_roots"); + + ItemType.Typed HAY_BLOCK = getItemType("hay_block"); + + 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 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 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 LAPIS_BLOCK = getItemType("lapis_block"); + + ItemType.Typed LAPIS_LAZULI = getItemType("lapis_lazuli"); + + ItemType.Typed LAPIS_ORE = getItemType("lapis_ore"); + + 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_BUNDLE = getItemType("light_blue_bundle"); + + 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_BUNDLE = getItemType("light_gray_bundle"); + + 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_BUNDLE = getItemType("lime_bundle"); + + 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 MAGENTA_BED = getItemType("magenta_bed"); + + ItemType.Typed MAGENTA_BUNDLE = getItemType("magenta_bundle"); + + 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 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 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 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_BUNDLE = getItemType("orange_bundle"); + + 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"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_HANGING_MOSS = getItemType("pale_hanging_moss"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_MOSS_BLOCK = getItemType("pale_moss_block"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_MOSS_CARPET = getItemType("pale_moss_carpet"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_BOAT = getItemType("pale_oak_boat"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_BUTTON = getItemType("pale_oak_button"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_CHEST_BOAT = getItemType("pale_oak_chest_boat"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_DOOR = getItemType("pale_oak_door"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_FENCE = getItemType("pale_oak_fence"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_FENCE_GATE = getItemType("pale_oak_fence_gate"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_HANGING_SIGN = getItemType("pale_oak_hanging_sign"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_LEAVES = getItemType("pale_oak_leaves"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_LOG = getItemType("pale_oak_log"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_PLANKS = getItemType("pale_oak_planks"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_PRESSURE_PLATE = getItemType("pale_oak_pressure_plate"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_SAPLING = getItemType("pale_oak_sapling"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_SIGN = getItemType("pale_oak_sign"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_SLAB = getItemType("pale_oak_slab"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_STAIRS = getItemType("pale_oak_stairs"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_TRAPDOOR = getItemType("pale_oak_trapdoor"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed PALE_OAK_WOOD = getItemType("pale_oak_wood"); + + 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_BUNDLE = getItemType("pink_bundle"); + + 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_BUNDLE = getItemType("purple_bundle"); + + 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_BUNDLE = getItemType("red_bundle"); + + 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"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed STRIPPED_PALE_OAK_LOG = getItemType("stripped_pale_oak_log"); + + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + @ApiStatus.Experimental + ItemType.Typed STRIPPED_PALE_OAK_WOOD = getItemType("stripped_pale_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_BUNDLE = getItemType("white_bundle"); + + 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_BUNDLE = getItemType("yellow_bundle"); + + 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) { + // Cast instead of using ItemType#typed, since item type can be a mock during testing and would return null + return (M) Registry.ITEM.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * 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 + // Paper start - data component API + /** + * Gets the default value of the data component type for this item type. + * + * @param type the data component type + * @param the value type + * @return the default value or {@code null} if there is none + * @see #hasDefaultData(io.papermc.paper.datacomponent.DataComponentType) for DataComponentType.NonValued + */ + @org.jetbrains.annotations.ApiStatus.Experimental + @Nullable T getDefaultData(io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued type); + + /** + * Checks if the data component type has a default value for this item type. + * + * @param type the data component type + * @return {@code true} if there is a default value + */ + @org.jetbrains.annotations.ApiStatus.Experimental + boolean hasDefaultData(io.papermc.paper.datacomponent.@NotNull DataComponentType type); + + /** + * Gets the default data component types for this item type. + * + * @return an immutable set of data component types + */ + @org.jetbrains.annotations.ApiStatus.Experimental + java.util.@org.jetbrains.annotations.Unmodifiable @NotNull Set getDefaultDataTypes(); + // Paper end - data component 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..18dd541637 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimMaterial.java @@ -0,0 +1,69 @@ +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; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a material that may be used in an {@link ArmorTrim}. + */ +public interface TrimMaterial extends Keyed, Translatable { + + // Paper start - Generated/TrimMaterial + // @GeneratedFrom 1.21.3 + 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 + + @NotNull + private static TrimMaterial getTrimMaterial(@NotNull String key) { + return Registry.TRIM_MATERIAL.getOrThrow(NamespacedKey.minecraft(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..64a9c82326 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/inventory/meta/trim/TrimPattern.java @@ -0,0 +1,85 @@ +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; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a pattern that may be used in an {@link ArmorTrim}. + */ +public interface TrimPattern extends Keyed, Translatable { + + // Paper start - Generated/TrimPattern + // @GeneratedFrom 1.21.3 + 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 + + @NotNull + private static TrimPattern getTrimPattern(@NotNull String key) { + return Registry.TRIM_PATTERN.getOrThrow(NamespacedKey.minecraft(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..ae13d85a98 --- /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.3 + 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..87fa8e39a8 --- /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.3 + 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..5e7b3f910e --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/map/MapCursor.java @@ -0,0 +1,417 @@ +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.3 + 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) { + return Registry.MAP_DECORATION_TYPE.getOrThrow(NamespacedKey.minecraft(key)); + } + + /** + * 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..b45c6e492a --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/map/MapPalette.java @@ -0,0 +1,513 @@ +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) { + // Paper start - Optimize color distance calculation by removing floating point math + int rsum = c1.getRed() + c2.getRed(); // Use sum instead of mean for no division + int r = c1.getRed() - c2.getRed(); + int g = c1.getGreen() - c2.getGreen(); + int b = c1.getBlue() - c2.getBlue(); + // All weights are 512x their original to avoid floating point division + int weightR = 1024 + rsum; + int weightG = 2048; + int weightB = 1024 + (255*2 - rsum); + + // Division by 256 here is unnecessary as this won't change the result of the sort + return weightR * r * r + weightG * g * g + weightB * b * b; + // Paper end + } + + @NotNull + static final Color[] colors = { + // Paper start - Generated/MapPalette#colors + // @GeneratedFrom 1.21.3 + 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..abba0ee7c0 --- /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.3 + 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..398a43c487 --- /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.3 + 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/generatedApi/org/bukkit/tag/DamageTypeTags.java b/paper-generator/generatedApi/org/bukkit/tag/DamageTypeTags.java new file mode 100644 index 0000000000..234748a4f5 --- /dev/null +++ b/paper-generator/generatedApi/org/bukkit/tag/DamageTypeTags.java @@ -0,0 +1,97 @@ +package org.bukkit.tag; + +import org.bukkit.Bukkit; +import org.bukkit.NamespacedKey; +import org.bukkit.Tag; +import org.bukkit.damage.DamageType; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Nullable; + +/** + * Vanilla {@link DamageType} {@link Tag tags}. + */ +@ApiStatus.Experimental +public final class DamageTypeTags { + + // Paper start - Generated/DamageTypeTags + // @GeneratedFrom 1.21.3 + public static final Tag ALWAYS_HURTS_ENDER_DRAGONS = getTag("always_hurts_ender_dragons"); + + public static final Tag ALWAYS_KILLS_ARMOR_STANDS = getTag("always_kills_armor_stands"); + + public static final Tag ALWAYS_MOST_SIGNIFICANT_FALL = getTag("always_most_significant_fall"); + + public static final Tag ALWAYS_TRIGGERS_SILVERFISH = getTag("always_triggers_silverfish"); + + public static final Tag AVOIDS_GUARDIAN_THORNS = getTag("avoids_guardian_thorns"); + + public static final Tag BURN_FROM_STEPPING = getTag("burn_from_stepping"); + + public static final Tag BURNS_ARMOR_STANDS = getTag("burns_armor_stands"); + + public static final Tag BYPASSES_ARMOR = getTag("bypasses_armor"); + + public static final Tag BYPASSES_EFFECTS = getTag("bypasses_effects"); + + public static final Tag BYPASSES_ENCHANTMENTS = getTag("bypasses_enchantments"); + + public static final Tag BYPASSES_INVULNERABILITY = getTag("bypasses_invulnerability"); + + public static final Tag BYPASSES_RESISTANCE = getTag("bypasses_resistance"); + + public static final Tag BYPASSES_SHIELD = getTag("bypasses_shield"); + + public static final Tag BYPASSES_WOLF_ARMOR = getTag("bypasses_wolf_armor"); + + public static final Tag CAN_BREAK_ARMOR_STAND = getTag("can_break_armor_stand"); + + public static final Tag DAMAGES_HELMET = getTag("damages_helmet"); + + public static final Tag IGNITES_ARMOR_STANDS = getTag("ignites_armor_stands"); + + public static final Tag IS_DROWNING = getTag("is_drowning"); + + public static final Tag IS_EXPLOSION = getTag("is_explosion"); + + public static final Tag IS_FALL = getTag("is_fall"); + + public static final Tag IS_FIRE = getTag("is_fire"); + + public static final Tag IS_FREEZING = getTag("is_freezing"); + + public static final Tag IS_LIGHTNING = getTag("is_lightning"); + + public static final Tag IS_PLAYER_ATTACK = getTag("is_player_attack"); + + public static final Tag IS_PROJECTILE = getTag("is_projectile"); + + public static final Tag IS_MACE_SMASH = getTag("mace_smash"); + + public static final Tag NO_ANGER = getTag("no_anger"); + + public static final Tag NO_IMPACT = getTag("no_impact"); + + public static final Tag NO_KNOCKBACK = getTag("no_knockback"); + + public static final Tag PANIC_CAUSES = getTag("panic_causes"); + + public static final Tag PANIC_ENVIRONMENTAL_CAUSES = getTag("panic_environmental_causes"); + + public static final Tag WITCH_RESISTANT_TO = getTag("witch_resistant_to"); + + public static final Tag WITHER_IMMUNE_TO = getTag("wither_immune_to"); + // Paper end - Generated/DamageTypeTags + /** + * Internal use only. + */ + @ApiStatus.Internal + public static final String REGISTRY_DAMAGE_TYPES = "damage_types"; + + @Nullable + private static Tag getTag(String key) { + return Bukkit.getTag(REGISTRY_DAMAGE_TYPES, NamespacedKey.minecraft(key), DamageType.class); + } + + private DamageTypeTags() { + } +} 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..2b3ec877b8 --- /dev/null +++ b/paper-generator/generatedServer/io/papermc/paper/registry/PaperRegistries.java @@ -0,0 +1,174 @@ +package io.papermc.paper.registry; + +import com.google.common.base.Preconditions; +import io.papermc.paper.adventure.PaperAdventure; +import io.papermc.paper.datacomponent.DataComponentType; +import io.papermc.paper.datacomponent.PaperComponentType; +import io.papermc.paper.registry.data.PaperEnchantmentRegistryEntry; +import io.papermc.paper.registry.data.PaperGameEventRegistryEntry; +import io.papermc.paper.registry.data.PaperPaintingVariantRegistryEntry; +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.Art; +import org.bukkit.Fluid; +import org.bukkit.GameEvent; +import org.bukkit.JukeboxSong; +import org.bukkit.Keyed; +import org.bukkit.MusicInstrument; +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.craftbukkit.CraftArt; +import org.bukkit.craftbukkit.CraftFluid; +import org.bukkit.craftbukkit.CraftGameEvent; +import org.bukkit.craftbukkit.CraftJukeboxSong; +import org.bukkit.craftbukkit.CraftMusicInstrument; +import org.bukkit.craftbukkit.CraftSound; +import org.bukkit.craftbukkit.attribute.CraftAttribute; +import org.bukkit.craftbukkit.block.CraftBiome; +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.jspecify.annotations.Nullable; + +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; + +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.3 + // 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.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), + entry(Registries.ATTRIBUTE, RegistryKey.ATTRIBUTE, Attribute.class, CraftAttribute::new), + entry(Registries.FLUID, RegistryKey.FLUID, Fluid.class, CraftFluid::new), + entry(Registries.SOUND_EVENT, RegistryKey.SOUND_EVENT, Sound.class, CraftSound::new), + entry(Registries.DATA_COMPONENT_TYPE, RegistryKey.DATA_COMPONENT_TYPE, DataComponentType.class, PaperComponentType::of), + + // data-driven + entry(Registries.BIOME, RegistryKey.BIOME, Biome.class, CraftBiome::new).delayed(), + 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(), + writable(Registries.PAINTING_VARIANT, RegistryKey.PAINTING_VARIANT, Art.class, CraftArt::new, PaperPaintingVariantRegistryEntry.PaperBuilder::new).delayed(), + entry(Registries.INSTRUMENT, RegistryKey.INSTRUMENT, MusicInstrument.class, CraftMusicInstrument::new).delayed(), + + // api-only + apiOnly(Registries.ENTITY_TYPE, RegistryKey.ENTITY_TYPE, PaperSimpleRegistry::entityType), + apiOnly(Registries.PARTICLE_TYPE, RegistryKey.PARTICLE_TYPE, PaperSimpleRegistry::particleType), + apiOnly(Registries.POTION, RegistryKey.POTION, PaperSimpleRegistry::potion), + apiOnly(Registries.MEMORY_MODULE_TYPE, RegistryKey.MEMORY_MODULE_TYPE, () -> org.bukkit.Registry.MEMORY_MODULE_TYPE) + // 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) { + Preconditions.checkState(byRegistryKey.put(entry.apiKey(), entry) == null, "Duplicate api registry key: %s", entry.apiKey()); + Preconditions.checkState(byResourceKey.put(entry.mcKey(), entry) == null, "Duplicate mc registry key: %s", entry.mcKey()); + } + 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/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java b/paper-generator/generatedServer/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java new file mode 100644 index 0000000000..9d1c17917a --- /dev/null +++ b/paper-generator/generatedServer/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java @@ -0,0 +1,58 @@ +package io.papermc.paper.world.flag; + +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableBiMap; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import net.minecraft.world.flag.FeatureElement; +import net.minecraft.world.flag.FeatureFlagSet; +import net.minecraft.world.flag.FeatureFlags; +import org.bukkit.FeatureFlag; +import org.bukkit.craftbukkit.entity.CraftEntityType; +import org.bukkit.craftbukkit.entity.CraftEntityTypes; +import org.bukkit.craftbukkit.potion.CraftPotionType; +import org.bukkit.craftbukkit.util.CraftMagicNumbers; +import org.bukkit.entity.EntityType; +import org.bukkit.potion.PotionType; + +public class PaperFeatureFlagProviderImpl implements FeatureFlagProvider { + + public static final BiMap FLAGS = ImmutableBiMap.of( + // Paper start - Generated/PaperFeatureFlagProviderImpl#FLAGS + // @GeneratedFrom 1.21.3 + FeatureFlag.MINECART_IMPROVEMENTS, FeatureFlags.MINECART_IMPROVEMENTS, + FeatureFlag.REDSTONE_EXPERIMENTS, FeatureFlags.REDSTONE_EXPERIMENTS, + FeatureFlag.TRADE_REBALANCE, FeatureFlags.TRADE_REBALANCE, + FeatureFlag.VANILLA, FeatureFlags.VANILLA, + FeatureFlag.WINTER_DROP, FeatureFlags.WINTER_DROP + // Paper end - Generated/PaperFeatureFlagProviderImpl#FLAGS + ); + + @Override + public Set requiredFeatures(final FeatureDependant dependant) { + final FeatureFlagSet requiredFeatures = getFeatureElement(dependant).requiredFeatures(); + return fromNms(requiredFeatures); + } + + public static Set fromNms(final FeatureFlagSet flagSet) { + final Set flags = new HashSet<>(); + for (final net.minecraft.world.flag.FeatureFlag nmsFlag : FeatureFlags.REGISTRY.names.values()) { + if (flagSet.contains(nmsFlag)) { + flags.add(FLAGS.inverse().get(nmsFlag)); + } + } + return Collections.unmodifiableSet(flags); + } + + static FeatureElement getFeatureElement(final FeatureDependant dependant) { + if (dependant instanceof final EntityType entityType) { + // TODO remove when EntityType is server-backed + return CraftEntityType.bukkitToMinecraft(entityType); + } else if (dependant instanceof final PotionType potionType) { + return CraftPotionType.bukkitToMinecraft(potionType); + } else { + throw new IllegalArgumentException(dependant + " is not a valid feature dependant"); + } + } +} 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..db0de98e31 --- /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.3 + 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.3 + 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..11e973f50a --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -0,0 +1,336 @@ +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.CreakingHeartBlockEntity; +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.3 + 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.CREAKING_HEART, CraftCreakingHeart.class, CraftCreakingHeart::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..1c5c7a24da --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -0,0 +1,790 @@ +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.core.registries.Registries; +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.CraftRegistry; +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.3 + 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.CreakingHeartBlock.class, org.bukkit.craftbukkit.block.impl.CraftCreakingHeart::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.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.HangingMossBlock.class, org.bukkit.craftbukkit.block.impl.CraftHangingMoss::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.MossyCarpetBlock.class, org.bukkit.craftbukkit.block.impl.CraftMossyCarpet::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(CraftRegistry.getMinecraftRegistry(Registries.BLOCK), 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..13c8539020 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAmethystCluster.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.AmethystCluster; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftAmethystCluster extends CraftBlockData implements AmethystCluster { + private static final EnumProperty 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..5199c201fa --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAnvil.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.AnvilBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftAnvil extends CraftBlockData implements Directional { + private static final EnumProperty 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..1fcd1026c2 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftAttachedStem.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.AttachedStemBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftAttachedStem extends CraftBlockData implements Directional { + private static final EnumProperty 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..7b0362683d --- /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.3") +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..0739f5201f --- /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.3") +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..ed466cde11 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBarrel.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Barrel; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftBarrel extends CraftBlockData implements Barrel { + private static final EnumProperty 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..0e84c0a05a --- /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.3") +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..be51d03a21 --- /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.3") +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..454b5fd47d --- /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.3") +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..962d79c130 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBaseCoralWallFan.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.CoralWallFan; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftBaseCoralWallFan extends CraftBlockData implements CoralWallFan { + private static final EnumProperty 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..14bf41b2e9 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Bed; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftBed extends CraftBlockData implements Bed { + private static final EnumProperty 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..beceead4c5 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBeehive.java @@ -0,0 +1,56 @@ +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.BeehiveBlock; +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 org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Beehive; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftBeehive extends CraftBlockData implements Beehive { + private static final EnumProperty 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..3f81861ca6 --- /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.3") +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..adb68978a7 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Bell; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftBell extends CraftBlockData implements Bell { + private static final EnumProperty ATTACHMENT = BellBlock.ATTACHMENT; + + private static final EnumProperty 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..9419a5be35 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.BigDripleaf; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftBigDripleaf extends CraftBlockData implements BigDripleaf { + private static final EnumProperty 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..9636804f57 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBigDripleafStem.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Dripleaf; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftBigDripleafStem extends CraftBlockData implements Dripleaf { + private static final EnumProperty 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..207920ba1e --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftBlastFurnace.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftBlastFurnace extends CraftBlockData implements Furnace { + private static final EnumProperty 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..bfd2ebe85c --- /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.3") +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..1d3e983ee9 --- /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.3") +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..aeb3e43470 --- /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.3") +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..4a8c91cf80 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Switch; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftButton extends CraftBlockData implements Switch { + private static final EnumProperty FACE = ButtonBlock.FACE; + + private static final EnumProperty 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..7941abfd9a --- /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.3") +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..e20fd73697 --- /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.3") +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..26749b8e27 --- /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.core.Direction; +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.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.3") +public class CraftCalibratedSculkSensor extends CraftBlockData implements CalibratedSculkSensor { + private static final EnumProperty 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..c175162bc3 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCampfire.java @@ -0,0 +1,75 @@ +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.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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Campfire; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftCampfire extends CraftBlockData implements Campfire { + private static final EnumProperty 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..f765e1bc15 --- /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.3") +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..66bdc05356 --- /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.3") +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..a8c5e8723a --- /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.3") +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..89b30f623f --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCarvedPumpkin.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.CarvedPumpkinBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftCarvedPumpkin extends CraftBlockData implements Directional { + private static final EnumProperty 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..aad212a53b --- /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.3") +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..da58a9bb96 --- /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.3") +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..3910f38a2c --- /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.3") +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..1d720ac19f --- /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.3") +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..df09158a27 --- /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.3") +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..bd2d79128d --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Chest; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftChest extends CraftBlockData implements Chest { + private static final EnumProperty 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..eb37adc8dd --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftChiseledBookShelf.java @@ -0,0 +1,70 @@ +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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.ChiseledBookshelf; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftChiseledBookShelf extends CraftBlockData implements ChiseledBookshelf { + private static final EnumProperty 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..841071d8c6 --- /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.3") +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..9cd543e119 --- /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.3") +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..2ffb642a96 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCocoa.java @@ -0,0 +1,56 @@ +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.CocoaBlock; +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 org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Cocoa; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftCocoa extends CraftBlockData implements Cocoa { + private static final IntegerProperty AGE = CocoaBlock.AGE; + + private static final EnumProperty 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..8eed0bba17 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCommandBlock.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.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.CommandBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftCommandBlock extends CraftBlockData implements CommandBlock { + private static final BooleanProperty CONDITIONAL = net.minecraft.world.level.block.CommandBlock.CONDITIONAL; + + private static final EnumProperty 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..78e567c157 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Comparator; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftComparator extends CraftBlockData implements Comparator { + private static final EnumProperty 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..04f18e6e70 --- /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.3") +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..13985ed0ba --- /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.3") +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..0119f67a95 --- /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.3") +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..8ec6bbaf9e --- /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.3") +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..7b79909259 --- /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.3") +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..dc0abf23b1 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCoralWallFan.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.CoralWallFan; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftCoralWallFan extends CraftBlockData implements CoralWallFan { + private static final EnumProperty 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..ac03e97b4d --- /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.3") +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/CraftCreakingHeart.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCreakingHeart.java new file mode 100644 index 0000000000..6e1ee28c0d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftCreakingHeart.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.CreakingHeartBlock; +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.type.CreakingHeart; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftCreakingHeart extends CraftBlockData implements CreakingHeart { + private static final EnumProperty AXIS = CreakingHeartBlock.AXIS; + + private static final EnumProperty CREAKING = CreakingHeartBlock.CREAKING; + + public CraftCreakingHeart(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 CreakingHeart.Creaking getCreaking() { + return this.get(CREAKING, CreakingHeart.Creaking.class); + } + + @Override + public void setCreaking(final CreakingHeart.Creaking creaking) { + Preconditions.checkArgument(creaking != null, "creaking cannot be null!"); + this.set(CREAKING, creaking); + } +} 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..2a9b6da75c --- /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.3") +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..3ddf140dc0 --- /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.3") +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..86f3566b18 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDecoratedPot.java @@ -0,0 +1,64 @@ +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.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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.DecoratedPot; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftDecoratedPot extends CraftBlockData implements DecoratedPot { + private static final BooleanProperty CRACKED = DecoratedPotBlock.CRACKED; + + private static final EnumProperty 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..4e5ca31fa9 --- /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.3") +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..6490dffab8 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDispenser.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Dispenser; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftDispenser extends CraftBlockData implements Dispenser { + private static final EnumProperty 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..92cafc6dab --- /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.core.Direction; +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.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.3") +public class CraftDoor extends CraftBlockData implements Door { + private static final EnumProperty 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..dc4bbdbf9c --- /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.3") +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..d25b59eba1 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftDropper.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Dispenser; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftDropper extends CraftBlockData implements Dispenser { + private static final EnumProperty 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..0e6daff0b2 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndPortalFrame.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.EndPortalFrame; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftEndPortalFrame extends CraftBlockData implements EndPortalFrame { + private static final BooleanProperty HAS_EYE = EndPortalFrameBlock.HAS_EYE; + + private static final EnumProperty 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..a4bf53674b --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEndRod.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.EndRodBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftEndRod extends CraftBlockData implements Directional { + private static final EnumProperty 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..696bb51506 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftEnderChest.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.EnderChest; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftEnderChest extends CraftBlockData implements EnderChest { + private static final EnumProperty 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/CraftFarm.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFarm.java new file mode 100644 index 0000000000..456090afc0 --- /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.3") +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..0c70a38bfe --- /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.3") +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..b67825c743 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFenceGate.java @@ -0,0 +1,75 @@ +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.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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Gate; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftFenceGate extends CraftBlockData implements Gate { + private static final EnumProperty 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..a8bf2b88d8 --- /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.3") +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..14b79a1d5e --- /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.3") +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..06428991bd --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftFurnace.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftFurnace extends CraftBlockData implements Furnace { + private static final EnumProperty 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..08e73029d4 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftGlazedTerracotta.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.GlazedTerracottaBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftGlazedTerracotta extends CraftBlockData implements Directional { + private static final EnumProperty 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..a135709e03 --- /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.3") +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..f4c31bc388 --- /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.3") +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..3237ef0380 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Grindstone; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftGrindstone extends CraftBlockData implements Grindstone { + private static final EnumProperty FACE = GrindstoneBlock.FACE; + + private static final EnumProperty 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/CraftHangingMoss.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHangingMoss.java new file mode 100644 index 0000000000..0b00bb2581 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHangingMoss.java @@ -0,0 +1,27 @@ +package org.bukkit.craftbukkit.block.impl; + +import io.papermc.paper.generated.GeneratedFrom; +import net.minecraft.world.level.block.HangingMossBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import org.bukkit.block.data.type.HangingMoss; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftHangingMoss extends CraftBlockData implements HangingMoss { + private static final BooleanProperty TIP = HangingMossBlock.TIP; + + public CraftHangingMoss(BlockState state) { + super(state); + } + + @Override + public boolean isTip() { + return this.get(TIP); + } + + @Override + public void setTip(final boolean tip) { + this.set(TIP, tip); + } +} 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..da60d6edea --- /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.3") +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..d58a117023 --- /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.3") +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..1e40196257 --- /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.HeavyCoreBlock; +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.3") +public class CraftHeavyCore extends CraftBlockData implements Waterlogged { + private static final BooleanProperty WATERLOGGED = HeavyCoreBlock.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..9811f87230 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftHopper.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Hopper; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftHopper extends CraftBlockData implements Hopper { + private static final BooleanProperty ENABLED = HopperBlock.ENABLED; + + private static final EnumProperty 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..1ad757f101 --- /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.3") +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..bfd29e67b3 --- /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.3") +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..e524630528 --- /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.3") +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..f6793fff7c --- /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.3") +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..c5361e8b5f --- /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.3") +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..8d5545581d --- /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.3") +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..638d8bb624 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLadder.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Ladder; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftLadder extends CraftBlockData implements Ladder { + private static final EnumProperty 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..616ee5f0b8 --- /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.3") +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..6168695134 --- /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.3") +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..299e2a9163 --- /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.3") +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..a53b2239bb --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLectern.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Lectern; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftLectern extends CraftBlockData implements Lectern { + private static final EnumProperty 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..f0f984816e --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Switch; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftLever extends CraftBlockData implements Switch { + private static final EnumProperty FACE = LeverBlock.FACE; + + private static final EnumProperty 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..5f4df026de --- /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.3") +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..c37a40a338 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLightningRod.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.LightningRod; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftLightningRod extends CraftBlockData implements LightningRod { + private static final EnumProperty 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..447dc5f329 --- /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.3") +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..ca66475994 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftLoom.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.LoomBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftLoom extends CraftBlockData implements Directional { + private static final EnumProperty 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..0d19c9eab1 --- /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.3") +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..82130f011a --- /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.3") +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..409003800c --- /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.3") +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/CraftMossyCarpet.java b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMossyCarpet.java new file mode 100644 index 0000000000..2d5bf0e003 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftMossyCarpet.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.Collections; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import net.minecraft.world.level.block.MossyCarpetBlock; +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 net.minecraft.world.level.block.state.properties.WallSide; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.MossyCarpet; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftMossyCarpet extends CraftBlockData implements MossyCarpet { + private static final BooleanProperty BASE = MossyCarpetBlock.BASE; + + private static final Map> PROPERTY_BY_DIRECTION = Map.of( + BlockFace.NORTH, BlockStateProperties.NORTH_WALL, + BlockFace.SOUTH, BlockStateProperties.SOUTH_WALL, + BlockFace.WEST, BlockStateProperties.WEST_WALL, + BlockFace.EAST, BlockStateProperties.EAST_WALL + ); + + public CraftMossyCarpet(BlockState state) { + super(state); + } + + @Override + public boolean isBottom() { + return this.get(BASE); + } + + @Override + public void setBottom(final boolean bottom) { + this.set(BASE, bottom); + } + + @Override + public org.bukkit.block.data.type.Wall.Height getHeight(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, org.bukkit.block.data.type.Wall.Height.class); + } + + @Override + public void setHeight(final BlockFace blockFace, + final org.bukkit.block.data.type.Wall.Height height) { + Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!"); + Preconditions.checkArgument(height != null, "height 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, height); + } + + public Set getAllowedHeights() { + return Collections.unmodifiableSet(PROPERTY_BY_DIRECTION.keySet()); + } +} 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..96d4547c1f --- /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.core.Direction; +import net.minecraft.world.level.block.piston.MovingPistonBlock; +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.PistonType; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.TechnicalPiston; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftMovingPiston extends CraftBlockData implements TechnicalPiston { + private static final EnumProperty 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..dc766c1b3b --- /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.3") +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..73f04f7101 --- /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.3") +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..5a482611fd --- /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.3") +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..b929af357f --- /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.3") +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..bc402ba3d5 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftObserver.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Observer; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftObserver extends CraftBlockData implements Observer { + private static final EnumProperty 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..7b61b95b53 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPiglinWallSkull.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftPiglinWallSkull extends CraftBlockData implements WallSkull { + private static final EnumProperty 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..905eb96bd2 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPinkPetals.java @@ -0,0 +1,61 @@ +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.PinkPetalsBlock; +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 org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.PinkPetals; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftPinkPetals extends CraftBlockData implements PinkPetals { + private static final EnumProperty 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..2cce08a545 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPistonBase.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Piston; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftPistonBase extends CraftBlockData implements Piston { + private static final BooleanProperty EXTENDED = PistonBaseBlock.EXTENDED; + + private static final EnumProperty 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..b086aa0516 --- /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.core.Direction; +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.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.3") +public class CraftPistonHead extends CraftBlockData implements PistonHead { + private static final EnumProperty 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..8cf0061259 --- /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.3") +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..56f8e808f6 --- /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.3") +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..e2bb2d337d --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftPlayerWallHead.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftPlayerWallHead extends CraftBlockData implements WallSkull { + private static final EnumProperty 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..304d8657d0 --- /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.core.Direction; +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.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.3") +public class CraftPointedDripstone extends CraftBlockData implements PointedDripstone { + private static final EnumProperty THICKNESS = PointedDripstoneBlock.THICKNESS; + + private static final EnumProperty 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..4e9ab36d0e --- /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.3") +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..ea051b13c9 --- /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.3") +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..7a825234ee --- /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.3") +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..66f3b364d3 --- /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.3") +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..3d652e1a14 --- /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.3") +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..d0213fed6a --- /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.3") +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..b2489d2149 --- /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.3") +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..c140dca1bf --- /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.3") +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..fe3666b6f9 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRedstoneWallTorch.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.RedstoneWallTorch; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftRedstoneWallTorch extends CraftBlockData implements RedstoneWallTorch { + private static final EnumProperty 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..7580dd0eb5 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftRepeater.java @@ -0,0 +1,86 @@ +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.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.EnumProperty; +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.3") +public class CraftRepeater extends CraftBlockData implements Repeater { + private static final IntegerProperty DELAY = RepeaterBlock.DELAY; + + private static final EnumProperty 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..dd4cfc91b1 --- /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.3") +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..2d6dfee478 --- /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.3") +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..5afeda5906 --- /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.3") +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..7619034bf5 --- /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.3") +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..72da7cc65f --- /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.3") +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..37d527f74b --- /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.3") +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..5a7c98951a --- /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.3") +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..c9f69b30b9 --- /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.3") +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..e1a73c4a6b --- /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.3") +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..51126a706c --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftShulkerBox.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.ShulkerBoxBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftShulkerBox extends CraftBlockData implements Directional { + private static final EnumProperty FACING = ShulkerBoxBlock.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..0efe19bcc0 --- /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.3") +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..0108f2e436 --- /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.3") +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..a87603d13a --- /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.core.Direction; +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.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.3") +public class CraftSmallDripleaf extends CraftBlockData implements SmallDripleaf { + private static final EnumProperty 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..61b4daf251 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftSmoker.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Furnace; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftSmoker extends CraftBlockData implements Furnace { + private static final EnumProperty 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..1369afb420 --- /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.3") +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..a2d031413a --- /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.3") +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..3fb521c0bc --- /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.3") +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..023c389227 --- /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.3") +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..3fe325cefe --- /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.core.Direction; +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.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.3") +public class CraftStair extends CraftBlockData implements Stairs { + private static final EnumProperty 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..af60823e26 --- /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.3") +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..e446fdb784 --- /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.3") +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..f32dddb683 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftStonecutter.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.StonecutterBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftStonecutter extends CraftBlockData implements Directional { + private static final EnumProperty 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..2283725344 --- /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.3") +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..bb406cb82a --- /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.3") +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..35819c9299 --- /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.3") +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..79702f3303 --- /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.3") +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..dfbc55a677 --- /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.3") +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..c6804cea6b --- /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.3") +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..bc6fa4ff1b --- /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.3") +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..b26520e2bc --- /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.3") +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..447bb8d387 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.TrapDoor; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftTrapDoor extends CraftBlockData implements TrapDoor { + private static final EnumProperty 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..fc96b89a52 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Chest; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftTrappedChest extends CraftBlockData implements Chest { + private static final EnumProperty 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..b22dfe9710 --- /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.3") +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..2a92725aaf --- /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.3") +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..5dc102d416 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftTripWireHook.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.TripwireHook; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftTripWireHook extends CraftBlockData implements TripwireHook { + private static final BooleanProperty ATTACHED = TripWireHookBlock.ATTACHED; + + private static final EnumProperty 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..f35d33d8dc --- /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.3") +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..88b5ec55b0 --- /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.3") +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..0c996512d9 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.Vault; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftVault extends CraftBlockData implements Vault { + private static final EnumProperty 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..033153c2d2 --- /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.3") +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..1332014b60 --- /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.3") +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..37f1fbc9d1 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallBanner.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.WallBannerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftWallBanner extends CraftBlockData implements Directional { + private static final EnumProperty 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..7be7ad1a5f --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallHangingSign.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallHangingSign; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftWallHangingSign extends CraftBlockData implements WallHangingSign { + private static final EnumProperty 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..438d58f487 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSign.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSign; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftWallSign extends CraftBlockData implements WallSign { + private static final EnumProperty 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..3d5fdd6906 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallSkull.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftWallSkull extends CraftBlockData implements WallSkull { + private static final EnumProperty 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..524ad9d8fc --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWallTorch.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.WallTorchBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Directional; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftWallTorch extends CraftBlockData implements Directional { + private static final EnumProperty 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..8712407eda --- /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.3") +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..16ef148e63 --- /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.3") +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..f73bb7caf4 --- /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.core.Direction; +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.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.3") +public class CraftWeatheringCopperDoor extends CraftBlockData implements Door { + private static final EnumProperty 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..5cce2d5b9b --- /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.3") +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..38d8783228 --- /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.3") +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..b32732aa59 --- /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.core.Direction; +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.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.3") +public class CraftWeatheringCopperStair extends CraftBlockData implements Stairs { + private static final EnumProperty 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..95b36e8bd6 --- /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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.TrapDoor; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftWeatheringCopperTrapDoor extends CraftBlockData implements TrapDoor { + private static final EnumProperty 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..4e54dc67a1 --- /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.3") +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..4f0de11a24 --- /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.3") +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..0ae97d3903 --- /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.3") +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..ed3934d065 --- /dev/null +++ b/paper-generator/generatedServer/org/bukkit/craftbukkit/block/impl/CraftWitherWallSkull.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.core.Direction; +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.EnumProperty; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.type.WallSkull; +import org.bukkit.craftbukkit.block.data.CraftBlockData; + +@GeneratedFrom("1.21.3") +public class CraftWitherWallSkull extends CraftBlockData implements WallSkull { + private static final EnumProperty 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..d907a1fb23 --- /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.3 + .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.3 + .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..5727c31164 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/Main.java @@ -0,0 +1,108 @@ +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.ExperimentalCollector; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import net.minecraft.SharedConstants; +import net.minecraft.commands.Commands; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.LayeredRegistryAccess; +import net.minecraft.core.Registry; +import net.minecraft.core.RegistryAccess; +import net.minecraft.resources.RegistryDataLoader; +import net.minecraft.server.Bootstrap; +import net.minecraft.server.RegistryLayer; +import net.minecraft.server.ReloadableServerResources; +import net.minecraft.server.packs.PackType; +import net.minecraft.server.packs.repository.Pack; +import net.minecraft.server.packs.repository.PackRepository; +import net.minecraft.server.packs.repository.ServerPacksSource; +import net.minecraft.server.packs.resources.MultiPackResourceManager; +import net.minecraft.tags.TagKey; +import net.minecraft.tags.TagLoader; +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(); + List> pendingTags = TagLoader.loadTagsForExistingRegistries(resourceManager, layers.getLayer(RegistryLayer.STATIC)); + List> worldGenLayer = TagLoader.buildUpdatedLookups(layers.getAccessForLoading(RegistryLayer.WORLDGEN), pendingTags); + RegistryAccess.Frozen frozenWorldgenRegistries = RegistryDataLoader.load(resourceManager, worldGenLayer, RegistryDataLoader.WORLDGEN_REGISTRIES); + layers = layers.replaceFrom(RegistryLayer.WORLDGEN, frozenWorldgenRegistries); + REGISTRY_ACCESS = layers.compositeAccess().freeze(); + ReloadableServerResources reloadableServerResources = ReloadableServerResources.loadResources( + resourceManager, + layers, + pendingTags, + FeatureFlags.VANILLA_SET, + Commands.CommandSelection.DEDICATED, + 0, + MoreExecutors.directExecutor(), + MoreExecutors.directExecutor() + ).join(); + reloadableServerResources.updateStaticRegistryTags(); + EXPERIMENTAL_TAGS = ExperimentalCollector.collectTags(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..00a88c5d4c --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/Rewriters.java @@ -0,0 +1,198 @@ +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.RegistryTagRewriter; +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.registry.PaperFeatureFlagMapping; +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.Map; +import javax.lang.model.SourceVersion; +import net.kyori.adventure.text.format.NamedTextColor; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.Registries; +import net.minecraft.tags.TagKey; +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.Salmon; +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.bukkit.tag.DamageTypeTags; +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.quoted; + +@NullMarked +public final class Rewriters { + + public static void bootstrap(PatternSourceSetRewriter apiSourceSet, PatternSourceSetRewriter serverSourceSet) { + apiSourceSet + .register("PotionType", PotionType.class, new EnumRegistryRewriter<>(Registries.POTION)) + .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("BoatStatus", Boat.Status.class, new EnumCloneRewriter<>(net.minecraft.world.entity.vehicle.Boat.Status.class)) + .register("FoxType", Fox.Type.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Fox.Variant.class)) + .register("SalmonVariant", Salmon.Variant.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Salmon.Variant.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(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("DamageTypeTags", DamageTypeTags.class, new RegistryTagRewriter<>(Registries.DAMAGE_TYPE, DamageType.class) { + + @Deprecated // spigot mistake + private static final Map RENAMES = Map.of( + "MACE_SMASH", "IS_MACE_SMASH" + ); + + @Override + protected String rewriteFieldName(TagKey tagKey) { + String keyedName = super.rewriteFieldName(tagKey); + return RENAMES.getOrDefault(keyedName, 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("Biome", Biome.class, new RegistryFieldRewriter<>(Registries.BIOME, "getBiome")) + .register("Fluid", Fluid.class, new RegistryFieldRewriter<>(Registries.FLUID, "getFluid")) + .register("Attribute", Attribute.class, new RegistryFieldRewriter<>(Registries.ATTRIBUTE, "getAttribute")) + .register("Sound", Sound.class, new RegistryFieldRewriter<>(Registries.SOUND_EVENT, "getSound")) + .register("Art", Art.class, new RegistryFieldRewriter<>(Registries.PAINTING_VARIANT, "getArt")) + .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")) + )) + .register("PaperFeatureFlagProviderImpl#FLAGS", Types.PAPER_FEATURE_FLAG_PROVIDER_IMPL, new PaperFeatureFlagMapping()); + 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..1b60fe16bc --- /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().listTags().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..05e16d933d --- /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.datacomponent.DataComponentType; +import io.papermc.paper.registry.data.EnchantmentRegistryEntry; +import io.papermc.paper.registry.data.GameEventRegistryEntry; +import io.papermc.paper.registry.data.PaintingVariantRegistryEntry; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.lang.reflect.Type; +import java.util.Arrays; +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 java.util.stream.Collectors; +import net.minecraft.core.Registry; +import net.minecraft.core.component.DataComponents; +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.enchantment.Enchantments; +import net.minecraft.world.item.equipment.trim.TrimMaterials; +import net.minecraft.world.item.equipment.trim.TrimPatterns; +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.levelgen.structure.BuiltinStructures; +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; + +@NullMarked +public final class RegistryEntries { + + // CraftBukkit entry where implementation start by "Craft" + private static RegistryEntry entry(ResourceKey> registryKey, Class holderElementsClass, Class apiClass) { + return entry(registryKey, holderElementsClass, apiClass, "Craft"); + } + + private static RegistryEntry entry(ResourceKey> registryKey, Class holderElementsClass, Class apiClass, String implPrefix) { + String name = io.papermc.typewriter.util.ClassHelper.retrieveFullNestedName(apiClass); + RegistryKeyField registryKeyField = (RegistryKeyField) REGISTRY_KEY_FIELDS.get(registryKey); + String[] classes = name.split("\\."); + if (classes.length == 0) { + return new RegistryEntry<>(registryKey, registryKeyField, holderElementsClass, apiClass, implPrefix.concat(apiClass.getSimpleName())); + } + + String implName = Arrays.stream(classes).map(implPrefix::concat).collect(Collectors.joining(".")); + return new RegistryEntry<>(registryKey, registryKeyField, holderElementsClass, apiClass, implName); + } + + private static RegistryEntry inconsistentEntry(ResourceKey> registryKey, Class holderElementsClass, Class apiClass, String implClass) { + return new RegistryEntry<>(registryKey, (RegistryKeyField) REGISTRY_KEY_FIELDS.get(registryKey), holderElementsClass, apiClass, implClass); + } + + 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.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), + entry(Registries.ATTRIBUTE, Attributes.class, Attribute.class), + entry(Registries.FLUID, Fluids.class, Fluid.class), + entry(Registries.SOUND_EVENT, SoundEvents.class, Sound.class).apiRegistryField("SOUNDS"), + inconsistentEntry(Registries.DATA_COMPONENT_TYPE, DataComponents.class, DataComponentType.class, "PaperComponentType").apiAccessor("of") + ); + + public static final List> DATA_DRIVEN = List.of( + entry(Registries.BIOME, Biomes.class, Biome.class).delayed(), + entry(Registries.STRUCTURE, BuiltinStructures.class, 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(), + entry(Registries.PAINTING_VARIANT, PaintingVariants.class, Art.class).apiRegistryBuilder(PaintingVariantRegistryEntry.Builder.class, "PaperPaintingVariantRegistryEntry.PaperBuilder").apiRegistryField("ART").delayed(), + entry(Registries.INSTRUMENT, Instruments.class, MusicInstrument.class).delayed() + ); + + public static final List> API_ONLY = List.of( + 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.MEMORY_MODULE_TYPE, MemoryModuleType.class, MemoryKey.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..9d4a9cc8c3 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/registry/RegistryEntry.java @@ -0,0 +1,192 @@ +package io.papermc.generator.registry; + +import com.google.common.base.Preconditions; +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 javax.lang.model.SourceVersion; +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 elementClass; + private final Class holderElementsClass; + + 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 String apiAccessor = ""; + private Optional apiRegistryField = Optional.empty(); + + private @Nullable Map, String> fieldNames; + + public RegistryEntry(ResourceKey> registryKey, RegistryKeyField registryKeyField, Class holderElementsClass, Class apiClass, String implClass) { + this.registryKey = registryKey; + this.registryKeyField = registryKeyField; + this.elementClass = registryKeyField.elementClass(); + this.holderElementsClass = holderElementsClass; + this.apiClass = apiClass; + this.implClass = implClass; + } + + public ResourceKey> registryKey() { + return this.registryKey; + } + + public Registry registry() { + return Main.REGISTRY_ACCESS.lookupOrThrow(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 apiAccessor(String name) { + Preconditions.checkArgument(SourceVersion.isIdentifier(name) && !SourceVersion.isKeyword(name), "Invalid accessor name"); + this.apiAccessor = name; + return this; + } + + public RegistryEntry withSerializationUpdater(String fieldName) { + this.fieldRename = fieldName; + return this; + } + + public boolean isDelayed() { + return this.delayed; + } + + public String apiAccessor() { + return this.apiAccessor; + } + + 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.elementClass.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.holderElementsClass.getDeclaredFields()) { + if (!ResourceKey.class.isAssignableFrom(field.getType()) && !Holder.Reference.class.isAssignableFrom(field.getType()) && !this.elementClass.isAssignableFrom(field.getType())) { + continue; + } + + if (ClassHelper.isStaticConstant(field, Modifier.PUBLIC)) { + ResourceKey key = null; + if (this.elementClass.isAssignableFrom(field.getType())) { + key = registry.getResourceKey(this.elementClass.cast(field.get(null))).orElseThrow(); + } else { + if (field.getGenericType() instanceof ParameterizedType complexType && complexType.getActualTypeArguments().length == 1 && + complexType.getActualTypeArguments()[0] == this.elementClass) { + + 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) { + 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..4ddc1bc9cc --- /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.SourceFile; +import io.papermc.typewriter.SourceRewriter; +import io.papermc.typewriter.context.IndentUnit; +import io.papermc.typewriter.context.SourcesMetadata; +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(SourcesMetadata.of(INDENT_UNIT)); + this.alternateOutput = alternateOutput; + } + + @VisibleForTesting + public SourcesMetadata getMetadata() { + return this.metadata; + } + + @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.metadata, 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..6c01870971 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/Types.java @@ -0,0 +1,26 @@ +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"); + + public static final ClassNamed PAPER_FEATURE_FLAG_PROVIDER_IMPL = ClassNamed.of("io.papermc.paper.world.flag", "PaperFeatureFlagProviderImpl"); + + public static final ClassNamed PAPER_SIMPLE_REGISTRY = ClassNamed.of("io.papermc.paper.registry", "PaperSimpleRegistry"); +} 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..63996011e3 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/EnumRegistryRewriter.java @@ -0,0 +1,80 @@ +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.experimental.ExperimentalCollector; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.typewriter.preset.EnumRewriter; +import io.papermc.typewriter.preset.model.EnumValue; +import java.util.Map; +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.generator.utils.Formatting.quoted; + +@NullMarked +public class EnumRegistryRewriter extends EnumRewriter> { + + private final Registry registry; + private final Supplier, SingleFlagHolder>> 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.lookupOrThrow(registryKey); + this.experimentalKeys = Suppliers.memoize(() -> ExperimentalCollector.collectDataDrivenElementIds(this.registry)); + this.isFilteredRegistry = FeatureElement.FILTERED_REGISTRIES.contains(registryKey); + this.hasKeyArgument = hasKeyArgument; + } + + @Override + protected Iterable> getValues() { + return this.registry.listElements().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 + return this.experimentalKeys.get().get(reference.key()); + } + 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..ede08c4a00 --- /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.generator.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/PaperFeatureFlagMapping.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/PaperFeatureFlagMapping.java new file mode 100644 index 0000000000..06287f65a0 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/PaperFeatureFlagMapping.java @@ -0,0 +1,30 @@ +package io.papermc.generator.rewriter.types.registry; + +import io.papermc.generator.utils.Formatting; +import io.papermc.typewriter.replace.SearchMetadata; +import io.papermc.typewriter.replace.SearchReplaceRewriter; +import java.util.Iterator; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.flag.FeatureFlags; +import org.bukkit.FeatureFlag; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public class PaperFeatureFlagMapping extends SearchReplaceRewriter { + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + Iterator flagIterator = FeatureFlags.REGISTRY.toNames(FeatureFlags.REGISTRY.allFlags()).stream().sorted(Formatting.alphabeticKeyOrder(ResourceLocation::getPath)).iterator(); + + while (flagIterator.hasNext()) { + ResourceLocation name = flagIterator.next(); + String keyedName = Formatting.formatKeyAsField(name.getPath()); + builder.append(metadata.indent()); + builder.append("%s.%s, %s.%s".formatted(FeatureFlag.class.getSimpleName(), keyedName, FeatureFlags.class.getSimpleName(), keyedName)); + if (flagIterator.hasNext()) { + builder.append(','); + } + 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..5e7c6ab332 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/PaperRegistriesRewriter.java @@ -0,0 +1,88 @@ +package io.papermc.generator.rewriter.types.registry; + +import com.google.common.base.CaseFormat; +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) { + if (entry.apiClass().isEnum()) { + builder.append(Types.PAPER_SIMPLE_REGISTRY.simpleName()).append("::").append(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, entry.registryKey().location().getPath())); + } else { + 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("::").append(entry.apiAccessor().equals("") ? "new" : entry.apiAccessor()); + 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..c2ca350571 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryFieldRewriter.java @@ -0,0 +1,133 @@ +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.experimental.ExperimentalCollector; +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.Map; +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.generator.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, SingleFlagHolder>> 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.lookupOrThrow(registryKey); + this.experimentalKeys = Suppliers.memoize(() -> ExperimentalCollector.collectDataDrivenElementIds(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.listElements().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 + return this.experimentalKeys.get().get(reference.key()); + } + return null; + } +} diff --git a/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryTagRewriter.java b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryTagRewriter.java new file mode 100644 index 0000000000..024c91743b --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/RegistryTagRewriter.java @@ -0,0 +1,89 @@ +package io.papermc.generator.rewriter.types.registry; + +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.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 net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.minecraft.tags.TagKey; +import org.bukkit.Keyed; +import org.bukkit.Tag; +import org.jspecify.annotations.NullMarked; +import org.slf4j.Logger; + +import static io.papermc.generator.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 RegistryTagRewriter extends SearchReplaceRewriter { + + private static final Logger LOGGER = LogUtils.getLogger(); + + private final Registry registry; + private final Class apiClass; + private final String fetchMethod = "getTag"; + + public RegistryTagRewriter(ResourceKey> registryKey, Class apiClass) { + this.registry = Main.REGISTRY_ACCESS.lookupOrThrow(registryKey); + this.apiClass = apiClass; + } + + @Override + public boolean registerFor(SourceFile file) { + ClassNamed holderClass = this.options.targetClass().orElse(file.mainClass()); + if (holderClass.knownClass() != null) { + try { + holderClass.knownClass().getDeclaredMethod(this.fetchMethod, String.class); + } catch (NoSuchMethodException e) { + LOGGER.error("Fetch method not found, skipping the rewriter for registry tag fields of {}", this.registry.key(), e); + return false; + } + } + + return super.registerFor(file); + } + + @Override + protected void insert(SearchMetadata metadata, StringBuilder builder) { + Iterator> keyIterator = this.registry.listTagIds().sorted(Formatting.alphabeticKeyOrder(reference -> reference.location().getPath())).iterator(); + + while (keyIterator.hasNext()) { + TagKey tagKey = keyIterator.next(); + + 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 %s ".formatted(PUBLIC, STATIC, FINAL)); + + builder.append("%s<%s>".formatted(Tag.class.getSimpleName(), this.apiClass.getSimpleName())).append(' ').append(this.rewriteFieldName(tagKey)); + builder.append(" = "); + builder.append(this.rewriteFieldValue(tagKey)); + builder.append(';'); + + builder.append('\n'); + if (keyIterator.hasNext()) { + builder.append('\n'); + } + } + } + + protected String rewriteFieldName(TagKey tagKey) { + return Formatting.formatKeyAsField(tagKey.location().getPath()); + } + + protected String rewriteFieldValue(TagKey tagKey) { + return "%s(%s)".formatted(this.fetchMethod, quoted(tagKey.location().getPath())); + } +} 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..b52f0c3144 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/registry/TagRewriter.java @@ -0,0 +1,89 @@ +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.generator.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) + // new TagRegistry("damage_types", DamageType.class, Registries.DAMAGE_TYPE) - separate in DamageTypeTags + }; + + @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.lookupOrThrow(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.listTagIds().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..9a496c75e1 --- /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.util.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..9639d3e8be --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/EntityTypeRewriter.java @@ -0,0 +1,169 @@ +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.generator.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.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 = new ArrayList<>(4); + arguments.add(quoted(path)); + arguments.add(toBukkitClass(reference).concat(".class")); + arguments.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..232cf52237 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/ItemTypeRewriter.java @@ -0,0 +1,27 @@ +package io.papermc.generator.rewriter.types.simple; + +import io.papermc.generator.rewriter.types.registry.RegistryFieldRewriter; +import io.papermc.typewriter.util.ClassHelper; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.Registries; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; +import org.bukkit.inventory.ItemType; +import org.bukkit.inventory.meta.ItemMeta; + +@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()); + } +} 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..7a3a55eaf1 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MapPaletteRewriter.java @@ -0,0 +1,30 @@ +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 = new Color(mapColor.calculateARGBColor(brightness), true); + 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'); + } + } + } +} 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..1c8d49a315 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/MaterialRewriter.java @@ -0,0 +1,148 @@ +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.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.Item; +import net.minecraft.world.item.equipment.Equippable; +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 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.listElements().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.listElements().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(); + 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 + } + } + + 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.listElements().forEach(reference -> { + Equippable equippable = reference.value().components().get(DataComponents.EQUIPPABLE); + net.minecraft.world.entity.EquipmentSlot slot = equippable == null ? defaultValue : equippable.slot(); + 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..d2212a315d --- /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.generator.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..bd69165f08 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/StatisticRewriter.java @@ -0,0 +1,170 @@ +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.generator.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.listElements().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.listElements().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..077392d0e8 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/rewriter/types/simple/VillagerProfessionRewriter.java @@ -0,0 +1,136 @@ +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.sequence.SequenceTokens; +import io.papermc.typewriter.parser.sequence.TokenTaskBuilder; +import io.papermc.typewriter.parser.token.CharSequenceBlockToken; +import io.papermc.typewriter.parser.token.CharSequenceToken; +import io.papermc.typewriter.parser.token.TokenType; +import io.papermc.typewriter.replace.SearchMetadata; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Predicate; +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; + +@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 static class ConstantInfo { + private @MonotonicNonNull String constantName; + private @MonotonicNonNull List javadocs; + + public void constantName(String name) { + this.constantName = name; + } + + public void javadocs(List javadocs) { + this.javadocs = javadocs; + } + + public String constantName() { + return this.constantName; + } + + public List javadocs() { + return this.javadocs; + } + + public boolean isComplete() { + return this.constantName != null && this.javadocs != null; + } + } + + private Map> parseConstantJavadocs(String content) { + Map> map = new HashMap<>(); + + Lexer lex = new Lexer(content.toCharArray()); + SequenceTokens.wrap(lex, FORMAT_TOKENS) + .group(action -> { + ConstantInfo info = new ConstantInfo(); + action + .map(TokenType.JAVADOC, token -> { + info.javadocs(((CharSequenceBlockToken) token).value()); + }, TokenTaskBuilder::asOptional) + .skipQualifiedName(Predicate.isEqual(TokenType.JAVADOC)) + .map(TokenType.IDENTIFIER, token -> { + info.constantName(((CharSequenceToken) token).value()); + }) + .skip(TokenType.IDENTIFIER) + .skipClosure(TokenType.LPAREN, TokenType.RPAREN, true) + .map(TokenType.SECO, $ -> { + if (info.isComplete()) { + map.put(info.constantName(), info.javadocs()); + } + }); + }, TokenTaskBuilder::asRepeatable) + .execute(); + /* + for enums: + Set endMarkers = Set.of(TokenType.CO, TokenType.SECO); // move to static + SequenceTokens.wrap(lex, FORMAT_TOKENS) + .group(action -> { + ConstantInfo info = new ConstantInfo(); + action + .map(TokenType.JAVADOC, token -> { + info.javadocs(((CharSequenceBlockToken) token).value()); + }, TokenTaskBuilder::asOptional) + .map(TokenType.IDENTIFIER, token -> { + info.constantName(((CharSequenceToken) token).value()); + }) + .skipClosure(TokenType.LPAREN, TokenType.RPAREN, true) + .skipClosure(TokenType.LSCOPE, TokenType.RSCOPE, true) + .map(endMarkers::contains, $ -> { + // this part will probably fail for the last entry for enum without end (,;) + if (info.isComplete()) { + map.put(info.constantName(), info.javadocs()); + } + }); + }, TokenTaskBuilder::asRepeatable) + .execute(); + */ + + return map; + } + + @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..013f7f643e --- /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.util.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/OverriddenClassGenerator.java b/paper-generator/src/main/java/io/papermc/generator/types/OverriddenClassGenerator.java new file mode 100644 index 0000000000..2a66cf16d2 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/OverriddenClassGenerator.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 OverriddenClassGenerator extends SimpleGenerator { + + private static final Logger LOGGER = LogUtils.getLogger(); + + protected final Class baseClass; + protected boolean printWarningOnMissingOverride; + + protected OverriddenClassGenerator(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/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 3608b449f8..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,14 +22,15 @@ 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/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..5e55153cc2 --- /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.OverriddenClassGenerator; +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 OverriddenClassGenerator { + + 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.getFirst(), 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..5d5fb8c8be --- /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.craftblockdata.CraftBlockDataGenerator; +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, CraftBlockDataGenerator 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..60c93f27a9 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/PropertyWriter.java @@ -0,0 +1,88 @@ +package io.papermc.generator.types.craftblockdata.property; + +import com.google.common.base.Suppliers; +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.craftblockdata.CraftBlockDataGenerator; +import io.papermc.generator.types.craftblockdata.property.appender.PropertyAppenders; +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.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)"; + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, CraftBlockDataGenerator generator, NamingManager naming) { + PropertyAppenders.ifPresent(this.property, appender -> appender.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..b1e149e75b --- /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.craftblockdata.CraftBlockDataGenerator; +import io.papermc.generator.utils.NamingManager; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public interface AppenderBase { + + void addExtras(TypeSpec.Builder builder, FieldSpec field, CraftBlockDataGenerator 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..0898c37475 --- /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.craftblockdata.CraftBlockDataGenerator; +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, CraftBlockDataGenerator 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/appender/PropertyAppenders.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/PropertyAppenders.java new file mode 100644 index 0000000000..9ddfe158c6 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/appender/PropertyAppenders.java @@ -0,0 +1,33 @@ +package io.papermc.generator.types.craftblockdata.property.appender; + +import java.util.Map; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +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 final class PropertyAppenders { + + private static final Map, AppenderBase> APPENDERS = Stream.of( + new EnumValuesAppender<>(BlockStateProperties.AXIS, Axis.class, "getAxes"), + new EnumValuesAppender<>(BlockStateProperties.HORIZONTAL_AXIS, Axis.class, "getAxes"), + new EnumValuesAppender<>(BlockStateProperties.FACING, BlockFace.class, "getFaces"), + new EnumValuesAppender<>(BlockStateProperties.HORIZONTAL_FACING, BlockFace.class, "getFaces"), + new EnumValuesAppender<>(BlockStateProperties.FACING_HOPPER, BlockFace.class, "getFaces"), + new EnumValuesAppender<>(BlockStateProperties.RAIL_SHAPE, Rail.Shape.class, "getShapes"), + new EnumValuesAppender<>(BlockStateProperties.RAIL_SHAPE_STRAIGHT, Rail.Shape.class, "getShapes"), + new EnumValuesAppender<>(BlockStateProperties.VERTICAL_DIRECTION, BlockFace.class, "getVerticalDirections") + ).collect(Collectors.toUnmodifiableMap(PropertyAppender::getProperty, key -> key)); + + public static void ifPresent(Property property, Consumer callback) { + if (APPENDERS.containsKey(property)) { + callback.accept(APPENDERS.get(property)); + } + } +} 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..f4c3205c84 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converter.java @@ -0,0 +1,13 @@ +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(); + + @Override + 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..ee2f8d3d5f --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/converter/Converters.java @@ -0,0 +1,25 @@ +package io.papermc.generator.types.craftblockdata.property.converter; + +import io.papermc.generator.types.craftblockdata.property.PropertyMaker; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; +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 = Stream.of( + new RotationConverter(), + new NoteConverter() + ).collect(Collectors.toUnmodifiableMap(Converter::getProperty, key -> key)); + + public static ConverterBase getOrDefault(Property property, PropertyMaker maker) { + return CONVERTERS.getOrDefault(property, maker); + } + + public static boolean has(Property property) { + return CONVERTERS.containsKey(property); + } +} 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..965b26e7e6 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/DataPropertyWriter.java @@ -0,0 +1,162 @@ +package io.papermc.generator.types.craftblockdata.property.holder; + +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.Types; +import io.papermc.generator.types.craftblockdata.CraftBlockDataGenerator; +import io.papermc.generator.types.craftblockdata.property.converter.ConverterBase; +import io.papermc.generator.types.craftblockdata.property.holder.appender.DataAppenders; +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.ChiseledBookShelfBlock; +import net.minecraft.world.level.block.MossyCarpetBlock; +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 record FieldKey(Class blockClass, String fieldName) { + } + + private static FieldKey key(Class blockClass, String fieldName) { + return new FieldKey(blockClass, fieldName); + } + + private static final Map FIELD_TO_BASE_NAME = Map.of( + BlockStateMapping.PIPE_FIELD_NAME, "FACE" + ); + + private static final Map FIELD_TO_BASE_NAME_SPECIFICS = Map.of( + key(ChiseledBookShelfBlock.class, "SLOT_OCCUPIED_PROPERTIES"), "SLOT_OCCUPIED", + key(MossyCarpetBlock.class, "PROPERTY_BY_DIRECTION"), "HEIGHT" + ); + + protected final Field field; + protected @MonotonicNonNull 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(); + + FieldKey key = key(this.blockClass, constantName); + if (FIELD_TO_BASE_NAME_SPECIFICS.containsKey(key)) { + return FIELD_TO_BASE_NAME_SPECIFICS.get(key); + } + + 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; + } + + @Override + public void addExtras(TypeSpec.Builder builder, FieldSpec field, ParameterSpec indexParameter, ConverterBase childConverter, CraftBlockDataGenerator generator, NamingManager naming) { + DataAppenders.ifPresent(this.type, appender -> appender.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..df7ef4cfda --- /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.craftblockdata.CraftBlockDataGenerator; +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, CraftBlockDataGenerator 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..88853a234f --- /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.craftblockdata.CraftBlockDataGenerator; +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, CraftBlockDataGenerator 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..3d42772f69 --- /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.craftblockdata.CraftBlockDataGenerator; +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, CraftBlockDataGenerator generator, NamingManager naming); +} diff --git a/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/DataAppenders.java b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/DataAppenders.java new file mode 100644 index 0000000000..fb484ff56b --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/appender/DataAppenders.java @@ -0,0 +1,24 @@ +package io.papermc.generator.types.craftblockdata.property.holder.appender; + +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import java.util.Map; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class DataAppenders { + + private static final Map APPENDERS = Stream.of( + new ArrayAppender(), + new ListAppender(), + new MapAppender() + ).collect(Collectors.toUnmodifiableMap(DataAppender::getType, key -> key)); + + public static void ifPresent(DataHolderType type, Consumer callback) { + if (APPENDERS.containsKey(type)) { + callback.accept(APPENDERS.get(type)); + } + } +} 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..67c4d72bac --- /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.craftblockdata.CraftBlockDataGenerator; +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, CraftBlockDataGenerator 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..f7ebd43ffd --- /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.craftblockdata.CraftBlockDataGenerator; +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, CraftBlockDataGenerator 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..cfe7e37d4e --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/craftblockdata/property/holder/converter/DataConverters.java @@ -0,0 +1,25 @@ +package io.papermc.generator.types.craftblockdata.property.holder.converter; + +import io.papermc.generator.types.craftblockdata.property.holder.DataHolderType; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.jspecify.annotations.NullMarked; + +@NullMarked +public final class DataConverters { + + private static final Map CONVERTERS = Stream.of( + new ArrayConverter(), + new ListConverter(), + new MapConverter() + ).collect(Collectors.toUnmodifiableMap(DataConverter::getType, key -> key)); + + public static DataConverter getOrThrow(DataHolderType type) { + DataConverter converter = CONVERTERS.get(type); + if (converter == null) { + throw new IllegalStateException("Cannot handle data holder type: " + type); + } + return 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 76% 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 abcc93e61a..0740f0d3bd 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 @@ -3,7 +3,6 @@ package io.papermc.generator.types.goal; 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; @@ -16,28 +15,29 @@ 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.util.ClassHelper; import java.util.Comparator; import java.util.List; +import java.util.stream.Stream; 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.Mob; -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 @@ -51,9 +51,8 @@ public class MobGoalGenerator extends SimpleGenerator { .addJavadoc(CLASS_HEADER); TypeName mobType = ParameterizedTypeName.get(ClassName.get(Class.class), type); - TypeName keyType = TypeName.get(String.class); - ParameterSpec keyParam = ParameterSpec.builder(keyType, "key", FINAL).build(); + ParameterSpec keyParam = ParameterSpec.builder(String.class, "key", FINAL).build(); ParameterSpec typeParam = ParameterSpec.builder(mobType, "type", FINAL).build(); MethodSpec.Builder createMethod = MethodSpec.methodBuilder("create") .addModifiers(PRIVATE, STATIC) @@ -68,33 +67,25 @@ public class MobGoalGenerator extends SimpleGenerator { classes = scanResult.getSubclasses(Goal.class.getName()).loadClasses(Goal.class); } - List> vanillaNames = classes.stream() + Stream> 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(); + vanillaGoals.forEach(goalKey -> { + 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()); - } + }); return typeBuilder.addMethod(createMethod.build()).build(); } - - @Override - protected JavaFile.Builder file(JavaFile.Builder builder) { - return builder; - } } 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 07c6d50719..a14a1007e4 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,109 +103,86 @@ 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.monster.creaking.Creaking.class, org.bukkit.entity.Creaking.class); - bukkitMap.put(net.minecraft.world.entity.monster.creaking.CreakingTransient.class, org.bukkit.entity.CreakingTransient.class); - bukkitMap.put(net.minecraft.world.entity.animal.AgeableWaterCreature.class, org.bukkit.entity.Squid.class); // close enough + 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); + bukkitMap.put(net.minecraft.world.entity.monster.creaking.Creaking.class, Creaking.class); + bukkitMap.put(net.minecraft.world.entity.monster.creaking.CreakingTransient.class, CreakingTransient.class); + bukkitMap.put(net.minecraft.world.entity.animal.AgeableWaterCreature.class, Squid.class); // close enough // } - 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; + private static String getPathName(String name) { + String pathName = name.substring(name.lastIndexOf('.') + 1); + boolean needDeobfMap = 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; + 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! } - 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("_", ""); + 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 (flag && !deobfuscationMap.containsKey(name.toLowerCase(Locale.ROOT)) && !ignored.contains(name)) { - System.out.println("need to map " + original + " (" + name.toLowerCase(Locale.ROOT) + ")"); + 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); @@ -323,11 +191,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..c56411ae56 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/types/registry/GeneratedKeyType.java @@ -0,0 +1,139 @@ +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.experimental.ExperimentalCollector; +import io.papermc.generator.utils.experimental.SingleFlagHolder; +import io.papermc.paper.registry.RegistryKey; +import io.papermc.paper.registry.TypedKey; +import java.util.Map; +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, SingleFlagHolder>> 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(() -> ExperimentalCollector.collectDataDrivenElementIds(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.listElements().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"); + } + + 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 + return this.experimentalKeys.get().get(reference.key()); + } + 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..44c47094a5 --- /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.listTagIds().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..47322695e4 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/Annotations.java @@ -0,0 +1,48 @@ +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; + +@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 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(); + 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( + suppressWarnings("unused", "SpellCheckingInspection"), + 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..f8e7cf20d9 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/BlockStateMapping.java @@ -0,0 +1,510 @@ +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.CreakingHeartBlock; +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.CreakingHeart; +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) + .put(CreakingHeartBlock.CreakingHeartState.class, CreakingHeart.Creaking.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..51e3df843e --- /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 @Nullable Class classOr(String className, @Nullable 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-generator/src/main/java/io/papermc/generator/utils/Formatting.java b/paper-generator/src/main/java/io/papermc/generator/utils/Formatting.java new file mode 100644 index 0000000000..e571a785f2 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/Formatting.java @@ -0,0 +1,111 @@ +package io.papermc.generator.utils; + +import java.util.Optional; +import org.apache.commons.lang3.math.NumberUtils; +import java.util.Comparator; +import java.util.Locale; +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.jspecify.annotations.NullMarked; + +@NullMarked +public final class Formatting { + + private static final Pattern ILLEGAL_FIELD_CHARACTERS = Pattern.compile("[.-/]"); + + public static String formatKeyAsField(String path) { + 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) { + int tagsIndex = resourcePath.indexOf(tagDir); + int dotIndex = resourcePath.lastIndexOf('.'); + if (tagsIndex == -1 || dotIndex == -1) { + return Optional.empty(); + } + return Optional.of(resourcePath.substring(tagsIndex + tagDir.length() + 1, dotIndex)); // namespace/tags/registry_key/[tag_key].json + } + + public static String quoted(String value) { + return "\"" + value + "\""; + } + + 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 final Comparator ALPHABETIC_KEY_ORDER = alphabeticKeyOrder(path -> path); + + public static Comparator alphabeticKeyOrder(Function mapper) { + return (o1, o2) -> { + String path1 = mapper.apply(o1); + String path2 = mapper.apply(o2); + + OptionalInt trailingInt1 = tryParseTrailingInt(path1); + OptionalInt trailingInt2 = tryParseTrailingInt(path2); + + if (trailingInt1.isPresent() && trailingInt2.isPresent()) { + return Integer.compare(trailingInt1.getAsInt(), trailingInt2.getAsInt()); + } + + return path1.compareTo(path2); + }; + } + + private static OptionalInt tryParseTrailingInt(String path) { + int delimiterIndex = path.lastIndexOf('_'); + if (delimiterIndex != -1) { + String score = path.substring(delimiterIndex + 1); + if (NumberUtils.isDigits(score)) { + return OptionalInt.of(Integer.parseInt(score)); + } + } + return OptionalInt.empty(); + } + + private Formatting() { + } +} 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-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 51% 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 c2fbaa2a05..c360dc6faf 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, resourceKey); + public Holder.Reference register(ResourceKey key, T value, Lifecycle lifecycle) { + this.registered.add(key); + return Holder.Reference.createStandAlone(this.registry, key); } @Override - public HolderGetter lookup(final ResourceKey> resourceKey) { - return Main.REGISTRY_ACCESS.lookupOrThrow(resourceKey); + public HolderGetter lookup(ResourceKey> key) { + return Main.REGISTRY_ACCESS.lookupOrThrow(key); } } diff --git a/paper-generator/src/main/java/io/papermc/generator/utils/experimental/ExperimentalCollector.java b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/ExperimentalCollector.java new file mode 100644 index 0000000000..b8ad105e8c --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/ExperimentalCollector.java @@ -0,0 +1,134 @@ +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.Collection; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.stream.Collectors; +import net.minecraft.core.Registry; +import net.minecraft.core.RegistryAccess; +import net.minecraft.core.RegistrySetBuilder; +import net.minecraft.core.registries.Registries; +import net.minecraft.data.registries.TradeRebalanceRegistries; +import net.minecraft.data.registries.VanillaRegistries; +import net.minecraft.data.registries.WinterDropRegistries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.server.packs.PackResources; +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.jspecify.annotations.Nullable; +import org.slf4j.Logger; + +@NullMarked +public final class ExperimentalCollector { + + private static final Logger LOGGER = LogUtils.getLogger(); + + 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 EXPERIMENTAL_REGISTRY_FLAGS = Map.of( + // Update for Experimental API + WinterDropRegistries.BUILDER, FlagHolders.WINTER_DROP, + TradeRebalanceRegistries.BUILDER, FlagHolders.TRADE_REBALANCE + ); + + private static final Multimap>, Map.Entry>> EXPERIMENTAL_REGISTRY_ENTRIES; + static { + EXPERIMENTAL_REGISTRY_ENTRIES = HashMultimap.create(); + for (Map.Entry entry : EXPERIMENTAL_REGISTRY_FLAGS.entrySet()) { + for (RegistrySetBuilder.RegistryStub stub : entry.getKey().entries) { + EXPERIMENTAL_REGISTRY_ENTRIES.put(stub.key(), Map.entry(entry.getValue(), stub.bootstrap())); + } + } + } + + @SuppressWarnings("unchecked") + public static Map, SingleFlagHolder> collectDataDrivenElementIds(Registry registry) { + Collection>> experimentalEntries = EXPERIMENTAL_REGISTRY_ENTRIES.get(registry.key()); + if (experimentalEntries.isEmpty()) { + return Collections.emptyMap(); + } + + Map, SingleFlagHolder> result = new IdentityHashMap<>(); + for (Map.Entry> experimentalEntry : experimentalEntries) { + RegistrySetBuilder.RegistryBootstrap experimentalBootstrap = (RegistrySetBuilder.RegistryBootstrap) experimentalEntry.getValue(); + Set> experimental = Collections.newSetFromMap(new IdentityHashMap<>()); + CollectingContext experimentalCollector = new CollectingContext<>(experimental, registry); + experimentalBootstrap.run(experimentalCollector); + result.putAll(experimental.stream().collect(Collectors.toMap(key -> key, key -> experimentalEntry.getKey()))); + } + + 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); + result.keySet().removeAll(vanilla); + } + return result; + } + + // 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 + public static Map, String> collectTags(MultiPackResourceManager resourceManager) { + Map, String> result = new IdentityHashMap<>(); + + // collect all vanilla tags + Multimap>, String> vanillaTags = HashMultimap.create(); + PackResources vanillaPack = resourceManager.listPacks() + .filter(packResources -> packResources.packId().equals(BuiltInPackSource.VANILLA_ID)) + .findFirst() + .orElseThrow(); + collectTagsFromPack(vanillaPack, (entry, path) -> vanillaTags.put(entry.key(), path)); + + // then distinct with other data-pack tags to know for sure newly created tags and so experimental one + resourceManager.listPacks().forEach(pack -> { + String packId = pack.packId(); + if (packId.equals(BuiltInPackSource.VANILLA_ID)) return; + + collectTagsFromPack(pack, (entry, path) -> { + if (vanillaTags.get(entry.key()).contains(path)) { + return; + } + + result.put(entry.value().listTagIds() + .filter(tagKey -> tagKey.location().getPath().equals(path)) + .findFirst() + .orElseThrow(), packId); + }); + }); + return Collections.unmodifiableMap(result); + } + + private static void collectTagsFromPack(PackResources pack, BiConsumer, String> output) { + Set namespaces = pack.getNamespaces(PackType.SERVER_DATA); + + for (String namespace : namespaces) { + Main.REGISTRY_ACCESS.registries().forEach(entry -> { + // this is probably expensive but can't find another way around and data-pack loader has similar logic + // the issue is that registry key can have parent/key but tag key can also have parent/key so parsing become a mess + // without having at least one of the two values + String tagDir = Registries.tagsDirPath(entry.key()); + pack.listResources(PackType.SERVER_DATA, namespace, tagDir, (id, supplier) -> { + Formatting.formatTagKey(tagDir, id.getPath()).ifPresentOrElse(path -> output.accept(entry, path), () -> { + LOGGER.warn("Unable to parse the path: {}/{}/{}.json in the data-pack {} into a tag key", namespace, tagDir, id.getPath(), pack.packId()); + }); + }); + }); + } + } + + private ExperimentalCollector() { + } +} 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..2a736de1e0 --- /dev/null +++ b/paper-generator/src/main/java/io/papermc/generator/utils/experimental/FlagHolders.java @@ -0,0 +1,26 @@ +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; + +@NullMarked +public class FlagHolders { + + public static final SingleFlagHolder WINTER_DROP = SingleFlagHolder.fromValue(FeatureFlags.WINTER_DROP); + public static final SingleFlagHolder TRADE_REBALANCE = SingleFlagHolder.fromValue(FeatureFlags.TRADE_REBALANCE); + public static final SingleFlagHolder REDSTONE_EXPERIMENTS = SingleFlagHolder.fromValue(FeatureFlags.REDSTONE_EXPERIMENTS); + public static final SingleFlagHolder MINECART_IMPROVEMENTS = SingleFlagHolder.fromValue(FeatureFlags.MINECART_IMPROVEMENTS); + + static final Map ANNOTATION_EQUIVALENT = Util.make(new HashMap(), map -> { + map.put(WINTER_DROP, MinecraftExperimental.Requires.WINTER_DROP); + map.put(TRADE_REBALANCE, MinecraftExperimental.Requires.TRADE_REBALANCE); + map.put(REDSTONE_EXPERIMENTS, MinecraftExperimental.Requires.REDSTONE_EXPERIMENTS); + map.put(MINECART_IMPROVEMENTS, MinecraftExperimental.Requires.MINECART_IMPROVEMENTS); + }).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..d97a4a5926 --- /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-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..39d2bb95f7 --- /dev/null +++ b/paper-generator/src/test/java/io/papermc/generator/BlockStatePropertyTest.java @@ -0,0 +1,75 @@ +package io.papermc.generator; + +import io.papermc.generator.utils.BlockStateMapping; +import java.lang.invoke.MethodHandles; +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.List; +import java.util.Map; +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.MossyCarpetBlock; +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.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +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); + } + } + + @Test + public void testReferences() throws NoSuchFieldException, IllegalAccessException { + // if renamed should change DataPropertyWriter#FIELD_TO_BASE_NAME/FIELD_TO_BASE_NAME_SPECIFICS + MethodHandles.Lookup lookup = MethodHandles.lookup(); + lookup.findStaticVarHandle(ChiseledBookShelfBlock.class, "SLOT_OCCUPIED_PROPERTIES", List.class); + lookup.findStaticVarHandle(PipeBlock.class, "PROPERTY_BY_DIRECTION", Map.class); + MethodHandles.privateLookupIn(MossyCarpetBlock.class, lookup).findStaticVarHandle(MossyCarpetBlock.class, "PROPERTY_BY_DIRECTION", Map.class); + } + + @Test + public void testBridge() { + Set missingApiEquivalents = new HashSet<>(); + for (Class> value : ENUM_PROPERTY_VALUES) { + if (!BlockStateMapping.ENUM_BRIDGE.containsKey(value)) { + missingApiEquivalents.add(value.getCanonicalName()); + } + } + + Assertions.assertTrue(missingApiEquivalents.isEmpty(), () -> "Missing some api equivalent in the block state mapping enum bridge (BlockStateMapping#ENUM_BRIDGE) : " + String.join(", ", missingApiEquivalents)); + } +} 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 74% 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..56052d6b58 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,21 +3,21 @@ 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; +import static org.junit.jupiter.api.Assertions.assertTrue; public class MobGoalConverterTest { @Test public void testBukkitMap() { final List> classes; - try (ScanResult scanResult = new ClassGraph().enableAllInfo().whitelistPackages(Entity.class.getPackageName()).scan()) { + try (ScanResult scanResult = new ClassGraph().enableClassInfo().whitelistPackages(Entity.class.getPackageName()).scan()) { classes = scanResult.getSubclasses(Mob.class.getName()).loadClasses(Mob.class); } @@ -30,8 +30,6 @@ public class MobGoalConverterTest { } } - if (!missingClasses.isEmpty()) { - fail("Missing some entity classes in the bukkit map: " + String.join(", ", missingClasses)); - } + assertTrue(missingClasses.isEmpty(), () -> "Missing some entity classes in the bukkit map: " + String.join(", ", missingClasses)); } } diff --git a/paper-generator/src/test/java/io/papermc/generator/RegistryMigrationTest.java b/paper-generator/src/test/java/io/papermc/generator/RegistryMigrationTest.java new file mode 100644 index 0000000000..61a2648438 --- /dev/null +++ b/paper-generator/src/test/java/io/papermc/generator/RegistryMigrationTest.java @@ -0,0 +1,50 @@ +package io.papermc.generator; + +import io.papermc.generator.registry.RegistryEntries; +import io.papermc.generator.registry.RegistryEntry; +import java.util.HashSet; +import java.util.Set; +import net.minecraft.SharedConstants; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.server.Bootstrap; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +public class RegistryMigrationTest { + + @BeforeAll + public static void setup() { + SharedConstants.tryDetectVersion(); + Bootstrap.bootStrap(); + Bootstrap.validate(); + } + + @Test + public void testBuiltInToDataDriven() { + Set migratedRegistries = new HashSet<>(); + for (RegistryEntry entry : RegistryEntries.BUILT_IN) { + ResourceKey> key = entry.registryKey(); + if (!BuiltInRegistries.REGISTRY.containsKey(key.location())) { + migratedRegistries.add(key.toString()); + } + } + + Assertions.assertTrue(migratedRegistries.isEmpty(), () -> "Some registries have become data-driven: %s".formatted(String.join(", ", migratedRegistries))); + } + + @Test + public void testDataDrivenToBuiltIn() { // shouldn't really happen but just in case + Set migratedRegistries = new HashSet<>(); + for (RegistryEntry entry : RegistryEntries.DATA_DRIVEN) { + ResourceKey> key = entry.registryKey(); + if (BuiltInRegistries.REGISTRY.containsKey(key.location())) { + migratedRegistries.add(key.toString()); + } + } + + Assertions.assertTrue(migratedRegistries.isEmpty(), () -> "Some registries have become built-in: %s".formatted(String.join(", ", migratedRegistries))); + } +} 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..cf2187a63c --- /dev/null +++ b/paper-generator/src/test/java/io/papermc/generator/rewriter/OldGeneratedCodeTest.java @@ -0,0 +1,119 @@ +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.SourceFile; +import io.papermc.typewriter.SourceRewriter; +import io.papermc.typewriter.context.FileMetadata; +import io.papermc.typewriter.context.IndentUnit; +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.metadata().flatMap(FileMetadata::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.searchStartMarker(lineIterator, indentUnit, rewriters); + 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-api-generator/wideners.at b/paper-generator/wideners.at similarity index 57% rename from paper-api-generator/wideners.at rename to paper-generator/wideners.at index 6c8ce1529e..8400c80eea 100644 --- a/paper-api-generator/wideners.at +++ b/paper-generator/wideners.at @@ -1,6 +1,11 @@ +public net/minecraft/world/level/material/MapColor MATERIAL_COLORS +public net/minecraft/world/level/block/state/properties/IntegerProperty min + # for auto-marking experimental stuff public net/minecraft/core/RegistrySetBuilder entries public net/minecraft/core/RegistrySetBuilder$RegistryStub public net/minecraft/data/registries/VanillaRegistries BUILDER public net/minecraft/data/registries/WinterDropRegistries BUILDER public net/minecraft/data/registries/TradeRebalanceRegistries BUILDER +public net/minecraft/world/flag/FeatureFlagRegistry names +public net/minecraft/world/flag/FeatureFlagSet mask diff --git a/patches/api/0004-Code-Generation.patch b/patches/api/0004-Code-Generation.patch index b5b2313958..0f6126f4ea 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 c7f660d52e1b5f085919a8aebf8476918705a391..89208fed89181f890bb7a2bb237ed744ec2aea96 100644 +index c7f660d52e1b5f085919a8aebf8476918705a391..574a6d56b968ea8165ea9cbe5e803a4fbf67bf49 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ @@ -23,16 +23,16 @@ index c7f660d52e1b5f085919a8aebf8476918705a391..89208fed89181f890bb7a2bb237ed744 } +// 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 c7f660d52e1b5f085919a8aebf8476918705a391..89208fed89181f890bb7a2bb237ed744 +} +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/0501-fix-memory-keys-use-of-generics.patch b/patches/api/0501-fix-memory-keys-use-of-generics.patch new file mode 100644 index 0000000000..6a8c098f2a --- /dev/null +++ b/patches/api/0501-fix-memory-keys-use-of-generics.patch @@ -0,0 +1,80 @@ +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 d55c33ca14257be5005520e18e465da87a58dbaf..5c9ca6738e48c70538c8b5a3d454c7318fc419ef 100644 +--- a/src/main/java/org/bukkit/Registry.java ++++ b/src/main/java/org/bukkit/Registry.java +@@ -305,24 +305,24 @@ 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 MemoryKey getOrThrow(@NotNull NamespacedKey key) { +- MemoryKey memoryKey = get(key); ++ public MemoryKey getOrThrow(@NotNull NamespacedKey key) { ++ MemoryKey memoryKey = get(key); + + Preconditions.checkArgument(memoryKey != null, "No MemoryKey registry entry found for key %s.", key); + +@@ -331,7 +331,7 @@ public interface Registry extends Iterable { + + @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/0502-Code-generation-marker-stub.patch b/patches/api/0502-Code-generation-marker-stub.patch new file mode 100644 index 0000000000..c236adf107 --- /dev/null +++ b/patches/api/0502-Code-generation-marker-stub.patch @@ -0,0 +1,1132 @@ +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 40deffbd0930508bb04e9aedfd62ad2144855198..22b247fbb79135e1091bd7d62f721781edec6e2a 100644 +--- a/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java ++++ b/src/main/java/io/papermc/paper/registry/event/RegistryEvents.java +@@ -20,9 +20,11 @@ import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create; + @NullMarked + 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); + public static final RegistryEventProvider PAINTING_VARIANT = create(RegistryKey.PAINTING_VARIANT); ++ // 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 ed2263450e98460250e431d2ee6debd03204c175..b3a61cf019781f8351ba3805080ca50c767abb40 100644 +--- a/src/main/java/org/bukkit/Art.java ++++ b/src/main/java/org/bukkit/Art.java +@@ -17,7 +17,7 @@ import org.jetbrains.annotations.Nullable; + * which can be accessed via {@link Registry#ART}. + */ + public interface Art extends OldEnum, Keyed { +- ++ // Paper start - Generated/Art + Art KEBAB = getArt("kebab"); + Art AZTEC = getArt("aztec"); + Art ALBAN = getArt("alban"); +@@ -68,6 +68,7 @@ public interface Art extends OldEnum, Keyed { + Art POND = getArt("pond"); + Art SUNFLOWERS = getArt("sunflowers"); + Art TIDES = getArt("tides"); ++ // Paper end - Generated/Art + + @NotNull + private static Art getArt(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/FeatureFlag.java b/src/main/java/org/bukkit/FeatureFlag.java +index 0acea3e8d639c252b44cd5da5e3584aa6e6c9b5c..b0d804055c1c007dadb19a1c3645b0bfa8d77f6b 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. + */ +@@ -34,12 +35,6 @@ public interface FeatureFlag extends Keyed { + @ApiStatus.Experimental // Paper - add missing annotation + FeatureFlag TRADE_REBALANCE = create("trade_rebalance"); + +- @Deprecated(since = "1.20") +- FeatureFlag UPDATE_1_20 = deprecated("update_1_20"); +- +- @Deprecated(since = "1.21") +- FeatureFlag UPDATE_121 = deprecated("update_1_21"); +- + @ApiStatus.Experimental // Paper - add missing annotation + FeatureFlag WINTER_DROP = create("winter_drop"); + +@@ -48,6 +43,13 @@ public interface FeatureFlag extends Keyed { + + @ApiStatus.Experimental // Paper - add missing annotation + FeatureFlag MINECART_IMPROVEMENTS = create("minecart_improvements"); ++ // 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. +diff --git a/src/main/java/org/bukkit/Fluid.java b/src/main/java/org/bukkit/Fluid.java +index a3ff4fefaf50f3e99a69ba68cbe8e30c95dac5df..8d9b852eaeba3be1d6241cfb5e524aa6169c3c57 100644 +--- a/src/main/java/org/bukkit/Fluid.java ++++ b/src/main/java/org/bukkit/Fluid.java +@@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull; + */ + public interface Fluid extends OldEnum, Keyed { + ++ // Paper start - Generated/Fluid + /** + * No fluid. + */ +@@ -31,6 +32,7 @@ public interface Fluid extends OldEnum, Keyed { + * Flowing lava. + */ + Fluid FLOWING_LAVA = getFluid("flowing_lava"); ++ // Paper end - Generated/Fluid + + @NotNull + private static Fluid getFluid(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/GameEvent.java b/src/main/java/org/bukkit/GameEvent.java +index e2c632afdf555418dd1dc6ad6c5d197670e2211a..16d7e0198b50f04203e0f8f02e0305dce190e303 100644 +--- a/src/main/java/org/bukkit/GameEvent.java ++++ b/src/main/java/org/bukkit/GameEvent.java +@@ -11,6 +11,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"); +@@ -20,42 +21,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"); +@@ -68,34 +45,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"); +@@ -111,6 +72,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 c6feb13c735fabbd08676fa8828ce0b9fd54da32..64a5006fb9175495250eb2094d0d092b7187cc84 100644 +--- a/src/main/java/org/bukkit/JukeboxSong.java ++++ b/src/main/java/org/bukkit/JukeboxSong.java +@@ -9,6 +9,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"); +@@ -28,6 +29,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 key) { +diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java +index c7ce8fa1ff9feda66d5a4e497112a24ff51c9d2b..8d39d1a1f4cd443b444d21231d603acdad327a13 100644 +--- a/src/main/java/org/bukkit/Material.java ++++ b/src/main/java/org/bukkit/Material.java +@@ -137,6 +137,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, 64), // Paper - air stacks to 64 + STONE(22948), + GRANITE(21091), +@@ -3843,6 +3844,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), +@@ -5203,6 +5207,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: +@@ -5330,6 +5335,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: +@@ -5560,6 +5566,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: +@@ -5624,6 +5631,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 84edda17692eca0f21eeb01a9eb94eba81c356ab..47d44d5dd0ff785227fe4a575fbb3955581966a9 100644 +--- a/src/main/java/org/bukkit/MusicInstrument.java ++++ b/src/main/java/org/bukkit/MusicInstrument.java +@@ -8,6 +8,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"); +@@ -16,6 +17,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 97c4fc9615e28c7268cd8340b50029c8f7de56b7..cc01193eab1d8da6ce50958cd66953771a6f7aeb 100644 +--- a/src/main/java/org/bukkit/Sound.java ++++ b/src/main/java/org/bukkit/Sound.java +@@ -22,6 +22,7 @@ import org.jetbrains.annotations.NotNull; + */ + public interface Sound extends OldEnum, Keyed, net.kyori.adventure.sound.Sound.Type { // Paper - implement Sound.Type + ++ // Paper start - Generated/Sound + Sound AMBIENT_BASALT_DELTAS_ADDITIONS = getSound("ambient.basalt_deltas.additions"); + Sound AMBIENT_BASALT_DELTAS_LOOP = getSound("ambient.basalt_deltas.loop"); + Sound AMBIENT_BASALT_DELTAS_MOOD = getSound("ambient.basalt_deltas.mood"); +@@ -1658,6 +1659,7 @@ public interface Sound extends OldEnum, Keyed, net.kyori.adventure.sound. + Sound UI_TOAST_OUT = getSound("ui.toast.out"); + Sound WEATHER_RAIN = getSound("weather.rain"); + Sound WEATHER_RAIN_ABOVE = getSound("weather.rain.above"); ++ // Paper end - Generated/Sound + + @NotNull + private static Sound getSound(@NotNull String 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 42f0501ae6a2d9297bdd9bb9ab2fbb02abb881f5..bbf4a2514c7b088e820f2c62deae8bfb546b731d 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. + */ +@@ -827,24 +823,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. + */ +@@ -1050,9 +1032,9 @@ public interface Tag extends Keyed { + */ + Tag ITEMS_REPAIRS_WOLF_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("repairs_wolf_armor"), Material.class); + /** +- * Vanilla item tag representing all furnace materials. ++ * Vanilla item tag representing all stone based materials for crafting. + */ +- Tag ITEMS_FURNACE_MATERIALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("furnace_materials"), Material.class); ++ Tag ITEMS_STONE_CRAFTING_MATERIALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("stone_crafting_materials"), Material.class); + /** + * Vanilla item tag representing all compasses. + */ +@@ -1134,15 +1116,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 plantable by villagers. + */ +@@ -1252,13 +1225,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). +@@ -1340,12 +1306,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. + */ +@@ -1429,6 +1389,55 @@ 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 furnace materials. ++ * ++ * @deprecated use {@link #ITEMS_STONE_CRAFTING_MATERIALS} ++ */ ++ @Deprecated(since = "1.16.2") ++ Tag ITEMS_FURNACE_MATERIALS = ITEMS_STONE_CRAFTING_MATERIALS; ++ /** ++ * 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 521f035409ee61a9ad73d39bec938f2938892570..b44b951561d69fbccd539aa9280340b77dedd696 100644 +--- a/src/main/java/org/bukkit/attribute/Attribute.java ++++ b/src/main/java/org/bukkit/attribute/Attribute.java +@@ -16,6 +16,7 @@ import org.jetbrains.annotations.NotNull; + */ + public interface Attribute extends OldEnum, Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations + ++ // Paper start - Generated/Attribute + /** + * Maximum health of an Entity. + */ +@@ -144,6 +145,7 @@ public interface Attribute extends OldEnum, Keyed, Translatable, net. + * Chance of a zombie to spawn reinforcements. + */ + Attribute SPAWN_REINFORCEMENTS = getAttribute("spawn_reinforcements"); ++ // Paper end - Generated/Attribute + + @NotNull + private static Attribute getAttribute(@NotNull String key) { +diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java +index 464f8f81ba907a61588e4ab869e4f8269830195a..a23c7451b317988619185ba15614d732170828ba 100644 +--- a/src/main/java/org/bukkit/block/Biome.java ++++ b/src/main/java/org/bukkit/block/Biome.java +@@ -24,6 +24,7 @@ import org.jetbrains.annotations.NotNull; + */ + public interface Biome extends OldEnum, Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations + ++ // Paper start - Generated/Biome + Biome OCEAN = getBiome("ocean"); + Biome PLAINS = getBiome("plains"); + Biome DESERT = getBiome("desert"); +@@ -91,6 +92,7 @@ public interface Biome extends OldEnum, Keyed, net.kyori.adventure.transl + @ApiStatus.Experimental + @MinecraftExperimental(MinecraftExperimental.Requires.WINTER_DROP) + Biome PALE_GARDEN = Registry.BIOME.get(NamespacedKey.minecraft("pale_garden")); ++ // 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 f019d490794b49d21057820bab047e2f909934a1..fa458580525fba79bb81baa821cdb187f863ef74 100644 +--- a/src/main/java/org/bukkit/block/BlockType.java ++++ b/src/main/java/org/bukkit/block/BlockType.java +@@ -183,6 +183,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"); +@@ -3442,6 +3443,7 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran + * BlockData: {@link Waterlogged} + */ + BlockType.Typed HEAVY_CORE = getBlockType("heavy_core"); ++ // 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 70904d6c43b93cb7b9d74d20666fac93a6b4996c..0f0bf88bb347f0c042f396a41230a717169f09ee 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 14f90d8d4c1caaf35f5b9385981c12191d8e4fd3..bf8b4f8c8895e79311d5ccb237310eba7f650c0a 100644 +--- a/src/main/java/org/bukkit/damage/DamageType.java ++++ b/src/main/java/org/bukkit/damage/DamageType.java +@@ -19,6 +19,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"); +@@ -68,6 +69,7 @@ public interface DamageType extends Keyed, Translatable { + public static final DamageType GENERIC_KILL = getDamageType("generic_kill"); + public static final DamageType WIND_CHARGE = getDamageType("wind_charge"); + public static final DamageType MACE_SMASH = getDamageType("mace_smash"); ++ // 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 574574dc4f54a4ce32e7c97f2fbeb92a4991d353..690d8960e0fb94aa868e404545b388185ac32aa3 100644 +--- a/src/main/java/org/bukkit/entity/Boat.java ++++ b/src/main/java/org/bukkit/entity/Boat.java +@@ -176,11 +176,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 fca4671c6976aee9e981ef344244f9322651d0c9..a9b3421addf1c6add36d404c72e4d9bef6c5cb7d 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 c1aa59bab82aee8fd42f7149c520b45660b29082..f85791b55769f790262f3799877106626bf7d30f 100644 +--- a/src/main/java/org/bukkit/entity/EntityType.java ++++ b/src/main/java/org/bukkit/entity/EntityType.java +@@ -48,6 +48,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. + *

+@@ -349,6 +350,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 f661a6b4797dd814a197e9245bcb2ddf2fca773f..80d665fc6462d843533732e1585a0149c2ea8fa7 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/Salmon.java b/src/main/java/org/bukkit/entity/Salmon.java +index d8a2d44fe50a9ab24d8916aad270dfba0bd84e5e..e500853e6130fc35c87f8ea0ff559af2774a6f7c 100644 +--- a/src/main/java/org/bukkit/entity/Salmon.java ++++ b/src/main/java/org/bukkit/entity/Salmon.java +@@ -27,6 +27,7 @@ public interface Salmon extends io.papermc.paper.entity.SchoolableFish { // Pape + */ + public enum Variant { + ++ // Paper start - Generated/SalmonVariant + /** + * Small salmon. + */ +@@ -39,5 +40,6 @@ public interface Salmon extends io.papermc.paper.entity.SchoolableFish { // Pape + * Large salmon. + */ + LARGE; ++ // Paper end - Generated/SalmonVariant + } + } +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 1db3742024e9cd1b70af2d52b4b756a544c019df..6de3fe818cb6c3a2e03398a3b4d10c078649e4c0 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) { +@@ -214,6 +216,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 +@@ -285,6 +288,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 c73489f4b745bc84501ce94f0227b034d9768eae..9d42924199527987fd7fd53241823444739991b5 100644 +--- a/src/main/java/org/bukkit/entity/Wolf.java ++++ b/src/main/java/org/bukkit/entity/Wolf.java +@@ -93,6 +93,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"); +@@ -102,6 +103,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 542e3e32e77c0b8dfa707193787516f83b884780..e1f9190394c94053793619ca2da455f13302529b 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 + + @NotNull + private static Structure getStructure(@NotNull String name) { +diff --git a/src/main/java/org/bukkit/generator/structure/StructureType.java b/src/main/java/org/bukkit/generator/structure/StructureType.java +index ffa0fc250f04729299203bc7c158f52a44530a8e..784244a5cdf517a8ecb183eaf44f08e4ac87a0f3 100644 +--- a/src/main/java/org/bukkit/generator/structure/StructureType.java ++++ b/src/main/java/org/bukkit/generator/structure/StructureType.java +@@ -15,6 +15,7 @@ import org.jetbrains.annotations.NotNull; + */ + 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"); +@@ -31,6 +32,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 + + @NotNull + private static StructureType getStructureType(@NotNull String 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 2a3c4f055d0e4ef009caed95152570660ab100d5..cb844e40ad7af127ced062e6641c1d5fb74cdd04 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 + */ +@@ -2260,6 +2261,7 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans + * ItemMeta: {@link OminousBottleMeta} + */ + ItemType.Typed OMINOUS_BOTTLE = getItemType("ominous_bottle"); ++ // 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 2a7bedf850896e358213c2a201ca3d611cb9ea67..8c9280fe4df4ad3651ee670ee4e3f6c08a43ec81 100644 +--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java ++++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java +@@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull; + */ + public interface TrimMaterial extends Keyed, Translatable { + ++ // Paper start - Generated/TrimMaterial + /** + * {@link Material#QUARTZ}. + */ +@@ -52,6 +53,7 @@ public interface TrimMaterial extends Keyed, Translatable { + * {@link Material#AMETHYST_SHARD}. + */ + public static final TrimMaterial AMETHYST = getTrimMaterial("amethyst"); ++ // Paper end - Generated/TrimMaterial + + @NotNull + private static TrimMaterial getTrimMaterial(@NotNull String key) { +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 db657206c158e755227e8ef8e102a2ee2cc3bf0a..92de2bfc31ce84f7da36be21b07582dc8e175e77 100644 +--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java ++++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java +@@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull; + */ + public interface TrimPattern extends Keyed, Translatable { + ++ // Paper start - Generated/TrimPattern + /** + * {@link Material#SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE}. + */ +@@ -84,6 +85,7 @@ public interface TrimPattern extends Keyed, Translatable { + * {@link Material#BOLT_ARMOR_TRIM_SMITHING_TEMPLATE}. + */ + public static final TrimPattern BOLT = getTrimPattern("bolt"); ++ // Paper end - Generated/TrimPattern + + @NotNull + private static TrimPattern getTrimPattern(@NotNull String key) { +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 eb73f3224e7d2314c4209a3743a37bdae2395670..dd1a5981671346e93bf4bc5e82530596f21ad955 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 55a46db9d73885ea967ac929013906b687e476bb..7d82a5ffff11b62af23320052074f5d7031099f2 100644 +--- a/src/main/java/org/bukkit/map/MapPalette.java ++++ b/src/main/java/org/bukkit/map/MapPalette.java +@@ -46,6 +46,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), +@@ -108,6 +109,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/src/main/java/org/bukkit/tag/DamageTypeTags.java b/src/main/java/org/bukkit/tag/DamageTypeTags.java +index 548122148dc243ecb646d5f87e4b043a81b96c62..7221c85d83e1c0b5051491beee79ec6c5c62f06c 100644 +--- a/src/main/java/org/bukkit/tag/DamageTypeTags.java ++++ b/src/main/java/org/bukkit/tag/DamageTypeTags.java +@@ -13,6 +13,7 @@ import org.jetbrains.annotations.Nullable; + @ApiStatus.Experimental + public final class DamageTypeTags { + ++ // Paper start - Generated/DamageTypeTags + /** + * Vanilla tag representing damage types which damage helmets. + */ +@@ -154,6 +155,7 @@ public final class DamageTypeTags { + * Vanilla tag representing damage types which originate from mace smashes. + */ + public static final Tag IS_MACE_SMASH = getTag("mace_smash"); ++ // Paper end - Generated/DamageTypeTags + /** + * Internal use only. + */ diff --git a/patches/api/0503-cleanup-block-data.patch b/patches/api/0503-cleanup-block-data.patch new file mode 100644 index 0000000000..db6f2032b9 --- /dev/null +++ b/patches/api/0503-cleanup-block-data.patch @@ -0,0 +1,336 @@ +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/MossyCarpet.java b/src/main/java/org/bukkit/block/data/type/MossyCarpet.java +index e8463c71f9ac167d661d9b78bca98208175fcf7e..cb5e2bbc5d66e196dc8225a7f3ce2905e5e775b0 100644 +--- a/src/main/java/org/bukkit/block/data/type/MossyCarpet.java ++++ b/src/main/java/org/bukkit/block/data/type/MossyCarpet.java +@@ -37,7 +37,7 @@ public interface MossyCarpet extends BlockData { + * @return if face is enabled + */ + @NotNull +- Height getHeight(@NotNull BlockFace face); ++ Wall.Height getHeight(@NotNull BlockFace face); // Paper + + /** + * Set the height of the specified face. +@@ -45,11 +45,16 @@ public interface MossyCarpet extends BlockData { + * @param face to set + * @param height the height + */ +- void setHeight(@NotNull BlockFace face, @NotNull Height height); ++ void setHeight(@NotNull BlockFace face, @NotNull Wall.Height height); // Paper + + /** + * The different heights a face may have. ++ * ++ * @deprecated this property is not specific to the MossyCarpet, use ++ * {@link org.bukkit.block.data.type.Wall.Height} instead. All references ++ * to this enum will be redirected to that enum at runtime. + */ ++ @Deprecated // Paper + public enum Height { + /** + * Not present. +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 0ffa92a4a53e4567ed72b4aa9ea4a9956ea38b40..39f641bb2e972349b0050fd10c290c06fb6f30f2 100644 +--- a/src/main/java/org/bukkit/block/data/type/Vault.java ++++ b/src/main/java/org/bukkit/block/data/type/Vault.java +@@ -26,7 +26,11 @@ public interface Vault extends Directional { + */ + @Deprecated(forRemoval = true) + @NotNull +- State getTrialSpawnerState(); ++ // Paper start ++ default State getTrialSpawnerState() { ++ return this.getVaultState(); ++ } ++ // Paper end + + /** + * Sets the value of the 'vault_state' property. +@@ -42,7 +46,11 @@ public interface Vault extends Directional { + * @deprecated see {@link #setVaultState(State)} + */ + @Deprecated(forRemoval = true) +- void setTrialSpawnerState(@NotNull State state); ++ // Paper start ++ default void setTrialSpawnerState(@NotNull State state) { ++ this.setVaultState(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 2065edd4c2..a2ac4d31ef 100644 --- a/patches/server/0004-Test-changes.patch +++ b/patches/server/0004-Test-changes.patch @@ -386,6 +386,18 @@ index ee5ab15bb0bfeb0ff6fa0d720eeff086d92cb459..7419ea2f68607aad27929a608c402bd4 public class ExplosionResultTest { @Test +diff --git a/src/test/java/org/bukkit/MaterialTest.java b/src/test/java/org/bukkit/MaterialTest.java +index d4bfec42faf0c3cc1746bf8ac43526fa4494b526..6e43a70b96b006f2d44cc4d3e8a7cc7c9f5cea97 100644 +--- a/src/test/java/org/bukkit/MaterialTest.java ++++ b/src/test/java/org/bukkit/MaterialTest.java +@@ -53,6 +53,7 @@ public class MaterialTest { + } + + @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/RegistryClassTest.java b/src/test/java/org/bukkit/registry/RegistryClassTest.java index 297700b237bbd8d5ff9116919f203c82b4037968..ea3d37f387bdb0dd5ae3fba9231ace31d0cebd64 100644 --- a/src/test/java/org/bukkit/registry/RegistryClassTest.java diff --git a/patches/server/0350-Implement-Mob-Goal-API.patch b/patches/server/0350-Implement-Mob-Goal-API.patch index 18883d8d15..0d3aa89ed2 100644 --- a/patches/server/0350-Implement-Mob-Goal-API.patch +++ b/patches/server/0350-Implement-Mob-Goal-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/build.gradle.kts b/build.gradle.kts -index 40afa9e2cfb4518e9050ccac739aec3215f95d56..fd687af4923208272b01fc03fe9b65867e49dd6e 100644 +index cb100e337521fd278893ec775606f128717105f7..d253682a020cc5cb41c9fdae48adf5c85258be62 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -54,6 +54,7 @@ dependencies { @@ -18,159 +18,37 @@ index 40afa9e2cfb4518e9050ccac739aec3215f95d56..fd687af4923208272b01fc03fe9b6586 testImplementation("org.hamcrest:hamcrest:2.2") 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..05e793e722bbb367ca64cd7f26156fa3dabb8474 +index 0000000000000000000000000000000000000000..0a8dcfd9bdb56e988fee6404c4663aca7c5c7e98 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -@@ -0,0 +1,380 @@ +@@ -0,0 +1,243 @@ +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..05e793e722bbb367ca64cd7f26156fa3 + 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..05e793e722bbb367ca64cd7f26156fa3 + 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,72 +125,74 @@ index 0000000000000000000000000000000000000000..05e793e722bbb367ca64cd7f26156fa3 + 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.monster.creaking.Creaking.class, org.bukkit.entity.Creaking.class); -+ bukkitMap.put(net.minecraft.world.entity.monster.creaking.CreakingTransient.class, org.bukkit.entity.CreakingTransient.class); -+ bukkitMap.put(net.minecraft.world.entity.animal.AgeableWaterCreature.class, org.bukkit.entity.Squid.class); // close enough ++ 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); ++ bukkitMap.put(net.minecraft.world.entity.monster.creaking.Creaking.class, Creaking.class); ++ bukkitMap.put(net.minecraft.world.entity.monster.creaking.CreakingTransient.class, CreakingTransient.class); ++ bukkitMap.put(net.minecraft.world.entity.animal.AgeableWaterCreature.class, Squid.class); // close enough ++ // + } + -+ 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) { @@ -326,20 +206,14 @@ index 0000000000000000000000000000000000000000..05e793e722bbb367ca64cd7f26156fa3 + } + + 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) { @@ -351,55 +225,44 @@ index 0000000000000000000000000000000000000000..05e793e722bbb367ca64cd7f26156fa3 + } + + 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 diff --git a/patches/server/0552-Missing-Entity-API.patch b/patches/server/0552-Missing-Entity-API.patch index 5640dce8db..af34e944b2 100644 --- a/patches/server/0552-Missing-Entity-API.patch +++ b/patches/server/0552-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 05e793e722bbb367ca64cd7f26156fa3dabb8474..3470720466fc81f977c18e3a97bb918926025a22 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/1073-move-spigot-scrap.patch b/patches/server/1073-move-spigot-scrap.patch new file mode 100644 index 0000000000..7105164ecb --- /dev/null +++ b/patches/server/1073-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 faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..eed7b4bedee8da20179bd8e5890400db5e7eee3c 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -3,6 +3,7 @@ import java.time.Instant + + plugins { + java ++ idea // Paper + `maven-publish` + } + +@@ -208,6 +209,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/1074-cleanup-block-data.patch b/patches/server/1074-cleanup-block-data.patch new file mode 100644 index 0000000000..5d9ca28958 --- /dev/null +++ b/patches/server/1074-cleanup-block-data.patch @@ -0,0 +1,3484 @@ +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 50fb7edd25c1b38f5c463b78d21d4583bdc89229..8fef0485386d1940d9189b8acfa5ae4679ad4892 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -356,6 +356,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<>(); + +@@ -365,9 +372,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); +@@ -377,52 +384,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); +@@ -430,62 +437,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); +@@ -533,9 +540,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/data/type/CraftMossyCarpet.java b/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftMossyCarpet.java +index 80a646334ef6dea5a25f1bd32843d208205f4554..6d59f0028e4c71d62aa69d54acc0cb2a5cabc695 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftMossyCarpet.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftMossyCarpet.java +@@ -21,12 +21,12 @@ public abstract class CraftMossyCarpet extends CraftBlockData implements MossyCa + } + + @Override +- public org.bukkit.block.data.type.MossyCarpet.Height getHeight(org.bukkit.block.BlockFace face) { +- return this.get(CraftMossyCarpet.HEIGHTS[face.ordinal()], org.bukkit.block.data.type.MossyCarpet.Height.class); ++ public org.bukkit.block.data.type.Wall.Height getHeight(org.bukkit.block.BlockFace face) { ++ return this.get(CraftMossyCarpet.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.MossyCarpet.Height height) { ++ public void setHeight(org.bukkit.block.BlockFace face, org.bukkit.block.data.type.Wall.Height height) { + this.set(CraftMossyCarpet.HEIGHTS[face.ordinal()], height); + } + } +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/CraftMossyCarpet.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMossyCarpet.java +index 745eaca8b79c83391bbe9593c7ae199f54fcbfd9..d602000a3bbe32487a09b0a689de55d1c0e64ab2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMossyCarpet.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMossyCarpet.java +@@ -31,12 +31,12 @@ public final class CraftMossyCarpet extends org.bukkit.craftbukkit.block.data.Cr + } + + @Override +- public org.bukkit.block.data.type.MossyCarpet.Height getHeight(org.bukkit.block.BlockFace face) { +- return this.get(CraftMossyCarpet.HEIGHTS[face.ordinal()], org.bukkit.block.data.type.MossyCarpet.Height.class); ++ public org.bukkit.block.data.type.Wall.Height getHeight(org.bukkit.block.BlockFace face) { ++ return this.get(CraftMossyCarpet.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.MossyCarpet.Height height) { ++ public void setHeight(org.bukkit.block.BlockFace face, org.bukkit.block.data.type.Wall.Height height) { + this.set(CraftMossyCarpet.HEIGHTS[face.ordinal()], height); + } + } +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/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 2a2e37a7c67cac657712fc20746a892097a3c4be..7b837247decab67d859113c8a113bc117a6de59e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +@@ -79,7 +79,10 @@ 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 ++ "org/bukkit/block/data/type/MossyCarpet$Height", "org/bukkit/block/data/type/Wall$Height" // Paper + ); + + private static final Map CLASS_TO_INTERFACE = Map.ofEntries( diff --git a/patches/server/1075-server-gen-test.patch b/patches/server/1075-server-gen-test.patch new file mode 100644 index 0000000000..c7968c928e --- /dev/null +++ b/patches/server/1075-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 eed7b4bedee8da20179bd8e5890400db5e7eee3c..d952cb036080f43ee66358ef543538e208cf158e 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -210,17 +210,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/1076-Code-generation-marker-stub.patch b/patches/server/1076-Code-generation-marker-stub.patch new file mode 100644 index 0000000000..d4e92440de --- /dev/null +++ b/patches/server/1076-Code-generation-marker-stub.patch @@ -0,0 +1,140 @@ +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 b81d0d906789ef2ff3759395821316462aacf323..860223691f37ca3ecedbf0ceb73feb8a361df19e 100644 +--- a/src/main/java/io/papermc/paper/registry/PaperRegistries.java ++++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java +@@ -82,6 +82,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), +@@ -117,6 +118,7 @@ public final class PaperRegistries { + apiOnly(Registries.PARTICLE_TYPE, RegistryKey.PARTICLE_TYPE, PaperSimpleRegistry::particleType), + apiOnly(Registries.POTION, RegistryKey.POTION, PaperSimpleRegistry::potion), + apiOnly(Registries.MEMORY_MODULE_TYPE, RegistryKey.MEMORY_MODULE_TYPE, () -> (org.bukkit.Registry>) (org.bukkit.Registry) org.bukkit.Registry.MEMORY_MODULE_TYPE) ++ // 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/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java b/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java +index 8a2fb217501bb6293adf54686420ef7d1ce2ec11..c16b54ae7446fb60890f4a9e9a96e162d028c4c7 100644 +--- a/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java ++++ b/src/main/java/io/papermc/paper/world/flag/PaperFeatureFlagProviderImpl.java +@@ -19,11 +19,13 @@ import org.bukkit.potion.PotionType; + public class PaperFeatureFlagProviderImpl implements FeatureFlagProvider { + + public static final BiMap FLAGS = ImmutableBiMap.of( ++ // Paper start - Generated/PaperFeatureFlagProviderImpl#FLAGS + FeatureFlag.VANILLA, FeatureFlags.VANILLA, + FeatureFlag.TRADE_REBALANCE, FeatureFlags.TRADE_REBALANCE, + FeatureFlag.MINECART_IMPROVEMENTS, FeatureFlags.MINECART_IMPROVEMENTS, + FeatureFlag.REDSTONE_EXPERIMENTS, FeatureFlags.REDSTONE_EXPERIMENTS, + FeatureFlag.WINTER_DROP, FeatureFlags.WINTER_DROP ++ // Paper end - Generated/PaperFeatureFlagProviderImpl#FLAGS + ); + + @Override +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 56453454cbd4b9e9270fc833f8ab38d5fa7a3763..b17011ef1f206eb1610425ec0a60434b1b73e4f6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +@@ -133,7 +133,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); +@@ -179,7 +179,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 8fef0485386d1940d9189b8acfa5ae4679ad4892..6cfe7135a9d619a27839ef2c4ae276b29a5a9ad8 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -368,6 +368,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); +@@ -543,6 +544,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/1077-remove-CraftTropicalFish.CraftPattern.patch b/patches/server/1077-remove-CraftTropicalFish.CraftPattern.patch new file mode 100644 index 0000000000..57f9035eae --- /dev/null +++ b/patches/server/1077-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/1078-remove-fluidstate-mapping.patch b/patches/server/1078-remove-fluidstate-mapping.patch new file mode 100644 index 0000000000..5552050c31 --- /dev/null +++ b/patches/server/1078-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/1079-fix-memory-keys-use-of-generics.patch b/patches/server/1079-fix-memory-keys-use-of-generics.patch new file mode 100644 index 0000000000..29251d1b31 --- /dev/null +++ b/patches/server/1079-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/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")