1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
committed by
Nassim Jahnke
parent
39203a65e0
commit
a24f9b204c
@ -317,7 +317,7 @@ public class MaterialTags {
|
||||
*/
|
||||
public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
|
||||
.endsWith("_SPAWN_EGG")
|
||||
.ensureSize("SPAWN_EGGS", 81).lock();
|
||||
.ensureSize("SPAWN_EGGS", 82).lock();
|
||||
|
||||
/**
|
||||
* Covers all colors of stained glass.
|
||||
|
||||
@ -15,45 +15,46 @@ import org.jspecify.annotations.Nullable;
|
||||
@NullMarked
|
||||
public final class GoalKey<T extends Mob> {
|
||||
|
||||
private final Class<T> entityClass;
|
||||
private final NamespacedKey namespacedKey;
|
||||
private final Class<T> type;
|
||||
private final NamespacedKey key;
|
||||
|
||||
private GoalKey(Class<T> entityClass, NamespacedKey namespacedKey) {
|
||||
this.entityClass = entityClass;
|
||||
this.namespacedKey = namespacedKey;
|
||||
private GoalKey(Class<T> type, NamespacedKey key) {
|
||||
this.type = type;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public Class<T> getEntityClass() {
|
||||
return this.entityClass;
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public NamespacedKey getNamespacedKey() {
|
||||
return this.namespacedKey;
|
||||
return this.key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || this.getClass() != o.getClass()) return false;
|
||||
|
||||
GoalKey<?> goalKey = (GoalKey<?>) o;
|
||||
return Objects.equals(this.entityClass, goalKey.entityClass) &&
|
||||
Objects.equals(this.namespacedKey, goalKey.namespacedKey);
|
||||
return Objects.equals(this.type, goalKey.type) &&
|
||||
Objects.equals(this.key, goalKey.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(this.entityClass, this.namespacedKey);
|
||||
return Objects.hash(this.type, this.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringJoiner(", ", GoalKey.class.getSimpleName() + "[", "]")
|
||||
.add("entityClass=" + this.entityClass)
|
||||
.add("namespacedKey=" + this.namespacedKey)
|
||||
.add("type=" + this.type)
|
||||
.add("key=" + this.key)
|
||||
.toString();
|
||||
}
|
||||
|
||||
public static <A extends Mob> GoalKey<A> of(Class<A> entityClass, NamespacedKey namespacedKey) {
|
||||
return new GoalKey<>(entityClass, namespacedKey);
|
||||
public static <A extends Mob> GoalKey<A> of(Class<A> type, NamespacedKey key) {
|
||||
return new GoalKey<>(type, key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,8 @@ public enum CommandRegistrationFlag {
|
||||
@Deprecated(since = "1.21.4")
|
||||
FLATTEN_ALIASES,
|
||||
/**
|
||||
* Prevents this command from being sent to the client.
|
||||
* @deprecated Removed as it causes a warning to appear on the client now.
|
||||
*/
|
||||
@Deprecated(since = "1.21.6", forRemoval = true)
|
||||
SERVER_ONLY
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ package io.papermc.paper.datacomponent;
|
||||
import org.bukkit.Utility;
|
||||
import org.bukkit.persistence.PersistentDataContainer;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
@ -23,8 +22,8 @@ public interface DataComponentHolder extends DataComponentView {
|
||||
* @param <T> value type
|
||||
*/
|
||||
@Utility
|
||||
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||
public <T> void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type, final @NotNull io.papermc.paper.datacomponent.DataComponentBuilder<T> valueBuilder);
|
||||
@ApiStatus.Experimental
|
||||
<T> void setData(final DataComponentType.Valued<T> type, final DataComponentBuilder<T> valueBuilder);
|
||||
|
||||
/**
|
||||
* Sets the value of the data component type for this holder.
|
||||
@ -33,16 +32,16 @@ public interface DataComponentHolder extends DataComponentView {
|
||||
* @param value value to set
|
||||
* @param <T> value type
|
||||
*/
|
||||
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||
public <T> void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type, final @NotNull T value);
|
||||
@ApiStatus.Experimental
|
||||
<T> void setData(final DataComponentType.Valued<T> type, final T value);
|
||||
|
||||
/**
|
||||
* Marks this non-valued data component type as present in this itemstack.
|
||||
*
|
||||
* @param type the data component type
|
||||
*/
|
||||
@org.jetbrains.annotations.ApiStatus.Experimental
|
||||
public void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull NonValued type);
|
||||
@ApiStatus.Experimental
|
||||
void setData(final DataComponentType.NonValued type);
|
||||
|
||||
// TODO: Do we even want to have the concept of overriding here? Not sure what is going on with entity components
|
||||
}
|
||||
|
||||
@ -364,8 +364,8 @@ public final class DataComponentTypes {
|
||||
public static final DataComponentType.Valued<Rabbit.Type> RABBIT_VARIANT = valued("rabbit/variant");
|
||||
public static final DataComponentType.Valued<Pig.Variant> PIG_VARIANT = valued("pig/variant");
|
||||
public static final DataComponentType.Valued<Cow.Variant> COW_VARIANT = valued("cow/variant");
|
||||
// TODO: This is a eitherholder? Why specifically the chicken?? Oh wait this is prolly for chicken egg cause legacy item loading
|
||||
public static final DataComponentType.Valued<Chicken.Variant> CHICKEN_VARIANT = valued("chicken/variant");
|
||||
// This is a eitherholder? Why specifically the chicken?? Oh wait this is prolly for chicken egg cause legacy item loading
|
||||
public static final DataComponentType.Valued<Frog.Variant> FROG_VARIANT = valued("frog/variant");
|
||||
public static final DataComponentType.Valued<Horse.Color> HORSE_VARIANT = valued("horse/variant");
|
||||
public static final DataComponentType.Valued<Art> PAINTING_VARIANT = valued("painting/variant");
|
||||
@ -376,7 +376,6 @@ public final class DataComponentTypes {
|
||||
public static final DataComponentType.Valued<DyeColor> SHEEP_COLOR = valued("sheep/color");
|
||||
public static final DataComponentType.Valued<DyeColor> SHULKER_COLOR = valued("shulker/color");
|
||||
|
||||
|
||||
private static DataComponentType.NonValued unvalued(final String name) {
|
||||
final DataComponentType dataComponentType = requireNonNull(Registry.DATA_COMPONENT_TYPE.get(NamespacedKey.minecraft(name)), name + " unvalued data component type couldn't be found, this is a bug.");
|
||||
if (dataComponentType instanceof DataComponentType.NonValued) {
|
||||
|
||||
@ -3,9 +3,8 @@ package io.papermc.paper.datacomponent;
|
||||
import org.bukkit.Utility;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* This represents a view of a data component holder. No
|
||||
@ -23,11 +22,11 @@ public interface DataComponentView {
|
||||
* @param type the data component type
|
||||
* @param <T> the value type
|
||||
* @return the value for the data component type, or {@code null} if not set or marked as removed
|
||||
* @see #hasData(io.papermc.paper.datacomponent.DataComponentType) for DataComponentType.NonValued
|
||||
* @see #hasData(DataComponentType) for DataComponentType.NonValued
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@ApiStatus.Experimental
|
||||
public <T> @Nullable T getData(final DataComponentType.@NotNull Valued<T> type);
|
||||
<T> @Nullable T getData(final DataComponentType.Valued<T> type);
|
||||
|
||||
/**
|
||||
* Gets the value for the data component type on this holder with
|
||||
@ -41,7 +40,7 @@ public interface DataComponentView {
|
||||
@Utility
|
||||
@Contract(value = "_, !null -> !null", pure = true)
|
||||
@ApiStatus.Experimental
|
||||
public <T> @Nullable T getDataOrDefault(final DataComponentType.@NotNull Valued<? extends T> type, final @Nullable T fallback);
|
||||
<T> @Nullable T getDataOrDefault(final DataComponentType.Valued<? extends T> type, final @Nullable T fallback);
|
||||
|
||||
/**
|
||||
* Checks if the data component type is set on this holder.
|
||||
@ -51,7 +50,7 @@ public interface DataComponentView {
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@ApiStatus.Experimental
|
||||
boolean hasData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type);
|
||||
boolean hasData(final DataComponentType type);
|
||||
|
||||
// Not applicable to entities
|
||||
// /**
|
||||
@ -61,5 +60,5 @@ public interface DataComponentView {
|
||||
// */
|
||||
// @Contract("-> new")
|
||||
// @ApiStatus.Experimental
|
||||
// java.util.@Unmodifiable Set<io.papermc.paper.datacomponent.@NotNull DataComponentType> getDataTypes();
|
||||
// @Unmodifiable Set<DataComponentType> getDataTypes();
|
||||
}
|
||||
|
||||
@ -4,13 +4,13 @@ import io.papermc.paper.datacomponent.DataComponentBuilder;
|
||||
import io.papermc.paper.datacomponent.item.blocksattacks.DamageReduction;
|
||||
import io.papermc.paper.datacomponent.item.blocksattacks.ItemDamageFunction;
|
||||
import io.papermc.paper.registry.tag.TagKey;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import org.bukkit.damage.DamageType;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Holds block attacks to the holding player like Shield.
|
||||
@ -62,24 +62,21 @@ public interface BlocksAttacks {
|
||||
*
|
||||
* @return a damage type tag key, or null if there is no such tag key
|
||||
*/
|
||||
@Nullable
|
||||
TagKey<DamageType> bypassedBy();
|
||||
@Nullable TagKey<DamageType> bypassedBy();
|
||||
|
||||
/**
|
||||
* Gets the key sound to play when an attack is successfully blocked.
|
||||
*
|
||||
* @return a key of the sound
|
||||
*/
|
||||
@Nullable
|
||||
Key blockSound();
|
||||
@Nullable Key blockSound();
|
||||
|
||||
/**
|
||||
* Gets the key sound to play when the item goes on its disabled cooldown due to an attack.
|
||||
*
|
||||
* @return a key of the sound
|
||||
*/
|
||||
@Nullable
|
||||
Key disableSound();
|
||||
@Nullable Key disableSound();
|
||||
|
||||
/**
|
||||
* Builder for {@link BlocksAttacks}.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package io.papermc.paper.datacomponent.item;
|
||||
|
||||
import java.util.List;
|
||||
import io.papermc.paper.datacomponent.DataComponentBuilder;
|
||||
import java.util.List;
|
||||
import org.bukkit.Color;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
|
||||
@ -104,6 +104,22 @@ public interface Equippable extends BuildableDataComponent<Equippable, Equippabl
|
||||
@Contract(pure = true)
|
||||
boolean equipOnInteract();
|
||||
|
||||
/**
|
||||
* Checks if the item can be sheared off an entity.
|
||||
*
|
||||
* @return true if can be sheared off an entity, false otherwise
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
boolean canBeSheared();
|
||||
|
||||
/**
|
||||
* Returns the sound that is played when shearing this equipment off an entity.
|
||||
*
|
||||
* @return shear sound
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
Key shearSound();
|
||||
|
||||
/**
|
||||
* Builder for {@link Equippable}.
|
||||
*/
|
||||
@ -182,5 +198,23 @@ public interface Equippable extends BuildableDataComponent<Equippable, Equippabl
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder equipOnInteract(boolean equipOnInteract);
|
||||
|
||||
/**
|
||||
* Sets whether the item can be sheared off an entity.
|
||||
*
|
||||
* @param canBeSheared true if can be sheared off an entity
|
||||
* @return the builder for chaining
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder canBeSheared(boolean canBeSheared);
|
||||
|
||||
/**
|
||||
* Sets the sound that is played when shearing this equipment off an entity.
|
||||
*
|
||||
* @param shearSound the shear sound key
|
||||
* @return the builder for chaining
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder shearSound(Key shearSound);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package io.papermc.paper.datacomponent.item;
|
||||
|
||||
import io.papermc.paper.block.BlockPredicate;
|
||||
import io.papermc.paper.datacomponent.BuildableDataComponent;
|
||||
import io.papermc.paper.datacomponent.DataComponentBuilder;
|
||||
import java.util.List;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package io.papermc.paper.datacomponent.item;
|
||||
|
||||
import io.papermc.paper.datacomponent.DataComponentBuilder;
|
||||
import io.papermc.paper.datacomponent.item.attribute.AttributeModifierDisplay;
|
||||
import java.util.List;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
@ -55,13 +56,21 @@ public interface ItemAttributeModifiers {
|
||||
AttributeModifier modifier();
|
||||
|
||||
/**
|
||||
* Gets the slot group for this attribute.
|
||||
* Gets the slot group for the paired attribute.
|
||||
*
|
||||
* @return the slot group
|
||||
*/
|
||||
default EquipmentSlotGroup getGroup() {
|
||||
return this.modifier().getSlotGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
* The display behavior for the attribute modifier.
|
||||
*
|
||||
* @return the display behavior
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
AttributeModifierDisplay display();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,24 +83,55 @@ public interface ItemAttributeModifiers {
|
||||
/**
|
||||
* Adds a modifier to this builder.
|
||||
*
|
||||
* @param attribute attribute
|
||||
* @param modifier modifier
|
||||
* @param attribute the attribute
|
||||
* @param modifier the modifier
|
||||
* @return the builder for chaining
|
||||
* @see #modifiers()
|
||||
*/
|
||||
@Contract(value = "_, _ -> this", mutates = "this")
|
||||
Builder addModifier(Attribute attribute, AttributeModifier modifier);
|
||||
default Builder addModifier(Attribute attribute, AttributeModifier modifier) {
|
||||
return this.addModifier(attribute, modifier, modifier.getSlotGroup());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a modifier to this builder.
|
||||
*
|
||||
* @param attribute attribute
|
||||
* @param modifier modifier
|
||||
* @param attribute the attribute
|
||||
* @param modifier the modifier
|
||||
* @param equipmentSlotGroup the slot group this modifier applies to (overrides any slot group in the modifier)
|
||||
* @return the builder for chaining
|
||||
* @see #modifiers()
|
||||
*/
|
||||
@Contract(value = "_, _, _ -> this", mutates = "this")
|
||||
Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup);
|
||||
default Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup) {
|
||||
return this.addModifier(attribute, modifier, equipmentSlotGroup, AttributeModifierDisplay.reset());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a modifier to this builder.
|
||||
*
|
||||
* @param attribute the attribute
|
||||
* @param modifier the modifier
|
||||
* @param display the modifier display behavior
|
||||
* @return the builder for chaining
|
||||
* @see #modifiers()
|
||||
*/
|
||||
@Contract(value = "_, _, _ -> this", mutates = "this")
|
||||
default Builder addModifier(Attribute attribute, AttributeModifier modifier, AttributeModifierDisplay display) {
|
||||
return this.addModifier(attribute, modifier, modifier.getSlotGroup(), display);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a modifier to this builder.
|
||||
*
|
||||
* @param attribute the attribute
|
||||
* @param modifier the modifier
|
||||
* @param equipmentSlotGroup the slot group this modifier applies to (overrides any slot group in the modifier)
|
||||
* @param display the modifier display behavior
|
||||
* @return the builder for chaining
|
||||
* @see #modifiers()
|
||||
*/
|
||||
@Contract(value = "_, _, _, _ -> this", mutates = "this")
|
||||
Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup, AttributeModifierDisplay display);
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ interface ItemComponentTypesBridge {
|
||||
|
||||
MapId mapId(int id);
|
||||
|
||||
UseRemainder useRemainder(ItemStack itemStack);
|
||||
UseRemainder useRemainder(ItemStack stack);
|
||||
|
||||
Consumable.Builder consumable();
|
||||
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
package io.papermc.paper.datacomponent.item.attribute;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.ComponentLike;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* The display behavior for a dedicated attribute entry.
|
||||
*
|
||||
* @see io.papermc.paper.datacomponent.DataComponentTypes#ATTRIBUTE_MODIFIERS
|
||||
* @see io.papermc.paper.datacomponent.item.ItemAttributeModifiers#itemAttributes()
|
||||
*/
|
||||
@NullMarked
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface AttributeModifierDisplay {
|
||||
|
||||
/**
|
||||
* Reset any override of the text displayed by the attribute modifier
|
||||
* to its default behavior displaying the statistics.
|
||||
*
|
||||
* @return the new display behavior instance
|
||||
*/
|
||||
@Contract(value = "-> new", pure = true)
|
||||
static Default reset() {
|
||||
return AttributeModifierDisplayBridge.bridge().reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the statistics displayed by the attribute modifier.
|
||||
*
|
||||
* @return the new display behavior instance
|
||||
*/
|
||||
@Contract(value = "-> new", pure = true)
|
||||
static Hidden hidden() {
|
||||
return AttributeModifierDisplayBridge.bridge().hidden();
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the statistics displayed by the attribute modifier
|
||||
* to an arbitrary text.
|
||||
*
|
||||
* @param text the overridden text
|
||||
* @return the new display behavior instance
|
||||
*/
|
||||
@Contract(value = "_ -> new", pure = true)
|
||||
static OverrideText override(final ComponentLike text) {
|
||||
return AttributeModifierDisplayBridge.bridge().override(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hidden statistics display for the attribute modifier.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
interface Hidden extends AttributeModifierDisplay {
|
||||
}
|
||||
|
||||
/**
|
||||
* Default display for the attribute modifier, showing
|
||||
* the statistic of its effect.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
interface Default extends AttributeModifierDisplay {
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies an overridden text to show instead of
|
||||
* the default behavior for the attribute modifier.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
interface OverrideText extends AttributeModifierDisplay {
|
||||
|
||||
/**
|
||||
* Overridden text
|
||||
*
|
||||
* @return the overridden text
|
||||
*/
|
||||
Component text();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package io.papermc.paper.datacomponent.item.attribute;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.ServiceLoader;
|
||||
import net.kyori.adventure.text.ComponentLike;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
@NullMarked
|
||||
@ApiStatus.Internal
|
||||
interface AttributeModifierDisplayBridge {
|
||||
|
||||
Optional<AttributeModifierDisplayBridge> BRIDGE = ServiceLoader.load(AttributeModifierDisplayBridge.class).findFirst();
|
||||
|
||||
static AttributeModifierDisplayBridge bridge() {
|
||||
return BRIDGE.orElseThrow();
|
||||
}
|
||||
|
||||
AttributeModifierDisplay.Default reset();
|
||||
|
||||
AttributeModifierDisplay.Hidden hidden();
|
||||
|
||||
AttributeModifierDisplay.OverrideText override(ComponentLike text);
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
package io.papermc.paper.datacomponent.item.blocksattacks;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import java.util.Optional;
|
||||
import java.util.ServiceLoader;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
@NullMarked
|
||||
@ApiStatus.Internal
|
||||
|
||||
@ -30,16 +30,14 @@ public interface DamageReduction {
|
||||
*
|
||||
* @return the set of damage type
|
||||
*/
|
||||
@Nullable
|
||||
RegistryKeySet<DamageType> type();
|
||||
@Nullable RegistryKeySet<DamageType> type();
|
||||
|
||||
/**
|
||||
* Get the maximum angle between the users facing direction and the direction of the incoming attack to be blocked.
|
||||
*
|
||||
* @return the angle
|
||||
*/
|
||||
@Positive
|
||||
float horizontalBlockingAngle();
|
||||
@Positive float horizontalBlockingAngle();
|
||||
|
||||
/**
|
||||
* Get the constant amount of damage to be blocked.
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
package io.papermc.paper.datacomponent.item.consumable;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
/**
|
||||
* Represents the hand animation that is used when a player is consuming this item.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public enum ItemUseAnimation {
|
||||
// Start generate - ItemUseAnimation
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
NONE,
|
||||
EAT,
|
||||
DRINK,
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
/**
|
||||
* The paper configuration package contains the new java representation of a plugins configuration file.
|
||||
* While most values are described in detail on {@link io.papermc.paper.plugin.configuration.PluginMeta}, a full
|
||||
* entry on the paper contains a full and extensive example of possible configurations of the paper-plugin.yml.
|
||||
* @see <a href="https://docs.papermc.io/paper">Extensive documentation and examples of the paper-plugin.yml</a>
|
||||
* <!--TODO update the documentation link once documentation for this exists and is deployed-->
|
||||
* entry on the paper website contains a full and extensive example of possible configurations of the paper-plugin.yml.
|
||||
* @see <a href="https://docs.papermc.io/paper/dev/getting-started/paper-plugins">Extensive documentation and examples of the paper-plugin.yml</a>
|
||||
*/
|
||||
package io.papermc.paper.plugin.configuration;
|
||||
|
||||
@ -11,7 +11,6 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* server initialization.
|
||||
* @see LifecycleEvents
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface LifecycleEvent {
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import io.papermc.paper.plugin.lifecycle.event.handler.LifecycleEventHandler;
|
||||
import io.papermc.paper.plugin.lifecycle.event.handler.configuration.LifecycleEventHandlerConfiguration;
|
||||
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEventType;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Manages a plugin's lifecycle events. Can be obtained
|
||||
@ -12,8 +11,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
*
|
||||
* @param <O> the owning type, {@link org.bukkit.plugin.Plugin} or {@link io.papermc.paper.plugin.bootstrap.BootstrapContext}
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface LifecycleEventManager<O extends LifecycleEventOwner> {
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@ package io.papermc.paper.plugin.lifecycle.event;
|
||||
|
||||
import io.papermc.paper.plugin.configuration.PluginMeta;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Implemented by types that are considered owners
|
||||
@ -11,8 +10,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* a {@link LifecycleEventManager} where you can register
|
||||
* event handlers.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface LifecycleEventOwner {
|
||||
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package io.papermc.paper.plugin.lifecycle.event.handler;
|
||||
|
||||
import io.papermc.paper.plugin.lifecycle.event.LifecycleEvent;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* A handler for a specific event. Can be implemented
|
||||
@ -10,8 +8,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
*
|
||||
* @param <E> the event
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@FunctionalInterface
|
||||
public interface LifecycleEventHandler<E extends LifecycleEvent> {
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
|
||||
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
|
||||
import io.papermc.paper.plugin.lifecycle.event.handler.LifecycleEventHandler;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Base type for constructing configured event handlers for
|
||||
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <O>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface LifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> {
|
||||
}
|
||||
|
||||
@ -3,15 +3,12 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
|
||||
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Handler configuration for event types that allow "monitor" handlers.
|
||||
*
|
||||
* @param <O> the required owner type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface MonitorLifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> extends LifecycleEventHandlerConfiguration<O> {
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
|
||||
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Handler configuration that allows both "monitor" and prioritized handlers.
|
||||
@ -11,8 +10,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
*
|
||||
* @param <O> the required owner type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface PrioritizedLifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> extends LifecycleEventHandlerConfiguration<O> {
|
||||
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@ -0,0 +1,6 @@
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.plugin.lifecycle.event.handler;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@ -0,0 +1,6 @@
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.plugin.lifecycle.event;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@ -6,7 +6,6 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
* To be implemented by types that provide ways to register types
|
||||
* either on server start or during a reload
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface Registrar {
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ package io.papermc.paper.plugin.lifecycle.event.registrar;
|
||||
import io.papermc.paper.plugin.lifecycle.event.LifecycleEvent;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* A lifecycle event that exposes a {@link Registrar} of some kind
|
||||
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <R> registrar type
|
||||
* @see ReloadableRegistrarEvent
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistrarEvent<R extends Registrar> extends LifecycleEvent {
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@ package io.papermc.paper.plugin.lifecycle.event.registrar;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* A lifecycle event that exposes a {@link Registrar} that is
|
||||
@ -11,8 +10,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <R> the registrar type
|
||||
* @see RegistrarEvent
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface ReloadableRegistrarEvent<R extends Registrar> extends RegistrarEvent<R> {
|
||||
|
||||
@ -24,7 +21,6 @@ public interface ReloadableRegistrarEvent<R extends Registrar> extends Registrar
|
||||
@Contract(pure = true)
|
||||
Cause cause();
|
||||
|
||||
@ApiStatus.Experimental
|
||||
enum Cause {
|
||||
/**
|
||||
* The initial load of the server.
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.plugin.lifecycle.event.registrar;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@ -9,7 +9,6 @@ import io.papermc.paper.plugin.lifecycle.event.handler.configuration.MonitorLife
|
||||
import io.papermc.paper.plugin.lifecycle.event.handler.configuration.PrioritizedLifecycleEventHandlerConfiguration;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Base type for all types of lifecycle events. Differs from
|
||||
@ -22,8 +21,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <E> the event object type
|
||||
* @param <C> the configuration type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface LifecycleEventType<O extends LifecycleEventOwner, E extends LifecycleEvent, C extends LifecycleEventHandlerConfiguration<O>> {
|
||||
|
||||
@ -55,7 +52,6 @@ public interface LifecycleEventType<O extends LifecycleEventOwner, E extends Lif
|
||||
* @param <O> the required owner type
|
||||
* @param <E> the event object type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
interface Monitorable<O extends LifecycleEventOwner, E extends LifecycleEvent> extends LifecycleEventType<O, E, MonitorLifecycleEventHandlerConfiguration<O>> {
|
||||
}
|
||||
@ -67,7 +63,6 @@ public interface LifecycleEventType<O extends LifecycleEventOwner, E extends Lif
|
||||
* @param <O> the required owner type
|
||||
* @param <E> the event object type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
interface Prioritizable<O extends LifecycleEventOwner, E extends LifecycleEvent> extends LifecycleEventType<O, E, PrioritizedLifecycleEventHandlerConfiguration<O>> {
|
||||
}
|
||||
|
||||
@ -5,10 +5,8 @@ import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
|
||||
import java.util.Optional;
|
||||
import java.util.ServiceLoader;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@NullMarked
|
||||
interface LifecycleEventTypeProvider {
|
||||
|
||||
Optional<LifecycleEventTypeProvider> INSTANCE = ServiceLoader.load(LifecycleEventTypeProvider.class)
|
||||
|
||||
@ -10,15 +10,12 @@ import io.papermc.paper.plugin.lifecycle.event.registrar.RegistrarEvent;
|
||||
import io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Holds various types of lifecycle events for
|
||||
* use when creating event handler configurations
|
||||
* in {@link LifecycleEventManager}.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
public final class LifecycleEvents {
|
||||
|
||||
/**
|
||||
|
||||
@ -6,7 +6,6 @@ import io.papermc.paper.registry.RegistryKey;
|
||||
import io.papermc.paper.tag.PostFlattenTagRegistrar;
|
||||
import io.papermc.paper.tag.PreFlattenTagRegistrar;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Provides event types for tag registration.
|
||||
@ -14,8 +13,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @see PreFlattenTagRegistrar
|
||||
* @see PostFlattenTagRegistrar
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface TagEventTypeProvider {
|
||||
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.plugin.lifecycle.event.types;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@ -1,16 +1,19 @@
|
||||
package io.papermc.paper.registry;
|
||||
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.key.KeyPattern;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
@NullMarked
|
||||
record TypedKeyImpl<T>(Key key, RegistryKey<T> registryKey) implements TypedKey<T> {
|
||||
// Wrap key methods to make this easier to use
|
||||
@KeyPattern.Namespace
|
||||
@Override
|
||||
public String namespace() {
|
||||
return this.key.namespace();
|
||||
}
|
||||
|
||||
@KeyPattern.Value
|
||||
@Override
|
||||
public String value() {
|
||||
return this.key.value();
|
||||
|
||||
@ -3,6 +3,7 @@ package io.papermc.paper.registry.data;
|
||||
import io.papermc.paper.registry.RegistryBuilder;
|
||||
import io.papermc.paper.registry.RegistryKey;
|
||||
import io.papermc.paper.registry.TypedKey;
|
||||
import io.papermc.paper.registry.event.RegistryComposeEvent;
|
||||
import io.papermc.paper.registry.set.RegistryKeySet;
|
||||
import io.papermc.paper.registry.set.RegistrySet;
|
||||
import io.papermc.paper.registry.tag.TagKey;
|
||||
@ -153,7 +154,7 @@ public interface EnchantmentRegistryEntry {
|
||||
/**
|
||||
* Configures the set of supported items this enchantment can be applied on. This
|
||||
* can be a {@link RegistryKeySet} created via {@link RegistrySet#keySet(io.papermc.paper.registry.RegistryKey, Iterable)} or
|
||||
* a tag obtained via {@link io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)} with
|
||||
* a tag obtained via {@link RegistryComposeEvent#getOrCreateTag(TagKey)} with
|
||||
* tag keys found in {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys} such as
|
||||
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
|
||||
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
|
||||
@ -161,7 +162,7 @@ public interface EnchantmentRegistryEntry {
|
||||
* @param supportedItems the registry key set representing the supported items.
|
||||
* @return this builder instance.
|
||||
* @see RegistrySet#keySet(RegistryKey, TypedKey[])
|
||||
* @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
|
||||
* @see RegistryComposeEvent#getOrCreateTag(TagKey)
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder supportedItems(RegistryKeySet<ItemType> supportedItems);
|
||||
@ -170,7 +171,7 @@ public interface EnchantmentRegistryEntry {
|
||||
* Configures a set of item types this enchantment can naturally be applied to, when enchanting in an
|
||||
* enchantment table.This can be a {@link RegistryKeySet} created via
|
||||
* {@link RegistrySet#keySet(io.papermc.paper.registry.RegistryKey, Iterable)} or a tag obtained via
|
||||
* {@link io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)} with
|
||||
* {@link RegistryComposeEvent#getOrCreateTag(TagKey)} with
|
||||
* tag keys found in {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys} such as
|
||||
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
|
||||
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
|
||||
@ -182,7 +183,7 @@ public interface EnchantmentRegistryEntry {
|
||||
* @param primaryItems the registry key set representing the primary items.
|
||||
* @return this builder instance.
|
||||
* @see RegistrySet#keySet(RegistryKey, TypedKey[])
|
||||
* @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
|
||||
* @see RegistryComposeEvent#getOrCreateTag(TagKey)
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder primaryItems(@Nullable RegistryKeySet<ItemType> primaryItems);
|
||||
@ -285,7 +286,7 @@ public interface EnchantmentRegistryEntry {
|
||||
* @param exclusiveWith a registry set of enchantments exclusive to this one.
|
||||
* @return this builder instance.
|
||||
* @see RegistrySet#keySet(RegistryKey, TypedKey[])
|
||||
* @see io.papermc.paper.registry.event.RegistryFreezeEvent#getOrCreateTag(TagKey)
|
||||
* @see RegistryComposeEvent#getOrCreateTag(TagKey)
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder exclusiveWith(RegistryKeySet<Enchantment> exclusiveWith);
|
||||
|
||||
@ -18,5 +18,4 @@ public interface InlinedRegistryBuilderProvider {
|
||||
return Holder.INSTANCE.orElseThrow();
|
||||
}
|
||||
|
||||
Art createPaintingVariant(Consumer<RegistryBuilderFactory<Art, ? extends PaintingVariantRegistryEntry.Builder>> value);
|
||||
}
|
||||
|
||||
@ -0,0 +1,134 @@
|
||||
package io.papermc.paper.registry.data;
|
||||
|
||||
import io.papermc.paper.registry.RegistryBuilder;
|
||||
import io.papermc.paper.registry.RegistryBuilderFactory;
|
||||
import io.papermc.paper.registry.TypedKey;
|
||||
import io.papermc.paper.registry.holder.RegistryHolder;
|
||||
import java.util.function.Consumer;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.JukeboxSong;
|
||||
import org.bukkit.Sound;
|
||||
import org.checkerframework.checker.index.qual.Positive;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.Range;
|
||||
|
||||
/**
|
||||
* A data-centric version-specific registry entry for the {@link JukeboxSong} type.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface JukeboxSongRegistryEntry {
|
||||
|
||||
/**
|
||||
* Gets the sound event for this song.
|
||||
*
|
||||
* @return the sound event
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
RegistryHolder<Sound, SoundEventRegistryEntry> soundEvent();
|
||||
|
||||
/**
|
||||
* Gets the description for this song.
|
||||
*
|
||||
* @return the description
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
Component description();
|
||||
|
||||
/**
|
||||
* Gets the length in seconds for this song.
|
||||
*
|
||||
* @return the length in seconds
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@Positive float lengthInSeconds();
|
||||
|
||||
/**
|
||||
* Gets the comparator output for this song.
|
||||
*
|
||||
* @return the comparator output
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@Range(from = 0, to = 15) int comparatorOutput();
|
||||
|
||||
/**
|
||||
* A mutable builder for the {@link JukeboxSongRegistryEntry} plugins may change in applicable registry events.
|
||||
* <p>
|
||||
* The following values are required for each builder:
|
||||
* <ul>
|
||||
* <li>
|
||||
* {@link #soundEvent(TypedKey)}, {@link #soundEvent(Consumer)} or {@link #soundEvent(RegistryHolder)}
|
||||
* </li>
|
||||
* <li>{@link #description(Component)}</li>
|
||||
* <li>{@link #lengthInSeconds(float)}</li>
|
||||
* <li>{@link #comparatorOutput(int)}</li>
|
||||
* </ul>
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
interface Builder extends JukeboxSongRegistryEntry, RegistryBuilder<JukeboxSong> {
|
||||
|
||||
/**
|
||||
* Sets the sound event for this song to a sound event present
|
||||
* in the {@link io.papermc.paper.registry.RegistryKey#SOUND_EVENT} registry.
|
||||
* <p>This will override both {@link #soundEvent(Consumer)} and {@link #soundEvent(RegistryHolder)}</p>
|
||||
*
|
||||
* @param soundEvent the sound event
|
||||
* @return this builder
|
||||
* @see #soundEvent(Consumer)
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder soundEvent(TypedKey<Sound> soundEvent);
|
||||
|
||||
/**
|
||||
* Sets the sound event for this song to a new sound event.
|
||||
* <p>This will override both {@link #soundEvent(TypedKey)} and {@link #soundEvent(RegistryHolder)}</p>
|
||||
*
|
||||
* @param soundEvent the sound event
|
||||
* @return this builder
|
||||
* @see #soundEvent(TypedKey)
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder soundEvent(Consumer<RegistryBuilderFactory<Sound, ? extends SoundEventRegistryEntry.Builder>> soundEvent);
|
||||
|
||||
/**
|
||||
* Sets the sound event for this song.
|
||||
* <p>This will override both {@link #soundEvent(Consumer)} and {@link #soundEvent(TypedKey)}</p>
|
||||
*
|
||||
* @param soundEvent the sound event
|
||||
* @return this builder
|
||||
* @see #soundEvent(TypedKey)
|
||||
* @see #soundEvent(Consumer)
|
||||
*/
|
||||
@Contract( value = "_ -> this", mutates = "this")
|
||||
Builder soundEvent(RegistryHolder<Sound, SoundEventRegistryEntry> soundEvent);
|
||||
|
||||
/**
|
||||
* Sets the description for this song.
|
||||
*
|
||||
* @param description the description
|
||||
* @return this builder
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder description(Component description);
|
||||
|
||||
/**
|
||||
* Sets the length in seconds for this song.
|
||||
*
|
||||
* @param lengthInSeconds the length in seconds (positive)
|
||||
* @return this builder
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder lengthInSeconds(@Positive float lengthInSeconds);
|
||||
|
||||
/**
|
||||
* Sets the comparator output for this song.
|
||||
*
|
||||
* @param comparatorOutput the comparator output [0-15]
|
||||
* @return this builder
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder comparatorOutput(@Range(from = 0, to = 15) int comparatorOutput);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package io.papermc.paper.registry.data;
|
||||
|
||||
import io.papermc.paper.registry.RegistryBuilder;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import org.bukkit.Sound;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* A data-centric version-specific registry entry for the {@link Sound} type.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface SoundEventRegistryEntry {
|
||||
|
||||
/**
|
||||
* Gets the resource pack location for this sound event.
|
||||
*
|
||||
* @return the location
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
Key location();
|
||||
|
||||
/**
|
||||
* Gets the fixed range for this sound event, if present.
|
||||
*
|
||||
* @return the fixed range, or {@code null} if not present
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@Nullable Float fixedRange();
|
||||
|
||||
/**
|
||||
* A mutable builder for the {@link SoundEventRegistryEntry} plugins may change in applicable registry events.
|
||||
* <p>
|
||||
* The following values are required for each builder:
|
||||
* <ul>
|
||||
* <li>{@link #location(Key)}</li>
|
||||
* </ul>
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
interface Builder extends SoundEventRegistryEntry, RegistryBuilder<Sound> {
|
||||
|
||||
/**
|
||||
* Sets the resource pack location for this sound event.
|
||||
*
|
||||
* @param location the location
|
||||
* @return this builder
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder location(Key location);
|
||||
|
||||
/**
|
||||
* Sets the fixed range for this sound event.
|
||||
*
|
||||
* @param fixedRange the fixed range
|
||||
* @return this builder
|
||||
*/
|
||||
@Contract(value = "_ -> this", mutates = "this")
|
||||
Builder fixedRange(@Nullable Float fixedRange);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package io.papermc.paper.registry.event;
|
||||
|
||||
import io.papermc.paper.registry.RegistryBuilder;
|
||||
import io.papermc.paper.registry.tag.Tag;
|
||||
import io.papermc.paper.registry.tag.TagKey;
|
||||
import org.bukkit.Keyed;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
/**
|
||||
* Event object for {@link RegistryEventProvider#compose()}. This
|
||||
* event is fired after a registry is loaded with its normal values.
|
||||
* It provides a way for plugins to add new objects to the registry.
|
||||
*
|
||||
* @param <T> registry entry type
|
||||
* @param <B> registry entry builder type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistryComposeEvent<T, B extends RegistryBuilder<T>> extends RegistryEvent<T> {
|
||||
|
||||
/**
|
||||
* Get the writable registry.
|
||||
*
|
||||
* @return a writable registry
|
||||
*/
|
||||
WritableRegistry<T, B> registry();
|
||||
|
||||
/**
|
||||
* Gets or creates a tag for the given tag key. This tag
|
||||
* is then required to be filled either from the built-in or
|
||||
* custom datapack.
|
||||
*
|
||||
* @param tagKey the tag key
|
||||
* @return the tag
|
||||
* @param <V> the tag value type
|
||||
*/
|
||||
<V extends Keyed> Tag<V> getOrCreateTag(TagKey<V> tagKey); // TODO remove Keyed
|
||||
}
|
||||
@ -6,7 +6,6 @@ import io.papermc.paper.registry.tag.Tag;
|
||||
import io.papermc.paper.registry.tag.TagKey;
|
||||
import org.bukkit.Keyed;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Event object for {@link RegistryEventProvider#entryAdd()}. This
|
||||
@ -16,8 +15,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <T> registry entry type
|
||||
* @param <B> registry entry builder type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistryEntryAddEvent<T, B extends RegistryBuilder<T>> extends RegistryEvent<T> {
|
||||
|
||||
|
||||
@ -3,15 +3,12 @@ package io.papermc.paper.registry.event;
|
||||
import io.papermc.paper.plugin.lifecycle.event.LifecycleEvent;
|
||||
import io.papermc.paper.registry.RegistryKey;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Base type for all registry events.
|
||||
*
|
||||
* @param <T> registry entry type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistryEvent<T> extends LifecycleEvent {
|
||||
|
||||
|
||||
@ -7,7 +7,6 @@ import io.papermc.paper.registry.RegistryBuilder;
|
||||
import io.papermc.paper.registry.RegistryKey;
|
||||
import io.papermc.paper.registry.event.type.RegistryEntryAddEventType;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Provider for registry events for a specific registry.
|
||||
@ -15,14 +14,12 @@ import org.jspecify.annotations.NullMarked;
|
||||
* Supported events are:
|
||||
* <ul>
|
||||
* <li>{@link RegistryEntryAddEvent} (via {@link #entryAdd()})</li>
|
||||
* <li>{@link RegistryFreezeEvent} (via {@link #freeze()})</li>
|
||||
* <li>{@link RegistryComposeEvent} (via {@link #compose()})</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param <T> registry entry type
|
||||
* @param <B> registry entry builder type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistryEventProvider<T, B extends RegistryBuilder<T>> {
|
||||
|
||||
@ -45,8 +42,25 @@ public interface RegistryEventProvider<T, B extends RegistryBuilder<T>> {
|
||||
* to register a handler for {@link RegistryFreezeEvent}.
|
||||
*
|
||||
* @return the registry freeze event type
|
||||
* @deprecated use {@link #compose()} instead.
|
||||
*/
|
||||
LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T, B>> freeze();
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "1.21.7 or 1.22, whichever comes first")
|
||||
@Deprecated(since = "1.21.6", forRemoval = true)
|
||||
default LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T, B>> freeze() {
|
||||
return (LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T,B>>) (LifecycleEventType.Prioritizable) this.compose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the event type for {@link RegistryComposeEvent} which is fired after
|
||||
* a registry is loaded of expected elements. It allows for the registration of new objects.
|
||||
* <p>
|
||||
* Can be used in {@link io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager#registerEventHandler(LifecycleEventType, LifecycleEventHandler)}
|
||||
* to register a handler for {@link RegistryComposeEvent}.
|
||||
*
|
||||
* @return the registry freeze event type
|
||||
*/
|
||||
LifecycleEventType.Prioritizable<BootstrapContext, RegistryComposeEvent<T, B>> compose();
|
||||
|
||||
/**
|
||||
* Gets the registry key associated with this event type provider.
|
||||
|
||||
@ -6,10 +6,8 @@ import io.papermc.paper.registry.RegistryBuilder;
|
||||
import io.papermc.paper.registry.RegistryKey;
|
||||
import io.papermc.paper.registry.event.type.RegistryEntryAddEventType;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@NullMarked
|
||||
record RegistryEventProviderImpl<T, B extends RegistryBuilder<T>>(RegistryKey<T> registryKey) implements RegistryEventProvider<T, B> {
|
||||
|
||||
static <T, B extends RegistryBuilder<T>> RegistryEventProvider<T, B> create(final RegistryKey<T> registryKey) {
|
||||
@ -22,8 +20,7 @@ record RegistryEventProviderImpl<T, B extends RegistryBuilder<T>>(RegistryKey<T>
|
||||
}
|
||||
|
||||
@Override
|
||||
public LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T, B>> freeze() {
|
||||
return RegistryEventTypeProvider.provider().registryFreeze(this);
|
||||
public LifecycleEventType.Prioritizable<BootstrapContext, RegistryComposeEvent<T, B>> compose() {
|
||||
return RegistryEventTypeProvider.provider().registryCompose(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -20,5 +20,5 @@ interface RegistryEventTypeProvider {
|
||||
|
||||
<T, B extends RegistryBuilder<T>> RegistryEntryAddEventType<T, B> registryEntryAdd(RegistryEventProvider<T, B> type);
|
||||
|
||||
<T, B extends RegistryBuilder<T>> LifecycleEventType.Prioritizable<BootstrapContext, RegistryFreezeEvent<T, B>> registryFreeze(RegistryEventProvider<T, B> type);
|
||||
<T, B extends RegistryBuilder<T>> LifecycleEventType.Prioritizable<BootstrapContext, RegistryComposeEvent<T, B>> registryCompose(RegistryEventProvider<T, B> type);
|
||||
}
|
||||
|
||||
@ -9,11 +9,13 @@ import io.papermc.paper.registry.data.DamageTypeRegistryEntry;
|
||||
import io.papermc.paper.registry.data.EnchantmentRegistryEntry;
|
||||
import io.papermc.paper.registry.data.FrogVariantRegistryEntry;
|
||||
import io.papermc.paper.registry.data.GameEventRegistryEntry;
|
||||
import io.papermc.paper.registry.data.JukeboxSongRegistryEntry;
|
||||
import io.papermc.paper.registry.data.PaintingVariantRegistryEntry;
|
||||
import io.papermc.paper.registry.data.PigVariantRegistryEntry;
|
||||
import io.papermc.paper.registry.data.WolfVariantRegistryEntry;
|
||||
import org.bukkit.Art;
|
||||
import org.bukkit.GameEvent;
|
||||
import org.bukkit.JukeboxSong;
|
||||
import org.bukkit.block.banner.PatternType;
|
||||
import org.bukkit.damage.DamageType;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@ -23,25 +25,22 @@ import org.bukkit.entity.Cow;
|
||||
import org.bukkit.entity.Frog;
|
||||
import org.bukkit.entity.Pig;
|
||||
import org.bukkit.entity.Wolf;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create;
|
||||
|
||||
/**
|
||||
* Holds providers for {@link RegistryEntryAddEvent} and {@link RegistryFreezeEvent}
|
||||
* Holds providers for {@link RegistryEntryAddEvent} and {@link RegistryComposeEvent}
|
||||
* handlers for each applicable registry.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
public final class RegistryEvents {
|
||||
|
||||
// Start generate - RegistryEvents
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
public static final RegistryEventProvider<GameEvent, GameEventRegistryEntry.Builder> GAME_EVENT = create(RegistryKey.GAME_EVENT);
|
||||
public static final RegistryEventProvider<DamageType, DamageTypeRegistryEntry.Builder> DAMAGE_TYPE = create(RegistryKey.DAMAGE_TYPE);
|
||||
public static final RegistryEventProvider<Wolf.Variant, WolfVariantRegistryEntry.Builder> WOLF_VARIANT = create(RegistryKey.WOLF_VARIANT);
|
||||
public static final RegistryEventProvider<Enchantment, EnchantmentRegistryEntry.Builder> ENCHANTMENT = create(RegistryKey.ENCHANTMENT);
|
||||
public static final RegistryEventProvider<JukeboxSong, JukeboxSongRegistryEntry.Builder> JUKEBOX_SONG = create(RegistryKey.JUKEBOX_SONG);
|
||||
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);
|
||||
public static final RegistryEventProvider<Cat.Type, CatTypeRegistryEntry.Builder> CAT_VARIANT = create(RegistryKey.CAT_VARIANT);
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
package io.papermc.paper.registry.event;
|
||||
|
||||
import io.papermc.paper.registry.RegistryBuilder;
|
||||
import io.papermc.paper.registry.tag.Tag;
|
||||
import io.papermc.paper.registry.tag.TagKey;
|
||||
import org.bukkit.Keyed;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Event object for {@link RegistryEventProvider#freeze()}. This
|
||||
@ -14,27 +10,10 @@ import org.jspecify.annotations.NullMarked;
|
||||
*
|
||||
* @param <T> registry entry type
|
||||
* @param <B> registry entry builder type
|
||||
* @deprecated renamed to {@link RegistryComposeEvent}
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "1.21.7 or 1.22, whichever comes first")
|
||||
@Deprecated(since = "1.21.6", forRemoval = true)
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistryFreezeEvent<T, B extends RegistryBuilder<T>> extends RegistryEvent<T> {
|
||||
|
||||
/**
|
||||
* Get the writable registry.
|
||||
*
|
||||
* @return a writable registry
|
||||
*/
|
||||
WritableRegistry<T, B> registry();
|
||||
|
||||
/**
|
||||
* Gets or creates a tag for the given tag key. This tag
|
||||
* is then required to be filled either from the built-in or
|
||||
* custom datapack.
|
||||
*
|
||||
* @param tagKey the tag key
|
||||
* @return the tag
|
||||
* @param <V> the tag value type
|
||||
*/
|
||||
<V extends Keyed> Tag<V> getOrCreateTag(TagKey<V> tagKey);
|
||||
public interface RegistryFreezeEvent<T, B extends RegistryBuilder<T>> extends RegistryComposeEvent<T, B> {
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@ import io.papermc.paper.registry.RegistryBuilderFactory;
|
||||
import io.papermc.paper.registry.TypedKey;
|
||||
import java.util.function.Consumer;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* A registry which supports registering new objects.
|
||||
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <T> registry entry type
|
||||
* @param <B> registry entry builder type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface WritableRegistry<T, B extends RegistryBuilder<T>> {
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* This package contains events related to the Paper registry system.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.registry.event;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@ -4,15 +4,15 @@ import io.papermc.paper.plugin.bootstrap.BootstrapContext;
|
||||
import io.papermc.paper.plugin.lifecycle.event.handler.configuration.PrioritizedLifecycleEventHandlerConfiguration;
|
||||
import io.papermc.paper.registry.TypedKey;
|
||||
import java.util.function.Predicate;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Specific configuration for {@link io.papermc.paper.registry.event.RegistryEntryAddEvent}s.
|
||||
*
|
||||
* @param <T> registry entry type
|
||||
*/
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistryEntryAddConfiguration<T> extends PrioritizedLifecycleEventHandlerConfiguration<BootstrapContext> {
|
||||
|
||||
/**
|
||||
|
||||
@ -5,7 +5,6 @@ import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEventType;
|
||||
import io.papermc.paper.registry.RegistryBuilder;
|
||||
import io.papermc.paper.registry.event.RegistryEntryAddEvent;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* Lifecycle event type for {@link RegistryEntryAddEvent}s.
|
||||
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <T> registry entry type
|
||||
* @param <B> registry entry builder type
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RegistryEntryAddEventType<T, B extends RegistryBuilder<T>> extends LifecycleEventType<BootstrapContext, RegistryEntryAddEvent<T, B>, RegistryEntryAddConfiguration<T>> {
|
||||
}
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* This package contains events related to the Paper registry system.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.registry.event.type;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@ -0,0 +1,50 @@
|
||||
package io.papermc.paper.registry.holder;
|
||||
|
||||
import io.papermc.paper.registry.TypedKey;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
/**
|
||||
* During the registry loading phase, some values can be references to values to-be-loaded
|
||||
* in the future, or inlined, anonymous values that already exist. This type (and subtypes) represent
|
||||
* that structure.
|
||||
* @param <API> the registry's type
|
||||
* @param <ENTRY> the type of the registry entry (for inlined values)
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public sealed interface RegistryHolder<API, ENTRY> permits RegistryHolder.Reference, RegistryHolder.Inlined {
|
||||
|
||||
/**
|
||||
* A holder that references a registry value by key, but does not have the entry itself.
|
||||
* This is used for entries that are only referenced by key and may not yet have any value associated with them.
|
||||
*
|
||||
* @param <API> the registry's type
|
||||
* @param <ENTRY> the type of the registry entry
|
||||
*/
|
||||
@ApiStatus.NonExtendable
|
||||
non-sealed interface Reference<API, ENTRY> extends RegistryHolder<API, ENTRY> {
|
||||
|
||||
/**
|
||||
* The key of the referenced value.
|
||||
*
|
||||
* @return the key of the value
|
||||
*/
|
||||
TypedKey<API> key();
|
||||
}
|
||||
|
||||
/**
|
||||
* A holder that contains an inlined registry entry, an anonymous value (does not have a key).
|
||||
*
|
||||
* @param <API> the registry's type
|
||||
* @param <ENTRY> the type of the registry entry
|
||||
*/
|
||||
@ApiStatus.NonExtendable
|
||||
non-sealed interface Inlined<API, ENTRY> extends RegistryHolder<API, ENTRY> {
|
||||
|
||||
/**
|
||||
* The inlined entry.
|
||||
*
|
||||
* @return the inlined entry
|
||||
*/
|
||||
ENTRY entry();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Registry holders.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.registry.holder;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@ -24,19 +24,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public interface Art extends OldEnum<Art>, Keyed {
|
||||
|
||||
/**
|
||||
* Create an inlined painting variant.
|
||||
*
|
||||
* @param value a consumer for the builder factory
|
||||
* @return the created painting variant
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
static @NotNull Art create(final @NotNull Consumer<RegistryBuilderFactory<Art, ? extends PaintingVariantRegistryEntry.Builder>> value) {
|
||||
return InlinedRegistryBuilderProvider.instance().createPaintingVariant(value);
|
||||
}
|
||||
|
||||
// Start generate - Art
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Art ALBAN = getArt("alban");
|
||||
|
||||
Art AZTEC = getArt("aztec");
|
||||
|
||||
@ -476,7 +476,12 @@ public enum EntityEffect {
|
||||
*
|
||||
* @see org.bukkit.inventory.EquipmentSlot#SADDLE
|
||||
*/
|
||||
BREAK_EQUIPMENT_SADDLE(68, LivingEntity.class);
|
||||
BREAK_EQUIPMENT_SADDLE(68, LivingEntity.class),
|
||||
/**
|
||||
* Ravager roars.
|
||||
*/
|
||||
RAVAGER_ROARED(69, Ravager.class),
|
||||
;
|
||||
|
||||
private final byte data;
|
||||
private final Set<Class<? extends Entity>> applicableClasses;
|
||||
|
||||
@ -15,7 +15,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
public interface FeatureFlag extends Keyed {
|
||||
|
||||
// Start generate - FeatureFlag
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
@ApiStatus.Experimental
|
||||
FeatureFlag MINECART_IMPROVEMENTS = create("minecart_improvements");
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public interface Fluid extends OldEnum<Fluid>, Keyed {
|
||||
|
||||
// Start generate - Fluid
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Fluid EMPTY = getFluid("empty");
|
||||
|
||||
Fluid FLOWING_LAVA = getFluid("flowing_lava");
|
||||
|
||||
@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
public abstract class GameEvent implements Keyed {
|
||||
|
||||
// Start generate - GameEvent
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
public static final GameEvent BLOCK_ACTIVATE = getEvent("block_activate");
|
||||
|
||||
public static final GameEvent BLOCK_ATTACH = getEvent("block_attach");
|
||||
|
||||
@ -305,6 +305,11 @@ public final class GameRule<T> implements net.kyori.adventure.translation.Transl
|
||||
*/
|
||||
public static final GameRule<Integer> SPAWN_CHUNK_RADIUS = new GameRule<>("spawnChunkRadius", Integer.class);
|
||||
|
||||
/**
|
||||
* Configures if the world uses the locator bar.
|
||||
*/
|
||||
public static final GameRule<Boolean> LOCATOR_BAR = new GameRule<>("locatorBar", Boolean.class);
|
||||
|
||||
// All GameRules instantiated above this for organizational purposes
|
||||
private final String name;
|
||||
private final Class<T> type;
|
||||
|
||||
@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public interface JukeboxSong extends Keyed, Translatable {
|
||||
|
||||
// Start generate - JukeboxSong
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
JukeboxSong ELEVEN = get("11");
|
||||
|
||||
JukeboxSong THIRTEEN = get("13");
|
||||
@ -47,6 +47,8 @@ public interface JukeboxSong extends Keyed, Translatable {
|
||||
|
||||
JukeboxSong STRAD = get("strad");
|
||||
|
||||
JukeboxSong TEARS = get("tears");
|
||||
|
||||
JukeboxSong WAIT = get("wait");
|
||||
|
||||
JukeboxSong WARD = get("ward");
|
||||
|
||||
@ -852,6 +852,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param radius X Radius
|
||||
* @return the collection of entities near location. This will always be a non-null collection.
|
||||
*/
|
||||
@ -861,6 +862,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param xzRadius X/Z Radius
|
||||
* @param yRadius Y Radius
|
||||
* @return the collection of living entities near location. This will always be a non-null collection.
|
||||
@ -871,6 +873,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
* @param zRadius Z radius
|
||||
@ -882,6 +885,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param radius Radius
|
||||
* @param predicate a predicate used to filter results
|
||||
* @return the collection of living entities near location. This will always be a non-null collection.
|
||||
@ -892,6 +896,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param xzRadius X/Z Radius
|
||||
* @param yRadius Y Radius
|
||||
* @param predicate a predicate used to filter results
|
||||
@ -903,6 +908,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
* @param zRadius Z radius
|
||||
@ -915,6 +921,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param radius X/Y/Z Radius
|
||||
* @return the collection of players near location. This will always be a non-null collection.
|
||||
*/
|
||||
@ -924,6 +931,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param xzRadius X/Z Radius
|
||||
* @param yRadius Y Radius
|
||||
* @return the collection of players near location. This will always be a non-null collection.
|
||||
@ -934,6 +942,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
* @param zRadius Z Radius
|
||||
@ -945,6 +954,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param radius X/Y/Z Radius
|
||||
* @param predicate a predicate used to filter results
|
||||
* @return the collection of players near location. This will always be a non-null collection.
|
||||
@ -955,6 +965,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param xzRadius X/Z Radius
|
||||
* @param yRadius Y Radius
|
||||
* @param predicate a predicate used to filter results
|
||||
@ -966,6 +977,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
* @param zRadius Z Radius
|
||||
@ -978,6 +990,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param radius X/Y/Z radius to search within
|
||||
* @param <T> the entity type
|
||||
@ -989,6 +1002,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param xzRadius X/Z radius to search within
|
||||
* @param yRadius Y radius to search within
|
||||
@ -1001,6 +1015,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -1014,6 +1029,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param radius X/Y/Z radius to search within
|
||||
* @param predicate a predicate used to filter results
|
||||
@ -1026,6 +1042,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param xzRadius X/Z radius to search within
|
||||
* @param yRadius Y radius to search within
|
||||
@ -1039,6 +1056,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -1047,7 +1065,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
* @param <T> the entity type
|
||||
* @return the collection of entities near location. This will always be a non-null collection.
|
||||
*/
|
||||
public @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends Entity> clazz, final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super T> predicate) {
|
||||
public @NotNull <T extends Entity> Collection<T> getNearbyEntitiesByType(final @Nullable Class<? extends T> clazz, final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super T> predicate) {
|
||||
final World world = this.getWorld();
|
||||
if (world == null) {
|
||||
throw new IllegalArgumentException("Location has no world");
|
||||
|
||||
@ -60,6 +60,7 @@ import org.bukkit.block.data.type.DaylightDetector;
|
||||
import org.bukkit.block.data.type.DecoratedPot;
|
||||
import org.bukkit.block.data.type.Dispenser;
|
||||
import org.bukkit.block.data.type.Door;
|
||||
import org.bukkit.block.data.type.DriedGhast;
|
||||
import org.bukkit.block.data.type.Dripleaf;
|
||||
import org.bukkit.block.data.type.EndPortalFrame;
|
||||
import org.bukkit.block.data.type.EnderChest;
|
||||
@ -144,7 +145,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
public enum Material implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper
|
||||
//<editor-fold desc="Materials" defaultstate="collapsed">
|
||||
// Start generate - Items
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
ACACIA_BOAT(-1, 1),
|
||||
ACACIA_CHEST_BOAT(-1, 1),
|
||||
AIR(-1),
|
||||
@ -173,6 +174,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
BIRCH_CHEST_BOAT(-1, 1),
|
||||
BLACK_BUNDLE(-1, 1),
|
||||
BLACK_DYE(-1),
|
||||
BLACK_HARNESS(-1, 1),
|
||||
BLADE_POTTERY_SHERD(-1),
|
||||
BLAZE_POWDER(-1),
|
||||
BLAZE_ROD(-1),
|
||||
@ -180,6 +182,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
BLUE_BUNDLE(-1, 1),
|
||||
BLUE_DYE(-1),
|
||||
BLUE_EGG(-1, 16),
|
||||
BLUE_HARNESS(-1, 1),
|
||||
BOGGED_SPAWN_EGG(-1),
|
||||
BOLT_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
|
||||
BONE(-1),
|
||||
@ -196,6 +199,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
BROWN_BUNDLE(-1, 1),
|
||||
BROWN_DYE(-1),
|
||||
BROWN_EGG(-1, 16),
|
||||
BROWN_HARNESS(-1, 1),
|
||||
BRUSH(-1, 1),
|
||||
BUCKET(-1, 16),
|
||||
BUNDLE(-1, 1),
|
||||
@ -242,6 +246,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
CROSSBOW(-1, 1),
|
||||
CYAN_BUNDLE(-1, 1),
|
||||
CYAN_DYE(-1),
|
||||
CYAN_HARNESS(-1, 1),
|
||||
DANGER_POTTERY_SHERD(-1),
|
||||
DARK_OAK_BOAT(-1, 1),
|
||||
DARK_OAK_CHEST_BOAT(-1, 1),
|
||||
@ -257,18 +262,10 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
DIAMOND_PICKAXE(-1, 1),
|
||||
DIAMOND_SHOVEL(-1, 1),
|
||||
DIAMOND_SWORD(-1, 1),
|
||||
DRAGON_BREATH(-1),
|
||||
END_CRYSTAL(-1),
|
||||
FIELD_MASONED_BANNER_PATTERN(-1, 1),
|
||||
FLOW_BANNER_PATTERN(-1, 1),
|
||||
GLOBE_BANNER_PATTERN(-1, 1),
|
||||
IRON_NUGGET(-1),
|
||||
KNOWLEDGE_BOOK(-1, 1),
|
||||
LINGERING_POTION(-1, 1),
|
||||
MUSIC_DISC_5(-1, 1),
|
||||
DISC_FRAGMENT_5(-1),
|
||||
DOLPHIN_SPAWN_EGG(-1),
|
||||
DONKEY_SPAWN_EGG(-1),
|
||||
DRAGON_BREATH(-1),
|
||||
DRIED_KELP(-1),
|
||||
DROWNED_SPAWN_EGG(-1),
|
||||
DUNE_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
|
||||
@ -279,6 +276,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
EMERALD(-1),
|
||||
ENCHANTED_BOOK(-1, 1),
|
||||
ENCHANTED_GOLDEN_APPLE(-1),
|
||||
END_CRYSTAL(-1),
|
||||
ENDER_DRAGON_SPAWN_EGG(-1),
|
||||
ENDER_EYE(-1),
|
||||
ENDER_PEARL(-1, 16),
|
||||
@ -290,6 +288,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
EYE_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
|
||||
FEATHER(-1),
|
||||
FERMENTED_SPIDER_EYE(-1),
|
||||
FIELD_MASONED_BANNER_PATTERN(-1, 1),
|
||||
FILLED_MAP(-1),
|
||||
FIRE_CHARGE(-1),
|
||||
FIREWORK_ROCKET(-1),
|
||||
@ -298,6 +297,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
FLINT(-1),
|
||||
FLINT_AND_STEEL(-1, 1),
|
||||
FLOW_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
|
||||
FLOW_BANNER_PATTERN(-1, 1),
|
||||
FLOW_POTTERY_SHERD(-1),
|
||||
FLOWER_BANNER_PATTERN(-1, 1),
|
||||
FOX_SPAWN_EGG(-1),
|
||||
@ -308,6 +308,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
GHAST_TEAR(-1),
|
||||
GLASS_BOTTLE(-1),
|
||||
GLISTERING_MELON_SLICE(-1),
|
||||
GLOBE_BANNER_PATTERN(-1, 1),
|
||||
GLOW_BERRIES(-1),
|
||||
GLOW_INK_SAC(-1),
|
||||
GLOW_ITEM_FRAME(-1),
|
||||
@ -331,12 +332,15 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
GOLDEN_SWORD(-1, 1),
|
||||
GRAY_BUNDLE(-1, 1),
|
||||
GRAY_DYE(-1),
|
||||
GRAY_HARNESS(-1, 1),
|
||||
GREEN_BUNDLE(-1, 1),
|
||||
GREEN_DYE(-1),
|
||||
GREEN_HARNESS(-1, 1),
|
||||
GUARDIAN_SPAWN_EGG(-1),
|
||||
GUNPOWDER(-1),
|
||||
GUSTER_BANNER_PATTERN(-1, 1),
|
||||
GUSTER_POTTERY_SHERD(-1),
|
||||
HAPPY_GHAST_SPAWN_EGG(-1),
|
||||
HEART_OF_THE_SEA(-1),
|
||||
HEART_POTTERY_SHERD(-1),
|
||||
HEARTBREAK_POTTERY_SHERD(-1),
|
||||
@ -358,12 +362,14 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
IRON_HORSE_ARMOR(-1, 1),
|
||||
IRON_INGOT(-1),
|
||||
IRON_LEGGINGS(-1, 1),
|
||||
IRON_NUGGET(-1),
|
||||
IRON_PICKAXE(-1, 1),
|
||||
IRON_SHOVEL(-1, 1),
|
||||
IRON_SWORD(-1, 1),
|
||||
ITEM_FRAME(-1),
|
||||
JUNGLE_BOAT(-1, 1),
|
||||
JUNGLE_CHEST_BOAT(-1, 1),
|
||||
KNOWLEDGE_BOOK(-1, 1),
|
||||
LAPIS_LAZULI(-1),
|
||||
LAVA_BUCKET(-1, 1),
|
||||
LEAD(-1),
|
||||
@ -375,14 +381,19 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
LEATHER_LEGGINGS(-1, 1),
|
||||
LIGHT_BLUE_BUNDLE(-1, 1),
|
||||
LIGHT_BLUE_DYE(-1),
|
||||
LIGHT_BLUE_HARNESS(-1, 1),
|
||||
LIGHT_GRAY_BUNDLE(-1, 1),
|
||||
LIGHT_GRAY_DYE(-1),
|
||||
LIGHT_GRAY_HARNESS(-1, 1),
|
||||
LIME_BUNDLE(-1, 1),
|
||||
LIME_DYE(-1),
|
||||
LIME_HARNESS(-1, 1),
|
||||
LINGERING_POTION(-1, 1),
|
||||
LLAMA_SPAWN_EGG(-1),
|
||||
MACE(-1, 1),
|
||||
MAGENTA_BUNDLE(-1, 1),
|
||||
MAGENTA_DYE(-1),
|
||||
MAGENTA_HARNESS(-1, 1),
|
||||
MAGMA_CREAM(-1),
|
||||
MAGMA_CUBE_SPAWN_EGG(-1),
|
||||
MANGROVE_BOAT(-1, 1),
|
||||
@ -398,6 +409,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
MOURNER_POTTERY_SHERD(-1),
|
||||
MULE_SPAWN_EGG(-1),
|
||||
MUSHROOM_STEW(-1, 1),
|
||||
MUSIC_DISC_5(-1, 1),
|
||||
MUSIC_DISC_11(-1, 1),
|
||||
MUSIC_DISC_13(-1, 1),
|
||||
MUSIC_DISC_BLOCKS(-1, 1),
|
||||
@ -414,6 +426,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
MUSIC_DISC_RELIC(-1, 1),
|
||||
MUSIC_DISC_STAL(-1, 1),
|
||||
MUSIC_DISC_STRAD(-1, 1),
|
||||
MUSIC_DISC_TEARS(-1, 1),
|
||||
MUSIC_DISC_WAIT(-1, 1),
|
||||
MUSIC_DISC_WARD(-1, 1),
|
||||
MUTTON(-1),
|
||||
@ -440,6 +453,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
OMINOUS_TRIAL_KEY(-1),
|
||||
ORANGE_BUNDLE(-1, 1),
|
||||
ORANGE_DYE(-1),
|
||||
ORANGE_HARNESS(-1, 1),
|
||||
PAINTING(-1),
|
||||
PALE_OAK_BOAT(-1, 1),
|
||||
PALE_OAK_CHEST_BOAT(-1, 1),
|
||||
@ -455,6 +469,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
PILLAGER_SPAWN_EGG(-1),
|
||||
PINK_BUNDLE(-1, 1),
|
||||
PINK_DYE(-1),
|
||||
PINK_HARNESS(-1, 1),
|
||||
PITCHER_POD(-1),
|
||||
PLENTY_POTTERY_SHERD(-1),
|
||||
POISONOUS_POTATO(-1),
|
||||
@ -474,6 +489,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
PUMPKIN_SEEDS(-1),
|
||||
PURPLE_BUNDLE(-1, 1),
|
||||
PURPLE_DYE(-1),
|
||||
PURPLE_HARNESS(-1, 1),
|
||||
QUARTZ(-1),
|
||||
RABBIT(-1),
|
||||
RABBIT_FOOT(-1),
|
||||
@ -488,6 +504,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
RECOVERY_COMPASS(-1),
|
||||
RED_BUNDLE(-1, 1),
|
||||
RED_DYE(-1),
|
||||
RED_HARNESS(-1, 1),
|
||||
REDSTONE(-1),
|
||||
RESIN_BRICK(-1),
|
||||
RIB_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
|
||||
@ -569,6 +586,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
WHEAT_SEEDS(-1),
|
||||
WHITE_BUNDLE(-1, 1),
|
||||
WHITE_DYE(-1),
|
||||
WHITE_HARNESS(-1, 1),
|
||||
WILD_ARMOR_TRIM_SMITHING_TEMPLATE(-1),
|
||||
WIND_CHARGE(-1),
|
||||
WITCH_SPAWN_EGG(-1),
|
||||
@ -585,6 +603,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
WRITTEN_BOOK(-1, 16),
|
||||
YELLOW_BUNDLE(-1, 1),
|
||||
YELLOW_DYE(-1),
|
||||
YELLOW_HARNESS(-1, 1),
|
||||
ZOGLIN_SPAWN_EGG(-1),
|
||||
ZOMBIE_HORSE_SPAWN_EGG(-1),
|
||||
ZOMBIE_SPAWN_EGG(-1),
|
||||
@ -592,7 +611,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
ZOMBIFIED_PIGLIN_SPAWN_EGG(-1),
|
||||
// End generate - Items
|
||||
// Start generate - Blocks
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
ACACIA_BUTTON(-1, Switch.class),
|
||||
ACACIA_DOOR(-1, Door.class),
|
||||
ACACIA_FENCE(-1, Fence.class),
|
||||
@ -942,6 +961,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
DRAGON_EGG(-1),
|
||||
DRAGON_HEAD(-1, Skull.class),
|
||||
DRAGON_WALL_HEAD(-1, WallSkull.class),
|
||||
DRIED_GHAST(-1, DriedGhast.class),
|
||||
DRIED_KELP_BLOCK(-1),
|
||||
DRIPSTONE_BLOCK(-1),
|
||||
DROPPER(-1, Dispenser.class),
|
||||
|
||||
@ -13,7 +13,7 @@ import org.jspecify.annotations.Nullable;
|
||||
public abstract class MusicInstrument implements Keyed, net.kyori.adventure.translation.Translatable {
|
||||
|
||||
// Start generate - MusicInstrument
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
public static final MusicInstrument ADMIRE_GOAT_HORN = getInstrument("admire_goat_horn");
|
||||
|
||||
public static final MusicInstrument CALL_GOAT_HORN = getInstrument("call_goat_horn");
|
||||
|
||||
@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.Sound.Type { // Paper - implement Sound.Type
|
||||
|
||||
// Start generate - Sound
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Sound AMBIENT_BASALT_DELTAS_ADDITIONS = getSound("ambient.basalt_deltas.additions");
|
||||
|
||||
Sound AMBIENT_BASALT_DELTAS_LOOP = getSound("ambient.basalt_deltas.loop");
|
||||
@ -569,6 +569,22 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound BLOCK_DISPENSER_LAUNCH = getSound("block.dispenser.launch");
|
||||
|
||||
Sound BLOCK_DRIED_GHAST_AMBIENT = getSound("block.dried_ghast.ambient");
|
||||
|
||||
Sound BLOCK_DRIED_GHAST_AMBIENT_WATER = getSound("block.dried_ghast.ambient_water");
|
||||
|
||||
Sound BLOCK_DRIED_GHAST_BREAK = getSound("block.dried_ghast.break");
|
||||
|
||||
Sound BLOCK_DRIED_GHAST_FALL = getSound("block.dried_ghast.fall");
|
||||
|
||||
Sound BLOCK_DRIED_GHAST_PLACE = getSound("block.dried_ghast.place");
|
||||
|
||||
Sound BLOCK_DRIED_GHAST_PLACE_IN_WATER = getSound("block.dried_ghast.place_in_water");
|
||||
|
||||
Sound BLOCK_DRIED_GHAST_STEP = getSound("block.dried_ghast.step");
|
||||
|
||||
Sound BLOCK_DRIED_GHAST_TRANSITION = getSound("block.dried_ghast.transition");
|
||||
|
||||
Sound BLOCK_DRIPSTONE_BLOCK_BREAK = getSound("block.dripstone_block.break");
|
||||
|
||||
Sound BLOCK_DRIPSTONE_BLOCK_FALL = getSound("block.dripstone_block.fall");
|
||||
@ -579,6 +595,8 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound BLOCK_DRIPSTONE_BLOCK_STEP = getSound("block.dripstone_block.step");
|
||||
|
||||
Sound BLOCK_DRY_GRASS_AMBIENT = getSound("block.dry_grass.ambient");
|
||||
|
||||
Sound BLOCK_ENCHANTMENT_TABLE_USE = getSound("block.enchantment_table.use");
|
||||
|
||||
Sound BLOCK_END_GATEWAY_SPAWN = getSound("block.end_gateway.spawn");
|
||||
@ -1193,8 +1211,6 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound BLOCK_SAND_STEP = getSound("block.sand.step");
|
||||
|
||||
Sound BLOCK_SAND_WIND = getSound("block.sand.wind");
|
||||
|
||||
Sound BLOCK_SCAFFOLDING_BREAK = getSound("block.scaffolding.break");
|
||||
|
||||
Sound BLOCK_SCAFFOLDING_FALL = getSound("block.scaffolding.fall");
|
||||
@ -2077,6 +2093,14 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound ENTITY_GHAST_WARN = getSound("entity.ghast.warn");
|
||||
|
||||
Sound ENTITY_GHASTLING_AMBIENT = getSound("entity.ghastling.ambient");
|
||||
|
||||
Sound ENTITY_GHASTLING_DEATH = getSound("entity.ghastling.death");
|
||||
|
||||
Sound ENTITY_GHASTLING_HURT = getSound("entity.ghastling.hurt");
|
||||
|
||||
Sound ENTITY_GHASTLING_SPAWN = getSound("entity.ghastling.spawn");
|
||||
|
||||
Sound ENTITY_GLOW_ITEM_FRAME_ADD_ITEM = getSound("entity.glow_item_frame.add_item");
|
||||
|
||||
Sound ENTITY_GLOW_ITEM_FRAME_BREAK = getSound("entity.glow_item_frame.break");
|
||||
@ -2147,6 +2171,22 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound ENTITY_GUARDIAN_HURT_LAND = getSound("entity.guardian.hurt_land");
|
||||
|
||||
Sound ENTITY_HAPPY_GHAST_AMBIENT = getSound("entity.happy_ghast.ambient");
|
||||
|
||||
Sound ENTITY_HAPPY_GHAST_DEATH = getSound("entity.happy_ghast.death");
|
||||
|
||||
Sound ENTITY_HAPPY_GHAST_EQUIP = getSound("entity.happy_ghast.equip");
|
||||
|
||||
Sound ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_DOWN = getSound("entity.happy_ghast.harness_goggles_down");
|
||||
|
||||
Sound ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_UP = getSound("entity.happy_ghast.harness_goggles_up");
|
||||
|
||||
Sound ENTITY_HAPPY_GHAST_HURT = getSound("entity.happy_ghast.hurt");
|
||||
|
||||
Sound ENTITY_HAPPY_GHAST_RIDING = getSound("entity.happy_ghast.riding");
|
||||
|
||||
Sound ENTITY_HAPPY_GHAST_UNEQUIP = getSound("entity.happy_ghast.unequip");
|
||||
|
||||
Sound ENTITY_HOGLIN_AMBIENT = getSound("entity.hoglin.ambient");
|
||||
|
||||
Sound ENTITY_HOGLIN_ANGRY = getSound("entity.hoglin.angry");
|
||||
@ -2251,10 +2291,6 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound ENTITY_ITEM_FRAME_ROTATE_ITEM = getSound("entity.item_frame.rotate_item");
|
||||
|
||||
Sound ENTITY_LEASH_KNOT_BREAK = getSound("entity.leash_knot.break");
|
||||
|
||||
Sound ENTITY_LEASH_KNOT_PLACE = getSound("entity.leash_knot.place");
|
||||
|
||||
Sound ENTITY_LIGHTNING_BOLT_IMPACT = getSound("entity.lightning_bolt.impact");
|
||||
|
||||
Sound ENTITY_LIGHTNING_BOLT_THUNDER = getSound("entity.lightning_bolt.thunder");
|
||||
@ -2555,8 +2591,6 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound ENTITY_POLAR_BEAR_WARNING = getSound("entity.polar_bear.warning");
|
||||
|
||||
Sound ENTITY_PUFFER_FISH_AMBIENT = getSound("entity.puffer_fish.ambient");
|
||||
|
||||
Sound ENTITY_PUFFER_FISH_BLOW_OUT = getSound("entity.puffer_fish.blow_out");
|
||||
|
||||
Sound ENTITY_PUFFER_FISH_BLOW_UP = getSound("entity.puffer_fish.blow_up");
|
||||
@ -3253,8 +3287,18 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound ITEM_HONEYCOMB_WAX_ON = getSound("item.honeycomb.wax_on");
|
||||
|
||||
Sound ITEM_HORSE_ARMOR_UNEQUIP = getSound("item.horse_armor.unequip");
|
||||
|
||||
Sound ITEM_INK_SAC_USE = getSound("item.ink_sac.use");
|
||||
|
||||
Sound ITEM_LEAD_BREAK = getSound("item.lead.break");
|
||||
|
||||
Sound ITEM_LEAD_TIED = getSound("item.lead.tied");
|
||||
|
||||
Sound ITEM_LEAD_UNTIED = getSound("item.lead.untied");
|
||||
|
||||
Sound ITEM_LLAMA_CARPET_UNEQUIP = getSound("item.llama_carpet.unequip");
|
||||
|
||||
Sound ITEM_LODESTONE_COMPASS_LOCK = getSound("item.lodestone_compass.lock");
|
||||
|
||||
Sound ITEM_MACE_SMASH_AIR = getSound("item.mace.smash_air");
|
||||
@ -3267,6 +3311,10 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound ITEM_OMINOUS_BOTTLE_DISPOSE = getSound("item.ominous_bottle.dispose");
|
||||
|
||||
Sound ITEM_SADDLE_UNEQUIP = getSound("item.saddle.unequip");
|
||||
|
||||
Sound ITEM_SHEARS_SNIP = getSound("item.shears.snip");
|
||||
|
||||
Sound ITEM_SHIELD_BLOCK = getSound("item.shield.block");
|
||||
|
||||
Sound ITEM_SHIELD_BREAK = getSound("item.shield.break");
|
||||
@ -3399,6 +3447,8 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
||||
|
||||
Sound MUSIC_DISC_STRAD = getSound("music_disc.strad");
|
||||
|
||||
Sound MUSIC_DISC_TEARS = getSound("music_disc.tears");
|
||||
|
||||
Sound MUSIC_DISC_WAIT = getSound("music_disc.wait");
|
||||
|
||||
Sound MUSIC_DISC_WARD = getSound("music_disc.ward");
|
||||
|
||||
@ -1,10 +1,16 @@
|
||||
package org.bukkit;
|
||||
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
/**
|
||||
* An Enum of categories for sounds.
|
||||
*/
|
||||
public enum SoundCategory implements net.kyori.adventure.sound.Sound.Source.Provider { // Paper - implement Sound.Source.Provider
|
||||
@NullMarked
|
||||
public enum SoundCategory implements Sound.Source.Provider {
|
||||
|
||||
// Start generate - SoundCategory
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
MASTER,
|
||||
MUSIC,
|
||||
RECORDS,
|
||||
@ -14,23 +20,24 @@ public enum SoundCategory implements net.kyori.adventure.sound.Sound.Source.Prov
|
||||
NEUTRAL,
|
||||
PLAYERS,
|
||||
AMBIENT,
|
||||
VOICE;
|
||||
VOICE,
|
||||
UI;
|
||||
// End generate - SoundCategory
|
||||
|
||||
// Paper start - implement Sound.Source.Provider
|
||||
@Override
|
||||
public net.kyori.adventure.sound.Sound.@org.jetbrains.annotations.NotNull Source soundSource() {
|
||||
public Sound.Source soundSource() {
|
||||
return switch (this) {
|
||||
case MASTER -> net.kyori.adventure.sound.Sound.Source.MASTER;
|
||||
case MUSIC -> net.kyori.adventure.sound.Sound.Source.MUSIC;
|
||||
case RECORDS -> net.kyori.adventure.sound.Sound.Source.RECORD;
|
||||
case WEATHER -> net.kyori.adventure.sound.Sound.Source.WEATHER;
|
||||
case BLOCKS -> net.kyori.adventure.sound.Sound.Source.BLOCK;
|
||||
case HOSTILE -> net.kyori.adventure.sound.Sound.Source.HOSTILE;
|
||||
case NEUTRAL -> net.kyori.adventure.sound.Sound.Source.NEUTRAL;
|
||||
case PLAYERS -> net.kyori.adventure.sound.Sound.Source.PLAYER;
|
||||
case AMBIENT -> net.kyori.adventure.sound.Sound.Source.AMBIENT;
|
||||
case VOICE -> net.kyori.adventure.sound.Sound.Source.VOICE;
|
||||
case MASTER -> Sound.Source.MASTER;
|
||||
case MUSIC -> Sound.Source.MUSIC;
|
||||
case RECORDS -> Sound.Source.RECORD;
|
||||
case WEATHER -> Sound.Source.WEATHER;
|
||||
case BLOCKS -> Sound.Source.BLOCK;
|
||||
case HOSTILE -> Sound.Source.HOSTILE;
|
||||
case NEUTRAL -> Sound.Source.NEUTRAL;
|
||||
case PLAYERS -> Sound.Source.PLAYER;
|
||||
case AMBIENT -> Sound.Source.AMBIENT;
|
||||
case VOICE -> Sound.Source.VOICE;
|
||||
case UI -> throw new UnsupportedOperationException("Waiting on adventure release for the UI sound source"); // todo adventure
|
||||
};
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public enum Statistic implements Keyed {
|
||||
// Start generate - StatisticCustom
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
ANIMALS_BRED,
|
||||
AVIATE_ONE_CM,
|
||||
BELL_RING,
|
||||
@ -33,6 +33,7 @@ public enum Statistic implements Keyed {
|
||||
CAULDRON_FILLED,
|
||||
FISH_CAUGHT,
|
||||
FLY_ONE_CM,
|
||||
HAPPY_GHAST_ONE_CM,
|
||||
HORSE_ONE_CM,
|
||||
DISPENSER_INSPECTED,
|
||||
DROPPER_INSPECTED,
|
||||
@ -86,7 +87,7 @@ public enum Statistic implements Keyed {
|
||||
WALK_UNDER_WATER_ONE_CM,
|
||||
// End generate - StatisticCustom
|
||||
// Start generate - StatisticType
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
BREAK_ITEM(Type.ITEM),
|
||||
CRAFT_ITEM(Type.ITEM),
|
||||
DROP(Type.ITEM),
|
||||
|
||||
@ -20,7 +20,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public interface Tag<T extends Keyed> extends Keyed {
|
||||
|
||||
// Start generate - Tag
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
String REGISTRY_BLOCKS = "blocks";
|
||||
|
||||
Tag<Material> ACACIA_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("acacia_logs"), Material.class);
|
||||
@ -181,6 +181,8 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
|
||||
Tag<Material> GUARDED_BY_PIGLINS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("guarded_by_piglins"), Material.class);
|
||||
|
||||
Tag<Material> HAPPY_GHAST_AVOIDS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("happy_ghast_avoids"), Material.class);
|
||||
|
||||
Tag<Material> HOGLIN_REPELLENTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("hoglin_repellents"), Material.class);
|
||||
|
||||
Tag<Material> ICE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("ice"), Material.class);
|
||||
@ -275,8 +277,6 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
|
||||
Tag<Material> PLANKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("planks"), Material.class);
|
||||
|
||||
Tag<Material> PLAYS_AMBIENT_DESERT_BLOCK_SOUNDS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("plays_ambient_desert_block_sounds"), Material.class);
|
||||
|
||||
Tag<Material> POLAR_BEARS_SPAWNABLE_ON_ALTERNATE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("polar_bears_spawnable_on_alternate"), Material.class);
|
||||
|
||||
Tag<Material> PORTALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("portals"), Material.class);
|
||||
@ -359,6 +359,12 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
|
||||
Tag<Material> TRAPDOORS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("trapdoors"), Material.class);
|
||||
|
||||
Tag<Material> TRIGGERS_AMBIENT_DESERT_DRY_VEGETATION_BLOCK_SOUNDS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("triggers_ambient_desert_dry_vegetation_block_sounds"), Material.class);
|
||||
|
||||
Tag<Material> TRIGGERS_AMBIENT_DESERT_SAND_BLOCK_SOUNDS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("triggers_ambient_desert_sand_block_sounds"), Material.class);
|
||||
|
||||
Tag<Material> TRIGGERS_AMBIENT_DRIED_GHAST_BLOCK_SOUNDS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("triggers_ambient_dried_ghast_block_sounds"), Material.class);
|
||||
|
||||
Tag<Material> UNDERWATER_BONEMEALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("underwater_bonemeals"), Material.class);
|
||||
|
||||
Tag<Material> UNSTABLE_BOTTOM_CENTER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("unstable_bottom_center"), Material.class);
|
||||
@ -571,6 +577,12 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
|
||||
Tag<Material> ITEMS_HANGING_SIGNS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("hanging_signs"), Material.class);
|
||||
|
||||
Tag<Material> ITEMS_HAPPY_GHAST_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("happy_ghast_food"), Material.class);
|
||||
|
||||
Tag<Material> ITEMS_HAPPY_GHAST_TEMPT_ITEMS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("happy_ghast_tempt_items"), Material.class);
|
||||
|
||||
Tag<Material> ITEMS_HARNESSES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("harnesses"), Material.class);
|
||||
|
||||
Tag<Material> ITEMS_HEAD_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("head_armor"), Material.class);
|
||||
|
||||
Tag<Material> ITEMS_HOES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("hoes"), Material.class);
|
||||
@ -783,6 +795,8 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
|
||||
Tag<EntityType> ENTITY_TYPES_CAN_BREATHE_UNDER_WATER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_breathe_under_water"), EntityType.class);
|
||||
|
||||
Tag<EntityType> ENTITY_TYPES_CAN_EQUIP_HARNESS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_equip_harness"), EntityType.class);
|
||||
|
||||
Tag<EntityType> ENTITY_TYPES_CAN_EQUIP_SADDLE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_equip_saddle"), EntityType.class);
|
||||
|
||||
Tag<EntityType> ENTITY_TYPES_CAN_TURN_IN_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_turn_in_boats"), EntityType.class);
|
||||
@ -795,6 +809,8 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
|
||||
Tag<EntityType> ENTITY_TYPES_FALL_DAMAGE_IMMUNE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("fall_damage_immune"), EntityType.class);
|
||||
|
||||
Tag<EntityType> ENTITY_TYPES_FOLLOWABLE_FRIENDLY_MOBS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("followable_friendly_mobs"), EntityType.class);
|
||||
|
||||
Tag<EntityType> ENTITY_TYPES_FREEZE_HURTS_EXTRA_TYPES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("freeze_hurts_extra_types"), EntityType.class);
|
||||
|
||||
Tag<EntityType> ENTITY_TYPES_FREEZE_IMMUNE_ENTITY_TYPES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("freeze_immune_entity_types"), EntityType.class);
|
||||
@ -865,6 +881,11 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
*/
|
||||
@Deprecated(since = "1.21.5", forRemoval = true)
|
||||
Tag<Material> DEAD_BUSH_MAY_PLACE_ON = DRY_VEGETATION_MAY_PLACE_ON;
|
||||
/**
|
||||
* @deprecated replaced by {@link #TRIGGERS_AMBIENT_DESERT_DRY_VEGETATION_BLOCK_SOUNDS}
|
||||
*/
|
||||
@Deprecated(since = "1.21.6", forRemoval = true)
|
||||
Tag<Material> PLAYS_AMBIENT_DESERT_BLOCK_SOUNDS = TRIGGERS_AMBIENT_DESERT_DRY_VEGETATION_BLOCK_SOUNDS;
|
||||
/**
|
||||
* Vanilla block tag representing all blocks that are replaceable by
|
||||
* dripstone.
|
||||
|
||||
@ -13,14 +13,13 @@ public class Vibration {
|
||||
private final Destination destination;
|
||||
private final int arrivalTime;
|
||||
|
||||
// Paper start
|
||||
public Vibration(@NotNull Destination destination, @NotNull int arrivalTime) {
|
||||
this.destination = destination;
|
||||
this.arrivalTime = arrivalTime;
|
||||
this.origin = new Location(null, 0, 0, 0); // Dummy origin because getter expects null
|
||||
this.origin = new Location(null, 0, 0, 0); // Dummy origin because getter expects not null
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true) // Paper end
|
||||
@Deprecated(forRemoval = true)
|
||||
public Vibration(@NotNull Location origin, @NotNull Destination destination, int arrivalTime) {
|
||||
this.origin = origin;
|
||||
this.destination = destination;
|
||||
|
||||
@ -729,7 +729,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @param location Location to spawn the tree
|
||||
* @param type Type of the tree to create
|
||||
* @return true if the tree was created successfully, otherwise false
|
||||
* @deprecated in favor of {@link #generateTree(Location, java.util.Random, TreeType)} to specify its own random instance
|
||||
* and this method is not accessible through {@link RegionAccessor}
|
||||
*/
|
||||
@Deprecated(since = "1.21.6")
|
||||
public boolean generateTree(@NotNull Location location, @NotNull TreeType type);
|
||||
|
||||
/**
|
||||
@ -850,6 +853,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
// Paper start - additional getNearbyEntities API
|
||||
/**
|
||||
* Gets nearby LivingEntities within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param radius Radius
|
||||
* @return the collection of entities near location. This will always be a non-null collection.
|
||||
@ -860,6 +864,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby LivingEntities within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param xzRadius X/Z Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -871,6 +876,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby LivingEntities within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -883,6 +889,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby LivingEntities within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param radius X Radius
|
||||
* @param predicate a predicate used to filter results
|
||||
@ -894,6 +901,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby LivingEntities within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param xzRadius X/Z Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -906,6 +914,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby LivingEntities within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -919,6 +928,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param radius X/Y/Z Radius
|
||||
* @return the collection of living entities near location. This will always be a non-null collection.
|
||||
@ -929,6 +939,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param xzRadius X/Z Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -940,6 +951,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -952,6 +964,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param radius X/Y/Z Radius
|
||||
* @param predicate a predicate used to filter results
|
||||
@ -963,6 +976,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param xzRadius X/Z Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -975,6 +989,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets nearby players within the specified radius (bounding box)
|
||||
*
|
||||
* @param loc Center location
|
||||
* @param xRadius X Radius
|
||||
* @param yRadius Y Radius
|
||||
@ -988,6 +1003,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param loc Center location
|
||||
* @param radius X/Y/Z radius to search within
|
||||
@ -1000,6 +1016,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param loc Center location
|
||||
* @param xzRadius X/Z radius to search within
|
||||
@ -1013,6 +1030,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param loc Center location
|
||||
* @param xRadius X Radius
|
||||
@ -1027,6 +1045,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param loc Center location
|
||||
* @param radius X/Y/Z radius to search within
|
||||
@ -1040,6 +1059,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param loc Center location
|
||||
* @param xzRadius X/Z radius to search within
|
||||
@ -1054,6 +1074,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
|
||||
/**
|
||||
* Gets all nearby entities of the specified type, within the specified radius (bounding box)
|
||||
*
|
||||
* @param clazz Type to filter by
|
||||
* @param loc Center location
|
||||
* @param xRadius X Radius
|
||||
@ -1063,16 +1084,13 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @param <T> the entity type
|
||||
* @return the collection of entities near location. This will always be a non-null collection.
|
||||
*/
|
||||
default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends Entity> clazz, final @NotNull Location loc, final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super T> predicate) {
|
||||
if (clazz == null) {
|
||||
clazz = Entity.class;
|
||||
}
|
||||
default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, final @NotNull Location loc, final double xRadius, final double yRadius, final double zRadius, final @Nullable Predicate<? super T> predicate) {
|
||||
final List<T> nearby = new ArrayList<>();
|
||||
for (final Entity bukkitEntity : this.getNearbyEntities(loc, xRadius, yRadius, zRadius)) {
|
||||
for (final Entity entity : this.getNearbyEntities(loc, xRadius, yRadius, zRadius)) {
|
||||
//noinspection unchecked
|
||||
if (clazz.isAssignableFrom(bukkitEntity.getClass()) && (predicate == null || predicate.test((T) bukkitEntity))) {
|
||||
if ((clazz == null || clazz.isInstance(entity)) && (predicate == null || predicate.test((T) entity))) {
|
||||
//noinspection unchecked
|
||||
nearby.add((T) bukkitEntity);
|
||||
nearby.add((T) entity);
|
||||
}
|
||||
}
|
||||
return nearby;
|
||||
|
||||
@ -93,6 +93,10 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
|
||||
* How long an entity remains burning after ignition.
|
||||
*/
|
||||
Attribute BURNING_TIME = getAttribute("burning_time");
|
||||
/**
|
||||
* The camera distance of a player to their own entity.
|
||||
*/
|
||||
Attribute CAMERA_DISTANCE = getAttribute("camera_distance");
|
||||
/**
|
||||
* Resistance to knockback from explosions.
|
||||
*/
|
||||
@ -145,6 +149,14 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
|
||||
* Chance of a zombie to spawn reinforcements.
|
||||
*/
|
||||
Attribute SPAWN_REINFORCEMENTS = getAttribute("spawn_reinforcements");
|
||||
/**
|
||||
* Attribute controlling the range an entity transmits itself as a waypoint.
|
||||
*/
|
||||
Attribute WAYPOINT_TRANSMIT_RANGE = getAttribute("waypoint_transmit_range");
|
||||
/**
|
||||
* Attribute controlling the range an entity receives other waypoints from.
|
||||
*/
|
||||
Attribute WAYPOINT_RECEIVE_RANGE = getAttribute("waypoint_receive_range");
|
||||
|
||||
@NotNull
|
||||
private static Attribute getAttribute(@NotNull String key) {
|
||||
|
||||
@ -25,7 +25,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public interface Biome extends OldEnum<Biome>, Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
|
||||
|
||||
// Start generate - Biome
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Biome BADLANDS = getBiome("badlands");
|
||||
|
||||
Biome BAMBOO_JUNGLE = getBiome("bamboo_jungle");
|
||||
|
||||
@ -53,6 +53,7 @@ import org.bukkit.block.data.type.DaylightDetector;
|
||||
import org.bukkit.block.data.type.DecoratedPot;
|
||||
import org.bukkit.block.data.type.Dispenser;
|
||||
import org.bukkit.block.data.type.Door;
|
||||
import org.bukkit.block.data.type.DriedGhast;
|
||||
import org.bukkit.block.data.type.Dripleaf;
|
||||
import org.bukkit.block.data.type.EndPortalFrame;
|
||||
import org.bukkit.block.data.type.EnderChest;
|
||||
@ -197,7 +198,7 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
|
||||
|
||||
//<editor-fold desc="BlockTypes" defaultstate="collapsed">
|
||||
// Start generate - BlockType
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
BlockType.Typed<Switch> ACACIA_BUTTON = getBlockType("acacia_button");
|
||||
|
||||
BlockType.Typed<Door> ACACIA_DOOR = getBlockType("acacia_door");
|
||||
@ -898,6 +899,8 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
|
||||
|
||||
BlockType.Typed<WallSkull> DRAGON_WALL_HEAD = getBlockType("dragon_wall_head");
|
||||
|
||||
BlockType.Typed<DriedGhast> DRIED_GHAST = getBlockType("dried_ghast");
|
||||
|
||||
BlockType.Typed<BlockData> DRIED_KELP_BLOCK = getBlockType("dried_kelp_block");
|
||||
|
||||
BlockType.Typed<BlockData> DRIPSTONE_BLOCK = getBlockType("dripstone_block");
|
||||
|
||||
@ -16,7 +16,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
public interface PatternType extends OldEnum<PatternType>, Keyed {
|
||||
|
||||
// Start generate - PatternType
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
PatternType BASE = getType("base");
|
||||
|
||||
PatternType BORDER = getType("border");
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package org.bukkit.block.data.type;
|
||||
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
|
||||
/**
|
||||
* Represents a dried ghast block data.
|
||||
*/
|
||||
public interface DriedGhast extends Directional, Waterlogged {
|
||||
|
||||
/**
|
||||
* Gets the hydration level of this dried ghast.
|
||||
*
|
||||
* @return the hydration level, reaching from 0 to {@link #getMaximumHydration()}
|
||||
*/
|
||||
int getHydration();
|
||||
|
||||
/**
|
||||
* Sets the hydration level of this dried ghast.
|
||||
*
|
||||
* @param hydration the hydration level, reaching from 0 to {@link #getMaximumHydration()}
|
||||
*/
|
||||
void setHydration(final int hydration);
|
||||
|
||||
/**
|
||||
* Provides the maximum hydration level this dried ghast can reach.
|
||||
*
|
||||
* @return the maximum level.
|
||||
*/
|
||||
int getMaximumHydration();
|
||||
|
||||
}
|
||||
@ -22,7 +22,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public interface DamageType extends Keyed, Translatable {
|
||||
|
||||
// Start generate - DamageType
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
DamageType ARROW = getDamageType("arrow");
|
||||
|
||||
DamageType BAD_RESPAWN_POINT = getDamageType("bad_respawn_point");
|
||||
|
||||
@ -29,10 +29,13 @@ public interface Armadillo extends Animals {
|
||||
* Represents the current state of the armadillo.
|
||||
*/
|
||||
enum State {
|
||||
// Start generate - ArmadilloState
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
IDLE,
|
||||
ROLLING,
|
||||
SCARED,
|
||||
UNROLLING;
|
||||
// End generate - ArmadilloState
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Pa
|
||||
|
||||
NOT_IN_WORLD,
|
||||
// Start generate - BoatStatus
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
IN_WATER,
|
||||
UNDER_WATER,
|
||||
UNDER_FLOWING_WATER,
|
||||
|
||||
@ -55,7 +55,7 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
|
||||
interface Type extends OldEnum<Type>, Keyed {
|
||||
|
||||
// Start generate - CatType
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Type ALL_BLACK = getType("all_black");
|
||||
|
||||
Type BLACK = getType("black");
|
||||
|
||||
@ -60,7 +60,7 @@ public interface Chicken extends Animals {
|
||||
interface Variant extends Keyed {
|
||||
|
||||
// Start generate - ChickenVariant
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Variant COLD = getVariant("cold");
|
||||
|
||||
Variant TEMPERATE = getVariant("temperate");
|
||||
|
||||
@ -32,7 +32,7 @@ public interface Cow extends AbstractCow {
|
||||
interface Variant extends Keyed {
|
||||
|
||||
// Start generate - CowVariant
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Variant COLD = getVariant("cold");
|
||||
|
||||
Variant TEMPERATE = getVariant("temperate");
|
||||
|
||||
@ -15,7 +15,7 @@ public interface EnderSignal extends Entity {
|
||||
*
|
||||
* @return the {@link Location} this EnderSignal is moving towards.
|
||||
*/
|
||||
@NotNull
|
||||
@Nullable
|
||||
public Location getTargetLocation();
|
||||
|
||||
/**
|
||||
|
||||
@ -328,7 +328,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
boolean isVisualFire();
|
||||
|
||||
/**
|
||||
* Retrieves the visual fire state of the object.
|
||||
* Retrieves the visual fire state of the entity.
|
||||
*
|
||||
* @return A TriState indicating the current visual fire state.
|
||||
*/
|
||||
|
||||
@ -46,7 +46,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
public enum EntityType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - translatable
|
||||
|
||||
// Start generate - EntityType
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
ACACIA_BOAT("acacia_boat", AcaciaBoat.class, -1),
|
||||
ACACIA_CHEST_BOAT("acacia_chest_boat", AcaciaChestBoat.class, -1),
|
||||
ALLAY("allay", Allay.class, -1),
|
||||
@ -109,6 +109,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||
GLOW_SQUID("glow_squid", GlowSquid.class, -1),
|
||||
GOAT("goat", Goat.class, -1),
|
||||
GUARDIAN("guardian", Guardian.class, 68),
|
||||
HAPPY_GHAST("happy_ghast", HappyGhast.class, -1),
|
||||
HOGLIN("hoglin", Hoglin.class, -1),
|
||||
HOPPER_MINECART("hopper_minecart", HopperMinecart.class, 46),
|
||||
HORSE("horse", Horse.class, 100),
|
||||
@ -130,7 +131,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||
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),
|
||||
MINECART("minecart", RideableMinecart.class, 42),
|
||||
MOOSHROOM("mooshroom", MushroomCow.class, 96),
|
||||
MULE("mule", Mule.class, 32),
|
||||
OAK_BOAT("oak_boat", OakBoat.class, -1),
|
||||
|
||||
@ -2,5 +2,7 @@ package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents a Flying Entity.
|
||||
* @deprecated Minecraft no longer has a distinction for these types of mobs.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.21.6")
|
||||
public interface Flying extends Mob {}
|
||||
|
||||
@ -90,7 +90,7 @@ public interface Fox extends Animals, Sittable {
|
||||
*/
|
||||
public enum Type {
|
||||
// Start generate - FoxType
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
RED,
|
||||
SNOW;
|
||||
// End generate - FoxType
|
||||
|
||||
@ -53,7 +53,7 @@ public interface Frog extends Animals {
|
||||
interface Variant extends OldEnum<Variant>, Keyed {
|
||||
|
||||
// Start generate - FrogVariant
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Variant COLD = getVariant("cold");
|
||||
|
||||
Variant TEMPERATE = getVariant("temperate");
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents a happy ghast.
|
||||
*/
|
||||
public interface HappyGhast extends Vehicle, Animals {
|
||||
}
|
||||
@ -186,7 +186,7 @@ public interface Panda extends Animals, Sittable {
|
||||
public enum Gene {
|
||||
|
||||
// Start generate - PandaGene
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
NORMAL(false),
|
||||
LAZY(false),
|
||||
WORRIED(false),
|
||||
|
||||
@ -32,7 +32,7 @@ public interface Pig extends Steerable, Vehicle {
|
||||
interface Variant extends Keyed {
|
||||
|
||||
// Start generate - PigVariant
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Variant COLD = getVariant("cold");
|
||||
|
||||
Variant TEMPERATE = getVariant("temperate");
|
||||
|
||||
@ -5,9 +5,9 @@ package org.bukkit.entity;
|
||||
*/
|
||||
public enum Pose {
|
||||
|
||||
// Start generate - Pose
|
||||
/**
|
||||
* Entity is standing normally.
|
||||
*
|
||||
*/
|
||||
STANDING,
|
||||
/**
|
||||
@ -78,4 +78,5 @@ public enum Pose {
|
||||
* Entity is inhaling.
|
||||
*/
|
||||
INHALING;
|
||||
// End generate - Pose
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ public interface Salmon extends io.papermc.paper.entity.SchoolableFish { // Pape
|
||||
public enum Variant {
|
||||
|
||||
// Start generate - SalmonVariant
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
SMALL,
|
||||
MEDIUM,
|
||||
LARGE;
|
||||
|
||||
@ -75,7 +75,7 @@ public interface Sniffer extends Animals {
|
||||
*/
|
||||
public enum State {
|
||||
// Start generate - SnifferState
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
IDLING,
|
||||
FEELING_HAPPY,
|
||||
SCENTING,
|
||||
|
||||
@ -61,7 +61,7 @@ public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { /
|
||||
public static enum Pattern {
|
||||
|
||||
// Start generate - TropicalFishPattern
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
KOB,
|
||||
SUNSTREAK,
|
||||
SNOOPER,
|
||||
|
||||
@ -172,7 +172,7 @@ public interface Villager extends AbstractVillager {
|
||||
interface Type extends OldEnum<Type>, Keyed {
|
||||
|
||||
// Start generate - VillagerType
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
Type DESERT = getType("desert");
|
||||
|
||||
Type JUNGLE = getType("jungle");
|
||||
@ -224,7 +224,7 @@ public interface Villager extends AbstractVillager {
|
||||
interface Profession extends OldEnum<Profession>, Keyed, net.kyori.adventure.translation.Translatable {
|
||||
|
||||
// Start generate - VillagerProfession
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
/**
|
||||
* Armorer profession. Wears a black apron. Armorers primarily trade for
|
||||
* iron armor, chainmail armor, and sometimes diamond armor.
|
||||
|
||||
@ -142,7 +142,7 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
|
||||
interface SoundVariant extends Keyed {
|
||||
|
||||
// Start generate - WolfSoundVariant
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
SoundVariant ANGRY = getSoundVariant("angry");
|
||||
|
||||
SoundVariant BIG = getSoundVariant("big");
|
||||
|
||||
@ -47,7 +47,7 @@ public final class MemoryKey<T> implements Keyed {
|
||||
private static final Map<NamespacedKey, MemoryKey<?>> MEMORY_KEYS = new HashMap<>();
|
||||
|
||||
// Start generate - MemoryKey
|
||||
// @GeneratedFrom 1.21.5
|
||||
// @GeneratedFrom 1.21.6-rc1
|
||||
public static final MemoryKey<Boolean> ADMIRING_DISABLED = new MemoryKey<>(NamespacedKey.minecraft("admiring_disabled"), Boolean.class);
|
||||
|
||||
public static final MemoryKey<Boolean> ADMIRING_ITEM = new MemoryKey<>(NamespacedKey.minecraft("admiring_item"), Boolean.class);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user