Compare commits

...
Author SHA1 Message Date
Lulu13022002 6483f4fc43 add back inconsistent tags for compat 2025-02-25 17:41:27 +01:00
Lulu13022002 d8cf62ae9c Generators 2025-02-25 17:23:35 +01:00
Spottedleaf 636ae0cd87 Add missing Paper comments to player movement patch 2025-02-24 21:32:39 -08:00
Jason Penilla fcb2e81590 Clear lastSection on game event listener removal
Fixes https://github.com/Tuinity/Moonrise/issues/87

See comments in code
2025-02-24 21:32:39 -08:00
bonanandTamion e5a8ee849f Hide soul speed particles for vanished players (#12152)
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
2025-02-21 12:02:32 +01:00
Bjarne Koll 7b4d44f573 Revert "Always pass event block to damage source (#12158)"
This reverts commit ab984a0711.

The block damage is null *and has been* null in cases where the block
has already been cleared. Consumers are supposed to use the
getDamagerBlockState instead.
2025-02-21 11:52:04 +01:00
Bjarne Koll ab984a0711 Always pass event block to damage source (#12158)
Always passes the respective block to a damage source when passing a
block state. While we could technically use the damageSourcePosition
here by, we'd have to translate it back to a block position by
subtracting .5 from all its components.
Such behaviour however relies on the caller logic's mutation of the
damageSourcePosition and will break once this position is not the centre
of the block.

Passing in the block at the specific callsite is a lot more future
proof.
2025-02-20 20:22:46 +01:00
Emilia Kond 5e2a3bc0e2 Call EntityChangeBlockEvent with correct block when waxing (#12154) 2025-02-20 10:46:11 +01:00
Warrior edda0db18b Fix server crash when no enchantments are present (#12149) 2025-02-18 15:44:52 +01:00
Warrior 09f1f88f58 Fix getForwards/SidewaysMovement for players (#12140) 2025-02-18 01:03:48 +01:00
Jake Potrebic f070081825 Remove Experimental from TypedKey (#12134) 2025-02-17 15:33:26 -08:00
Jake Potrebic b386a8f527 Add simpler JavaPlugin command registration (#12142) 2025-02-18 00:21:29 +01:00
Epic e494f2894e Correctly call BlockFadeEvents (#12141) 2025-02-18 00:19:30 +01:00
Bjarne Koll 142695eb00 Default minecraft alias to redirect (#12146)
While the running server will still be using the recently introduced
copy-mechanic for vanilla command namespacing, the data converter logic
relies on the fact that namespaced aliases were redirects as well.

To not break the converted, the commands type now takes a modern flag
only set by the running server.
2025-02-18 00:09:54 +01:00
Jake Potrebic d26a9e90c8 Fix plugin commands (#12144) 2025-02-17 15:00:06 -08:00
Bjarne Koll 3b9106c7d1 Readd dead redirect recovery (#12136)
While the paper command system no longer uses redirects for namespaced
registration, vanilla still does. This means that removal of vanilla
redirecting target nodes still causes issues, e.g. the removal of the
vanilla 'msg' node in favour of a command alias one.
Redirecting nodes like tell, minecraft:msg and minecraft:tell are broken
by this and need to by flattened before sending them to the client.
2025-02-17 23:51:52 +01:00
Dqu1J fd69140d80 Fix disable-tripwire-updates option not cancelling tripwire hook updates (#12129) 2025-02-17 20:07:02 +01:00
698 changed files with 27433 additions and 25921 deletions

No files matched your search

+3 -1
View File
@@ -1,3 +1,5 @@
root = true
[*]
charset = utf-8
end_of_line = lf
@@ -40,5 +42,5 @@ ij_java_use_fq_class_names = true
[paper-server/src/minecraft/resources/data/**/*.json]
indent_size = 2
[paper-api/src/generated/java/**/*.java]
[paper-{server,api}/src/generated/java/**/*.java]
ij_java_imports_layout = $*, |, *
+1 -1
View File
@@ -45,7 +45,7 @@ logs/
!gradle/wrapper/gradle-wrapper.jar
test-plugin.settings.gradle.kts
paper-api-generator.settings.gradle.kts
paper-generator.settings.gradle.kts
# Don't track patched vanilla submodules
paper-server/src/minecraft/
-37
View File
@@ -1,37 +0,0 @@
import io.papermc.paperweight.util.defaultJavaLauncher
plugins {
java
id("io.papermc.paperweight.source-generator")
}
paperweight {
atFile.set(layout.projectDirectory.file("wideners.at"))
}
dependencies {
minecraftJar(project(":paper-server", "mappedJarOutgoing"))
implementation(project(":paper-server", "macheMinecraftLibraries"))
implementation("com.squareup:javapoet:1.13.0")
implementation(project(":paper-api"))
implementation("io.github.classgraph:classgraph:4.8.47")
implementation("org.jetbrains:annotations:26.0.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.register<JavaExec>("generate") {
dependsOn(tasks.check)
mainClass.set("io.papermc.generator.Main")
classpath(sourceSets.main.map { it.runtimeClasspath })
args(rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.absolutePath)
javaLauncher = javaToolchains.defaultJavaLauncher(project)
}
tasks.test {
useJUnitPlatform()
}
group = "io.papermc.paper"
version = "1.0-SNAPSHOT"
@@ -1,96 +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.EntityType;
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),
// api only
simpleTagKey("EntityTypeTagKeys", EntityType.class, Registries.ENTITY_TYPE, RegistryKey.ENTITY_TYPE),
new MobGoalGenerator("VanillaGoal", "com.destroystokyo.paper.entity.ai")
};
private static <T, A> SourceGenerator simpleKey(final String className, final Class<A> apiType, final ResourceKey<? extends Registry<T>> registryKey, final RegistryKey<A> apiRegistryKey, final boolean publicCreateKeyMethod) {
return new GeneratedKeyType<>(className, apiType, "io.papermc.paper.registry.keys", registryKey, apiRegistryKey, publicCreateKeyMethod);
}
private static <T, A> SourceGenerator simpleTagKey(final String className, final Class<A> apiType, final ResourceKey<? extends Registry<T>> registryKey, final RegistryKey<A> apiRegistryKey) {
return new GeneratedTagKeyType<>(className, apiType, "io.papermc.paper.registry.keys.tags", registryKey, apiRegistryKey, true);
}
}
@@ -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<TagKey<?>, 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<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
final List<Registry.PendingTags<?>> pendingTags = TagLoader.loadTagsForExistingRegistries(resourceManager, layers.getLayer(RegistryLayer.STATIC));
final List<HolderLookup.RegistryLookup<?>> 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);
}
}
}
@@ -1,207 +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.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<T, A> extends SimpleGenerator {
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> VANILLA_REGISTRY_ENTRIES = VanillaRegistries.BUILDER.entries.stream()
.collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap));
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> EXPERIMENTAL_REGISTRY_ENTRIES = Map.of(); // Update for Experimental API
private static final Map<RegistryKey<?>, String> REGISTRY_KEY_FIELD_NAMES;
static {
final Map<RegistryKey<?>, 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<A> apiType;
private final ResourceKey<? extends Registry<T>> registryKey;
private final RegistryKey<A> apiRegistryKey;
private final boolean publicCreateKeyMethod;
public GeneratedKeyType(final String keysClassName, final Class<A> apiType, final String pkg, final ResourceKey<? extends Registry<T>> registryKey, final RegistryKey<A> 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<String, String> 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<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey);
final Set<ResourceKey<T>> experimental = this.collectExperimentalKeys(registry);
boolean allExperimental = true;
for (final Holder.Reference<T> reference : registry.listElements().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) {
final ResourceKey<T> 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(null)); // Update for Experimental API
} else {
allExperimental = false;
}
typeBuilder.addField(fieldBuilder.build());
}
if (allExperimental) {
typeBuilder.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API
createMethod.addAnnotations(experimentalAnnotations(null)); // Update for Experimental API
} else {
typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API
}
return typeBuilder.addMethod(createMethod.build()).build();
}
// todo at some point this should be per feature data pack not all merged
private Set<ResourceKey<T>> collectExperimentalKeys(final Registry<T> registry) {
if (FeatureElement.FILTERED_REGISTRIES.contains(registry.key())) {
return this.collectExperimentalKeysBuiltIn(registry);
} else {
return this.collectExperimentalKeysDataDriven(registry);
}
}
private Set<ResourceKey<T>> collectExperimentalKeysBuiltIn(final Registry<T> registry) {
final HolderLookup.RegistryLookup<T> 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<ResourceKey<T>> collectExperimentalKeysDataDriven(final Registry<T> registry) {
final RegistrySetBuilder.@Nullable RegistryBootstrap<T> experimentalBootstrap = (RegistrySetBuilder.RegistryBootstrap<T>) EXPERIMENTAL_REGISTRY_ENTRIES.get(this.registryKey);
if (experimentalBootstrap == null) {
return Collections.emptySet();
}
final Set<ResourceKey<T>> experimental = Collections.newSetFromMap(new IdentityHashMap<>());
final CollectingContext<T> experimentalCollector = new CollectingContext<>(experimental, registry);
experimentalBootstrap.run(experimentalCollector);
final RegistrySetBuilder.@Nullable RegistryBootstrap<T> vanillaBootstrap = (RegistrySetBuilder.RegistryBootstrap<T>) VANILLA_REGISTRY_ENTRIES.get(this.registryKey);
if (vanillaBootstrap != null) {
final Set<ResourceKey<T>> vanilla = Collections.newSetFromMap(new IdentityHashMap<>());
final CollectingContext<T> 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");
}
}
@@ -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<T, A> extends SimpleGenerator {
private static final Map<RegistryKey<?>, String> REGISTRY_KEY_FIELD_NAMES;
static {
final Map<RegistryKey<?>, 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<A> apiType;
private final ResourceKey<? extends Registry<T>> registryKey;
private final RegistryKey<A> apiRegistryKey;
private final boolean publicCreateKeyMethod;
public GeneratedTagKeyType(final String keysClassName, final Class<A> apiType, final String pkg, final ResourceKey<? extends Registry<T>> registryKey, final RegistryKey<A> 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<T> 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");
}
}
@@ -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<AnnotationSpec> experimentalAnnotations(final MinecraftExperimental.@Nullable Requires requiredFeatureFlag) {
final List<AnnotationSpec> 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<AnnotationSpec> CLASS_HEADER = List.of(
SUPPRESS_WARNINGS,
GENERATED_FROM,
NULL_MARKED
);
private Annotations() {
}
}
@@ -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<String> 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<String> ALPHABETIC_KEY_ORDER = alphabeticKeyOrder(path -> path);
public static <T> Comparator<T> alphabeticKeyOrder(Function<T, String> 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() {
}
}
@@ -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() {
}
}
@@ -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<TagKey<?>, String> grabExperimental(final MultiPackResourceManager resourceManager) {
Map<TagKey<?>, String> result = new IdentityHashMap<>();
// collect all vanilla tags
Multimap<ResourceKey<? extends Registry<?>>, 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<RegistryAccess.RegistryEntry<?>, String> output) {
Set<String> 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() {
}
}
+15 -13
View File
@@ -93,16 +93,16 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
val generatedApiPath: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
idea {
module {
generatedSourceDirs.add(generatedApiPath.toFile())
generatedSourceDirs.add(generatedDir.toFile())
}
}
sourceSets {
main {
java {
srcDir(generatedApiPath)
srcDir(generatedDir)
}
}
}
@@ -228,21 +228,23 @@ tasks.compileTestJava {
options.compilerArgs.add("-parameters")
}
val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
val scanJarForBadCalls by tasks.registering(io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
jarToScan.set(tasks.jar.flatMap { it.archiveFile })
classpath.from(configurations.compileClasspath)
}
tasks.check {
dependsOn(scanJar)
dependsOn(scanJarForBadCalls)
}
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)
if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) {
val scanJarForOldGeneratedCode by tasks.registering(io.papermc.paperweight.tasks.ScanJarForOldGeneratedCode::class) {
mcVersion.set(providers.gradleProperty("mcVersion"))
annotation.set("Lio/papermc/paper/generated/GeneratedFrom;")
jarToScan.set(tasks.jar.flatMap { it.archiveFile })
classpath.from(configurations.compileClasspath)
}
tasks.check {
dependsOn(scanJarForOldGeneratedCode)
}
}
@@ -66,8 +66,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.4")
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.attribute.Attribute;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class AttributeKeys {
/**
* {@code minecraft:armor}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.banner.PatternType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class BannerPatternKeys {
/**
* {@code minecraft:base}
@@ -332,12 +330,11 @@ public final class BannerPatternKeys {
}
/**
* Creates a key for {@link PatternType} in the registry {@code minecraft:banner_pattern}.
* Creates a typed key for {@link PatternType} in the registry {@code minecraft:banner_pattern}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<PatternType> create(final Key key) {
return TypedKey.create(RegistryKey.BANNER_PATTERN, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.Biome;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class BiomeKeys {
/**
* {@code minecraft:badlands}
@@ -486,12 +484,11 @@ 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
*/
@ApiStatus.Experimental
public static TypedKey<Biome> create(final Key key) {
return TypedKey.create(RegistryKey.BIOME, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.BlockType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class BlockTypeKeys {
/**
* {@code minecraft:acacia_button}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Cat;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class CatVariantKeys {
/**
* {@code minecraft:all_black}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class DamageTypeKeys {
/**
* {@code minecraft:arrow}
@@ -374,12 +372,11 @@ public final class DamageTypeKeys {
}
/**
* Creates a key for {@link DamageType} in the registry {@code minecraft:damage_type}.
* Creates a typed key for {@link DamageType} in the registry {@code minecraft:damage_type}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<DamageType> create(final Key key) {
return TypedKey.create(RegistryKey.DAMAGE_TYPE, key);
}
@@ -0,0 +1,503 @@
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.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.4")
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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> 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<DataComponentType> WRITTEN_BOOK_CONTENT = create(key("written_book_content"));
private DataComponentTypeKeys() {
}
private static TypedKey<DataComponentType> create(final Key key) {
return TypedKey.create(RegistryKey.DATA_COMPONENT_TYPE, key);
}
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.enchantments.Enchantment;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class EnchantmentKeys {
/**
* {@code minecraft:aqua_affinity}
@@ -325,12 +323,11 @@ 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
*/
@ApiStatus.Experimental
public static TypedKey<Enchantment> create(final Key key) {
return TypedKey.create(RegistryKey.ENCHANTMENT, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Fluid;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class FluidKeys {
/**
* {@code minecraft:empty}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Frog;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class FrogVariantKeys {
/**
* {@code minecraft:cold}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.GameEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class GameEventKeys {
/**
* {@code minecraft:block_activate}
@@ -451,12 +449,11 @@ 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
*/
@ApiStatus.Experimental
public static TypedKey<GameEvent> create(final Key key) {
return TypedKey.create(RegistryKey.GAME_EVENT, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.MusicInstrument;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class InstrumentKeys {
/**
* {@code minecraft:admire_goat_horn}
@@ -87,12 +85,11 @@ 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
*/
@ApiStatus.Experimental
public static TypedKey<MusicInstrument> create(final Key key) {
return TypedKey.create(RegistryKey.INSTRUMENT, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class ItemTypeKeys {
/**
* {@code minecraft:acacia_boat}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.JukeboxSong;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class JukeboxSongKeys {
/**
* {@code minecraft:11}
@@ -164,12 +162,11 @@ public final class JukeboxSongKeys {
}
/**
* Creates a key for {@link JukeboxSong} in the registry {@code minecraft:jukebox_song}.
* Creates a typed key for {@link JukeboxSong} in the registry {@code minecraft:jukebox_song}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<JukeboxSong> create(final Key key) {
return TypedKey.create(RegistryKey.JUKEBOX_SONG, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.map.MapCursor;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class MapDecorationTypeKeys {
/**
* {@code minecraft:banner_black}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.MenuType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class MenuTypeKeys {
/**
* {@code minecraft:anvil}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class MobEffectKeys {
/**
* {@code minecraft:absorption}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Art;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class PaintingVariantKeys {
/**
* {@code minecraft:alban}
@@ -381,12 +379,11 @@ 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
*/
@ApiStatus.Experimental
public static TypedKey<Art> create(final Key key) {
return TypedKey.create(RegistryKey.PAINTING_VARIANT, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Sound;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class SoundEventKeys {
/**
* {@code minecraft:ambient.basalt_deltas.additions}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.generator.structure.Structure;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class StructureKeys {
/**
* {@code minecraft:ancient_city}
@@ -269,12 +267,11 @@ public final class StructureKeys {
}
/**
* Creates a key for {@link Structure} in the registry {@code minecraft:worldgen/structure}.
* Creates a typed key for {@link Structure} in the registry {@code minecraft:worldgen/structure}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<Structure> create(final Key key) {
return TypedKey.create(RegistryKey.STRUCTURE, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.generator.structure.StructureType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class StructureTypeKeys {
/**
* {@code minecraft:buried_treasure}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.meta.trim.TrimMaterial;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class TrimMaterialKeys {
/**
* {@code minecraft:amethyst}
@@ -108,12 +106,11 @@ public final class TrimMaterialKeys {
}
/**
* Creates a key for {@link TrimMaterial} in the registry {@code minecraft:trim_material}.
* Creates a typed key for {@link TrimMaterial} in the registry {@code minecraft:trim_material}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<TrimMaterial> create(final Key key) {
return TypedKey.create(RegistryKey.TRIM_MATERIAL, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.meta.trim.TrimPattern;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class TrimPatternKeys {
/**
* {@code minecraft:bolt}
@@ -157,12 +155,11 @@ public final class TrimPatternKeys {
}
/**
* Creates a key for {@link TrimPattern} in the registry {@code minecraft:trim_pattern}.
* Creates a typed key for {@link TrimPattern} in the registry {@code minecraft:trim_pattern}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<TrimPattern> create(final Key key) {
return TypedKey.create(RegistryKey.TRIM_PATTERN, key);
}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Villager;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class VillagerProfessionKeys {
/**
* {@code minecraft:armorer}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Villager;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class VillagerTypeKeys {
/**
* {@code minecraft:desert}
@@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Wolf;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,9 +22,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
@GeneratedFrom("1.21.4")
public final class WolfVariantKeys {
/**
* {@code minecraft:ashen}
@@ -94,12 +92,11 @@ public final class WolfVariantKeys {
}
/**
* Creates a key for {@link Wolf.Variant} in the registry {@code minecraft:wolf_variant}.
* Creates a typed key for {@link Wolf.Variant} in the registry {@code minecraft:wolf_variant}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<Wolf.Variant> create(final Key key) {
return TypedKey.create(RegistryKey.WOLF_VARIANT, key);
}
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class BannerPatternTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class BiomeTagKeys {
/**
@@ -11,7 +11,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
@@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class BlockTypeTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class CatVariantTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class DamageTypeTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class EnchantmentTagKeys {
/**
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#ENTITY_TYPE}.
* Vanilla tag keys for {@link RegistryKey#ENTITY_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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class EntityTypeTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class FluidTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class GameEventTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class InstrumentTagKeys {
/**
@@ -11,7 +11,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
@@ -23,8 +23,8 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class ItemTypeTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class PaintingVariantTagKeys {
/**
@@ -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.4")
@NullMarked
@GeneratedFrom("1.21.4")
@ApiStatus.Experimental
public final class StructureTagKeys {
/**
@@ -63,21 +63,76 @@ import static java.util.Objects.requireNonNull;
@ApiStatus.Experimental
public final class DataComponentTypes {
// Start generate - DataComponentTypes
// @GeneratedFrom 1.21.4
/**
* Controls the maximum stacking size of this item.
* <br>
* Values greater than 1 are mutually exclusive with the {@link #MAX_DAMAGE} component.
* Holds attribute modifiers applied to any item,
* if not set, has an implicit default value based on the item type's
* default attributes (e.g. attack damage for weapons).
*/
public static final DataComponentType.Valued<@IntRange(from = 1, to = 99) Integer> MAX_STACK_SIZE = valued("max_stack_size");
public static final DataComponentType.Valued<ItemAttributeModifiers> ATTRIBUTE_MODIFIERS = valued("attribute_modifiers");
/**
* Controls the maximum amount of damage than an item can take,
* if not present, the item cannot be damaged.
* <br>
* Mutually exclusive with the {@link #MAX_STACK_SIZE} component greater than 1.
* Stores the additional patterns applied to a Banner or Shield.
*/
public static final DataComponentType.Valued<BannerPatternLayers> BANNER_PATTERNS = valued("banner_patterns");
/**
* Stores the base color for a Shield.
*/
public static final DataComponentType.Valued<DyeColor> BASE_COLOR = valued("base_color");
/**
* Holds block state properties to apply when placing a block.
*/
public static final DataComponentType.Valued<BlockItemDataProperties> BLOCK_DATA = valued("block_state");
/**
* Holds all items stored inside a Bundle.
* If removed, items cannot be added to the Bundle.
*/
public static final DataComponentType.Valued<BundleContents> BUNDLE_CONTENTS = valued("bundle_contents");
/**
* Controls which blocks a player in Adventure mode can break with this item.
*/
public static final DataComponentType.Valued<ItemAdventurePredicate> CAN_BREAK = valued("can_break");
/**
* Controls which blocks a player in Adventure mode can place on with this item.
*/
public static final DataComponentType.Valued<ItemAdventurePredicate> CAN_PLACE_ON = valued("can_place_on");
/**
* Holds all projectiles that have been loaded into a Crossbow.
* If not present, the Crossbow is not charged.
*/
public static final DataComponentType.Valued<ChargedProjectiles> CHARGED_PROJECTILES = valued("charged_projectiles");
public static final DataComponentType.Valued<Consumable> CONSUMABLE = valued("consumable");
/**
* Holds the contents of container blocks (Chests, Shulker Boxes) in item form.
*/
public static final DataComponentType.Valued<ItemContainerContents> CONTAINER = valued("container");
/**
* Holds the unresolved loot table and seed of a container-like block.
*/
public static final DataComponentType.Valued<SeededContainerLoot> CONTAINER_LOOT = valued("container_loot");
/**
* Controls the minecraft:custom_model_data property in the item model.
*/
public static final DataComponentType.Valued<CustomModelData> CUSTOM_MODEL_DATA = valued("custom_model_data");
/**
* Custom name override for an item (as set by renaming with an Anvil).
*
* @see #DAMAGE
* @see #ITEM_NAME
*/
public static final DataComponentType.Valued<@Positive Integer> MAX_DAMAGE = valued("max_damage");
public static final DataComponentType.Valued<Component> CUSTOM_NAME = valued("custom_name");
/**
* The amount of durability removed from an item,
* for damageable items (with the {@link #MAX_DAMAGE} component), has an implicit default value of: {@code 0}.
@@ -85,16 +140,80 @@ public final class DataComponentTypes {
* @see #MAX_DAMAGE
*/
public static final DataComponentType.Valued<@NonNegative Integer> DAMAGE = valued("damage");
/**
* If set, the item will not lose any durability when used.
* If present, this item will not take damage from the specified damage types.
*/
public static final DataComponentType.Valued<Unbreakable> UNBREAKABLE = valued("unbreakable");
public static final DataComponentType.Valued<DamageResistant> DAMAGE_RESISTANT = valued("damage_resistant");
public static final DataComponentType.Valued<DeathProtection> DEATH_PROTECTION = valued("death_protection");
/**
* Custom name override for an item (as set by renaming with an Anvil).
* Represents a color applied to a dyeable item (in the {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#DYEABLE} item tag).
*/
public static final DataComponentType.Valued<DyedItemColor> DYED_COLOR = valued("dyed_color");
public static final DataComponentType.Valued<Enchantable> ENCHANTABLE = valued("enchantable");
/**
* Overrides the enchantment glint effect on an item.
* If not present, default behaviour is used.
*/
public static final DataComponentType.Valued<Boolean> ENCHANTMENT_GLINT_OVERRIDE = valued("enchantment_glint_override");
/**
* Controls the enchantments on an item.
* <br>
* If not present on a non-enchantment book, this item will not work in an anvil.
*
* @see #ITEM_NAME
* @see #STORED_ENCHANTMENTS
*/
public static final DataComponentType.Valued<Component> CUSTOM_NAME = valued("custom_name");
public static final DataComponentType.Valued<ItemEnchantments> ENCHANTMENTS = valued("enchantments");
public static final DataComponentType.Valued<Equippable> EQUIPPABLE = valued("equippable");
/**
* Stores the explosion crafted in a Firework Star.
*/
public static final DataComponentType.Valued<FireworkEffect> FIREWORK_EXPLOSION = valued("firework_explosion");
/**
* Stores all explosions crafted into a Firework Rocket, as well as flight duration.
*/
public static final DataComponentType.Valued<Fireworks> FIREWORKS = valued("fireworks");
/**
* Controls potential food benefits gained when consuming the item the component is applied on.
* Requires the {@link #CONSUMABLE} component to allow consumption in the first place.
*/
public static final DataComponentType.Valued<FoodProperties> FOOD = valued("food");
public static final DataComponentType.NonValued GLIDER = unvalued("glider");
/**
* If set, disables 'additional' tooltip part which comes from the item type
* (e.g. content of a shulker).
*/
public static final DataComponentType.NonValued HIDE_ADDITIONAL_TOOLTIP = unvalued("hide_additional_tooltip");
/**
* If set, it will completely hide whole item tooltip (that includes item name).
*/
public static final DataComponentType.NonValued HIDE_TOOLTIP = unvalued("hide_tooltip");
/**
* Holds the instrument type used by a Goat Horn.
*/
public static final DataComponentType.Valued<MusicInstrument> INSTRUMENT = valued("instrument");
/**
* Marks that a projectile item would be intangible when fired
* (i.e. can only be picked up by a creative mode player).
*/
public static final DataComponentType.NonValued INTANGIBLE_PROJECTILE = unvalued("intangible_projectile");
public static final DataComponentType.Valued<Key> ITEM_MODEL = valued("item_model");
/**
* When present, replaces default item name with contained chat component.
* <p>
@@ -109,91 +228,100 @@ public final class DataComponentTypes {
* @see #CUSTOM_NAME
*/
public static final DataComponentType.Valued<Component> ITEM_NAME = valued("item_name");
public static final DataComponentType.Valued<Key> ITEM_MODEL = valued("item_model");
public static final DataComponentType.Valued<JukeboxPlayable> JUKEBOX_PLAYABLE = valued("jukebox_playable");
/**
* If present, specifies that the Compass is a Lodestone Compass.
*/
public static final DataComponentType.Valued<LodestoneTracker> LODESTONE_TRACKER = valued("lodestone_tracker");
/**
* Additional lines to include in an item's tooltip.
*/
public static final DataComponentType.Valued<ItemLore> LORE = valued("lore");
/**
* Represents the tint of the decorations on the {@link org.bukkit.inventory.ItemType#FILLED_MAP} item.
*/
public static final DataComponentType.Valued<MapItemColor> MAP_COLOR = valued("map_color");
/**
* Holds a list of markers to be placed on a {@link org.bukkit.inventory.ItemType#FILLED_MAP} (used for Explorer Maps).
*/
public static final DataComponentType.Valued<MapDecorations> MAP_DECORATIONS = valued("map_decorations");
/**
* References the shared map state holding map contents and markers for a {@link org.bukkit.inventory.ItemType#FILLED_MAP}.
*/
public static final DataComponentType.Valued<MapId> MAP_ID = valued("map_id");
/**
* Internal map item state used in the map crafting recipe.
*/
public static final DataComponentType.Valued<MapPostProcessing> MAP_POST_PROCESSING = valued("map_post_processing");
/**
* Controls the maximum amount of damage than an item can take,
* if not present, the item cannot be damaged.
* <br>
* Mutually exclusive with the {@link #MAX_STACK_SIZE} component greater than 1.
*
* @see #DAMAGE
*/
public static final DataComponentType.Valued<@Positive Integer> MAX_DAMAGE = valued("max_damage");
/**
* Controls the maximum stacking size of this item.
* <br>
* Values greater than 1 are mutually exclusive with the {@link #MAX_DAMAGE} component.
*/
public static final DataComponentType.Valued<Integer> MAX_STACK_SIZE = valued("max_stack_size");
/**
* Controls the sound played by a Player Head when placed on a Note Block.
*/
public static final DataComponentType.Valued<Key> NOTE_BLOCK_SOUND = valued("note_block_sound");
/**
* Controls the amplifier amount for an Ominous Bottle's Bad Omen effect.
*/
public static final DataComponentType.Valued<OminousBottleAmplifier> OMINOUS_BOTTLE_AMPLIFIER = valued("ominous_bottle_amplifier");
/**
* Stores the Sherds applied to each side of a Decorated Pot.
*/
public static final DataComponentType.Valued<PotDecorations> POT_DECORATIONS = valued("pot_decorations");
/**
* Holds the contents of a potion (Potion, Splash Potion, Lingering Potion),
* or potion applied to a Tipped Arrow.
*/
public static final DataComponentType.Valued<PotionContents> POTION_CONTENTS = valued("potion_contents");
/**
* Controls the skin displayed on a Player Head.
*/
public static final DataComponentType.Valued<ResolvableProfile> PROFILE = valued("profile");
/**
* Controls the color of the item name.
*/
public static final DataComponentType.Valued<ItemRarity> RARITY = valued("rarity");
/**
* Controls the enchantments on an item.
* <br>
* If not present on a non-enchantment book, this item will not work in an anvil.
*
* @see #STORED_ENCHANTMENTS
* List of recipes that should be unlocked when using the Knowledge Book item.
*/
public static final DataComponentType.Valued<ItemEnchantments> ENCHANTMENTS = valued("enchantments");
/**
* Controls which blocks a player in Adventure mode can place on with this item.
*/
public static final DataComponentType.Valued<ItemAdventurePredicate> CAN_PLACE_ON = valued("can_place_on");
/**
* Controls which blocks a player in Adventure mode can break with this item.
*/
public static final DataComponentType.Valued<ItemAdventurePredicate> CAN_BREAK = valued("can_break");
/**
* Holds attribute modifiers applied to any item,
* if not set, has an implicit default value based on the item type's
* default attributes (e.g. attack damage for weapons).
*/
public static final DataComponentType.Valued<ItemAttributeModifiers> ATTRIBUTE_MODIFIERS = valued("attribute_modifiers");
/**
* Controls the minecraft:custom_model_data property in the item model.
*/
public static final DataComponentType.Valued<CustomModelData> CUSTOM_MODEL_DATA = valued("custom_model_data");
/**
* If set, disables 'additional' tooltip part which comes from the item type
* (e.g. content of a shulker).
*/
public static final DataComponentType.NonValued HIDE_ADDITIONAL_TOOLTIP = unvalued("hide_additional_tooltip");
/**
* If set, it will completely hide whole item tooltip (that includes item name).
*/
public static final DataComponentType.NonValued HIDE_TOOLTIP = unvalued("hide_tooltip");
public static final DataComponentType.Valued<List<Key>> RECIPES = valued("recipes");
/**
* The additional experience cost required to modify an item in an Anvil.
* If not present, has an implicit default value of: {@code 0}.
*/
public static final DataComponentType.Valued<@NonNegative Integer> REPAIR_COST = valued("repair_cost");
// /**
// * Causes an item to not be pickable in the creative menu, currently not very useful.
// */
// public static final DataComponentType.NonValued CREATIVE_SLOT_LOCK = unvalued("creative_slot_lock");
/**
* Overrides the enchantment glint effect on an item.
* If not present, default behaviour is used.
*/
public static final DataComponentType.Valued<Boolean> ENCHANTMENT_GLINT_OVERRIDE = valued("enchantment_glint_override");
/**
* Marks that a projectile item would be intangible when fired
* (i.e. can only be picked up by a creative mode player).
*/
public static final DataComponentType.NonValued INTANGIBLE_PROJECTILE = unvalued("intangible_projectile");
/**
* Controls potential food benefits gained when consuming the item the component is applied on.
* Requires the {@link #CONSUMABLE} component to allow consumption in the first place.
*/
public static final DataComponentType.Valued<FoodProperties> FOOD = valued("food");
public static final DataComponentType.Valued<Consumable> CONSUMABLE = valued("consumable");
public static final DataComponentType.Valued<UseRemainder> USE_REMAINDER = valued("use_remainder");
public static final DataComponentType.Valued<UseCooldown> USE_COOLDOWN = valued("use_cooldown");
/**
* If present, this item will not take damage from the specified damage types.
*/
public static final DataComponentType.Valued<DamageResistant> DAMAGE_RESISTANT = valued("damage_resistant");
/**
* Controls the behavior of the item as a tool.
*/
public static final DataComponentType.Valued<Tool> TOOL = valued("tool");
public static final DataComponentType.Valued<Enchantable> ENCHANTABLE = valued("enchantable");
public static final DataComponentType.Valued<Equippable> EQUIPPABLE = valued("equippable");
public static final DataComponentType.Valued<Repairable> REPAIRABLE = valued("repairable");
public static final DataComponentType.NonValued GLIDER = unvalued("glider");
public static final DataComponentType.Valued<Key> TOOLTIP_STYLE = valued("tooltip_style");
public static final DataComponentType.Valued<DeathProtection> DEATH_PROTECTION = valued("death_protection");
/**
* Stores list of enchantments and their levels for an Enchanted Book.
* Unlike {@link #ENCHANTMENTS}, the effects provided by enchantments
@@ -208,114 +336,51 @@ public final class DataComponentTypes {
* @see #ENCHANTMENTS
*/
public static final DataComponentType.Valued<ItemEnchantments> STORED_ENCHANTMENTS = valued("stored_enchantments");
/**
* Represents a color applied to a dyeable item (in the {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#DYEABLE} item tag).
*/
public static final DataComponentType.Valued<DyedItemColor> DYED_COLOR = valued("dyed_color");
/**
* Represents the tint of the decorations on the {@link org.bukkit.inventory.ItemType#FILLED_MAP} item.
*/
public static final DataComponentType.Valued<MapItemColor> MAP_COLOR = valued("map_color");
/**
* References the shared map state holding map contents and markers for a {@link org.bukkit.inventory.ItemType#FILLED_MAP}.
*/
public static final DataComponentType.Valued<MapId> MAP_ID = valued("map_id");
/**
* Holds a list of markers to be placed on a {@link org.bukkit.inventory.ItemType#FILLED_MAP} (used for Explorer Maps).
*/
public static final DataComponentType.Valued<MapDecorations> MAP_DECORATIONS = valued("map_decorations");
/**
* Internal map item state used in the map crafting recipe.
*/
public static final DataComponentType.Valued<MapPostProcessing> MAP_POST_PROCESSING = valued("map_post_processing");
/**
* Holds all projectiles that have been loaded into a Crossbow.
* If not present, the Crossbow is not charged.
*/
public static final DataComponentType.Valued<ChargedProjectiles> CHARGED_PROJECTILES = valued("charged_projectiles");
/**
* Holds all items stored inside a Bundle.
* If removed, items cannot be added to the Bundle.
*/
public static final DataComponentType.Valued<BundleContents> BUNDLE_CONTENTS = valued("bundle_contents");
/**
* Holds the contents of a potion (Potion, Splash Potion, Lingering Potion),
* or potion applied to a Tipped Arrow.
*/
public static final DataComponentType.Valued<PotionContents> POTION_CONTENTS = valued("potion_contents");
/**
* Holds the effects that will be applied when consuming Suspicious Stew.
*/
public static final DataComponentType.Valued<SuspiciousStewEffects> SUSPICIOUS_STEW_EFFECTS = valued("suspicious_stew_effects");
/**
* Holds the contents in a Book and Quill.
* Controls the behavior of the item as a tool.
*/
public static final DataComponentType.Valued<WritableBookContent> WRITABLE_BOOK_CONTENT = valued("writable_book_content");
/**
* Holds the contents and metadata of a Written Book.
*/
public static final DataComponentType.Valued<WrittenBookContent> WRITTEN_BOOK_CONTENT = valued("written_book_content");
public static final DataComponentType.Valued<Tool> TOOL = valued("tool");
public static final DataComponentType.Valued<Key> TOOLTIP_STYLE = valued("tooltip_style");
/**
* Holds the trims applied to an item in recipes
*/
public static final DataComponentType.Valued<ItemArmorTrim> TRIM = valued("trim");
/**
* If set, the item will not lose any durability when used.
*/
public static final DataComponentType.Valued<Unbreakable> UNBREAKABLE = valued("unbreakable");
public static final DataComponentType.Valued<UseCooldown> USE_COOLDOWN = valued("use_cooldown");
public static final DataComponentType.Valued<UseRemainder> USE_REMAINDER = valued("use_remainder");
/**
* Holds the contents in a Book and Quill.
*/
public static final DataComponentType.Valued<WritableBookContent> WRITABLE_BOOK_CONTENT = valued("writable_book_content");
/**
* Holds the contents and metadata of a Written Book.
*/
public static final DataComponentType.Valued<WrittenBookContent> WRITTEN_BOOK_CONTENT = valued("written_book_content");
// End generate - DataComponentTypes
// /**
// * Causes an item to not be pickable in the creative menu, currently not very useful.
// */
// public static final DataComponentType.NonValued CREATIVE_SLOT_LOCK = unvalued("creative_slot_lock");
// debug_stick_state - Block Property API
// entity_data
// bucket_entity_data
// block_entity_data
/**
* Holds the instrument type used by a Goat Horn.
*/
public static final DataComponentType.Valued<MusicInstrument> INSTRUMENT = valued("instrument");
/**
* Controls the amplifier amount for an Ominous Bottle's Bad Omen effect.
*/
public static final DataComponentType.Valued<OminousBottleAmplifier> OMINOUS_BOTTLE_AMPLIFIER = valued("ominous_bottle_amplifier");
public static final DataComponentType.Valued<JukeboxPlayable> JUKEBOX_PLAYABLE = valued("jukebox_playable");
/**
* List of recipes that should be unlocked when using the Knowledge Book item.
*/
public static final DataComponentType.Valued<List<Key>> RECIPES = valued("recipes");
/**
* If present, specifies that the Compass is a Lodestone Compass.
*/
public static final DataComponentType.Valued<LodestoneTracker> LODESTONE_TRACKER = valued("lodestone_tracker");
/**
* Stores the explosion crafted in a Firework Star.
*/
public static final DataComponentType.Valued<FireworkEffect> FIREWORK_EXPLOSION = valued("firework_explosion");
/**
* Stores all explosions crafted into a Firework Rocket, as well as flight duration.
*/
public static final DataComponentType.Valued<Fireworks> FIREWORKS = valued("fireworks");
/**
* Controls the skin displayed on a Player Head.
*/
public static final DataComponentType.Valued<ResolvableProfile> PROFILE = valued("profile");
/**
* Controls the sound played by a Player Head when placed on a Note Block.
*/
public static final DataComponentType.Valued<Key> NOTE_BLOCK_SOUND = valued("note_block_sound");
/**
* Stores the additional patterns applied to a Banner or Shield.
*/
public static final DataComponentType.Valued<BannerPatternLayers> BANNER_PATTERNS = valued("banner_patterns");
/**
* Stores the base color for a Shield.
*/
public static final DataComponentType.Valued<DyeColor> BASE_COLOR = valued("base_color");
/**
* Stores the Sherds applied to each side of a Decorated Pot.
*/
public static final DataComponentType.Valued<PotDecorations> POT_DECORATIONS = valued("pot_decorations");
/**
* Holds the contents of container blocks (Chests, Shulker Boxes) in item form.
*/
public static final DataComponentType.Valued<ItemContainerContents> CONTAINER = valued("container");
/**
* Holds block state properties to apply when placing a block.
*/
public static final DataComponentType.Valued<BlockItemDataProperties> BLOCK_DATA = valued("block_state");
// bees
// /**
// * Holds the lock state of a container-like block,
@@ -325,10 +390,6 @@ public final class DataComponentTypes {
// * to open this container.
// */
// public static final DataComponentType.Valued<LockCode> LOCK = valued("lock");
/**
* Holds the unresolved loot table and seed of a container-like block.
*/
public static final DataComponentType.Valued<SeededContainerLoot> CONTAINER_LOOT = valued("container_loot");
private static DataComponentType.NonValued unvalued(final String name) {
return (DataComponentType.NonValued) requireNonNull(Registry.DATA_COMPONENT_TYPE.get(NamespacedKey.minecraft(name)), name + " unvalued data component type couldn't be found, this is a bug.");
@@ -4,6 +4,8 @@ package io.papermc.paper.datacomponent.item.consumable;
* Represents the hand animation that is used when a player is consuming this item.
*/
public enum ItemUseAnimation {
// Start generate - ItemUseAnimation
// @GeneratedFrom 1.21.4
NONE,
EAT,
DRINK,
@@ -14,5 +16,6 @@ public enum ItemUseAnimation {
SPYGLASS,
TOOT_HORN,
BRUSH,
BUNDLE
BUNDLE;
// End generate - ItemUseAnimation
}
@@ -1,6 +1,7 @@
package io.papermc.paper.registry;
import io.papermc.paper.datacomponent.DataComponentType;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import net.kyori.adventure.key.Keyed;
@@ -209,7 +210,6 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @param key the key of the typed key.
* @return the constructed typed key.
*/
@ApiStatus.Experimental
default TypedKey<T> typedKey(final Key key) {
return TypedKey.create(this, key);
}
@@ -220,8 +220,29 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @param key the string representation of the key that will be passed to {@link Key#key(String)}.
* @return the constructed typed key.
*/
@ApiStatus.Experimental
default TypedKey<T> typedKey(final @KeyPattern String key) {
default TypedKey<T> typedKey(@KeyPattern final String key) {
return TypedKey.create(this, key);
}
/**
* Constructs a new {@link TagKey} for this registry given the tag key's key.
*
* @param key the key of the typed key.
* @return the constructed tag key.
*/
@ApiStatus.Experimental
default TagKey<T> tagKey(final Key key) {
return TagKey.create(this, key);
}
/**
* Constructs a new {@link TagKey} for this registry given the tag key's key.
*
* @param key the string representation of the key that will be passed to {@link Key#key(String)}.
* @return the constructed tag key.
*/
@ApiStatus.Experimental
default TagKey<T> tagKey(@KeyPattern final String key) {
return TagKey.create(this, key);
}
}
@@ -11,7 +11,6 @@ import org.jspecify.annotations.NullMarked;
*
* @param <T> the value type for the registry
*/
@ApiStatus.Experimental
@NullMarked
public sealed interface TypedKey<T> extends Key permits TypedKeyImpl {
@@ -39,7 +38,6 @@ public sealed interface TypedKey<T> extends Key permits TypedKeyImpl {
* @param <T> value type
* @return a new key for the value key and registry key
*/
@ApiStatus.Experimental
static <T> TypedKey<T> create(final RegistryKey<T> registryKey, final Key key) {
return new TypedKeyImpl<>(key, registryKey);
}
@@ -53,8 +51,7 @@ public sealed interface TypedKey<T> extends Key permits TypedKeyImpl {
* @return a new key for the value key and registry key
* @see Key#key(String)
*/
@ApiStatus.Experimental
static <T> TypedKey<T> create(final RegistryKey<T> registryKey, final @KeyPattern String key) {
static <T> TypedKey<T> create(final RegistryKey<T> registryKey, @KeyPattern final String key) {
return create(registryKey, Key.key(key));
}
}
@@ -24,11 +24,14 @@ import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create;
@NullMarked
public final class RegistryEvents {
// Start generate - RegistryEvents
// @GeneratedFrom 1.21.4
public static final RegistryEventProvider<GameEvent, GameEventRegistryEntry.Builder> GAME_EVENT = create(RegistryKey.GAME_EVENT);
public static final RegistryEventProvider<Enchantment, EnchantmentRegistryEntry.Builder> ENCHANTMENT = create(RegistryKey.ENCHANTMENT);
public static final RegistryEventProvider<Art, PaintingVariantRegistryEntry.Builder> PAINTING_VARIANT = create(RegistryKey.PAINTING_VARIANT);
public static final RegistryEventProvider<PatternType, BannerPatternRegistryEntry.Builder> BANNER_PATTERN = create(RegistryKey.BANNER_PATTERN);
public static final RegistryEventProvider<DamageType, DamageTypeRegistryEntry.Builder> DAMAGE_TYPE = create(RegistryKey.DAMAGE_TYPE);
public static final RegistryEventProvider<Enchantment, EnchantmentRegistryEntry.Builder> ENCHANTMENT = create(RegistryKey.ENCHANTMENT);
public static final RegistryEventProvider<PatternType, BannerPatternRegistryEntry.Builder> BANNER_PATTERN = create(RegistryKey.BANNER_PATTERN);
public static final RegistryEventProvider<Art, PaintingVariantRegistryEntry.Builder> PAINTING_VARIANT = create(RegistryKey.PAINTING_VARIANT);
// End generate - RegistryEvents
private RegistryEvents() {
}
@@ -1,7 +1,9 @@
package io.papermc.paper.registry.tag;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import net.kyori.adventure.key.Keyed;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
@@ -15,15 +17,29 @@ public sealed interface TagKey<T> extends Keyed permits TagKeyImpl {
* Creates a new tag key for a registry.
*
* @param registryKey the registry for the tag
* @param key the specific key for the tag
* @param key the specific key for the tag
* @param <T> the registry value type
* @return a new tag key
* @param <T> the registry value type
*/
@Contract(value = "_, _ -> new", pure = true)
static <T> TagKey<T> create(final RegistryKey<T> registryKey, final Key key) {
return new TagKeyImpl<>(registryKey, key);
}
/**
* Creates a new tag key for a registry.
*
* @param registryKey the registry for the tag
* @param key the string version of a {@link Key} that will be passed to {@link Key#key(String)} for parsing.
* @param <T> the registry value type
* @return a new tag key
* @see Key#key(String)
*/
@ApiStatus.Experimental
static <T> TagKey<T> create(final RegistryKey<T> registryKey, @KeyPattern final String key) {
return create(registryKey, Key.key(key));
}
/**
* Get the registry key for this tag key.
*
+85 -33
View File
@@ -35,57 +35,109 @@ public interface Art extends OldEnum<Art>, Keyed {
return InlinedRegistryBuilderProvider.instance().createPaintingVariant(value);
}
Art KEBAB = getArt("kebab");
Art AZTEC = getArt("aztec");
// Start generate - Art
// @GeneratedFrom 1.21.4
Art ALBAN = getArt("alban");
Art AZTEC = getArt("aztec");
Art AZTEC2 = getArt("aztec2");
Art BOMB = getArt("bomb");
Art PLANT = getArt("plant");
Art WASTELAND = getArt("wasteland");
Art POOL = getArt("pool");
Art COURBET = getArt("courbet");
Art SEA = getArt("sea");
Art SUNSET = getArt("sunset");
Art CREEBET = getArt("creebet");
Art WANDERER = getArt("wanderer");
Art GRAHAM = getArt("graham");
Art MATCH = getArt("match");
Art BUST = getArt("bust");
Art STAGE = getArt("stage");
Art VOID = getArt("void");
Art SKULL_AND_ROSES = getArt("skull_and_roses");
Art WITHER = getArt("wither");
Art FIGHTERS = getArt("fighters");
Art POINTER = getArt("pointer");
Art PIGSCENE = getArt("pigscene");
Art BURNING_SKULL = getArt("burning_skull");
Art SKELETON = getArt("skeleton");
Art DONKEY_KONG = getArt("donkey_kong");
Art EARTH = getArt("earth");
Art WIND = getArt("wind");
Art WATER = getArt("water");
Art FIRE = getArt("fire");
Art BAROQUE = getArt("baroque");
Art HUMBLE = getArt("humble");
Art MEDITATIVE = getArt("meditative");
Art PRAIRIE_RIDE = getArt("prairie_ride");
Art UNPACKED = getArt("unpacked");
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");
// End generate - Art
@NotNull
private static Art getArt(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PAINTING_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
@@ -14,19 +14,19 @@ import org.jetbrains.annotations.ApiStatus;
*/
public interface FeatureFlag extends Keyed {
// Paper start - overhaul FeatureFlag API
/**
* The {@code vanilla} feature flag.
*/
FeatureFlag VANILLA = create("vanilla");
// Start generate - FeatureFlag
// @GeneratedFrom 1.21.4
@ApiStatus.Experimental
FeatureFlag MINECART_IMPROVEMENTS = create("minecart_improvements");
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19.3 - 1.21.1
*
* @deprecated not available since 1.21.2
*/
@Deprecated(since = "1.21.2")
FeatureFlag BUNDLE = deprecated("bundle");
@ApiStatus.Experimental
FeatureFlag REDSTONE_EXPERIMENTS = create("redstone_experiments");
@ApiStatus.Experimental
FeatureFlag TRADE_REBALANCE = create("trade_rebalance");
FeatureFlag VANILLA = create("vanilla");
// End generate - FeatureFlag
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19 - 1.19.4
@@ -37,9 +37,6 @@ public interface FeatureFlag extends Keyed {
@Deprecated(since = "1.20")
FeatureFlag UPDATE_1_20 = deprecated("update_1_20");
@ApiStatus.Experimental // Paper - add missing annotation
FeatureFlag TRADE_REBALANCE = create("trade_rebalance");
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.20.5 - 1.20.6
*
@@ -48,6 +45,14 @@ public interface FeatureFlag extends Keyed {
@Deprecated(since = "1.21")
FeatureFlag UPDATE_121 = deprecated("update_1_21");
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19.3 - 1.21.1
*
* @deprecated not available since 1.21.2
*/
@Deprecated(since = "1.21.2")
FeatureFlag BUNDLE = deprecated("bundle");
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.21.2 - 1.21.3
*
@@ -56,12 +61,6 @@ public interface FeatureFlag extends Keyed {
@Deprecated(since = "1.21.4")
FeatureFlag WINTER_DROP = deprecated("winter_drop");
@ApiStatus.Experimental // Paper - add missing annotation
FeatureFlag REDSTONE_EXPERIMENTS = create("redstone_experiments");
@ApiStatus.Experimental // Paper - add missing annotation
FeatureFlag MINECART_IMPROVEMENTS = create("minecart_improvements");
/**
* An index of all feature flags.
*/
+10 -18
View File
@@ -12,27 +12,19 @@ import org.jetbrains.annotations.NotNull;
*/
public interface Fluid extends OldEnum<Fluid>, Keyed {
/**
* No fluid.
*/
// Start generate - Fluid
// @GeneratedFrom 1.21.4
Fluid EMPTY = getFluid("empty");
/**
* Stationary water.
*/
Fluid WATER = getFluid("water");
/**
* Flowing water.
*/
Fluid FLOWING_WATER = getFluid("flowing_water");
/**
* Stationary lava.
*/
Fluid LAVA = getFluid("lava");
/**
* Flowing lava.
*/
Fluid FLOWING_LAVA = getFluid("flowing_lava");
Fluid FLOWING_WATER = getFluid("flowing_water");
Fluid LAVA = getFluid("lava");
Fluid WATER = getFluid("water");
// End generate - Fluid
@NotNull
private static Fluid getFluid(@NotNull String key) {
return Registry.FLUID.getOrThrow(NamespacedKey.minecraft(key));
+176 -54
View File
@@ -11,107 +11,229 @@ import org.jetbrains.annotations.Nullable;
*/
public abstract class GameEvent implements Keyed {
// Start generate - GameEvent
// @GeneratedFrom 1.21.4
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");
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_PRESS = getEvent("block_activate");
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_SWITCH = getEvent("block_activate");
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_UNPRESS = getEvent("block_deactivate");
@Deprecated(since = "1.19")
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(since = "1.20")
public static final GameEvent DISPENSE_FAIL = getEvent("block_activate");
public static final GameEvent DRINK = getEvent("drink");
@Deprecated(since = "1.19")
public static final GameEvent DRINKING_FINISH = getEvent("drink");
public static final GameEvent EAT = getEvent("eat");
@Deprecated(since = "1.19")
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(since = "1.19")
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(since = "1.19")
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(since = "1.19")
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(since = "1.20.2")
public static final GameEvent ENTITY_ROAR = getEvent("entity_action");
@Deprecated(since = "1.20.2")
public static final GameEvent ENTITY_SHAKE = 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");
@Deprecated(since = "1.19")
public static final GameEvent MOB_INTERACT = getEvent("entity_interact");
public static final GameEvent NOTE_BLOCK_PLAY = getEvent("note_block_play");
@Deprecated(since = "1.20")
public static final GameEvent PISTON_CONTRACT = getEvent("block_deactivate");
@Deprecated(since = "1.20")
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(since = "1.19")
public static final GameEvent RAVAGER_ROAR = getEvent("entity_action");
@Deprecated(since = "1.19")
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(since = "1.19")
public static final GameEvent SHULKER_CLOSE = getEvent("container_close");
@Deprecated(since = "1.19")
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(since = "1.19")
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");
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");
// End generate - GameEvent
/**
* @deprecated in favor of {@link #BLOCK_ACTIVATE}
*/
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_PRESS = BLOCK_ACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_ACTIVATE}
*/
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_SWITCH = BLOCK_ACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_DEACTIVATE}
*/
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_UNPRESS = BLOCK_DEACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_DEACTIVATE}
*/
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_UNSWITCH = BLOCK_DEACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_ACTIVATE}
*/
@Deprecated(since = "1.20")
public static final GameEvent DISPENSE_FAIL = BLOCK_ACTIVATE;
/**
* @deprecated in favor of {@link #DRINK}
*/
@Deprecated(since = "1.19")
public static final GameEvent DRINKING_FINISH = DRINK;
/**
* @deprecated in favor of {@link #ELYTRA_GLIDE}
*/
@Deprecated(since = "1.19")
public static final GameEvent ELYTRA_FREE_FALL = ELYTRA_GLIDE;
/**
* @deprecated in favor of {@link #ENTITY_DAMAGE}
*/
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_DAMAGED = ENTITY_DAMAGE;
/**
* @deprecated in favor of {@link #ENTITY_DIE}
*/
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_DYING = ENTITY_DIE;
/**
* @deprecated in favor of {@link #ENTITY_DIE}
*/
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_KILLED = ENTITY_DIE;
/**
* @deprecated in favor of {@link #ENTITY_ACTION}
*/
@Deprecated(since = "1.20.2")
public static final GameEvent ENTITY_ROAR = ENTITY_ACTION;
/**
* @deprecated in favor of {@link #ENTITY_ACTION}
*/
@Deprecated(since = "1.20.2")
public static final GameEvent ENTITY_SHAKE = ENTITY_ACTION;
/**
* @deprecated in favor of {@link #ENTITY_INTERACT}
*/
@Deprecated(since = "1.19")
public static final GameEvent MOB_INTERACT = ENTITY_INTERACT;
/**
* @deprecated in favor of {@link #BLOCK_DEACTIVATE}
*/
@Deprecated(since = "1.20")
public static final GameEvent PISTON_CONTRACT = BLOCK_DEACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_ACTIVATE}
*/
@Deprecated(since = "1.20")
public static final GameEvent PISTON_EXTEND = BLOCK_ACTIVATE;
/**
* @deprecated in favor of {@link #ENTITY_ACTION}
*/
@Deprecated(since = "1.19")
public static final GameEvent RAVAGER_ROAR = ENTITY_ACTION;
/**
* @deprecated in favor of {@link #BLOCK_CHANGE}
*/
@Deprecated(since = "1.19")
public static final GameEvent RING_BELL = BLOCK_CHANGE;
/**
* @deprecated in favor of {@link #CONTAINER_CLOSE}
*/
@Deprecated(since = "1.19")
public static final GameEvent SHULKER_CLOSE = CONTAINER_CLOSE;
/**
* @deprecated in favor of {@link #CONTAINER_OPEN}
*/
@Deprecated(since = "1.19")
public static final GameEvent SHULKER_OPEN = CONTAINER_OPEN;
/**
* @deprecated in favor of {@link #ENTITY_ACTION}
*/
@Deprecated(since = "1.19")
public static final GameEvent WOLF_SHAKING = ENTITY_ACTION;
/**
* Returns a {@link GameEvent} by a {@link NamespacedKey}.
*
@@ -11,25 +11,46 @@ import org.jetbrains.annotations.NotNull;
@ApiStatus.Experimental
public interface JukeboxSong extends Keyed, Translatable {
public static final JukeboxSong THIRTEEN = get("13");
public static final JukeboxSong CAT = get("cat");
public static final JukeboxSong BLOCKS = get("blocks");
public static final JukeboxSong CHIRP = get("chirp");
public static final JukeboxSong FAR = get("far");
public static final JukeboxSong MALL = get("mall");
public static final JukeboxSong MELLOHI = get("mellohi");
public static final JukeboxSong STAL = get("stal");
public static final JukeboxSong STRAD = get("strad");
public static final JukeboxSong WARD = get("ward");
public static final JukeboxSong ELEVEN = get("11");
public static final JukeboxSong WAIT = get("wait");
public static final JukeboxSong PIGSTEP = get("pigstep");
public static final JukeboxSong OTHERSIDE = get("otherside");
public static final JukeboxSong FIVE = get("5");
public static final JukeboxSong RELIC = get("relic");
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");
// Start generate - JukeboxSong
// @GeneratedFrom 1.21.4
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");
// End generate - JukeboxSong
@NotNull
private static JukeboxSong get(@NotNull String key) {
File diff suppressed because it is too large. Load diff
@@ -10,15 +10,25 @@ import org.jetbrains.annotations.Nullable;
public abstract class MusicInstrument implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - translation keys
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");
public static final MusicInstrument FEEL_GOAT_HORN = getInstrument("feel_goat_horn");
// Start generate - MusicInstrument
// @GeneratedFrom 1.21.4
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 YEARN_GOAT_HORN = getInstrument("yearn_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");
// End generate - MusicInstrument
/**
* Returns a {@link MusicInstrument} by a {@link NamespacedKey}.
*
@@ -290,15 +290,15 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see MemoryKey
*/
Registry<MemoryKey> MEMORY_MODULE_TYPE = new NotARegistry<>() {
Registry<MemoryKey<?>> MEMORY_MODULE_TYPE = new NotARegistry<>() {
@Override
public Iterator iterator() {
public Iterator<MemoryKey<?>> iterator() {
return MemoryKey.values().iterator();
}
@Override
public @Nullable MemoryKey get(final NamespacedKey key) {
public @Nullable MemoryKey<?> get(final NamespacedKey key) {
return MemoryKey.getByKey(key);
}
};
File diff suppressed because it is too large. Load diff
@@ -7,92 +7,95 @@ import org.jetbrains.annotations.NotNull;
* Represents a countable statistic, which is tracked by the server.
*/
public enum Statistic implements Keyed {
DAMAGE_DEALT,
DAMAGE_TAKEN,
DEATHS,
MOB_KILLS,
PLAYER_KILLS,
FISH_CAUGHT,
// Start generate - StatisticCustom
// @GeneratedFrom 1.21.4
ANIMALS_BRED,
LEAVE_GAME,
JUMP,
DROP_COUNT,
DROP(Type.ITEM),
PICKUP(Type.ITEM),
/**
* Name is misleading, actually records ticks played.
*/
PLAY_ONE_MINUTE,
TOTAL_WORLD_TIME,
WALK_ONE_CM,
WALK_ON_WATER_ONE_CM,
FALL_ONE_CM,
SNEAK_TIME,
CLIMB_ONE_CM,
FLY_ONE_CM,
WALK_UNDER_WATER_ONE_CM,
MINECART_ONE_CM,
BOAT_ONE_CM,
PIG_ONE_CM,
HORSE_ONE_CM,
SPRINT_ONE_CM,
CROUCH_ONE_CM,
AVIATE_ONE_CM,
MINE_BLOCK(Type.BLOCK),
USE_ITEM(Type.ITEM),
BREAK_ITEM(Type.ITEM),
CRAFT_ITEM(Type.ITEM),
KILL_ENTITY(Type.ENTITY),
ENTITY_KILLED_BY(Type.ENTITY),
TIME_SINCE_DEATH,
TALKED_TO_VILLAGER,
TRADED_WITH_VILLAGER,
CAKE_SLICES_EATEN,
CAULDRON_FILLED,
CAULDRON_USED,
BELL_RING,
BOAT_ONE_CM,
ARMOR_CLEANED,
BANNER_CLEANED,
BREWINGSTAND_INTERACTION,
BEACON_INTERACTION,
DROPPER_INSPECTED,
HOPPER_INSPECTED,
DISPENSER_INSPECTED,
NOTEBLOCK_PLAYED,
NOTEBLOCK_TUNED,
FLOWER_POTTED,
TRAPPED_CHEST_TRIGGERED,
ENDERCHEST_OPENED,
ITEM_ENCHANTED,
RECORD_PLAYED,
FURNACE_INTERACTION,
CRAFTING_TABLE_INTERACTION,
CHEST_OPENED,
SLEEP_IN_BED,
SHULKER_BOX_OPENED,
TIME_SINCE_REST,
SWIM_ONE_CM,
CLEAN_SHULKER_BOX,
CLIMB_ONE_CM,
CROUCH_ONE_CM,
DAMAGE_ABSORBED,
DAMAGE_BLOCKED_BY_SHIELD,
DAMAGE_DEALT,
DAMAGE_DEALT_ABSORBED,
DAMAGE_DEALT_RESISTED,
DAMAGE_BLOCKED_BY_SHIELD,
DAMAGE_ABSORBED,
DAMAGE_RESISTED,
CLEAN_SHULKER_BOX,
OPEN_BARREL,
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,
INTERACT_WITH_SMOKER,
INTERACT_WITH_LECTERN,
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,
BELL_RING,
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,
INTERACT_WITH_ANVIL,
INTERACT_WITH_GRINDSTONE,
SLEEP_IN_BED,
SNEAK_TIME,
SPRINT_ONE_CM,
STRIDER_ONE_CM,
SWIM_ONE_CM,
TALKED_TO_VILLAGER,
TARGET_HIT,
INTERACT_WITH_SMITHING_TABLE,
STRIDER_ONE_CM;
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,
// End generate - StatisticCustom
// Start generate - StatisticType
// @GeneratedFrom 1.21.4
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);
// End generate - StatisticType
private final Type type;
private final NamespacedKey key;
File diff suppressed because it is too large. Load diff
@@ -17,135 +17,73 @@ import org.jetbrains.annotations.NotNull;
*/
public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
/**
* Maximum health of an Entity.
*/
Attribute MAX_HEALTH = getAttribute("max_health");
/**
* Range at which an Entity will follow others.
*/
Attribute FOLLOW_RANGE = getAttribute("follow_range");
/**
* Resistance of an Entity to knockback.
*/
Attribute KNOCKBACK_RESISTANCE = getAttribute("knockback_resistance");
/**
* Movement speed of an Entity.
*/
Attribute MOVEMENT_SPEED = getAttribute("movement_speed");
/**
* Flying speed of an Entity.
*/
Attribute FLYING_SPEED = getAttribute("flying_speed");
/**
* Attack damage of an Entity.
*/
Attribute ATTACK_DAMAGE = getAttribute("attack_damage");
/**
* Attack knockback of an Entity.
*/
Attribute ATTACK_KNOCKBACK = getAttribute("attack_knockback");
/**
* Attack speed of an Entity.
*/
Attribute ATTACK_SPEED = getAttribute("attack_speed");
/**
* Armor bonus of an Entity.
*/
// Start generate - Attribute
// @GeneratedFrom 1.21.4
Attribute ARMOR = getAttribute("armor");
/**
* Armor durability bonus of an Entity.
*/
Attribute ARMOR_TOUGHNESS = getAttribute("armor_toughness");
/**
* The fall damage multiplier of an Entity.
*/
Attribute FALL_DAMAGE_MULTIPLIER = getAttribute("fall_damage_multiplier");
/**
* Luck bonus of an Entity.
*/
Attribute LUCK = getAttribute("luck");
/**
* Maximum absorption of an Entity.
*/
Attribute MAX_ABSORPTION = getAttribute("max_absorption");
/**
* The distance which an Entity can fall without damage.
*/
Attribute SAFE_FALL_DISTANCE = getAttribute("safe_fall_distance");
/**
* The relative scale of an Entity.
*/
Attribute SCALE = getAttribute("scale");
/**
* The height which an Entity can walk over.
*/
Attribute STEP_HEIGHT = getAttribute("step_height");
/**
* The gravity applied to an Entity.
*/
Attribute GRAVITY = getAttribute("gravity");
/**
* Strength with which an Entity will jump.
*/
Attribute JUMP_STRENGTH = getAttribute("jump_strength");
/**
* How long an entity remains burning after ignition.
*/
Attribute BURNING_TIME = getAttribute("burning_time");
/**
* Resistance to knockback from explosions.
*/
Attribute EXPLOSION_KNOCKBACK_RESISTANCE = getAttribute("explosion_knockback_resistance");
/**
* Movement speed through difficult terrain.
*/
Attribute MOVEMENT_EFFICIENCY = getAttribute("movement_efficiency");
/**
* Oxygen use underwater.
*/
Attribute OXYGEN_BONUS = getAttribute("oxygen_bonus");
/**
* Movement speed through water.
*/
Attribute WATER_MOVEMENT_EFFICIENCY = getAttribute("water_movement_efficiency");
/**
* Range at which mobs will be tempted by items.
*/
Attribute TEMPT_RANGE = getAttribute("tempt_range");
/**
* The block reach distance of a Player.
*/
Attribute BLOCK_INTERACTION_RANGE = getAttribute("block_interaction_range");
/**
* The entity reach distance of a Player.
*/
Attribute ENTITY_INTERACTION_RANGE = getAttribute("entity_interaction_range");
/**
* Block break speed of a Player.
*/
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");
/**
* Mining speed for correct tools.
*/
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");
/**
* Sneaking speed.
*/
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");
/**
* Underwater mining speed.
*/
Attribute SUBMERGED_MINING_SPEED = getAttribute("submerged_mining_speed");
/**
* Sweeping damage.
*/
Attribute SWEEPING_DAMAGE_RATIO = getAttribute("sweeping_damage_ratio");
/**
* Chance of a zombie to spawn reinforcements.
*/
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");
// End generate - Attribute
@NotNull
private static Attribute getAttribute(@NotNull String key) {
return Registry.ATTRIBUTE.getOrThrow(NamespacedKey.minecraft(key));
@@ -23,72 +23,139 @@ import org.jetbrains.annotations.NotNull;
*/
public interface Biome extends OldEnum<Biome>, Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
Biome OCEAN = getBiome("ocean");
Biome PLAINS = getBiome("plains");
Biome DESERT = getBiome("desert");
Biome WINDSWEPT_HILLS = getBiome("windswept_hills");
Biome FOREST = getBiome("forest");
Biome TAIGA = getBiome("taiga");
Biome SWAMP = getBiome("swamp");
Biome MANGROVE_SWAMP = getBiome("mangrove_swamp");
Biome RIVER = getBiome("river");
Biome NETHER_WASTES = getBiome("nether_wastes");
Biome THE_END = getBiome("the_end");
Biome FROZEN_OCEAN = getBiome("frozen_ocean");
Biome FROZEN_RIVER = getBiome("frozen_river");
Biome SNOWY_PLAINS = getBiome("snowy_plains");
Biome MUSHROOM_FIELDS = getBiome("mushroom_fields");
Biome BEACH = getBiome("beach");
Biome JUNGLE = getBiome("jungle");
Biome SPARSE_JUNGLE = getBiome("sparse_jungle");
Biome DEEP_OCEAN = getBiome("deep_ocean");
Biome STONY_SHORE = getBiome("stony_shore");
Biome SNOWY_BEACH = getBiome("snowy_beach");
Biome BIRCH_FOREST = getBiome("birch_forest");
Biome DARK_FOREST = getBiome("dark_forest");
Biome PALE_GARDEN = getBiome("pale_garden");
Biome SNOWY_TAIGA = getBiome("snowy_taiga");
Biome OLD_GROWTH_PINE_TAIGA = getBiome("old_growth_pine_taiga");
Biome WINDSWEPT_FOREST = getBiome("windswept_forest");
Biome SAVANNA = getBiome("savanna");
Biome SAVANNA_PLATEAU = getBiome("savanna_plateau");
// Start generate - Biome
// @GeneratedFrom 1.21.4
Biome BADLANDS = getBiome("badlands");
Biome WOODED_BADLANDS = getBiome("wooded_badlands");
Biome SMALL_END_ISLANDS = getBiome("small_end_islands");
Biome END_MIDLANDS = getBiome("end_midlands");
Biome END_HIGHLANDS = getBiome("end_highlands");
Biome END_BARRENS = getBiome("end_barrens");
Biome WARM_OCEAN = getBiome("warm_ocean");
Biome LUKEWARM_OCEAN = getBiome("lukewarm_ocean");
Biome COLD_OCEAN = getBiome("cold_ocean");
Biome DEEP_LUKEWARM_OCEAN = getBiome("deep_lukewarm_ocean");
Biome DEEP_COLD_OCEAN = getBiome("deep_cold_ocean");
Biome DEEP_FROZEN_OCEAN = getBiome("deep_frozen_ocean");
Biome THE_VOID = getBiome("the_void");
Biome SUNFLOWER_PLAINS = getBiome("sunflower_plains");
Biome WINDSWEPT_GRAVELLY_HILLS = getBiome("windswept_gravelly_hills");
Biome FLOWER_FOREST = getBiome("flower_forest");
Biome ICE_SPIKES = getBiome("ice_spikes");
Biome OLD_GROWTH_BIRCH_FOREST = getBiome("old_growth_birch_forest");
Biome OLD_GROWTH_SPRUCE_TAIGA = getBiome("old_growth_spruce_taiga");
Biome WINDSWEPT_SAVANNA = getBiome("windswept_savanna");
Biome ERODED_BADLANDS = getBiome("eroded_badlands");
Biome BAMBOO_JUNGLE = getBiome("bamboo_jungle");
Biome SOUL_SAND_VALLEY = getBiome("soul_sand_valley");
Biome CRIMSON_FOREST = getBiome("crimson_forest");
Biome WARPED_FOREST = getBiome("warped_forest");
Biome BASALT_DELTAS = getBiome("basalt_deltas");
Biome DRIPSTONE_CAVES = getBiome("dripstone_caves");
Biome LUSH_CAVES = getBiome("lush_caves");
Biome DEEP_DARK = getBiome("deep_dark");
Biome MEADOW = getBiome("meadow");
Biome GROVE = getBiome("grove");
Biome SNOWY_SLOPES = getBiome("snowy_slopes");
Biome FROZEN_PEAKS = getBiome("frozen_peaks");
Biome JAGGED_PEAKS = getBiome("jagged_peaks");
Biome STONY_PEAKS = getBiome("stony_peaks");
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");
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");
// End generate - Biome
/**
* Represents a custom Biome
*
File diff suppressed because it is too large. Load diff
@@ -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
}
@@ -14,50 +14,96 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface PatternType extends OldEnum<PatternType>, Keyed {
// Start generate - PatternType
// @GeneratedFrom 1.21.4
PatternType BASE = getType("base");
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 STRIPE_BOTTOM = getType("stripe_bottom");
PatternType STRIPE_TOP = getType("stripe_top");
PatternType STRIPE_LEFT = getType("stripe_left");
PatternType STRIPE_RIGHT = getType("stripe_right");
PatternType STRIPE_CENTER = getType("stripe_center");
PatternType STRIPE_MIDDLE = getType("stripe_middle");
PatternType STRIPE_DOWNRIGHT = getType("stripe_downright");
PatternType STRIPE_DOWNLEFT = getType("stripe_downleft");
PatternType SMALL_STRIPES = getType("small_stripes");
PatternType CROSS = getType("cross");
PatternType STRAIGHT_CROSS = getType("straight_cross");
PatternType TRIANGLE_BOTTOM = getType("triangle_bottom");
PatternType TRIANGLE_TOP = getType("triangle_top");
PatternType TRIANGLES_BOTTOM = getType("triangles_bottom");
PatternType TRIANGLES_TOP = getType("triangles_top");
PatternType DIAGONAL_LEFT = getType("diagonal_left");
PatternType DIAGONAL_UP_RIGHT = getType("diagonal_up_right");
PatternType DIAGONAL_UP_LEFT = getType("diagonal_up_left");
PatternType DIAGONAL_RIGHT = getType("diagonal_right");
PatternType CIRCLE = getType("circle");
PatternType RHOMBUS = getType("rhombus");
PatternType HALF_VERTICAL = getType("half_vertical");
PatternType HALF_HORIZONTAL = getType("half_horizontal");
PatternType HALF_VERTICAL_RIGHT = getType("half_vertical_right");
PatternType HALF_HORIZONTAL_BOTTOM = getType("half_horizontal_bottom");
PatternType BORDER = getType("border");
PatternType CURLY_BORDER = getType("curly_border");
PatternType CREEPER = getType("creeper");
PatternType GRADIENT = getType("gradient");
PatternType GRADIENT_UP = getType("gradient_up");
PatternType BRICKS = getType("bricks");
PatternType SKULL = getType("skull");
PatternType FLOWER = getType("flower");
PatternType MOJANG = getType("mojang");
PatternType GLOBE = getType("globe");
PatternType PIGLIN = getType("piglin");
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");
// End generate - PatternType
// Paper start - deprecate getKey
/**
* @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
@@ -11,8 +11,19 @@ public interface CaveVinesPlant extends BlockData {
* Gets the value of the 'berries' property.
*
* @return the 'berries' value
* @deprecated bad name, use {@link #hasBerries()}
*/
boolean isBerries();
@Deprecated
default boolean isBerries() {
return this.hasBerries();
}
/**
* Gets the value of the 'berries' property.
*
* @return the 'berries' value
*/
boolean hasBerries();
/**
* Sets the value of the 'berries' property.
@@ -48,18 +48,23 @@ public interface Crafter extends BlockData {
* @return the 'orientation' value
*/
@NotNull
Orientation getOrientation();
org.bukkit.block.Orientation getOrientation();
/**
* 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);
/**
* 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
public enum Orientation {
DOWN_EAST,
@@ -4,17 +4,18 @@ import org.bukkit.block.data.Directional;
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
*/
public boolean isCracked();
/**
* Set whether the pot is cracked.
* Gets the value of the 'cracked' property.
*
* @param cracked whether the pot is cracked
* @return the 'cracked' value
*/
public void setCracked(boolean cracked);
// Paper end - add missing block data api
boolean isCracked();
/**
* Sets the value of the 'cracked' property.
*
* @param cracked the new 'cracked' value
*/
void setCracked(boolean cracked);
}
@@ -14,18 +14,23 @@ public interface Jigsaw extends BlockData {
* @return the 'orientation' value
*/
@NotNull
Orientation getOrientation();
org.bukkit.block.Orientation getOrientation();
/**
* 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);
/**
* 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
public enum Orientation {
DOWN_EAST,
@@ -14,4 +14,11 @@ public interface Jukebox extends BlockData {
* @return the 'has_record' value
*/
boolean hasRecord();
/**
* Sets the value of the 'has_record' property.
*
* @param hasRecord the new 'has_record' value
*/
void setHasRecord(boolean hasRecord);
}
@@ -15,4 +15,11 @@ public interface Lectern extends Directional, Powerable {
* @return the 'has_book' value
*/
boolean hasBook();
/**
* Sets the value of the 'has_book' property.
*
* @param hasBook the new 'has_book' value
*/
void setHasBook(boolean hasBook);
}
@@ -33,7 +33,7 @@ public interface MossyCarpet extends BlockData {
* @return if face is enabled
*/
@NotNull
Height getHeight(@NotNull BlockFace face);
Wall.Height getHeight(@NotNull BlockFace face);
/**
* Set the height of the specified face.
@@ -41,11 +41,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);
/**
* 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
public enum Height {
/**
* Not present.
@@ -13,16 +13,39 @@ 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();
@Deprecated
default Phase getPhase() {
return this.getSculkSensorPhase();
}
/**
* Sets the value of the 'sculk_sensor_phase' property.
*
* @param phase the new 'sculk_sensor_phase' value
* @deprecated bad name, use {@link #setSculkSensorPhase(Phase)}
*/
@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);
/**
* The Phase of the sensor.
@@ -7,6 +7,11 @@ import org.jetbrains.annotations.NotNull;
public interface Switch extends Directional, FaceAttachable, Powerable {
@NotNull
AttachedFace getAttachedFace();
void setAttachedFace(@NotNull AttachedFace face);
/**
* Gets the value of the 'face' property.
*
@@ -15,7 +20,9 @@ public interface Switch extends Directional, FaceAttachable, Powerable {
*/
@NotNull
@Deprecated(since = "1.15.2")
Face getFace();
default Face getFace() {
return Face.valueOf(this.getAttachedFace().name());
}
/**
* Sets the value of the 'face' property.
@@ -24,7 +31,9 @@ public interface Switch extends Directional, FaceAttachable, Powerable {
* @deprecated use {@link #setAttachedFace(AttachedFace)}
*/
@Deprecated(since = "1.15.2")
void setFace(@NotNull Face face);
default void setFace(@NotNull Face face) {
this.setAttachedFace(AttachedFace.valueOf(face.name()));
}
/**
* The face to which a switch type block is stuck.
@@ -26,7 +26,9 @@ public interface Vault extends Directional {
*/
@Deprecated(since = "1.21.3", forRemoval = true)
@NotNull
State getTrialSpawnerState();
default State getTrialSpawnerState() {
return this.getVaultState();
}
/**
* Sets the value of the 'vault_state' property.
@@ -42,7 +44,9 @@ public interface Vault extends Directional {
* @deprecated see {@link #setVaultState(State)}
*/
@Deprecated(since = "1.21.3", forRemoval = true)
void setTrialSpawnerState(@NotNull State state);
default void setTrialSpawnerState(@NotNull State state) {
this.setVaultState(state);
}
/**
* Gets the value of the 'ominous' property.
@@ -21,55 +21,106 @@ import org.jetbrains.annotations.NotNull;
@ApiStatus.Experimental
public interface DamageType extends Keyed, Translatable {
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");
public static final DamageType ON_FIRE = getDamageType("on_fire");
public static final DamageType LAVA = getDamageType("lava");
public static final DamageType HOT_FLOOR = getDamageType("hot_floor");
public static final DamageType IN_WALL = getDamageType("in_wall");
public static final DamageType CRAMMING = getDamageType("cramming");
public static final DamageType DROWN = getDamageType("drown");
public static final DamageType STARVE = getDamageType("starve");
public static final DamageType CACTUS = getDamageType("cactus");
public static final DamageType FALL = getDamageType("fall");
public static final DamageType ENDER_PEARL = getDamageType("ender_pearl");
public static final DamageType FLY_INTO_WALL = getDamageType("fly_into_wall");
public static final DamageType OUT_OF_WORLD = getDamageType("out_of_world");
public static final DamageType GENERIC = getDamageType("generic");
public static final DamageType MAGIC = getDamageType("magic");
public static final DamageType WITHER = getDamageType("wither");
public static final DamageType DRAGON_BREATH = getDamageType("dragon_breath");
public static final DamageType DRY_OUT = getDamageType("dry_out");
public static final DamageType SWEET_BERRY_BUSH = getDamageType("sweet_berry_bush");
public static final DamageType FREEZE = getDamageType("freeze");
public static final DamageType STALAGMITE = getDamageType("stalagmite");
public static final DamageType FALLING_BLOCK = getDamageType("falling_block");
public static final DamageType FALLING_ANVIL = getDamageType("falling_anvil");
public static final DamageType FALLING_STALACTITE = getDamageType("falling_stalactite");
public static final DamageType STING = getDamageType("sting");
public static final DamageType MOB_ATTACK = getDamageType("mob_attack");
public static final DamageType MOB_ATTACK_NO_AGGRO = getDamageType("mob_attack_no_aggro");
public static final DamageType PLAYER_ATTACK = getDamageType("player_attack");
public static final DamageType ARROW = getDamageType("arrow");
public static final DamageType TRIDENT = getDamageType("trident");
public static final DamageType MOB_PROJECTILE = getDamageType("mob_projectile");
public static final DamageType SPIT = getDamageType("spit");
public static final DamageType FIREWORKS = getDamageType("fireworks");
public static final DamageType FIREBALL = getDamageType("fireball");
public static final DamageType UNATTRIBUTED_FIREBALL = getDamageType("unattributed_fireball");
public static final DamageType WITHER_SKULL = getDamageType("wither_skull");
public static final DamageType THROWN = getDamageType("thrown");
public static final DamageType INDIRECT_MAGIC = getDamageType("indirect_magic");
public static final DamageType THORNS = getDamageType("thorns");
public static final DamageType EXPLOSION = getDamageType("explosion");
public static final DamageType PLAYER_EXPLOSION = getDamageType("player_explosion");
public static final DamageType SONIC_BOOM = getDamageType("sonic_boom");
public static final DamageType BAD_RESPAWN_POINT = getDamageType("bad_respawn_point");
public static final DamageType OUTSIDE_BORDER = getDamageType("outside_border");
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");
// Start generate - DamageType
// @GeneratedFrom 1.21.4
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");
// End generate - DamageType
@NotNull
private static DamageType getDamageType(@NotNull String key) {
@@ -6,7 +6,10 @@ import org.jetbrains.annotations.NotNull;
/**
* Represents the applicable target for a {@link Enchantment}
*
* @deprecated enchantment groupings are now managed by tags, not categories
*/
@Deprecated(since = "1.20.5", forRemoval = true)
public enum EnchantmentTarget {
/**
* Allows the Enchantment to be placed on all items
@@ -175,12 +175,15 @@ public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Pa
*/
public enum Status {
NOT_IN_WORLD, // Paper
NOT_IN_WORLD,
// Start generate - BoatStatus
// @GeneratedFrom 1.21.4
IN_WATER,
UNDER_WATER,
UNDER_FLOWING_WATER,
ON_LAND,
IN_AIR;
// End generate - BoatStatus
}
// Paper start
@@ -52,18 +52,31 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
*/
interface Type extends OldEnum<Type>, Keyed {
Type TABBY = getType("tabby");
Type BLACK = getType("black");
Type RED = getType("red");
Type SIAMESE = getType("siamese");
Type BRITISH_SHORTHAIR = getType("british_shorthair");
Type CALICO = getType("calico");
Type PERSIAN = getType("persian");
Type RAGDOLL = getType("ragdoll");
Type WHITE = getType("white");
Type JELLIE = getType("jellie");
// Start generate - CatType
// @GeneratedFrom 1.21.4
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");
// End generate - CatType
@NotNull
private static Type getType(@NotNull String key) {
return Registry.CAT_VARIANT.getOrThrow(NamespacedKey.minecraft(key));
@@ -45,299 +45,158 @@ 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.
/**
* An item resting on the ground.
* <p>
* Spawn with {@link World#dropItem(Location, ItemStack)} or {@link
* World#dropItemNaturally(Location, ItemStack)}
*/
ITEM("item", Item.class, 1),
/**
* An experience orb.
*/
EXPERIENCE_ORB("experience_orb", ExperienceOrb.class, 2),
/**
* @see AreaEffectCloud
*/
// Start generate - EntityType
// @GeneratedFrom 1.21.4
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),
/**
* @see ElderGuardian
*/
ELDER_GUARDIAN("elder_guardian", ElderGuardian.class, 4),
/**
* @see WitherSkeleton
*/
WITHER_SKELETON("wither_skeleton", WitherSkeleton.class, 5),
/**
* @see Stray
*/
STRAY("stray", Stray.class, 6),
/**
* A flying chicken egg.
*/
EGG("egg", Egg.class, 7),
/**
* A leash attached to a fencepost.
*/
LEASH_KNOT("leash_knot", LeashHitch.class, 8),
/**
* A painting on a wall.
*/
PAINTING("painting", Painting.class, 9),
/**
* An arrow projectile; may get stuck in the ground.
*/
ARROW("arrow", Arrow.class, 10),
/**
* A flying snowball.
*/
SNOWBALL("snowball", Snowball.class, 11),
/**
* A flying large fireball, as thrown by a Ghast for example.
*/
FIREBALL("fireball", LargeFireball.class, 12),
/**
* A flying small fireball, such as thrown by a Blaze or player.
*/
SMALL_FIREBALL("small_fireball", SmallFireball.class, 13),
/**
* A flying ender pearl.
*/
ENDER_PEARL("ender_pearl", EnderPearl.class, 14),
/**
* An ender eye signal.
*/
EYE_OF_ENDER("eye_of_ender", EnderSignal.class, 15),
/**
* A flying splash potion.
*/
POTION("potion", ThrownPotion.class, 16),
/**
* A flying experience bottle.
*/
EXPERIENCE_BOTTLE("experience_bottle", ThrownExpBottle.class, 17),
/**
* An item frame on a wall.
*/
ITEM_FRAME("item_frame", ItemFrame.class, 18),
/**
* A flying wither skull projectile.
*/
WITHER_SKULL("wither_skull", WitherSkull.class, 19),
/**
* Primed TNT that is about to explode.
*/
TNT("tnt", TNTPrimed.class, 20),
/**
* A block that is going to or is about to fall.
*/
FALLING_BLOCK("falling_block", FallingBlock.class, 21),
/**
* Internal representation of a Firework once it has been launched.
*/
FIREWORK_ROCKET("firework_rocket", Firework.class, 22),
/**
* @see Husk
*/
HUSK("husk", Husk.class, 23),
/**
* Like {@link #ARROW} but causes the {@link PotionEffectType#GLOWING} effect on all team members.
*/
SPECTRAL_ARROW("spectral_arrow", SpectralArrow.class, 24),
/**
* Bullet fired by {@link #SHULKER}.
*/
SHULKER_BULLET("shulker_bullet", ShulkerBullet.class, 25),
/**
* Like {@link #FIREBALL} but with added effects.
*/
DRAGON_FIREBALL("dragon_fireball", DragonFireball.class, 26),
/**
* @see ZombieVillager
*/
ZOMBIE_VILLAGER("zombie_villager", ZombieVillager.class, 27),
/**
* @see SkeletonHorse
*/
SKELETON_HORSE("skeleton_horse", SkeletonHorse.class, 28),
/**
* @see ZombieHorse
*/
ZOMBIE_HORSE("zombie_horse", ZombieHorse.class, 29),
/**
* Mechanical entity with an inventory for placing weapons / armor into.
*/
ARMADILLO("armadillo", Armadillo.class, -1),
ARMOR_STAND("armor_stand", ArmorStand.class, 30),
/**
* @see Donkey
*/
DONKEY("donkey", Donkey.class, 31),
/**
* @see Mule
*/
MULE("mule", Mule.class, 32),
/**
* @see EvokerFangs
*/
EVOKER_FANGS("evoker_fangs", EvokerFangs.class, 33),
/**
* @see Evoker
*/
EVOKER("evoker", Evoker.class, 34),
/**
* @see Vex
*/
VEX("vex", Vex.class, 35),
/**
* @see Vindicator
*/
VINDICATOR("vindicator", Vindicator.class, 36),
/**
* @see Illusioner
*/
ILLUSIONER("illusioner", Illusioner.class, 37),
/**
* @see CommandMinecart
*/
COMMAND_BLOCK_MINECART("command_block_minecart", CommandMinecart.class, 40),
/**
* @see RideableMinecart
*/
MINECART("minecart", RideableMinecart.class, 42),
/**
* @see StorageMinecart
*/
CHEST_MINECART("chest_minecart", StorageMinecart.class, 43),
/**
* @see PoweredMinecart
*/
FURNACE_MINECART("furnace_minecart", PoweredMinecart.class, 44),
/**
* @see ExplosiveMinecart
*/
TNT_MINECART("tnt_minecart", ExplosiveMinecart.class, 45),
/**
* @see HopperMinecart
*/
HOPPER_MINECART("hopper_minecart", HopperMinecart.class, 46),
/**
* @see SpawnerMinecart
*/
SPAWNER_MINECART("spawner_minecart", SpawnerMinecart.class, 47),
CREEPER("creeper", Creeper.class, 50),
SKELETON("skeleton", Skeleton.class, 51),
SPIDER("spider", Spider.class, 52),
GIANT("giant", Giant.class, 53),
ZOMBIE("zombie", Zombie.class, 54),
SLIME("slime", Slime.class, 55),
GHAST("ghast", Ghast.class, 56),
ZOMBIFIED_PIGLIN("zombified_piglin", PigZombie.class, 57),
ENDERMAN("enderman", Enderman.class, 58),
CAVE_SPIDER("cave_spider", CaveSpider.class, 59),
SILVERFISH("silverfish", Silverfish.class, 60),
BLAZE("blaze", Blaze.class, 61),
MAGMA_CUBE("magma_cube", MagmaCube.class, 62),
ENDER_DRAGON("ender_dragon", EnderDragon.class, 63),
WITHER("wither", Wither.class, 64),
BAT("bat", Bat.class, 65),
WITCH("witch", Witch.class, 66),
ENDERMITE("endermite", Endermite.class, 67),
GUARDIAN("guardian", Guardian.class, 68),
SHULKER("shulker", Shulker.class, 69),
PIG("pig", Pig.class, 90),
SHEEP("sheep", Sheep.class, 91),
COW("cow", Cow.class, 92),
CHICKEN("chicken", Chicken.class, 93),
SQUID("squid", Squid.class, 94),
WOLF("wolf", Wolf.class, 95),
MOOSHROOM("mooshroom", MushroomCow.class, 96),
SNOW_GOLEM("snow_golem", Snowman.class, 97),
OCELOT("ocelot", Ocelot.class, 98),
IRON_GOLEM("iron_golem", IronGolem.class, 99),
HORSE("horse", Horse.class, 100),
RABBIT("rabbit", Rabbit.class, 101),
POLAR_BEAR("polar_bear", PolarBear.class, 102),
LLAMA("llama", Llama.class, 103),
LLAMA_SPIT("llama_spit", LlamaSpit.class, 104),
PARROT("parrot", Parrot.class, 105),
VILLAGER("villager", Villager.class, 120),
END_CRYSTAL("end_crystal", EnderCrystal.class, 200),
TURTLE("turtle", Turtle.class, -1),
PHANTOM("phantom", Phantom.class, -1),
TRIDENT("trident", Trident.class, -1),
COD("cod", Cod.class, -1),
SALMON("salmon", Salmon.class, -1),
PUFFERFISH("pufferfish", PufferFish.class, -1),
TROPICAL_FISH("tropical_fish", TropicalFish.class, -1),
DROWNED("drowned", Drowned.class, -1),
DOLPHIN("dolphin", Dolphin.class, -1),
CAT("cat", Cat.class, -1),
PANDA("panda", Panda.class, -1),
PILLAGER("pillager", Pillager.class, -1),
RAVAGER("ravager", Ravager.class, -1),
TRADER_LLAMA("trader_llama", TraderLlama.class, -1),
WANDERING_TRADER("wandering_trader", WanderingTrader.class, -1),
FOX("fox", Fox.class, -1),
BEE("bee", Bee.class, -1),
HOGLIN("hoglin", Hoglin.class, -1),
PIGLIN("piglin", Piglin.class, -1),
STRIDER("strider", Strider.class, -1),
ZOGLIN("zoglin", Zoglin.class, -1),
PIGLIN_BRUTE("piglin_brute", PiglinBrute.class, -1),
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),
CREAKING("creaking", Creaking.class, -1),
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),
MARKER("marker", Marker.class, -1),
ALLAY("allay", Allay.class, -1),
FROG("frog", Frog.class, -1),
TADPOLE("tadpole", Tadpole.class, -1),
WARDEN("warden", Warden.class, -1),
CAMEL("camel", Camel.class, -1),
BLOCK_DISPLAY("block_display", BlockDisplay.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),
SNIFFER("sniffer", Sniffer.class, -1),
TEXT_DISPLAY("text_display", TextDisplay.class, -1),
BREEZE("breeze", Breeze.class, -1),
WIND_CHARGE("wind_charge", WindCharge.class, -1),
BREEZE_WIND_CHARGE("breeze_wind_charge", BreezeWindCharge.class, -1),
ARMADILLO("armadillo", Armadillo.class, -1),
BOGGED("bogged", Bogged.class, -1),
OMINOUS_ITEM_SPAWNER("ominous_item_spawner", OminousItemSpawner.class, -1),
ACACIA_BOAT("acacia_boat", AcaciaBoat.class, -1),
ACACIA_CHEST_BOAT("acacia_chest_boat", AcaciaChestBoat.class, -1),
BAMBOO_RAFT("bamboo_raft", BambooRaft.class, -1),
BAMBOO_CHEST_RAFT("bamboo_chest_raft", BambooChestRaft.class, -1),
BIRCH_BOAT("birch_boat", BirchBoat.class, -1),
BIRCH_CHEST_BOAT("birch_chest_boat", BirchChestBoat.class, -1),
CHERRY_BOAT("cherry_boat", CherryBoat.class, -1),
CHERRY_CHEST_BOAT("cherry_chest_boat", CherryChestBoat.class, -1),
DARK_OAK_BOAT("dark_oak_boat", DarkOakBoat.class, -1),
DARK_OAK_CHEST_BOAT("dark_oak_chest_boat", DarkOakChestBoat.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),
PALE_OAK_BOAT("pale_oak_boat", PaleOakBoat.class, -1),
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),
CREAKING("creaking", Creaking.class, -1),
/**
* A fishing line and bobber.
*/
FISHING_BOBBER("fishing_bobber", FishHook.class, -1, false),
/**
* A bolt of lightning.
* <p>
* Spawn with {@link World#strikeLightning(Location)}.
*/
LIGHTNING_BOLT("lightning_bolt", LightningStrike.class, -1),
PLAYER("player", Player.class, -1, false),
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),
// End generate - EntityType
/**
* An unknown entity without an Entity Class
*/
@@ -89,8 +89,11 @@ public interface Fox extends Animals, Sittable {
* Represents the various different fox types there are.
*/
public enum Type {
// Start generate - FoxType
// @GeneratedFrom 1.21.4
RED,
SNOW;
// End generate - FoxType
}
// Paper start - Add more fox behavior API
@@ -50,19 +50,15 @@ public interface Frog extends Animals {
*/
interface Variant extends OldEnum<Variant>, Keyed {
/**
* Temperate (brown-orange) frog.
*/
Variant TEMPERATE = getVariant("temperate");
/**
* Warm (gray) frog.
*/
Variant WARM = getVariant("warm");
/**
* Cold (green) frog.
*/
// Start generate - FrogVariant
// @GeneratedFrom 1.21.4
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");
Variant WARM = getVariant("warm");
// End generate - FrogVariant
@NotNull
private static Variant getVariant(@NotNull String key) {
return Registry.FROG_VARIANT.getOrThrow(NamespacedKey.minecraft(key));
@@ -1115,10 +1115,13 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* Retrieves the sideways movement direction of the entity.
* <p>
* The returned value ranges from -1 to 1, where:
* - Positive 1 represents movement to the left.
* - Negative 1 represents movement to the right.
* <p>
* Please note that for entities of type {@link Player}, this value is updated only when riding another entity.
* <ul>
* <li>Positive 1 represents movement to the left.</li>
* <li>Negative 1 represents movement to the right.</li>
* </ul>
*
* Please note that for entities of type {@link Player}, this value will only return whole numbers depending
* on what keys are held, see {@link Player#getCurrentInput()}.
* <p>
* This method specifically provides information about the entity's sideways movement, whereas {@link #getVelocity()} returns
* a vector representing the entity's overall current momentum.
@@ -1131,9 +1134,11 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* Retrieves the upwards movement direction of the entity.
* <p>
* The returned value ranges from -1 to 1, where:
* - Positive 1 represents upward movement.
* - Negative 1 represents downward movement.
* <p>
* <ul>
* <li>Positive 1 represents upward movement.</li>
* <li>Negative 1 represents downward movement.</li>
* </ul>
*
* Please note that for entities of type {@link Player}, this value is never updated.
* <p>
* This method specifically provides information about the entity's vertical movement,
@@ -1148,10 +1153,13 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* Retrieves the forwards movement direction of the entity.
* <p>
* The returned value ranges from -1 to 1, where:
* - Positive 1 represents movement forwards.
* - Negative 1 represents movement backwards.
* <p>
* Please note that for entities of type {@link Player}, this value is updated only when riding another entity.
* <ul>
* <li>Positive 1 represents movement forwards.</li>
* <li>Negative 1 represents movement backwards.</li>
* </ul>
*
* Please note that for entities of type {@link Player}, this value will only return whole numbers depending
* on what keys are held, see {@link Player#getCurrentInput()}.
* <p>
* This method specifically provides information about the entity's forward and backward movement,
* whereas {@link #getVelocity()} returns a vector representing the entity's overall current momentum.
@@ -185,6 +185,8 @@ public interface Panda extends Animals, Sittable {
public enum Gene {
// Start generate - PandaGene
// @GeneratedFrom 1.21.4
NORMAL(false),
LAZY(false),
WORRIED(false),
@@ -192,6 +194,7 @@ public interface Panda extends Animals, Sittable {
BROWN(true),
WEAK(true),
AGGRESSIVE(false);
// End generate - PandaGene
private final boolean recessive;
@@ -27,17 +27,11 @@ public interface Salmon extends io.papermc.paper.entity.SchoolableFish { // Pape
*/
public enum Variant {
/**
* Small salmon.
*/
// Start generate - SalmonVariant
// @GeneratedFrom 1.21.4
SMALL,
/**
* Default salmon.
*/
MEDIUM,
/**
* Large salmon.
*/
LARGE;
// End generate - SalmonVariant
}
}
@@ -74,6 +74,8 @@ public interface Sniffer extends Animals {
* Represents the current state of the Sniffer.
*/
public enum State {
// Start generate - SnifferState
// @GeneratedFrom 1.21.4
IDLING,
FEELING_HAPPY,
SCENTING,
@@ -81,5 +83,6 @@ public interface Sniffer extends Animals {
SEARCHING,
DIGGING,
RISING;
// End generate - SnifferState
}
}
@@ -60,6 +60,8 @@ public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { /
*/
public static enum Pattern {
// Start generate - TropicalFishPattern
// @GeneratedFrom 1.21.4
KOB,
SUNSTREAK,
SNOOPER,
@@ -72,5 +74,6 @@ public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { /
BLOCKFISH,
BETTY,
CLAYFISH;
// End generate - TropicalFishPattern
}
}
@@ -171,13 +171,22 @@ public interface Villager extends AbstractVillager {
*/
interface Type extends OldEnum<Type>, Keyed {
// Start generate - VillagerType
// @GeneratedFrom 1.21.4
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");
// End generate - VillagerType
@NotNull
private static Type getType(@NotNull String key) {
@@ -214,77 +223,94 @@ public interface Villager extends AbstractVillager {
*/
interface Profession extends OldEnum<Profession>, Keyed, net.kyori.adventure.translation.Translatable {
Profession NONE = getProfession("none");
// Start generate - VillagerProfession
// @GeneratedFrom 1.21.4
/**
* 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");
// End generate - VillagerProfession
@NotNull
private static Profession getProfession(@NotNull String key) {
@@ -95,16 +95,27 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
*/
interface Variant extends Keyed {
Variant PALE = getVariant("pale");
Variant SPOTTED = getVariant("spotted");
Variant SNOWY = getVariant("snowy");
Variant BLACK = getVariant("black");
// Start generate - WolfVariant
// @GeneratedFrom 1.21.4
Variant ASHEN = getVariant("ashen");
Variant RUSTY = getVariant("rusty");
Variant WOODS = getVariant("woods");
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");
// End generate - WolfVariant
@NotNull
private static Variant getVariant(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.WOLF_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
@@ -44,31 +44,90 @@ public final class MemoryKey<T> implements Keyed {
return tClass;
}
private static final Map<NamespacedKey, MemoryKey> MEMORY_KEYS = new HashMap<>();
//
public static final MemoryKey<Location> HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class);
public static final MemoryKey<Location> POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class);
public static final MemoryKey<Location> JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("job_site"), Location.class);
public static final MemoryKey<Location> MEETING_POINT = new MemoryKey<>(NamespacedKey.minecraft("meeting_point"), Location.class);
public static final MemoryKey<Boolean> GOLEM_DETECTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("golem_detected_recently"), Boolean.class);
public static final MemoryKey<Long> LAST_SLEPT = new MemoryKey<>(NamespacedKey.minecraft("last_slept"), Long.class);
public static final MemoryKey<Long> LAST_WOKEN = new MemoryKey<>(NamespacedKey.minecraft("last_woken"), Long.class);
public static final MemoryKey<Long> LAST_WORKED_AT_POI = new MemoryKey<>(NamespacedKey.minecraft("last_worked_at_poi"), Long.class);
public static final MemoryKey<Boolean> UNIVERSAL_ANGER = new MemoryKey<>(NamespacedKey.minecraft("universal_anger"), Boolean.class);
public static final MemoryKey<UUID> ANGRY_AT = new MemoryKey<>(NamespacedKey.minecraft("angry_at"), UUID.class);
public static final MemoryKey<Boolean> ADMIRING_ITEM = new MemoryKey<>(NamespacedKey.minecraft("admiring_item"), Boolean.class);
private static final Map<NamespacedKey, MemoryKey<?>> MEMORY_KEYS = new HashMap<>();
// Start generate - MemoryKey
// @GeneratedFrom 1.21.4
public static final MemoryKey<Boolean> ADMIRING_DISABLED = new MemoryKey<>(NamespacedKey.minecraft("admiring_disabled"), Boolean.class);
public static final MemoryKey<Boolean> HUNTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("hunted_recently"), Boolean.class);
public static final MemoryKey<Integer> PLAY_DEAD_TICKS = new MemoryKey<>(NamespacedKey.minecraft("play_dead_ticks"), Integer.class);
public static final MemoryKey<Integer> TEMPTATION_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("temptation_cooldown_ticks"), Integer.class);
public static final MemoryKey<Boolean> IS_TEMPTED = new MemoryKey<>(NamespacedKey.minecraft("is_tempted"), Boolean.class);
public static final MemoryKey<Integer> LONG_JUMP_COOLING_DOWN = new MemoryKey<>(NamespacedKey.minecraft("long_jump_cooling_down"), Integer.class);
public static final MemoryKey<Boolean> ADMIRING_ITEM = new MemoryKey<>(NamespacedKey.minecraft("admiring_item"), Boolean.class);
public static final MemoryKey<UUID> ANGRY_AT = new MemoryKey<>(NamespacedKey.minecraft("angry_at"), UUID.class);
public static final MemoryKey<Boolean> ATE_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("ate_recently"), Boolean.class);
public static final MemoryKey<Boolean> ATTACK_COOLING_DOWN = new MemoryKey<>(NamespacedKey.minecraft("attack_cooling_down"), Boolean.class);
public static final MemoryKey<Long> CANT_REACH_WALK_TARGET_SINCE = new MemoryKey<>(NamespacedKey.minecraft("cant_reach_walk_target_since"), Long.class);
public static final MemoryKey<Boolean> DANCING = new MemoryKey<>(NamespacedKey.minecraft("dancing"), Boolean.class);
public static final MemoryKey<Boolean> DANGER_DETECTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("danger_detected_recently"), Boolean.class);
public static final MemoryKey<Boolean> DISABLE_WALK_TO_ADMIRE_ITEM = new MemoryKey<>(NamespacedKey.minecraft("disable_walk_to_admire_item"), Boolean.class);
public static final MemoryKey<Integer> GAZE_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("gaze_cooldown_ticks"), Integer.class);
public static final MemoryKey<Boolean> GOLEM_DETECTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("golem_detected_recently"), Boolean.class);
public static final MemoryKey<Boolean> HAS_HUNTING_COOLDOWN = new MemoryKey<>(NamespacedKey.minecraft("has_hunting_cooldown"), Boolean.class);
public static final MemoryKey<Integer> RAM_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("ram_cooldown_ticks"), Integer.class);
public static final MemoryKey<UUID> LIKED_PLAYER = new MemoryKey<>(NamespacedKey.minecraft("liked_player"), UUID.class);
public static final MemoryKey<Location> LIKED_NOTEBLOCK_POSITION = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock"), Location.class);
public static final MemoryKey<Integer> LIKED_NOTEBLOCK_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock_cooldown_ticks"), Integer.class);
public static final MemoryKey<Long> HEARD_BELL_TIME = new MemoryKey<>(NamespacedKey.minecraft("heard_bell_time"), Long.class);
public static final MemoryKey<Location> HIDING_PLACE = new MemoryKey<>(NamespacedKey.minecraft("hiding_place"), Location.class);
public static final MemoryKey<Location> HOME = new MemoryKey<>(NamespacedKey.minecraft("home"), Location.class);
public static final MemoryKey<Boolean> HUNTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("hunted_recently"), Boolean.class);
public static final MemoryKey<Boolean> IS_PANICKING = new MemoryKey<>(NamespacedKey.minecraft("is_panicking"), Boolean.class);
public static final MemoryKey<Boolean> IS_TEMPTED = new MemoryKey<>(NamespacedKey.minecraft("is_tempted"), Boolean.class);
public static final MemoryKey<Integer> ITEM_PICKUP_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("item_pickup_cooldown_ticks"), Integer.class);
public static final MemoryKey<Location> JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("job_site"), Location.class);
public static final MemoryKey<Long> LAST_SLEPT = new MemoryKey<>(NamespacedKey.minecraft("last_slept"), Long.class);
public static final MemoryKey<Long> LAST_WOKEN = new MemoryKey<>(NamespacedKey.minecraft("last_woken"), Long.class);
public static final MemoryKey<Long> LAST_WORKED_AT_POI = new MemoryKey<>(NamespacedKey.minecraft("last_worked_at_poi"), Long.class);
public static final MemoryKey<Location> LIKED_NOTEBLOCK_POSITION = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock"), Location.class);
public static final MemoryKey<Integer> LIKED_NOTEBLOCK_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock_cooldown_ticks"), Integer.class);
public static final MemoryKey<UUID> LIKED_PLAYER = new MemoryKey<>(NamespacedKey.minecraft("liked_player"), UUID.class);
public static final MemoryKey<Integer> LONG_JUMP_COOLING_DOWN = new MemoryKey<>(NamespacedKey.minecraft("long_jump_cooling_down"), Integer.class);
public static final MemoryKey<Boolean> LONG_JUMP_MID_JUMP = new MemoryKey<>(NamespacedKey.minecraft("long_jump_mid_jump"), Boolean.class);
public static final MemoryKey<Location> MEETING_POINT = new MemoryKey<>(NamespacedKey.minecraft("meeting_point"), Location.class);
public static final MemoryKey<Boolean> PACIFIED = new MemoryKey<>(NamespacedKey.minecraft("pacified"), Boolean.class);
public static final MemoryKey<Integer> PLAY_DEAD_TICKS = new MemoryKey<>(NamespacedKey.minecraft("play_dead_ticks"), Integer.class);
public static final MemoryKey<Location> POTENTIAL_JOB_SITE = new MemoryKey<>(NamespacedKey.minecraft("potential_job_site"), Location.class);
public static final MemoryKey<Integer> RAM_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("ram_cooldown_ticks"), Integer.class);
public static final MemoryKey<Boolean> SNIFFER_DIGGING = new MemoryKey<>(NamespacedKey.minecraft("sniffer_digging"), Boolean.class);
public static final MemoryKey<Boolean> SNIFFER_HAPPY = new MemoryKey<>(NamespacedKey.minecraft("sniffer_happy"), Boolean.class);
public static final MemoryKey<Integer> TEMPTATION_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("temptation_cooldown_ticks"), Integer.class);
public static final MemoryKey<Integer> TIME_TRYING_TO_REACH_ADMIRE_ITEM = new MemoryKey<>(NamespacedKey.minecraft("time_trying_to_reach_admire_item"), Integer.class);
public static final MemoryKey<Boolean> UNIVERSAL_ANGER = new MemoryKey<>(NamespacedKey.minecraft("universal_anger"), Boolean.class);
public static final MemoryKey<Integer> VISIBLE_ADULT_HOGLIN_COUNT = new MemoryKey<>(NamespacedKey.minecraft("visible_adult_hoglin_count"), Integer.class);
public static final MemoryKey<Integer> VISIBLE_ADULT_PIGLIN_COUNT = new MemoryKey<>(NamespacedKey.minecraft("visible_adult_piglin_count"), Integer.class);
// End generate - 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
@@ -86,7 +145,7 @@ public final class MemoryKey<T> 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 +155,7 @@ public final class MemoryKey<T> implements Keyed {
* @return the memoryKeys
*/
@NotNull
public static Set<MemoryKey> values() {
public static Set<MemoryKey<?>> values() {
return new HashSet<>(MEMORY_KEYS.values());
}
}
@@ -16,41 +16,77 @@ import org.jetbrains.annotations.NotNull;
*/
public abstract class Structure implements Keyed {
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");
public static final Structure MANSION = getStructure("mansion");
public static final Structure JUNGLE_PYRAMID = getStructure("jungle_pyramid");
public static final Structure DESERT_PYRAMID = getStructure("desert_pyramid");
public static final Structure IGLOO = getStructure("igloo");
public static final Structure SHIPWRECK = getStructure("shipwreck");
public static final Structure SHIPWRECK_BEACHED = getStructure("shipwreck_beached");
public static final Structure SWAMP_HUT = getStructure("swamp_hut");
public static final Structure STRONGHOLD = getStructure("stronghold");
public static final Structure MONUMENT = getStructure("monument");
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 FORTRESS = getStructure("fortress");
public static final Structure NETHER_FOSSIL = getStructure("nether_fossil");
public static final Structure END_CITY = getStructure("end_city");
public static final Structure BURIED_TREASURE = getStructure("buried_treasure");
public static final Structure BASTION_REMNANT = getStructure("bastion_remnant");
public static final Structure VILLAGE_PLAINS = getStructure("village_plains");
public static final Structure VILLAGE_DESERT = getStructure("village_desert");
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");
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_SWAMP = getStructure("ruined_portal_swamp");
public static final Structure RUINED_PORTAL_MOUNTAIN = getStructure("ruined_portal_mountain");
public static final Structure RUINED_PORTAL_OCEAN = getStructure("ruined_portal_ocean");
public static final Structure RUINED_PORTAL_NETHER = getStructure("ruined_portal_nether");
// Start generate - Structure
// @GeneratedFrom 1.21.4
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");
// End generate - Structure
@NotNull
private static Structure getStructure(@NotNull String name) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.STRUCTURE).getOrThrow(NamespacedKey.minecraft(name));
Loaded 100 of 698 files, more files were not shown because too many files have changed in this diff. Show more