Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
Nassim Jahnke
2025-04-12 17:26:44 +02:00
parent 0767902699
commit f00727c57e
2092 changed files with 50551 additions and 48729 deletions

View File

@@ -35,57 +35,109 @@ public interface Art extends OldEnum<Art>, Keyed {
return InlinedRegistryBuilderProvider.instance().createPaintingVariant(value);
}
Art KEBAB = getArt("kebab");
Art AZTEC = getArt("aztec");
// Start generate - Art
// @GeneratedFrom 1.21.5
Art ALBAN = getArt("alban");
Art AZTEC = getArt("aztec");
Art AZTEC2 = getArt("aztec2");
Art BOMB = getArt("bomb");
Art PLANT = getArt("plant");
Art WASTELAND = getArt("wasteland");
Art POOL = getArt("pool");
Art COURBET = getArt("courbet");
Art SEA = getArt("sea");
Art SUNSET = getArt("sunset");
Art CREEBET = getArt("creebet");
Art WANDERER = getArt("wanderer");
Art GRAHAM = getArt("graham");
Art MATCH = getArt("match");
Art BUST = getArt("bust");
Art STAGE = getArt("stage");
Art VOID = getArt("void");
Art SKULL_AND_ROSES = getArt("skull_and_roses");
Art WITHER = getArt("wither");
Art FIGHTERS = getArt("fighters");
Art POINTER = getArt("pointer");
Art PIGSCENE = getArt("pigscene");
Art BURNING_SKULL = getArt("burning_skull");
Art SKELETON = getArt("skeleton");
Art DONKEY_KONG = getArt("donkey_kong");
Art EARTH = getArt("earth");
Art WIND = getArt("wind");
Art WATER = getArt("water");
Art FIRE = getArt("fire");
Art BAROQUE = getArt("baroque");
Art HUMBLE = getArt("humble");
Art MEDITATIVE = getArt("meditative");
Art PRAIRIE_RIDE = getArt("prairie_ride");
Art UNPACKED = getArt("unpacked");
Art BACKYARD = getArt("backyard");
Art BAROQUE = getArt("baroque");
Art BOMB = getArt("bomb");
Art BOUQUET = getArt("bouquet");
Art BURNING_SKULL = getArt("burning_skull");
Art BUST = getArt("bust");
Art CAVEBIRD = getArt("cavebird");
Art CHANGING = getArt("changing");
Art COTAN = getArt("cotan");
Art COURBET = getArt("courbet");
Art CREEBET = getArt("creebet");
Art DONKEY_KONG = getArt("donkey_kong");
Art EARTH = getArt("earth");
Art ENDBOSS = getArt("endboss");
Art FERN = getArt("fern");
Art FIGHTERS = getArt("fighters");
Art FINDING = getArt("finding");
Art FIRE = getArt("fire");
Art GRAHAM = getArt("graham");
Art HUMBLE = getArt("humble");
Art KEBAB = getArt("kebab");
Art LOWMIST = getArt("lowmist");
Art MATCH = getArt("match");
Art MEDITATIVE = getArt("meditative");
Art ORB = getArt("orb");
Art OWLEMONS = getArt("owlemons");
Art PASSAGE = getArt("passage");
Art PIGSCENE = getArt("pigscene");
Art PLANT = getArt("plant");
Art POINTER = getArt("pointer");
Art POND = getArt("pond");
Art POOL = getArt("pool");
Art PRAIRIE_RIDE = getArt("prairie_ride");
Art SEA = getArt("sea");
Art SKELETON = getArt("skeleton");
Art SKULL_AND_ROSES = getArt("skull_and_roses");
Art STAGE = getArt("stage");
Art SUNFLOWERS = getArt("sunflowers");
Art SUNSET = getArt("sunset");
Art TIDES = getArt("tides");
Art UNPACKED = getArt("unpacked");
Art VOID = getArt("void");
Art WANDERER = getArt("wanderer");
Art WASTELAND = getArt("wasteland");
Art WATER = getArt("water");
Art WIND = getArt("wind");
Art WITHER = getArt("wither");
// End generate - Art
@NotNull
private static Art getArt(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PAINTING_VARIANT).getOrThrow(NamespacedKey.minecraft(key));

View File

@@ -14,6 +14,7 @@ import java.util.Set;
import java.util.UUID;
import java.util.function.Consumer;
import java.util.logging.Logger;
import net.kyori.adventure.text.Component;
import org.bukkit.Warning.WarningState;
import org.bukkit.advancement.Advancement;
import org.bukkit.block.data.BlockData;
@@ -189,8 +190,8 @@ public final class Bukkit {
* uses. Normal and immediate iterator use without consequences that
* affect the collection are fully supported. The effects following
* (non-exhaustive) {@link Entity#teleport(Location) teleportation},
* {@link Player#setHealth(double) death}, and {@link Player#kickPlayer(
* String) kicking} are undefined. Any use of this collection from
* {@link Player#setHealth(double) death}, and {@link Player#kick(
* Component) kicking} are undefined. Any use of this collection from
* asynchronous threads is unsafe.
* <p>
* For safe consequential iteration or mimicking the old array behavior,
@@ -468,7 +469,7 @@ public final class Bukkit {
*
* @param message the message
* @return the number of players
* @deprecated in favour of {@link Server#broadcast(net.kyori.adventure.text.Component)}
* @deprecated in favour of {@link Server#broadcast(Component)}
*/
@Deprecated // Paper
public static int broadcastMessage(@NotNull String message) {
@@ -480,7 +481,7 @@ public final class Bukkit {
* Sends the component to all online players.
*
* @param component the component to send
* @deprecated use {@code sendMessage} methods on {@link #getServer()} that accept {@link net.kyori.adventure.text.Component}
* @deprecated use {@code sendMessage} methods on {@link #getServer()} that accept {@link Component}
*/
@Deprecated
public static void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) {
@@ -491,7 +492,7 @@ public final class Bukkit {
* Sends an array of components as a single message to all online players.
*
* @param components the components to send
* @deprecated use {@code sendMessage} methods on {@link #getServer()} that accept {@link net.kyori.adventure.text.Component}
* @deprecated use {@code sendMessage} methods on {@link #getServer()} that accept {@link Component}
*/
@Deprecated
public static void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
@@ -1463,7 +1464,7 @@ public final class Bukkit {
/**
* Broadcast a message to all players.
* <p>
* This is the same as calling {@link #broadcast(net.kyori.adventure.text.Component,
* This is the same as calling {@link #broadcast(Component,
* java.lang.String)} with the {@link Server#BROADCAST_CHANNEL_USERS} permission.
*
* @param message the message
@@ -1493,7 +1494,7 @@ public final class Bukkit {
* @param permission the required permission {@link Permissible
* permissibles} must have to receive the broadcast
* @return number of message recipients
* @deprecated in favour of {@link #broadcast(net.kyori.adventure.text.Component, String)}
* @deprecated in favour of {@link #broadcast(Component, String)}
*/
@Deprecated // Paper
public static int broadcast(@NotNull String message, @NotNull String permission) {
@@ -1740,7 +1741,7 @@ public final class Bukkit {
* @return a command sender
*/
@NotNull
public static CommandSender createCommandSender(final @NotNull java.util.function.Consumer<? super net.kyori.adventure.text.Component> feedback) {
public static CommandSender createCommandSender(final @NotNull java.util.function.Consumer<? super Component> feedback) {
return server.createCommandSender(feedback);
}
// Paper end
@@ -1864,7 +1865,7 @@ public final class Bukkit {
* @return The new inventory.
* @throws IllegalArgumentException if the {@link InventoryType} cannot be
* viewed.
* @deprecated in favour of {@link #createInventory(InventoryHolder, InventoryType, net.kyori.adventure.text.Component)}
* @deprecated in favour of {@link #createInventory(InventoryHolder, InventoryType, Component)}
*
* @see InventoryType#isCreatable()
*/
@@ -1916,7 +1917,7 @@ public final class Bukkit {
* viewed
* @return a new inventory
* @throws IllegalArgumentException if the size is not a multiple of 9
* @deprecated in favour of {@link #createInventory(InventoryHolder, InventoryType, net.kyori.adventure.text.Component)}
* @deprecated in favour of {@link #createInventory(InventoryHolder, InventoryType, Component)}
*/
@Deprecated // Paper
@NotNull
@@ -1945,7 +1946,7 @@ public final class Bukkit {
* @param title the title of the corresponding merchant inventory, displayed
* when the merchant inventory is viewed
* @return a new merchant
* @deprecated in favour of {@link #createMerchant(net.kyori.adventure.text.Component)}. The title parameter is
* @deprecated in favour of {@link #createMerchant(Component)}. The title parameter is
* no-longer needed when used with {@link MenuType#MERCHANT} and {@link MenuType.Typed#builder()}
*/
@NotNull
@@ -2082,7 +2083,7 @@ public final class Bukkit {
*
* @return the server's MOTD
*/
@NotNull public static net.kyori.adventure.text.Component motd() {
@NotNull public static Component motd() {
return server.motd();
}
@@ -2121,7 +2122,7 @@ public final class Bukkit {
* Set the message that is displayed on the server list.
*
* @param motd The message to be displayed
* @deprecated in favour of {@link #motd(net.kyori.adventure.text.Component)}
* @deprecated in favour of {@link #motd(Component)}
*/
@Deprecated // Paper
public static void setMotd(@NotNull String motd) {
@@ -2695,7 +2696,7 @@ public final class Bukkit {
* @return the default message
*/
@NotNull
public static net.kyori.adventure.text.Component permissionMessage() {
public static Component permissionMessage() {
return server.permissionMessage();
}

View File

@@ -136,9 +136,9 @@ public interface Chunk extends PersistentDataHolder {
@NotNull Entity @NotNull [] getEntities();
/**
* Get a list of all tile entities in the chunk.
* Get a list of all block entities in the chunk.
*
* @return The tile entities.
* @return The block entities.
*/
@NotNull
// Paper start
@@ -147,20 +147,20 @@ public interface Chunk extends PersistentDataHolder {
}
/**
* Get a list of all tile entities in the chunk.
* Get a list of all block entities in the chunk.
*
* @param useSnapshot Take snapshots or direct references
* @return The tile entities.
* @return The block entities.
*/
@NotNull
BlockState @NotNull [] getTileEntities(boolean useSnapshot);
/**
* Get a list of all tile entities that match a given predicate in the chunk.
* Get a list of all block entities that match a given predicate in the chunk.
*
* @param blockPredicate The predicate of blocks to return tile entities for
* @param blockPredicate The predicate of blocks to return block entities for
* @param useSnapshot Take snapshots or direct references
* @return The tile entities.
* @return The block entities.
*/
@NotNull
Collection<BlockState> getTileEntities(java.util.function.@NotNull Predicate<? super Block> blockPredicate, boolean useSnapshot);

View File

@@ -146,7 +146,7 @@ public final class Color implements ConfigurationSerializable {
* @param blue integer from 0-255
* @param green integer from 0-255
* @param red integer from 0-255
* @return a new Color object for the red, green, blue
* @return a new Color object for the blue, green, red
* @throws IllegalArgumentException if any value is strictly {@literal >255 or <0}
*/
@NotNull
@@ -225,7 +225,7 @@ public final class Color implements ConfigurationSerializable {
* Creates a new Color object with specified component
*
* @param alpha the alpha component, from 0 to 255
* @return a new color object with the red component
* @return a new color object with the alpha component
*/
@NotNull
public Color setAlpha(int alpha) {
@@ -264,8 +264,8 @@ public final class Color implements ConfigurationSerializable {
/**
* Creates a new Color object with specified component
*
* @param green the red component, from 0 to 255
* @return a new color object with the red component
* @param green the green component, from 0 to 255
* @return a new color object with the green component
*/
@NotNull
public Color setGreen(int green) {
@@ -284,8 +284,8 @@ public final class Color implements ConfigurationSerializable {
/**
* Creates a new Color object with specified component
*
* @param blue the red component, from 0 to 255
* @return a new color object with the red component
* @param blue the blue component, from 0 to 255
* @return a new color object with the blue component
*/
@NotNull
public Color setBlue(int blue) {

View File

@@ -247,11 +247,17 @@ public enum EntityEffect {
// 22-28 player internal flags
/**
* Shield blocks attack.
*
* @deprecated replaced by the {@code blocks_attacks} item data component
*/
@Deprecated(since = "1.21.5", forRemoval = true)
SHIELD_BLOCK(29, LivingEntity.class),
/**
* Shield breaks.
*
* @deprecated replaced by the {@code blocks_attacks} item data component
*/
@Deprecated(since = "1.21.5", forRemoval = true)
SHIELD_BREAK(30, LivingEntity.class),
// 31 - unused
/**
@@ -359,7 +365,7 @@ public enum EntityEffect {
*/
BREAK_EQUIPMENT_MAIN_HAND(47, LivingEntity.class),
/**
* Entity breaks item in off hand.
* Entity breaks item in off-hand.
*
* @see org.bukkit.inventory.EquipmentSlot#OFF_HAND
*/
@@ -458,11 +464,19 @@ public enum EntityEffect {
*/
BREAK_EQUIPMENT_BODY(65, LivingEntity.class),
/**
* A creaking transient shaking when being hit.
* Does not apply to plain creaking entities as they are not invulnerable like the transient ones spawned by the
* creaking heart.
* A creaking shaking when being hit.
*/
SHAKE(66, Creaking.class);
SHAKE(66, Creaking.class),
/**
* Drown particles for entities.
*/
DROWN_PARTICLES(67, LivingEntity.class),
/**
* Entity breaks item in saddle slot.
*
* @see org.bukkit.inventory.EquipmentSlot#SADDLE
*/
BREAK_EQUIPMENT_SADDLE(68, LivingEntity.class);
private final byte data;
private final Set<Class<? extends Entity>> applicableClasses;

View File

@@ -14,19 +14,19 @@ import org.jetbrains.annotations.ApiStatus;
*/
public interface FeatureFlag extends Keyed {
// Paper start - overhaul FeatureFlag API
/**
* The {@code vanilla} feature flag.
*/
FeatureFlag VANILLA = create("vanilla");
// Start generate - FeatureFlag
// @GeneratedFrom 1.21.5
@ApiStatus.Experimental
FeatureFlag MINECART_IMPROVEMENTS = create("minecart_improvements");
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19.3 - 1.21.1
*
* @deprecated not available since 1.21.2
*/
@Deprecated(since = "1.21.2")
FeatureFlag BUNDLE = deprecated("bundle");
@ApiStatus.Experimental
FeatureFlag REDSTONE_EXPERIMENTS = create("redstone_experiments");
@ApiStatus.Experimental
FeatureFlag TRADE_REBALANCE = create("trade_rebalance");
FeatureFlag VANILLA = create("vanilla");
// End generate - FeatureFlag
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19 - 1.19.4
@@ -37,9 +37,6 @@ public interface FeatureFlag extends Keyed {
@Deprecated(since = "1.20")
FeatureFlag UPDATE_1_20 = deprecated("update_1_20");
@ApiStatus.Experimental // Paper - add missing annotation
FeatureFlag TRADE_REBALANCE = create("trade_rebalance");
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.20.5 - 1.20.6
*
@@ -48,6 +45,14 @@ public interface FeatureFlag extends Keyed {
@Deprecated(since = "1.21")
FeatureFlag UPDATE_121 = deprecated("update_1_21");
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.19.3 - 1.21.1
*
* @deprecated not available since 1.21.2
*/
@Deprecated(since = "1.21.2")
FeatureFlag BUNDLE = deprecated("bundle");
/**
* <strong>AVAILABLE BETWEEN VERSIONS:</strong> 1.21.2 - 1.21.3
*
@@ -56,12 +61,6 @@ public interface FeatureFlag extends Keyed {
@Deprecated(since = "1.21.4")
FeatureFlag WINTER_DROP = deprecated("winter_drop");
@ApiStatus.Experimental // Paper - add missing annotation
FeatureFlag REDSTONE_EXPERIMENTS = create("redstone_experiments");
@ApiStatus.Experimental // Paper - add missing annotation
FeatureFlag MINECART_IMPROVEMENTS = create("minecart_improvements");
/**
* An index of all feature flags.
*/

View File

@@ -12,27 +12,19 @@ import org.jetbrains.annotations.NotNull;
*/
public interface Fluid extends OldEnum<Fluid>, Keyed {
/**
* No fluid.
*/
// Start generate - Fluid
// @GeneratedFrom 1.21.5
Fluid EMPTY = getFluid("empty");
/**
* Stationary water.
*/
Fluid WATER = getFluid("water");
/**
* Flowing water.
*/
Fluid FLOWING_WATER = getFluid("flowing_water");
/**
* Stationary lava.
*/
Fluid LAVA = getFluid("lava");
/**
* Flowing lava.
*/
Fluid FLOWING_LAVA = getFluid("flowing_lava");
Fluid FLOWING_WATER = getFluid("flowing_water");
Fluid LAVA = getFluid("lava");
Fluid WATER = getFluid("water");
// End generate - Fluid
@NotNull
private static Fluid getFluid(@NotNull String key) {
return Registry.FLUID.getOrThrow(NamespacedKey.minecraft(key));

View File

@@ -11,107 +11,229 @@ import org.jetbrains.annotations.Nullable;
*/
public abstract class GameEvent implements Keyed {
// Start generate - GameEvent
// @GeneratedFrom 1.21.5
public static final GameEvent BLOCK_ACTIVATE = getEvent("block_activate");
public static final GameEvent BLOCK_ATTACH = getEvent("block_attach");
public static final GameEvent BLOCK_CHANGE = getEvent("block_change");
public static final GameEvent BLOCK_CLOSE = getEvent("block_close");
public static final GameEvent BLOCK_DEACTIVATE = getEvent("block_deactivate");
public static final GameEvent BLOCK_DESTROY = getEvent("block_destroy");
public static final GameEvent BLOCK_DETACH = getEvent("block_detach");
public static final GameEvent BLOCK_OPEN = getEvent("block_open");
public static final GameEvent BLOCK_PLACE = getEvent("block_place");
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_PRESS = getEvent("block_activate");
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_SWITCH = getEvent("block_activate");
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_UNPRESS = getEvent("block_deactivate");
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_UNSWITCH = getEvent("block_deactivate");
public static final GameEvent CONTAINER_CLOSE = getEvent("container_close");
public static final GameEvent CONTAINER_OPEN = getEvent("container_open");
@Deprecated(since = "1.20")
public static final GameEvent DISPENSE_FAIL = getEvent("block_activate");
public static final GameEvent DRINK = getEvent("drink");
@Deprecated(since = "1.19")
public static final GameEvent DRINKING_FINISH = getEvent("drink");
public static final GameEvent EAT = getEvent("eat");
@Deprecated(since = "1.19")
public static final GameEvent ELYTRA_FREE_FALL = getEvent("elytra_glide");
public static final GameEvent ELYTRA_GLIDE = getEvent("elytra_glide");
public static final GameEvent ENTITY_DAMAGE = getEvent("entity_damage");
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_DAMAGED = getEvent("entity_damage");
public static final GameEvent ENTITY_DIE = getEvent("entity_die");
public static final GameEvent ENTITY_DISMOUNT = getEvent("entity_dismount");
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_DYING = getEvent("entity_die");
public static final GameEvent ENTITY_INTERACT = getEvent("entity_interact");
public static final GameEvent ENTITY_MOUNT = getEvent("entity_mount");
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_KILLED = getEvent("entity_die");
public static final GameEvent ENTITY_PLACE = getEvent("entity_place");
public static final GameEvent ENTITY_ACTION = getEvent("entity_action");
@Deprecated(since = "1.20.2")
public static final GameEvent ENTITY_ROAR = getEvent("entity_action");
@Deprecated(since = "1.20.2")
public static final GameEvent ENTITY_SHAKE = getEvent("entity_action");
public static final GameEvent ENTITY_DAMAGE = getEvent("entity_damage");
public static final GameEvent ENTITY_DIE = getEvent("entity_die");
public static final GameEvent ENTITY_DISMOUNT = getEvent("entity_dismount");
public static final GameEvent ENTITY_INTERACT = getEvent("entity_interact");
public static final GameEvent ENTITY_MOUNT = getEvent("entity_mount");
public static final GameEvent ENTITY_PLACE = getEvent("entity_place");
public static final GameEvent EQUIP = getEvent("equip");
public static final GameEvent EXPLODE = getEvent("explode");
public static final GameEvent FLAP = getEvent("flap");
public static final GameEvent FLUID_PICKUP = getEvent("fluid_pickup");
public static final GameEvent FLUID_PLACE = getEvent("fluid_place");
public static final GameEvent HIT_GROUND = getEvent("hit_ground");
public static final GameEvent INSTRUMENT_PLAY = getEvent("instrument_play");
public static final GameEvent ITEM_INTERACT_FINISH = getEvent("item_interact_finish");
public static final GameEvent ITEM_INTERACT_START = getEvent("item_interact_start");
public static final GameEvent JUKEBOX_PLAY = getEvent("jukebox_play");
public static final GameEvent JUKEBOX_STOP_PLAY = getEvent("jukebox_stop_play");
public static final GameEvent LIGHTNING_STRIKE = getEvent("lightning_strike");
@Deprecated(since = "1.19")
public static final GameEvent MOB_INTERACT = getEvent("entity_interact");
public static final GameEvent NOTE_BLOCK_PLAY = getEvent("note_block_play");
@Deprecated(since = "1.20")
public static final GameEvent PISTON_CONTRACT = getEvent("block_deactivate");
@Deprecated(since = "1.20")
public static final GameEvent PISTON_EXTEND = getEvent("block_activate");
public static final GameEvent PRIME_FUSE = getEvent("prime_fuse");
public static final GameEvent PROJECTILE_LAND = getEvent("projectile_land");
public static final GameEvent PROJECTILE_SHOOT = getEvent("projectile_shoot");
@Deprecated(since = "1.19")
public static final GameEvent RAVAGER_ROAR = getEvent("entity_action");
@Deprecated(since = "1.19")
public static final GameEvent RING_BELL = getEvent("block_change");
public static final GameEvent SCULK_SENSOR_TENDRILS_CLICKING = getEvent("sculk_sensor_tendrils_clicking");
public static final GameEvent SHEAR = getEvent("shear");
public static final GameEvent SHRIEK = getEvent("shriek");
@Deprecated(since = "1.19")
public static final GameEvent SHULKER_CLOSE = getEvent("container_close");
@Deprecated(since = "1.19")
public static final GameEvent SHULKER_OPEN = getEvent("container_open");
public static final GameEvent SPLASH = getEvent("splash");
public static final GameEvent STEP = getEvent("step");
public static final GameEvent SWIM = getEvent("swim");
public static final GameEvent TELEPORT = getEvent("teleport");
public static final GameEvent UNEQUIP = getEvent("unequip");
@Deprecated(since = "1.19")
public static final GameEvent WOLF_SHAKING = getEvent("entity_action");
public static final GameEvent RESONATE_1 = getEvent("resonate_1");
public static final GameEvent RESONATE_2 = getEvent("resonate_2");
public static final GameEvent RESONATE_3 = getEvent("resonate_3");
public static final GameEvent RESONATE_4 = getEvent("resonate_4");
public static final GameEvent RESONATE_5 = getEvent("resonate_5");
public static final GameEvent RESONATE_6 = getEvent("resonate_6");
public static final GameEvent RESONATE_7 = getEvent("resonate_7");
public static final GameEvent RESONATE_8 = getEvent("resonate_8");
public static final GameEvent RESONATE_9 = getEvent("resonate_9");
public static final GameEvent RESONATE_10 = getEvent("resonate_10");
public static final GameEvent RESONATE_11 = getEvent("resonate_11");
public static final GameEvent RESONATE_12 = getEvent("resonate_12");
public static final GameEvent RESONATE_13 = getEvent("resonate_13");
public static final GameEvent RESONATE_14 = getEvent("resonate_14");
public static final GameEvent RESONATE_15 = getEvent("resonate_15");
public static final GameEvent SCULK_SENSOR_TENDRILS_CLICKING = getEvent("sculk_sensor_tendrils_clicking");
public static final GameEvent SHEAR = getEvent("shear");
public static final GameEvent SHRIEK = getEvent("shriek");
public static final GameEvent SPLASH = getEvent("splash");
public static final GameEvent STEP = getEvent("step");
public static final GameEvent SWIM = getEvent("swim");
public static final GameEvent TELEPORT = getEvent("teleport");
public static final GameEvent UNEQUIP = getEvent("unequip");
// End generate - GameEvent
/**
* @deprecated in favor of {@link #BLOCK_ACTIVATE}
*/
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_PRESS = BLOCK_ACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_ACTIVATE}
*/
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_SWITCH = BLOCK_ACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_DEACTIVATE}
*/
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_UNPRESS = BLOCK_DEACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_DEACTIVATE}
*/
@Deprecated(since = "1.19")
public static final GameEvent BLOCK_UNSWITCH = BLOCK_DEACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_ACTIVATE}
*/
@Deprecated(since = "1.20")
public static final GameEvent DISPENSE_FAIL = BLOCK_ACTIVATE;
/**
* @deprecated in favor of {@link #DRINK}
*/
@Deprecated(since = "1.19")
public static final GameEvent DRINKING_FINISH = DRINK;
/**
* @deprecated in favor of {@link #ELYTRA_GLIDE}
*/
@Deprecated(since = "1.19")
public static final GameEvent ELYTRA_FREE_FALL = ELYTRA_GLIDE;
/**
* @deprecated in favor of {@link #ENTITY_DAMAGE}
*/
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_DAMAGED = ENTITY_DAMAGE;
/**
* @deprecated in favor of {@link #ENTITY_DIE}
*/
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_DYING = ENTITY_DIE;
/**
* @deprecated in favor of {@link #ENTITY_DIE}
*/
@Deprecated(since = "1.19")
public static final GameEvent ENTITY_KILLED = ENTITY_DIE;
/**
* @deprecated in favor of {@link #ENTITY_ACTION}
*/
@Deprecated(since = "1.20.2")
public static final GameEvent ENTITY_ROAR = ENTITY_ACTION;
/**
* @deprecated in favor of {@link #ENTITY_ACTION}
*/
@Deprecated(since = "1.20.2")
public static final GameEvent ENTITY_SHAKE = ENTITY_ACTION;
/**
* @deprecated in favor of {@link #ENTITY_INTERACT}
*/
@Deprecated(since = "1.19")
public static final GameEvent MOB_INTERACT = ENTITY_INTERACT;
/**
* @deprecated in favor of {@link #BLOCK_DEACTIVATE}
*/
@Deprecated(since = "1.20")
public static final GameEvent PISTON_CONTRACT = BLOCK_DEACTIVATE;
/**
* @deprecated in favor of {@link #BLOCK_ACTIVATE}
*/
@Deprecated(since = "1.20")
public static final GameEvent PISTON_EXTEND = BLOCK_ACTIVATE;
/**
* @deprecated in favor of {@link #ENTITY_ACTION}
*/
@Deprecated(since = "1.19")
public static final GameEvent RAVAGER_ROAR = ENTITY_ACTION;
/**
* @deprecated in favor of {@link #BLOCK_CHANGE}
*/
@Deprecated(since = "1.19")
public static final GameEvent RING_BELL = BLOCK_CHANGE;
/**
* @deprecated in favor of {@link #CONTAINER_CLOSE}
*/
@Deprecated(since = "1.19")
public static final GameEvent SHULKER_CLOSE = CONTAINER_CLOSE;
/**
* @deprecated in favor of {@link #CONTAINER_OPEN}
*/
@Deprecated(since = "1.19")
public static final GameEvent SHULKER_OPEN = CONTAINER_OPEN;
/**
* @deprecated in favor of {@link #ENTITY_ACTION}
*/
@Deprecated(since = "1.19")
public static final GameEvent WOLF_SHAKING = ENTITY_ACTION;
/**
* Returns a {@link GameEvent} by a {@link NamespacedKey}.
*

View File

@@ -220,6 +220,14 @@ public final class GameRule<T> implements net.kyori.adventure.translation.Transl
* Whether ender pearls will vanish on player death.
*/
public static final GameRule<Boolean> ENDER_PEARLS_VANISH_ON_DEATH = new GameRule<>("enderPearlsVanishOnDeath", Boolean.class);
/**
* Whether fire will still propagate far away from players (8 chunks).
*/
public static final GameRule<Boolean> ALLOW_FIRE_TICKS_AWAY_FROM_PLAYER = new GameRule<>("allowFireTicksAwayFromPlayer", Boolean.class);
/**
* Whether primed tnt explodes.
*/
public static final GameRule<Boolean> TNT_EXPLODES = new GameRule<>("tntExplodes", Boolean.class);
// Numerical rules
/**

View File

@@ -11,25 +11,46 @@ import org.jetbrains.annotations.NotNull;
@ApiStatus.Experimental
public interface JukeboxSong extends Keyed, Translatable {
public static final JukeboxSong THIRTEEN = get("13");
public static final JukeboxSong CAT = get("cat");
public static final JukeboxSong BLOCKS = get("blocks");
public static final JukeboxSong CHIRP = get("chirp");
public static final JukeboxSong FAR = get("far");
public static final JukeboxSong MALL = get("mall");
public static final JukeboxSong MELLOHI = get("mellohi");
public static final JukeboxSong STAL = get("stal");
public static final JukeboxSong STRAD = get("strad");
public static final JukeboxSong WARD = get("ward");
public static final JukeboxSong ELEVEN = get("11");
public static final JukeboxSong WAIT = get("wait");
public static final JukeboxSong PIGSTEP = get("pigstep");
public static final JukeboxSong OTHERSIDE = get("otherside");
public static final JukeboxSong FIVE = get("5");
public static final JukeboxSong RELIC = get("relic");
public static final JukeboxSong PRECIPICE = get("precipice");
public static final JukeboxSong CREATOR = get("creator");
public static final JukeboxSong CREATOR_MUSIC_BOX = get("creator_music_box");
// Start generate - JukeboxSong
// @GeneratedFrom 1.21.5
JukeboxSong ELEVEN = get("11");
JukeboxSong THIRTEEN = get("13");
JukeboxSong FIVE = get("5");
JukeboxSong BLOCKS = get("blocks");
JukeboxSong CAT = get("cat");
JukeboxSong CHIRP = get("chirp");
JukeboxSong CREATOR = get("creator");
JukeboxSong CREATOR_MUSIC_BOX = get("creator_music_box");
JukeboxSong FAR = get("far");
JukeboxSong MALL = get("mall");
JukeboxSong MELLOHI = get("mellohi");
JukeboxSong OTHERSIDE = get("otherside");
JukeboxSong PIGSTEP = get("pigstep");
JukeboxSong PRECIPICE = get("precipice");
JukeboxSong RELIC = get("relic");
JukeboxSong STAL = get("stal");
JukeboxSong STRAD = get("strad");
JukeboxSong WAIT = get("wait");
JukeboxSong WARD = get("ward");
// End generate - JukeboxSong
@NotNull
private static JukeboxSong get(@NotNull String key) {

File diff suppressed because it is too large Load Diff

View File

@@ -10,15 +10,25 @@ import org.jetbrains.annotations.Nullable;
public abstract class MusicInstrument implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - translation keys
public static final MusicInstrument PONDER_GOAT_HORN = getInstrument("ponder_goat_horn");
public static final MusicInstrument SING_GOAT_HORN = getInstrument("sing_goat_horn");
public static final MusicInstrument SEEK_GOAT_HORN = getInstrument("seek_goat_horn");
public static final MusicInstrument FEEL_GOAT_HORN = getInstrument("feel_goat_horn");
// Start generate - MusicInstrument
// @GeneratedFrom 1.21.5
public static final MusicInstrument ADMIRE_GOAT_HORN = getInstrument("admire_goat_horn");
public static final MusicInstrument CALL_GOAT_HORN = getInstrument("call_goat_horn");
public static final MusicInstrument YEARN_GOAT_HORN = getInstrument("yearn_goat_horn");
public static final MusicInstrument DREAM_GOAT_HORN = getInstrument("dream_goat_horn");
public static final MusicInstrument FEEL_GOAT_HORN = getInstrument("feel_goat_horn");
public static final MusicInstrument PONDER_GOAT_HORN = getInstrument("ponder_goat_horn");
public static final MusicInstrument SEEK_GOAT_HORN = getInstrument("seek_goat_horn");
public static final MusicInstrument SING_GOAT_HORN = getInstrument("sing_goat_horn");
public static final MusicInstrument YEARN_GOAT_HORN = getInstrument("yearn_goat_horn");
// End generate - MusicInstrument
/**
* Returns a {@link MusicInstrument} by a {@link NamespacedKey}.
*

View File

@@ -7,7 +7,6 @@ import org.jetbrains.annotations.Nullable;
*/
public interface Nameable {
// Paper start
/**
* Gets the custom name.
*
@@ -29,7 +28,6 @@ public interface Nameable {
* @param customName the custom name to set
*/
void customName(final net.kyori.adventure.text.@Nullable Component customName);
// Paper end
/**
* Gets the custom name on a mob or block. If there is no name this method

View File

@@ -30,7 +30,7 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key, com.des
* compatibility measures.
*/
public static final String BUKKIT = "bukkit";
//
private final String namespace;
private final String key;

View File

@@ -257,7 +257,10 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
*/
@Nullable
@Deprecated(since = "1.20.4")
public Location getBedSpawnLocation();
default Location getBedSpawnLocation() {
return this.getRespawnLocation();
}
// Paper start
/**
* Gets the last date and time that this player logged into the server.

View File

@@ -3,7 +3,6 @@ package org.bukkit;
import com.google.common.base.Preconditions;
import org.bukkit.block.data.BlockData;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
public enum Particle implements Keyed {
@@ -22,7 +21,7 @@ public enum Particle implements Keyed {
EFFECT("effect"),
INSTANT_EFFECT("instant_effect"),
/**
* Uses {@link Color} as DataType
* Uses {@link Color} as DataType (with alpha support)
*/
ENTITY_EFFECT("entity_effect", Color.class),
WITCH("witch"),
@@ -117,16 +116,20 @@ public enum Particle implements Keyed {
SONIC_BOOM("sonic_boom"),
SCULK_SOUL("sculk_soul"),
/**
* Use {@link Float} as DataType
* Uses {@link Float} as DataType
*/
SCULK_CHARGE("sculk_charge", Float.class),
SCULK_CHARGE_POP("sculk_charge_pop"),
/**
* Use {@link Integer} as DataType
* Uses {@link Integer} as DataType
*/
SHRIEK("shriek", Integer.class),
CHERRY_LEAVES("cherry_leaves"),
PALE_OAK_LEAVES("pale_oak_leaves"),
/**
* Uses {@link Color} as DataType (with alpha support)
*/
TINTED_LEAVES("tinted_leaves", Color.class),
EGG_CRACK("egg_crack"),
DUST_PLUME("dust_plume"),
WHITE_SMOKE("white_smoke"),
@@ -147,6 +150,7 @@ public enum Particle implements Keyed {
* Uses {@link BlockData} as DataType
*/
BLOCK_CRUMBLE("block_crumble", BlockData.class),
FIREFLY("firefly"),
/**
* Uses {@link Trail} as DataType
*/

View File

@@ -137,7 +137,10 @@ public interface Raid extends org.bukkit.persistence.PersistentDataHolder { // P
* Gets the id of this raid.
*
* @return the raid id
* @deprecated Raid identifiers are magic internal values and may or may not be present.
* -1 is returned for raids without an assigned id.
*/
@Deprecated(forRemoval = true, since = "1.21.5")
int getId();
/**

View File

@@ -148,8 +148,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* Server cat types.
*
* @see Cat.Type
* @deprecated use {@link RegistryAccess#getRegistry(RegistryKey)} with {@link RegistryKey#CAT_VARIANT}
*/
Registry<Cat.Type> CAT_VARIANT = registryFor(RegistryKey.CAT_VARIANT);
@Deprecated(since = "1.21.5")
Registry<Cat.Type> CAT_VARIANT = legacyRegistryFor(Cat.Type.class);
/**
* Server enchantments.
*
@@ -291,10 +293,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see MemoryKey
*/
Registry<MemoryKey> MEMORY_MODULE_TYPE = new NotARegistry<>() {
Registry<MemoryKey<?>> MEMORY_MODULE_TYPE = new NotARegistry<>() {
@Override
public Iterator iterator() {
public Iterator<MemoryKey<?>> iterator() {
return MemoryKey.values().iterator();
}
@@ -304,7 +306,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
}
@Override
public @Nullable MemoryKey get(final NamespacedKey key) {
public @Nullable MemoryKey<?> get(final NamespacedKey key) {
return MemoryKey.getByKey(key);
}
};
@@ -318,8 +320,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* Frog variants.
*
* @see Frog.Variant
* @deprecated use {@link RegistryAccess#getRegistry(RegistryKey)} with {@link RegistryKey#FROG_VARIANT}
*/
Registry<Frog.Variant> FROG_VARIANT = registryFor(RegistryKey.FROG_VARIANT);
@Deprecated(since = "1.21.5")
Registry<Frog.Variant> FROG_VARIANT = legacyRegistryFor(Frog.Variant.class);
/**
* Wolf variants.
*

View File

@@ -151,8 +151,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* uses. Normal and immediate iterator use without consequences that
* affect the collection are fully supported. The effects following
* (non-exhaustive) {@link Entity#teleport(Location) teleportation},
* {@link Player#setHealth(double) death}, and {@link Player#kickPlayer(
* String) kicking} are undefined. Any use of this collection from
* {@link Player#setHealth(double) death}, and {@link Player#kick(
* Component) kicking} are undefined. Any use of this collection from
* asynchronous threads is unsafe.
* <p>
* For safe consequential iteration or mimicking the old array behavior,
@@ -387,7 +387,9 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @deprecated use {@link #broadcast(net.kyori.adventure.text.Component)}
*/
@Deprecated // Paper
public int broadcastMessage(@NotNull String message);
default int broadcastMessage(@NotNull String message) {
return this.broadcast(message, BROADCAST_CHANNEL_USERS);
}
// Paper start
/**
@@ -1296,7 +1298,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @deprecated in favour of {@link #broadcast(net.kyori.adventure.text.Component, String)}
*/
@Deprecated // Paper
public int broadcast(@NotNull String message, @NotNull String permission);
default int broadcast(@NotNull String message, @NotNull String permission) {
return this.broadcast(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message), permission);
}
// Paper start
/**
* Broadcast a message to all players.
@@ -1307,7 +1312,9 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @param message the message
* @return the number of players
*/
int broadcast(net.kyori.adventure.text.@NotNull Component message);
default int broadcast(net.kyori.adventure.text.@NotNull Component message) {
return this.broadcast(message, BROADCAST_CHANNEL_USERS);
}
/**
* Broadcasts the specified message to every user with the given

File diff suppressed because it is too large Load Diff

View File

@@ -7,92 +7,95 @@ import org.jetbrains.annotations.NotNull;
* Represents a countable statistic, which is tracked by the server.
*/
public enum Statistic implements Keyed {
DAMAGE_DEALT,
DAMAGE_TAKEN,
DEATHS,
MOB_KILLS,
PLAYER_KILLS,
FISH_CAUGHT,
// Start generate - StatisticCustom
// @GeneratedFrom 1.21.5
ANIMALS_BRED,
LEAVE_GAME,
JUMP,
DROP_COUNT,
DROP(Type.ITEM),
PICKUP(Type.ITEM),
/**
* Name is misleading, actually records ticks played.
*/
PLAY_ONE_MINUTE,
TOTAL_WORLD_TIME,
WALK_ONE_CM,
WALK_ON_WATER_ONE_CM,
FALL_ONE_CM,
SNEAK_TIME,
CLIMB_ONE_CM,
FLY_ONE_CM,
WALK_UNDER_WATER_ONE_CM,
MINECART_ONE_CM,
BOAT_ONE_CM,
PIG_ONE_CM,
HORSE_ONE_CM,
SPRINT_ONE_CM,
CROUCH_ONE_CM,
AVIATE_ONE_CM,
MINE_BLOCK(Type.BLOCK),
USE_ITEM(Type.ITEM),
BREAK_ITEM(Type.ITEM),
CRAFT_ITEM(Type.ITEM),
KILL_ENTITY(Type.ENTITY),
ENTITY_KILLED_BY(Type.ENTITY),
TIME_SINCE_DEATH,
TALKED_TO_VILLAGER,
TRADED_WITH_VILLAGER,
CAKE_SLICES_EATEN,
CAULDRON_FILLED,
CAULDRON_USED,
BELL_RING,
BOAT_ONE_CM,
ARMOR_CLEANED,
BANNER_CLEANED,
BREWINGSTAND_INTERACTION,
BEACON_INTERACTION,
DROPPER_INSPECTED,
HOPPER_INSPECTED,
DISPENSER_INSPECTED,
NOTEBLOCK_PLAYED,
NOTEBLOCK_TUNED,
FLOWER_POTTED,
TRAPPED_CHEST_TRIGGERED,
ENDERCHEST_OPENED,
ITEM_ENCHANTED,
RECORD_PLAYED,
FURNACE_INTERACTION,
CRAFTING_TABLE_INTERACTION,
CHEST_OPENED,
SLEEP_IN_BED,
SHULKER_BOX_OPENED,
TIME_SINCE_REST,
SWIM_ONE_CM,
CLEAN_SHULKER_BOX,
CLIMB_ONE_CM,
CROUCH_ONE_CM,
DAMAGE_ABSORBED,
DAMAGE_BLOCKED_BY_SHIELD,
DAMAGE_DEALT,
DAMAGE_DEALT_ABSORBED,
DAMAGE_DEALT_RESISTED,
DAMAGE_BLOCKED_BY_SHIELD,
DAMAGE_ABSORBED,
DAMAGE_RESISTED,
CLEAN_SHULKER_BOX,
OPEN_BARREL,
DAMAGE_TAKEN,
DEATHS,
DROP_COUNT,
CAKE_SLICES_EATEN,
ITEM_ENCHANTED,
FALL_ONE_CM,
CAULDRON_FILLED,
FISH_CAUGHT,
FLY_ONE_CM,
HORSE_ONE_CM,
DISPENSER_INSPECTED,
DROPPER_INSPECTED,
HOPPER_INSPECTED,
INTERACT_WITH_ANVIL,
BEACON_INTERACTION,
INTERACT_WITH_BLAST_FURNACE,
INTERACT_WITH_SMOKER,
INTERACT_WITH_LECTERN,
BREWINGSTAND_INTERACTION,
INTERACT_WITH_CAMPFIRE,
INTERACT_WITH_CARTOGRAPHY_TABLE,
CRAFTING_TABLE_INTERACTION,
FURNACE_INTERACTION,
INTERACT_WITH_GRINDSTONE,
INTERACT_WITH_LECTERN,
INTERACT_WITH_LOOM,
INTERACT_WITH_SMITHING_TABLE,
INTERACT_WITH_SMOKER,
INTERACT_WITH_STONECUTTER,
BELL_RING,
JUMP,
LEAVE_GAME,
MINECART_ONE_CM,
MOB_KILLS,
OPEN_BARREL,
CHEST_OPENED,
ENDERCHEST_OPENED,
SHULKER_BOX_OPENED,
PIG_ONE_CM,
NOTEBLOCK_PLAYED,
RECORD_PLAYED,
PLAY_ONE_MINUTE,
PLAYER_KILLS,
FLOWER_POTTED,
RAID_TRIGGER,
RAID_WIN,
INTERACT_WITH_ANVIL,
INTERACT_WITH_GRINDSTONE,
SLEEP_IN_BED,
SNEAK_TIME,
SPRINT_ONE_CM,
STRIDER_ONE_CM,
SWIM_ONE_CM,
TALKED_TO_VILLAGER,
TARGET_HIT,
INTERACT_WITH_SMITHING_TABLE,
STRIDER_ONE_CM;
TIME_SINCE_DEATH,
TIME_SINCE_REST,
TOTAL_WORLD_TIME,
TRADED_WITH_VILLAGER,
TRAPPED_CHEST_TRIGGERED,
NOTEBLOCK_TUNED,
CAULDRON_USED,
WALK_ON_WATER_ONE_CM,
WALK_ONE_CM,
WALK_UNDER_WATER_ONE_CM,
// End generate - StatisticCustom
// Start generate - StatisticType
// @GeneratedFrom 1.21.5
BREAK_ITEM(Type.ITEM),
CRAFT_ITEM(Type.ITEM),
DROP(Type.ITEM),
KILL_ENTITY(Type.ENTITY),
ENTITY_KILLED_BY(Type.ENTITY),
MINE_BLOCK(Type.BLOCK),
PICKUP(Type.ITEM),
USE_ITEM(Type.ITEM);
// End generate - StatisticType
private final Type type;
private final NamespacedKey key;

File diff suppressed because it is too large Load Diff

View File

@@ -23,6 +23,7 @@ import org.bukkit.potion.PotionType;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
/**
* This interface provides value conversions that may be specific to a
@@ -142,9 +143,6 @@ public interface UnsafeValues {
@ApiStatus.Internal
<B extends Keyed> B get(RegistryKey<B> registry, NamespacedKey key);
@ApiStatus.Internal
Biome getCustomBiome();
// Paper start
@Deprecated(forRemoval = true)
boolean isSupportedApiVersion(String apiVersion);
@@ -382,4 +380,8 @@ public interface UnsafeValues {
@NotNull java.util.List<net.kyori.adventure.text.Component> computeTooltipLines(@NotNull ItemStack itemStack, @NotNull io.papermc.paper.inventory.tooltip.TooltipContext tooltipContext, @Nullable org.bukkit.entity.Player player); // Paper - expose itemstack tooltip lines
ItemStack createEmptyStack(); // Paper - proxy ItemStack
@NotNull Map<String, Object> serializeStack(ItemStack itemStack);
@NotNull ItemStack deserializeStack(@NotNull Map<String, Object> args);
}

View File

@@ -67,7 +67,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
void setVoidDamageEnabled(boolean enabled);
/**
* Gets the damage applied to the player when they are in the void in this world.
* Gets the damage applied to the entities when they are in the void in this world.
* Check {@link #isVoidDamageEnabled()} to see if void damage is enabled.
*
* @return amount of damage to apply
@@ -76,7 +76,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
float getVoidDamageAmount();
/**
* Sets the damage applied to the player when they are in the void in this world.
* Sets the damage applied to the entities when they are in the void in this world.
* Check {@link #isVoidDamageEnabled()} to see if void damage is enabled.
*
* @param voidDamageAmount amount of damage to apply
@@ -101,27 +101,27 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
// Paper start
/**
* @return The amount of Entities in this world
* @return The amount of entities in this world
*/
int getEntityCount();
/**
* @return The amount of Tile Entities in this world
* @return The amount of block entities in this world
*/
int getTileEntityCount();
/**
* @return The amount of Tickable Tile Entities in this world
* @return The amount of tickable block entities in this world
*/
int getTickableTileEntityCount();
/**
* @return The amount of Chunks in this world
* @return The amount of chunks in this world
*/
int getChunkCount();
/**
* @return The amount of Players in this world
* @return The amount of players in this world
*/
int getPlayerCount();
// Paper end
@@ -741,7 +741,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* this method
* @return true if the tree was created successfully, otherwise false
* @see #generateTree(org.bukkit.Location, java.util.Random, org.bukkit.TreeType, java.util.function.Consumer)
* @deprecated this method does not handle tile entities (bee nests)
* @deprecated this method does not handle block entities (bee nests)
*/
@Deprecated(since = "1.17.1")
public boolean generateTree(@NotNull Location loc, @NotNull TreeType type, @NotNull BlockChangeDelegate delegate);

View File

@@ -130,7 +130,6 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
*/
@Nullable
@Deprecated(since = "1.20.5")
@io.papermc.paper.annotation.DoNotUse // Paper
public EquipmentSlot getSlot() {
return slot == EquipmentSlotGroup.ANY ? null : slot.getExample();
}

View File

@@ -26,7 +26,9 @@ public interface Bell extends TileState {
* @param entity the entity ringing the bell
* @return true if rung successfully, false if the event was cancelled
*/
public boolean ring(@Nullable Entity entity);
default boolean ring(@Nullable Entity entity) {
return this.ring(entity, null);
}
/**
* Ring this bell. This will call a {@link BellRingEvent}.
@@ -35,7 +37,9 @@ public interface Bell extends TileState {
* ring in the direction that the bell is facing
* @return true if rung successfully, false if the event was cancelled
*/
public boolean ring(@Nullable BlockFace direction);
default boolean ring(@Nullable BlockFace direction) {
return this.ring(null, direction);
}
/**
* Ring this bell in the direction that the bell is facing. This will call a
@@ -43,7 +47,9 @@ public interface Bell extends TileState {
*
* @return true if rung successfully, false if the event was cancelled
*/
public boolean ring();
default boolean ring() {
return this.ring(null, null);
}
/**
* Check whether or not this bell is shaking. A bell is considered to be

View File

@@ -2,6 +2,7 @@ package org.bukkit.block;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.papermc.paper.InternalAPIBridge;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
@@ -23,79 +24,146 @@ import org.jetbrains.annotations.NotNull;
*/
public interface Biome extends OldEnum<Biome>, Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
Biome OCEAN = getBiome("ocean");
Biome PLAINS = getBiome("plains");
Biome DESERT = getBiome("desert");
Biome WINDSWEPT_HILLS = getBiome("windswept_hills");
Biome FOREST = getBiome("forest");
Biome TAIGA = getBiome("taiga");
Biome SWAMP = getBiome("swamp");
Biome MANGROVE_SWAMP = getBiome("mangrove_swamp");
Biome RIVER = getBiome("river");
Biome NETHER_WASTES = getBiome("nether_wastes");
Biome THE_END = getBiome("the_end");
Biome FROZEN_OCEAN = getBiome("frozen_ocean");
Biome FROZEN_RIVER = getBiome("frozen_river");
Biome SNOWY_PLAINS = getBiome("snowy_plains");
Biome MUSHROOM_FIELDS = getBiome("mushroom_fields");
Biome BEACH = getBiome("beach");
Biome JUNGLE = getBiome("jungle");
Biome SPARSE_JUNGLE = getBiome("sparse_jungle");
Biome DEEP_OCEAN = getBiome("deep_ocean");
Biome STONY_SHORE = getBiome("stony_shore");
Biome SNOWY_BEACH = getBiome("snowy_beach");
Biome BIRCH_FOREST = getBiome("birch_forest");
Biome DARK_FOREST = getBiome("dark_forest");
Biome PALE_GARDEN = getBiome("pale_garden");
Biome SNOWY_TAIGA = getBiome("snowy_taiga");
Biome OLD_GROWTH_PINE_TAIGA = getBiome("old_growth_pine_taiga");
Biome WINDSWEPT_FOREST = getBiome("windswept_forest");
Biome SAVANNA = getBiome("savanna");
Biome SAVANNA_PLATEAU = getBiome("savanna_plateau");
// Start generate - Biome
// @GeneratedFrom 1.21.5
Biome BADLANDS = getBiome("badlands");
Biome WOODED_BADLANDS = getBiome("wooded_badlands");
Biome SMALL_END_ISLANDS = getBiome("small_end_islands");
Biome END_MIDLANDS = getBiome("end_midlands");
Biome END_HIGHLANDS = getBiome("end_highlands");
Biome END_BARRENS = getBiome("end_barrens");
Biome WARM_OCEAN = getBiome("warm_ocean");
Biome LUKEWARM_OCEAN = getBiome("lukewarm_ocean");
Biome COLD_OCEAN = getBiome("cold_ocean");
Biome DEEP_LUKEWARM_OCEAN = getBiome("deep_lukewarm_ocean");
Biome DEEP_COLD_OCEAN = getBiome("deep_cold_ocean");
Biome DEEP_FROZEN_OCEAN = getBiome("deep_frozen_ocean");
Biome THE_VOID = getBiome("the_void");
Biome SUNFLOWER_PLAINS = getBiome("sunflower_plains");
Biome WINDSWEPT_GRAVELLY_HILLS = getBiome("windswept_gravelly_hills");
Biome FLOWER_FOREST = getBiome("flower_forest");
Biome ICE_SPIKES = getBiome("ice_spikes");
Biome OLD_GROWTH_BIRCH_FOREST = getBiome("old_growth_birch_forest");
Biome OLD_GROWTH_SPRUCE_TAIGA = getBiome("old_growth_spruce_taiga");
Biome WINDSWEPT_SAVANNA = getBiome("windswept_savanna");
Biome ERODED_BADLANDS = getBiome("eroded_badlands");
Biome BAMBOO_JUNGLE = getBiome("bamboo_jungle");
Biome SOUL_SAND_VALLEY = getBiome("soul_sand_valley");
Biome CRIMSON_FOREST = getBiome("crimson_forest");
Biome WARPED_FOREST = getBiome("warped_forest");
Biome BASALT_DELTAS = getBiome("basalt_deltas");
Biome DRIPSTONE_CAVES = getBiome("dripstone_caves");
Biome LUSH_CAVES = getBiome("lush_caves");
Biome DEEP_DARK = getBiome("deep_dark");
Biome MEADOW = getBiome("meadow");
Biome GROVE = getBiome("grove");
Biome SNOWY_SLOPES = getBiome("snowy_slopes");
Biome FROZEN_PEAKS = getBiome("frozen_peaks");
Biome JAGGED_PEAKS = getBiome("jagged_peaks");
Biome STONY_PEAKS = getBiome("stony_peaks");
Biome BEACH = getBiome("beach");
Biome BIRCH_FOREST = getBiome("birch_forest");
Biome CHERRY_GROVE = getBiome("cherry_grove");
Biome COLD_OCEAN = getBiome("cold_ocean");
Biome CRIMSON_FOREST = getBiome("crimson_forest");
Biome DARK_FOREST = getBiome("dark_forest");
Biome DEEP_COLD_OCEAN = getBiome("deep_cold_ocean");
Biome DEEP_DARK = getBiome("deep_dark");
Biome DEEP_FROZEN_OCEAN = getBiome("deep_frozen_ocean");
Biome DEEP_LUKEWARM_OCEAN = getBiome("deep_lukewarm_ocean");
Biome DEEP_OCEAN = getBiome("deep_ocean");
Biome DESERT = getBiome("desert");
Biome DRIPSTONE_CAVES = getBiome("dripstone_caves");
Biome END_BARRENS = getBiome("end_barrens");
Biome END_HIGHLANDS = getBiome("end_highlands");
Biome END_MIDLANDS = getBiome("end_midlands");
Biome ERODED_BADLANDS = getBiome("eroded_badlands");
Biome FLOWER_FOREST = getBiome("flower_forest");
Biome FOREST = getBiome("forest");
Biome FROZEN_OCEAN = getBiome("frozen_ocean");
Biome FROZEN_PEAKS = getBiome("frozen_peaks");
Biome FROZEN_RIVER = getBiome("frozen_river");
Biome GROVE = getBiome("grove");
Biome ICE_SPIKES = getBiome("ice_spikes");
Biome JAGGED_PEAKS = getBiome("jagged_peaks");
Biome JUNGLE = getBiome("jungle");
Biome LUKEWARM_OCEAN = getBiome("lukewarm_ocean");
Biome LUSH_CAVES = getBiome("lush_caves");
Biome MANGROVE_SWAMP = getBiome("mangrove_swamp");
Biome MEADOW = getBiome("meadow");
Biome MUSHROOM_FIELDS = getBiome("mushroom_fields");
Biome NETHER_WASTES = getBiome("nether_wastes");
Biome OCEAN = getBiome("ocean");
Biome OLD_GROWTH_BIRCH_FOREST = getBiome("old_growth_birch_forest");
Biome OLD_GROWTH_PINE_TAIGA = getBiome("old_growth_pine_taiga");
Biome OLD_GROWTH_SPRUCE_TAIGA = getBiome("old_growth_spruce_taiga");
Biome PALE_GARDEN = getBiome("pale_garden");
Biome PLAINS = getBiome("plains");
Biome RIVER = getBiome("river");
Biome SAVANNA = getBiome("savanna");
Biome SAVANNA_PLATEAU = getBiome("savanna_plateau");
Biome SMALL_END_ISLANDS = getBiome("small_end_islands");
Biome SNOWY_BEACH = getBiome("snowy_beach");
Biome SNOWY_PLAINS = getBiome("snowy_plains");
Biome SNOWY_SLOPES = getBiome("snowy_slopes");
Biome SNOWY_TAIGA = getBiome("snowy_taiga");
Biome SOUL_SAND_VALLEY = getBiome("soul_sand_valley");
Biome SPARSE_JUNGLE = getBiome("sparse_jungle");
Biome STONY_PEAKS = getBiome("stony_peaks");
Biome STONY_SHORE = getBiome("stony_shore");
Biome SUNFLOWER_PLAINS = getBiome("sunflower_plains");
Biome SWAMP = getBiome("swamp");
Biome TAIGA = getBiome("taiga");
Biome THE_END = getBiome("the_end");
Biome THE_VOID = getBiome("the_void");
Biome WARM_OCEAN = getBiome("warm_ocean");
Biome WARPED_FOREST = getBiome("warped_forest");
Biome WINDSWEPT_FOREST = getBiome("windswept_forest");
Biome WINDSWEPT_GRAVELLY_HILLS = getBiome("windswept_gravelly_hills");
Biome WINDSWEPT_HILLS = getBiome("windswept_hills");
Biome WINDSWEPT_SAVANNA = getBiome("windswept_savanna");
Biome WOODED_BADLANDS = getBiome("wooded_badlands");
// End generate - Biome
/**
* Represents a custom Biome
*
* @deprecated Biome is no longer an enum, custom biomes will have their own biome instance.
*/
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
Biome CUSTOM = Bukkit.getUnsafe().getCustomBiome();
Biome CUSTOM = InternalAPIBridge.get().constructLegacyCustomBiome();
@NotNull
private static Biome getBiome(@NotNull String key) {

View File

@@ -364,7 +364,7 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
// Paper start
/**
* @see #getState() optionally disables use of snapshot, to operate on real block data
* @param useSnapshot if this block is a TE, should we create a fully copy of the TileEntity
* @param useSnapshot if this block is a block entity, should we create a full copy of the BlockEntity
* @return BlockState with the current state of this block
*/
@NotNull

File diff suppressed because it is too large Load Diff

View File

@@ -70,7 +70,6 @@ public interface Campfire extends TileState {
*/
void setCookTimeTotal(int index, int cookTimeTotal);
// Paper start
/**
* Disable cooking in all slots.
*/
@@ -104,5 +103,4 @@ public interface Campfire extends TileState {
* @return {@code true} if the specified slot index cannot cook
*/
boolean isCookingDisabled(int index);
// Paper end
}

View File

@@ -10,7 +10,7 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
/**
* Gets the command that this CommandBlock will run when powered.
* This will never return null. If the CommandBlock does not have a
* This will never return null. If the CommandBlock does not have a
* command, an empty String will be returned instead.
*
* @return Command that this CommandBlock will run when powered.
@@ -28,8 +28,8 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
public void setCommand(@Nullable String command);
/**
* Gets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. This name will never be null, and
* Gets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. This name will never be null, and
* by default is "@".
*
* @return Name of this CommandBlock.
@@ -40,8 +40,8 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
public String getName();
/**
* Sets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. Setting the name to null is the
* Sets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. Setting the name to null is the
* same as setting it to "@".
*
* @param name New name for this CommandBlock.
@@ -50,10 +50,9 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
@Deprecated // Paper
public void setName(@Nullable String name);
// Paper start
/**
* Gets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. This name will never be null, and
* Gets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. This name will never be null, and
* by default is a {@link net.kyori.adventure.text.TextComponent} containing {@code @}.
*
* @return Name of this CommandBlock.
@@ -61,12 +60,11 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
public net.kyori.adventure.text.@NotNull Component name();
/**
* Sets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. Setting the name to null is the
* Sets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. Setting the name to null is the
* same as setting it to a {@link net.kyori.adventure.text.TextComponent} containing {@code @}.
*
* @param name New name for this CommandBlock.
*/
public void name(net.kyori.adventure.text.@Nullable Component name);
// Paper end
}

View File

@@ -0,0 +1,20 @@
package org.bukkit.block;
/**
* Represents the face and the direction of a block
*/
public enum Orientation {
DOWN_EAST,
DOWN_NORTH,
DOWN_SOUTH,
DOWN_WEST,
UP_EAST,
UP_NORTH,
UP_SOUTH,
UP_WEST,
WEST_UP,
EAST_UP,
NORTH_UP,
SOUTH_UP
}

View File

@@ -0,0 +1,7 @@
package org.bukkit.block;
/**
* Represents a captured state of a test block.
*/
public interface TestBlock extends TileState {
}

View File

@@ -0,0 +1,7 @@
package org.bukkit.block;
/**
* Represents a captured state of a test instance block.
*/
public interface TestInstanceBlock extends TileState {
}

View File

@@ -5,13 +5,13 @@ import org.bukkit.persistence.PersistentDataHolder;
import org.jetbrains.annotations.NotNull;
/**
* Represents a block state that also hosts a tile entity at the given location.
*
* Represents a block state that also hosts a block entity at the given location.
* <br>
* This interface alone is merely a marker that does not provide any data.
*
* Data about the tile entities is provided by the respective interface for each
* tile entity type.
*
* <p>
* Data about the block entities is provided by the respective interface for each
* block entity type.
* <p>
* After modifying the data provided by a TileState, {@link #update()} needs to
* be called to store the data.
*/
@@ -19,16 +19,16 @@ public interface TileState extends BlockState, PersistentDataHolder {
/**
* Returns a custom tag container capable of storing tags on the object.
*
* <p>
* Note that the tags stored on this container are all stored under their
* own custom namespace therefore modifying default tags using this
* {@link PersistentDataHolder} is impossible.
* <p>
* This {@link PersistentDataHolder} is only linked to the snapshot instance
* stored by the {@link BlockState}.
*
* <p>
* When storing changes on the {@link PersistentDataHolder}, the updated
* content will only be applied to the actual tile entity after one of the
* content will only be applied to the actual block entity after one of the
* {@link #update()} methods is called.
*
* @return the custom tag container
@@ -40,7 +40,7 @@ public interface TileState extends BlockState, PersistentDataHolder {
// Paper start
/**
* Checks if this TileState is a snapshot or a live
* representation of the underlying tile entity.
* representation of the underlying block entity.
* <p>
* NOTE: You may still have to call {@link BlockState#update()} on
* live representations to update any visuals on the block.

View File

@@ -14,50 +14,96 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface PatternType extends OldEnum<PatternType>, Keyed {
// Start generate - PatternType
// @GeneratedFrom 1.21.5
PatternType BASE = getType("base");
PatternType SQUARE_BOTTOM_LEFT = getType("square_bottom_left");
PatternType SQUARE_BOTTOM_RIGHT = getType("square_bottom_right");
PatternType SQUARE_TOP_LEFT = getType("square_top_left");
PatternType SQUARE_TOP_RIGHT = getType("square_top_right");
PatternType STRIPE_BOTTOM = getType("stripe_bottom");
PatternType STRIPE_TOP = getType("stripe_top");
PatternType STRIPE_LEFT = getType("stripe_left");
PatternType STRIPE_RIGHT = getType("stripe_right");
PatternType STRIPE_CENTER = getType("stripe_center");
PatternType STRIPE_MIDDLE = getType("stripe_middle");
PatternType STRIPE_DOWNRIGHT = getType("stripe_downright");
PatternType STRIPE_DOWNLEFT = getType("stripe_downleft");
PatternType SMALL_STRIPES = getType("small_stripes");
PatternType CROSS = getType("cross");
PatternType STRAIGHT_CROSS = getType("straight_cross");
PatternType TRIANGLE_BOTTOM = getType("triangle_bottom");
PatternType TRIANGLE_TOP = getType("triangle_top");
PatternType TRIANGLES_BOTTOM = getType("triangles_bottom");
PatternType TRIANGLES_TOP = getType("triangles_top");
PatternType DIAGONAL_LEFT = getType("diagonal_left");
PatternType DIAGONAL_UP_RIGHT = getType("diagonal_up_right");
PatternType DIAGONAL_UP_LEFT = getType("diagonal_up_left");
PatternType DIAGONAL_RIGHT = getType("diagonal_right");
PatternType CIRCLE = getType("circle");
PatternType RHOMBUS = getType("rhombus");
PatternType HALF_VERTICAL = getType("half_vertical");
PatternType HALF_HORIZONTAL = getType("half_horizontal");
PatternType HALF_VERTICAL_RIGHT = getType("half_vertical_right");
PatternType HALF_HORIZONTAL_BOTTOM = getType("half_horizontal_bottom");
PatternType BORDER = getType("border");
PatternType CURLY_BORDER = getType("curly_border");
PatternType CREEPER = getType("creeper");
PatternType GRADIENT = getType("gradient");
PatternType GRADIENT_UP = getType("gradient_up");
PatternType BRICKS = getType("bricks");
PatternType SKULL = getType("skull");
PatternType FLOWER = getType("flower");
PatternType MOJANG = getType("mojang");
PatternType GLOBE = getType("globe");
PatternType PIGLIN = getType("piglin");
PatternType CIRCLE = getType("circle");
PatternType CREEPER = getType("creeper");
PatternType CROSS = getType("cross");
PatternType CURLY_BORDER = getType("curly_border");
PatternType DIAGONAL_LEFT = getType("diagonal_left");
PatternType DIAGONAL_RIGHT = getType("diagonal_right");
PatternType DIAGONAL_UP_LEFT = getType("diagonal_up_left");
PatternType DIAGONAL_UP_RIGHT = getType("diagonal_up_right");
PatternType FLOW = getType("flow");
PatternType FLOWER = getType("flower");
PatternType GLOBE = getType("globe");
PatternType GRADIENT = getType("gradient");
PatternType GRADIENT_UP = getType("gradient_up");
PatternType GUSTER = getType("guster");
PatternType HALF_HORIZONTAL = getType("half_horizontal");
PatternType HALF_HORIZONTAL_BOTTOM = getType("half_horizontal_bottom");
PatternType HALF_VERTICAL = getType("half_vertical");
PatternType HALF_VERTICAL_RIGHT = getType("half_vertical_right");
PatternType MOJANG = getType("mojang");
PatternType PIGLIN = getType("piglin");
PatternType RHOMBUS = getType("rhombus");
PatternType SKULL = getType("skull");
PatternType SMALL_STRIPES = getType("small_stripes");
PatternType SQUARE_BOTTOM_LEFT = getType("square_bottom_left");
PatternType SQUARE_BOTTOM_RIGHT = getType("square_bottom_right");
PatternType SQUARE_TOP_LEFT = getType("square_top_left");
PatternType SQUARE_TOP_RIGHT = getType("square_top_right");
PatternType STRAIGHT_CROSS = getType("straight_cross");
PatternType STRIPE_BOTTOM = getType("stripe_bottom");
PatternType STRIPE_CENTER = getType("stripe_center");
PatternType STRIPE_DOWNLEFT = getType("stripe_downleft");
PatternType STRIPE_DOWNRIGHT = getType("stripe_downright");
PatternType STRIPE_LEFT = getType("stripe_left");
PatternType STRIPE_MIDDLE = getType("stripe_middle");
PatternType STRIPE_RIGHT = getType("stripe_right");
PatternType STRIPE_TOP = getType("stripe_top");
PatternType TRIANGLE_BOTTOM = getType("triangle_bottom");
PatternType TRIANGLE_TOP = getType("triangle_top");
PatternType TRIANGLES_BOTTOM = getType("triangles_bottom");
PatternType TRIANGLES_TOP = getType("triangles_top");
// End generate - PatternType
// Paper start - deprecate getKey
/**
* @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},

View File

@@ -0,0 +1,35 @@
package org.bukkit.block.data;
/**
* 'segment_amount' represents the number of segment in this block.
*/
public interface Segmentable extends BlockData {
/**
* Gets the value of the 'segment_amount' property.
*
* @return the 'segment_amount' value
*/
int getSegmentAmount();
/**
* Sets the value of the 'segment_amount' property.
*
* @param segmentAmount the new 'segment_amount' value
*/
void setSegmentAmount(int segmentAmount);
/**
* Gets the minimum allowed value of the 'segment_amount' property.
*
* @return the minimum 'segment_amount' value
*/
int getMinimumSegmentAmount();
/**
* Gets the maximum allowed value of the 'segment_amount' property.
*
* @return the maximum 'segment_amount' value
*/
int getMaximumSegmentAmount();
}

View File

@@ -11,8 +11,19 @@ public interface CaveVinesPlant extends BlockData {
* Gets the value of the 'berries' property.
*
* @return the 'berries' value
* @deprecated bad name, use {@link #hasBerries()}
*/
boolean isBerries();
@Deprecated
default boolean isBerries() {
return this.hasBerries();
}
/**
* Gets the value of the 'berries' property.
*
* @return the 'berries' value
*/
boolean hasBerries();
/**
* Sets the value of the 'berries' property.

View File

@@ -48,18 +48,23 @@ public interface Crafter extends BlockData {
* @return the 'orientation' value
*/
@NotNull
Orientation getOrientation();
org.bukkit.block.Orientation getOrientation();
/**
* Sets the value of the 'orientation' property.
*
* @param orientation the new 'orientation' value
*/
void setOrientation(@NotNull Orientation orientation);
void setOrientation(@NotNull org.bukkit.block.Orientation orientation);
/**
* The directions the Crafter can be oriented.
*
* @deprecated this property is not specific to the Crafter, use
* {@link org.bukkit.block.Orientation} instead. All references
* to this enum will be redirected to that enum at runtime.
*/
@Deprecated
public enum Orientation {
DOWN_EAST,

View File

@@ -1,9 +1,10 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.Orientable;
import org.jetbrains.annotations.NotNull;
/**
* 'active' is whether the block is active.
* 'creaking_heart_state' is the state of the block depending on the time and its position.
* <br>
* 'natural' is whether this is a naturally generated block.
*/
@@ -13,15 +14,38 @@ public interface CreakingHeart extends Orientable {
* Gets the value of the 'active' property.
*
* @return the 'active' value
* @deprecated use {@link #getCreakingHeartState()}
*/
boolean isActive();
@Deprecated(since = "1.21.5", forRemoval = true)
default boolean isActive() {
return this.getCreakingHeartState() != State.UPROOTED;
}
/**
* Sets the value of the 'active' property.
*
* @param active the new 'active' value
* @deprecated use {@link #setCreakingHeartState(State)}
*/
void setActive(boolean active);
@Deprecated(since = "1.21.5", forRemoval = true)
default void setActive(boolean active) {
this.setCreakingHeartState(active ? State.AWAKE : State.UPROOTED);
}
/**
* Gets the value of the 'creaking_heart_state' property.
*
* @return the 'creaking_heart_state' value
*/
@NotNull
State getCreakingHeartState();
/**
* Sets the value of the 'creaking_heart_state' property.
*
* @param state the new 'creaking_heart_state' value
*/
void setCreakingHeartState(@NotNull State state);
/**
* Gets the value of the 'natural' property.
@@ -36,4 +60,10 @@ public interface CreakingHeart extends Orientable {
* @param natural the new 'natural' value
*/
void setNatural(boolean natural);
enum State {
UPROOTED,
DORMANT,
AWAKE
}
}

View File

@@ -4,17 +4,18 @@ import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Waterlogged;
public interface DecoratedPot extends Directional, Waterlogged {
// Paper start - add missing block data api
/**
* @return whether the pot is cracked
*/
public boolean isCracked();
/**
* Set whether the pot is cracked.
* Gets the value of the 'cracked' property.
*
* @param cracked whether the pot is cracked
* @return the 'cracked' value
*/
public void setCracked(boolean cracked);
// Paper end - add missing block data api
boolean isCracked();
/**
* Sets the value of the 'cracked' property.
*
* @param cracked the new 'cracked' value
*/
void setCracked(boolean cracked);
}

View File

@@ -0,0 +1,39 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.Directional;
/**
* 'flower_amount' represents the number of flowers.
*/
public interface FlowerBed extends Directional {
/**
* Gets the value of the 'flower_amount' property.
*
* @return the 'flower_amount' value
*/
int getFlowerAmount();
/**
* Sets the value of the 'flower_amount' property.
*
* @param flower_amount the new 'flower_amount' value
*/
void setFlowerAmount(int flower_amount);
// Paper start
/**
* Gets the minimum allowed value of the 'flower_amount' property.
*
* @return the minimum 'flower_amount' value
*/
int getMinimumFlowerAmount();
// Paper end
/**
* Gets the maximum allowed value of the 'flower_amount' property.
*
* @return the maximum 'flower_amount' value
*/
int getMaximumFlowerAmount();
}

View File

@@ -14,18 +14,23 @@ public interface Jigsaw extends BlockData {
* @return the 'orientation' value
*/
@NotNull
Orientation getOrientation();
org.bukkit.block.Orientation getOrientation();
/**
* Sets the value of the 'orientation' property.
*
* @param orientation the new 'orientation' value
*/
void setOrientation(@NotNull Orientation orientation);
void setOrientation(@NotNull org.bukkit.block.Orientation orientation);
/**
* The directions the Jigsaw can be oriented.
*
* @deprecated this property is not specific to the Jigsaw, use
* {@link org.bukkit.block.Orientation} instead. All references
* to this enum will be redirected to that enum at runtime.
*/
@Deprecated
public enum Orientation {
DOWN_EAST,

View File

@@ -14,4 +14,11 @@ public interface Jukebox extends BlockData {
* @return the 'has_record' value
*/
boolean hasRecord();
/**
* Sets the value of the 'has_record' property.
*
* @param hasRecord the new 'has_record' value
*/
void setHasRecord(boolean hasRecord);
}

View File

@@ -0,0 +1,6 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Segmentable;
public interface LeafLitter extends Segmentable, Directional { }

View File

@@ -15,4 +15,11 @@ public interface Lectern extends Directional, Powerable {
* @return the 'has_book' value
*/
boolean hasBook();
/**
* Sets the value of the 'has_book' property.
*
* @param hasBook the new 'has_book' value
*/
void setHasBook(boolean hasBook);
}

View File

@@ -33,7 +33,7 @@ public interface MossyCarpet extends BlockData {
* @return if face is enabled
*/
@NotNull
Height getHeight(@NotNull BlockFace face);
Wall.Height getHeight(@NotNull BlockFace face);
/**
* Set the height of the specified face.
@@ -41,11 +41,16 @@ public interface MossyCarpet extends BlockData {
* @param face to set
* @param height the height
*/
void setHeight(@NotNull BlockFace face, @NotNull Height height);
void setHeight(@NotNull BlockFace face, @NotNull Wall.Height height);
/**
* The different heights a face may have.
*
* @deprecated this property is not specific to the MossyCarpet, use
* {@link org.bukkit.block.data.type.Wall.Height} instead. All references
* to this enum will be redirected to that enum at runtime.
*/
@Deprecated
public enum Height {
/**
* Not present.

View File

@@ -1,39 +1,11 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.Directional;
/**
* 'flower_amount' represents the number of petals.
*
* @deprecated incorrect name as multiple types of flower collection blocks exist now. Use {@link FlowerBed}
*/
public interface PinkPetals extends Directional {
@Deprecated(forRemoval = true, since = "1.21.5")
public interface PinkPetals extends FlowerBed {
/**
* Gets the value of the 'flower_amount' property.
*
* @return the 'flower_amount' value
*/
int getFlowerAmount();
/**
* Sets the value of the 'flower_amount' property.
*
* @param flower_amount the new 'flower_amount' value
*/
void setFlowerAmount(int flower_amount);
// Paper start
/**
* Gets the minimum allowed value of the 'flower_amount' property.
*
* @return the minimum 'flower_amount' value
*/
int getMinimumFlowerAmount();
// Paper end
/**
* Gets the maximum allowed value of the 'flower_amount' property.
*
* @return the maximum 'flower_amount' value
*/
int getMaximumFlowerAmount();
}

View File

@@ -13,16 +13,39 @@ public interface SculkSensor extends AnaloguePowerable, Waterlogged {
* Gets the value of the 'sculk_sensor_phase' property.
*
* @return the 'sculk_sensor_phase' value
* @deprecated bad name, use {@link #getSculkSensorPhase()}
*/
@NotNull
Phase getPhase();
@Deprecated
default Phase getPhase() {
return this.getSculkSensorPhase();
}
/**
* Sets the value of the 'sculk_sensor_phase' property.
*
* @param phase the new 'sculk_sensor_phase' value
* @deprecated bad name, use {@link #setSculkSensorPhase(Phase)}
*/
@Deprecated
default void setPhase(@NotNull Phase phase) {
this.setSculkSensorPhase(phase);
}
/**
* Gets the value of the 'sculk_sensor_phase' property.
*
* @return the 'sculk_sensor_phase' value
*/
@NotNull
Phase getSculkSensorPhase();
/**
* Sets the value of the 'sculk_sensor_phase' property.
*
* @param phase the new 'sculk_sensor_phase' value
*/
void setPhase(@NotNull Phase phase);
void setSculkSensorPhase(@NotNull Phase phase);
/**
* The Phase of the sensor.

View File

@@ -7,6 +7,11 @@ import org.jetbrains.annotations.NotNull;
public interface Switch extends Directional, FaceAttachable, Powerable {
@NotNull
AttachedFace getAttachedFace();
void setAttachedFace(@NotNull AttachedFace face);
/**
* Gets the value of the 'face' property.
*
@@ -15,7 +20,9 @@ public interface Switch extends Directional, FaceAttachable, Powerable {
*/
@NotNull
@Deprecated(since = "1.15.2")
Face getFace();
default Face getFace() {
return Face.valueOf(this.getAttachedFace().name());
}
/**
* Sets the value of the 'face' property.
@@ -24,7 +31,9 @@ public interface Switch extends Directional, FaceAttachable, Powerable {
* @deprecated use {@link #setAttachedFace(AttachedFace)}
*/
@Deprecated(since = "1.15.2")
void setFace(@NotNull Face face);
default void setFace(@NotNull Face face) {
this.setAttachedFace(AttachedFace.valueOf(face.name()));
}
/**
* The face to which a switch type block is stuck.

View File

@@ -0,0 +1,32 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.BlockData;
import org.jetbrains.annotations.NotNull;
/**
* 'mode' is the reaction of the block to a redstone pulse or its supply.
*/
public interface TestBlock extends BlockData {
/**
* Gets the value of the 'mode' property.
*
* @return the 'mode' value
*/
@NotNull
Mode getMode();
/**
* Sets the value of the 'mode' property.
*
* @param mode the new 'mode' value
*/
void setMode(@NotNull Mode mode);
enum Mode {
START,
LOG,
FAIL,
ACCEPT
}
}

View File

@@ -26,7 +26,9 @@ public interface Vault extends Directional {
*/
@Deprecated(since = "1.21.3", forRemoval = true)
@NotNull
State getTrialSpawnerState();
default State getTrialSpawnerState() {
return this.getVaultState();
}
/**
* Sets the value of the 'vault_state' property.
@@ -42,7 +44,9 @@ public interface Vault extends Directional {
* @deprecated see {@link #setVaultState(State)}
*/
@Deprecated(since = "1.21.3", forRemoval = true)
void setTrialSpawnerState(@NotNull State state);
default void setTrialSpawnerState(@NotNull State state) {
this.setVaultState(state);
}
/**
* Gets the value of the 'ominous' property.

View File

@@ -1,6 +1,5 @@
package org.bukkit.command.defaults;
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.io.Resources;
@@ -11,6 +10,7 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -25,14 +25,12 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
// Paper start - version command 2.0
import com.destroystokyo.paper.util.VersionFetcher;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.format.TextDecoration;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
// Paper end - version command 2.0
public class VersionCommand extends BukkitCommand {
private VersionFetcher versionFetcher; // Paper - version command 2.0
@@ -283,8 +281,8 @@ public class VersionCommand extends BukkitCommand {
private static int getDistance(@NotNull String repo, @NotNull String hash) {
try {
BufferedReader reader = Resources.asCharSource(
new URL("https://hub.spigotmc.org/stash/rest/api/1.0/projects/SPIGOT/repos/" + repo + "/commits?since=" + URLEncoder.encode(hash, "UTF-8") + "&withCounts=true"),
Charsets.UTF_8
new URL("https://hub.spigotmc.org/stash/rest/api/1.0/projects/SPIGOT/repos/" + repo + "/commits?since=" + URLEncoder.encode(hash, StandardCharsets.UTF_8) + "&withCounts=true"),
StandardCharsets.UTF_8
).openBufferedStream();
try {
JsonObject obj = new Gson().fromJson(reader, JsonObject.class);

View File

@@ -1,6 +1,5 @@
package org.bukkit.configuration.file;
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.common.io.Files;
import java.io.BufferedReader;
@@ -13,6 +12,7 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.MemoryConfiguration;
@@ -64,7 +64,7 @@ public abstract class FileConfiguration extends MemoryConfiguration {
String data = saveToString();
Writer writer = new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8);
Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);
try {
writer.write(data);
@@ -125,7 +125,7 @@ public abstract class FileConfiguration extends MemoryConfiguration {
final FileInputStream stream = new FileInputStream(file);
load(new InputStreamReader(stream, Charsets.UTF_8));
load(new InputStreamReader(stream, StandardCharsets.UTF_8));
}
/**

View File

@@ -21,55 +21,106 @@ import org.jetbrains.annotations.NotNull;
@ApiStatus.Experimental
public interface DamageType extends Keyed, Translatable {
public static final DamageType IN_FIRE = getDamageType("in_fire");
public static final DamageType CAMPFIRE = getDamageType("campfire");
public static final DamageType LIGHTNING_BOLT = getDamageType("lightning_bolt");
public static final DamageType ON_FIRE = getDamageType("on_fire");
public static final DamageType LAVA = getDamageType("lava");
public static final DamageType HOT_FLOOR = getDamageType("hot_floor");
public static final DamageType IN_WALL = getDamageType("in_wall");
public static final DamageType CRAMMING = getDamageType("cramming");
public static final DamageType DROWN = getDamageType("drown");
public static final DamageType STARVE = getDamageType("starve");
public static final DamageType CACTUS = getDamageType("cactus");
public static final DamageType FALL = getDamageType("fall");
public static final DamageType ENDER_PEARL = getDamageType("ender_pearl");
public static final DamageType FLY_INTO_WALL = getDamageType("fly_into_wall");
public static final DamageType OUT_OF_WORLD = getDamageType("out_of_world");
public static final DamageType GENERIC = getDamageType("generic");
public static final DamageType MAGIC = getDamageType("magic");
public static final DamageType WITHER = getDamageType("wither");
public static final DamageType DRAGON_BREATH = getDamageType("dragon_breath");
public static final DamageType DRY_OUT = getDamageType("dry_out");
public static final DamageType SWEET_BERRY_BUSH = getDamageType("sweet_berry_bush");
public static final DamageType FREEZE = getDamageType("freeze");
public static final DamageType STALAGMITE = getDamageType("stalagmite");
public static final DamageType FALLING_BLOCK = getDamageType("falling_block");
public static final DamageType FALLING_ANVIL = getDamageType("falling_anvil");
public static final DamageType FALLING_STALACTITE = getDamageType("falling_stalactite");
public static final DamageType STING = getDamageType("sting");
public static final DamageType MOB_ATTACK = getDamageType("mob_attack");
public static final DamageType MOB_ATTACK_NO_AGGRO = getDamageType("mob_attack_no_aggro");
public static final DamageType PLAYER_ATTACK = getDamageType("player_attack");
public static final DamageType ARROW = getDamageType("arrow");
public static final DamageType TRIDENT = getDamageType("trident");
public static final DamageType MOB_PROJECTILE = getDamageType("mob_projectile");
public static final DamageType SPIT = getDamageType("spit");
public static final DamageType FIREWORKS = getDamageType("fireworks");
public static final DamageType FIREBALL = getDamageType("fireball");
public static final DamageType UNATTRIBUTED_FIREBALL = getDamageType("unattributed_fireball");
public static final DamageType WITHER_SKULL = getDamageType("wither_skull");
public static final DamageType THROWN = getDamageType("thrown");
public static final DamageType INDIRECT_MAGIC = getDamageType("indirect_magic");
public static final DamageType THORNS = getDamageType("thorns");
public static final DamageType EXPLOSION = getDamageType("explosion");
public static final DamageType PLAYER_EXPLOSION = getDamageType("player_explosion");
public static final DamageType SONIC_BOOM = getDamageType("sonic_boom");
public static final DamageType BAD_RESPAWN_POINT = getDamageType("bad_respawn_point");
public static final DamageType OUTSIDE_BORDER = getDamageType("outside_border");
public static final DamageType GENERIC_KILL = getDamageType("generic_kill");
public static final DamageType WIND_CHARGE = getDamageType("wind_charge");
public static final DamageType MACE_SMASH = getDamageType("mace_smash");
// Start generate - DamageType
// @GeneratedFrom 1.21.5
DamageType ARROW = getDamageType("arrow");
DamageType BAD_RESPAWN_POINT = getDamageType("bad_respawn_point");
DamageType CACTUS = getDamageType("cactus");
DamageType CAMPFIRE = getDamageType("campfire");
DamageType CRAMMING = getDamageType("cramming");
DamageType DRAGON_BREATH = getDamageType("dragon_breath");
DamageType DROWN = getDamageType("drown");
DamageType DRY_OUT = getDamageType("dry_out");
DamageType ENDER_PEARL = getDamageType("ender_pearl");
DamageType EXPLOSION = getDamageType("explosion");
DamageType FALL = getDamageType("fall");
DamageType FALLING_ANVIL = getDamageType("falling_anvil");
DamageType FALLING_BLOCK = getDamageType("falling_block");
DamageType FALLING_STALACTITE = getDamageType("falling_stalactite");
DamageType FIREBALL = getDamageType("fireball");
DamageType FIREWORKS = getDamageType("fireworks");
DamageType FLY_INTO_WALL = getDamageType("fly_into_wall");
DamageType FREEZE = getDamageType("freeze");
DamageType GENERIC = getDamageType("generic");
DamageType GENERIC_KILL = getDamageType("generic_kill");
DamageType HOT_FLOOR = getDamageType("hot_floor");
DamageType IN_FIRE = getDamageType("in_fire");
DamageType IN_WALL = getDamageType("in_wall");
DamageType INDIRECT_MAGIC = getDamageType("indirect_magic");
DamageType LAVA = getDamageType("lava");
DamageType LIGHTNING_BOLT = getDamageType("lightning_bolt");
DamageType MACE_SMASH = getDamageType("mace_smash");
DamageType MAGIC = getDamageType("magic");
DamageType MOB_ATTACK = getDamageType("mob_attack");
DamageType MOB_ATTACK_NO_AGGRO = getDamageType("mob_attack_no_aggro");
DamageType MOB_PROJECTILE = getDamageType("mob_projectile");
DamageType ON_FIRE = getDamageType("on_fire");
DamageType OUT_OF_WORLD = getDamageType("out_of_world");
DamageType OUTSIDE_BORDER = getDamageType("outside_border");
DamageType PLAYER_ATTACK = getDamageType("player_attack");
DamageType PLAYER_EXPLOSION = getDamageType("player_explosion");
DamageType SONIC_BOOM = getDamageType("sonic_boom");
DamageType SPIT = getDamageType("spit");
DamageType STALAGMITE = getDamageType("stalagmite");
DamageType STARVE = getDamageType("starve");
DamageType STING = getDamageType("sting");
DamageType SWEET_BERRY_BUSH = getDamageType("sweet_berry_bush");
DamageType THORNS = getDamageType("thorns");
DamageType THROWN = getDamageType("thrown");
DamageType TRIDENT = getDamageType("trident");
DamageType UNATTRIBUTED_FIREBALL = getDamageType("unattributed_fireball");
DamageType WIND_CHARGE = getDamageType("wind_charge");
DamageType WITHER = getDamageType("wither");
DamageType WITHER_SKULL = getDamageType("wither_skull");
// End generate - DamageType
@NotNull
private static DamageType getDamageType(@NotNull String key) {

View File

@@ -6,7 +6,10 @@ import org.jetbrains.annotations.NotNull;
/**
* Represents the applicable target for a {@link Enchantment}
*
* @deprecated enchantment groupings are now managed by tags, not categories
*/
@Deprecated(since = "1.20.5", forRemoval = true)
public enum EnchantmentTarget {
/**
* Allows the Enchantment to be placed on all items

View File

@@ -0,0 +1,14 @@
package org.bukkit.entity;
import org.jspecify.annotations.NullMarked;
/**
* This interface defines or represents the abstract concept of cow-like
* entities on the server. The interface is hence not a direct representation
* of an entity but rather serves as a parent to interfaces/entity types like
* {@link Cow} or {@link MushroomCow}.
*/
@NullMarked
public interface AbstractCow extends Animals {
}

View File

@@ -223,7 +223,7 @@ public interface AreaEffectCloud extends Entity {
* @param type the potion effect type to check for
* @return true if the potion has this effect
*/
boolean hasCustomEffect(@Nullable PotionEffectType type);
boolean hasCustomEffect(@NotNull PotionEffectType type);
/**
* Removes all custom potion effects from this cloud.

View File

@@ -14,7 +14,7 @@ public interface ArmorStand extends LivingEntity {
*
* @return the held item
* @see #getEquipment()
* @deprecated prefer {@link ArmorStand#getItem(EquipmentSlot)} // Paper
* @deprecated prefer {@link ArmorStand#getItem(EquipmentSlot)}
*/
@NotNull
@Deprecated(since = "1.15.2")
@@ -26,7 +26,7 @@ public interface ArmorStand extends LivingEntity {
* @param item the item to hold
* @see #getEquipment()
* @deprecated prefer
* {@link ArmorStand#setItem(EquipmentSlot, ItemStack)} // Paper
* {@link ArmorStand#setItem(EquipmentSlot, ItemStack)}
*/
@Deprecated(since = "1.15.2")
void setItemInHand(@Nullable ItemStack item);

View File

@@ -175,12 +175,15 @@ public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Pa
*/
public enum Status {
NOT_IN_WORLD, // Paper
NOT_IN_WORLD,
// Start generate - BoatStatus
// @GeneratedFrom 1.21.5
IN_WATER,
UNDER_WATER,
UNDER_FLOWING_WATER,
ON_LAND,
IN_AIR;
// End generate - BoatStatus
}
// Paper start

View File

@@ -3,6 +3,8 @@ package org.bukkit.entity;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import org.bukkit.DyeColor;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
@@ -52,21 +54,34 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
*/
interface Type extends OldEnum<Type>, Keyed {
Type TABBY = getType("tabby");
Type BLACK = getType("black");
Type RED = getType("red");
Type SIAMESE = getType("siamese");
Type BRITISH_SHORTHAIR = getType("british_shorthair");
Type CALICO = getType("calico");
Type PERSIAN = getType("persian");
Type RAGDOLL = getType("ragdoll");
Type WHITE = getType("white");
Type JELLIE = getType("jellie");
// Start generate - CatType
// @GeneratedFrom 1.21.5
Type ALL_BLACK = getType("all_black");
Type BLACK = getType("black");
Type BRITISH_SHORTHAIR = getType("british_shorthair");
Type CALICO = getType("calico");
Type JELLIE = getType("jellie");
Type PERSIAN = getType("persian");
Type RAGDOLL = getType("ragdoll");
Type RED = getType("red");
Type SIAMESE = getType("siamese");
Type TABBY = getType("tabby");
Type WHITE = getType("white");
// End generate - CatType
@NotNull
private static Type getType(@NotNull String key) {
return Registry.CAT_VARIANT.getOrThrow(NamespacedKey.minecraft(key));
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
}
/**
@@ -77,7 +92,7 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Type valueOf(@NotNull String name) {
Type type = Registry.CAT_VARIANT.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Type type = RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT).get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(type != null, "No cat type found with the name %s", name);
return type;
}
@@ -89,11 +104,10 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Type[] values() {
return Lists.newArrayList(Registry.CAT_VARIANT).toArray(new Type[0]);
return Lists.newArrayList(RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT)).toArray(new Type[0]);
}
}
// Paper start - More cat api
/**
* Sets if the cat is lying down.
* This is visual and does not affect the behaviour of the cat.
@@ -123,5 +137,4 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
* @return head is up
*/
public boolean isHeadUp();
// Paper end - More cat api
}

View File

@@ -1,11 +1,31 @@
package org.bukkit.entity;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jspecify.annotations.NullMarked;
/**
* Represents a Chicken.
*/
// Paper start
@NullMarked
public interface Chicken extends Animals {
/**
* Gets the variant of this chicken.
*
* @return the chicken variant
*/
Variant getVariant();
/**
* Sets the variant of this chicken.
*
* @param variant the chicken variant
*/
void setVariant(Variant variant);
/**
* Gets if this chicken was spawned as a chicken jockey.
*
@@ -33,5 +53,23 @@ public interface Chicken extends Animals {
* @param eggLayTime ticks till the chicken lays an egg
*/
void setEggLayTime(int eggLayTime);
/**
* Represents the variant of a chicken.
*/
interface Variant extends Keyed {
// Start generate - ChickenVariant
// @GeneratedFrom 1.21.5
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");
Variant WARM = getVariant("warm");
// End generate - ChickenVariant
private static Variant getVariant(String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CHICKEN_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
}
}
}
// Paper end

View File

@@ -1,6 +1,47 @@
package org.bukkit.entity;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jspecify.annotations.NullMarked;
/**
* Represents a Cow.
*/
public interface Cow extends Animals {}
@NullMarked
public interface Cow extends AbstractCow {
/**
* Gets the variant of this cow.
*
* @return the cow variant
*/
Variant getVariant();
/**
* Sets the variant of this cow.
*
* @param variant the cow variant
*/
void setVariant(Variant variant);
/**
* Represents the variant of a cow.
*/
interface Variant extends Keyed {
// Start generate - CowVariant
// @GeneratedFrom 1.21.5
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");
Variant WARM = getVariant("warm");
// End generate - CowVariant
private static Variant getVariant(String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.COW_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
}
}
}

View File

@@ -53,7 +53,6 @@ public interface Damageable extends Entity {
*/
void setHealth(double health);
// Paper start - entity heal API
/**
* Heal this entity by the given amount. This will call {@link org.bukkit.event.entity.EntityRegainHealthEvent}.
*
@@ -70,7 +69,6 @@ public interface Damageable extends Entity {
* @param reason heal reason
*/
void heal(double amount, @NotNull org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason reason);
// Paper end - entity heal API
/**
* Gets the entity's absorption amount.

View File

@@ -1,8 +1,9 @@
package org.bukkit.entity;
import org.bukkit.Location;
import org.jetbrains.annotations.Nullable;
public interface Dolphin extends Ageable, WaterMob { // Paper start - Dolphin API
public interface Dolphin extends Ageable, WaterMob {
/**
* Gets the moistness level of this dolphin
@@ -37,7 +38,7 @@ public interface Dolphin extends Ageable, WaterMob { // Paper start - Dolphin AP
*
* @return calculated closest treasure location
*/
@org.jetbrains.annotations.NotNull
@Nullable
Location getTreasureLocation();
/**
@@ -48,5 +49,5 @@ public interface Dolphin extends Ageable, WaterMob { // Paper start - Dolphin AP
*
* @param location location to guide to
*/
void setTreasureLocation(@org.jetbrains.annotations.NotNull Location location);
} // Paper end - Dolphin API
void setTreasureLocation(@Nullable Location location);
}

View File

@@ -3,10 +3,12 @@ package org.bukkit.entity;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import io.papermc.paper.datacomponent.DataComponentView;
import io.papermc.paper.entity.LookAnchor;
import org.bukkit.Chunk; // Paper
import org.bukkit.EntityEffect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Nameable;
import org.bukkit.Server;
import org.bukkit.Sound;
@@ -33,7 +35,7 @@ import org.jetbrains.annotations.Nullable;
* Not all methods are guaranteed to work/may have side effects when
* {@link #isInWorld()} is false.
*/
public interface Entity extends Metadatable, CommandSender, Nameable, PersistentDataHolder, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, net.kyori.adventure.sound.Sound.Emitter { // Paper
public interface Entity extends Metadatable, CommandSender, Nameable, PersistentDataHolder, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, net.kyori.adventure.sound.Sound.Emitter, DataComponentView { // Paper
/**
* Gets the entity's current position
@@ -337,7 +339,6 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
boolean isFrozen();
// Paper start - missing entity api
/**
* Sets whether the entity is invisible or not.
* <p>
@@ -347,14 +348,14 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*
* @param invisible If the entity is invisible
*/
void setInvisible(boolean invisible); // Paper - moved up from LivingEntity
void setInvisible(boolean invisible);
/**
* Gets whether the entity is invisible or not.
*
* @return Whether the entity is invisible
*/
boolean isInvisible(); // Paper - moved up from LivingEntity
boolean isInvisible();
/**
* Sets this entities no physics status.
@@ -369,9 +370,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return true if the entity does not have physics.
*/
boolean hasNoPhysics();
// Paper end - missing entity api
// Paper start - Freeze Tick Lock API
/**
* Gets if the entity currently has its freeze ticks locked
* to a set amount.
@@ -389,12 +388,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @param locked prevent vanilla modification or not
*/
void lockFreezeTicks(boolean locked);
// Paper end - Freeze Tick Lock API
/**
* Mark the entity's removal.
*
* @throws UnsupportedOperationException if you try to remove a {@link Player} use {@link Player#kickPlayer(String)} in this case instead
* @throws UnsupportedOperationException if you try to remove a {@link Player} use {@link Player#kick(net.kyori.adventure.text.Component)} in this case instead
*/
public void remove();
@@ -533,6 +531,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @param event a {@link EntityDamageEvent}
* @deprecated method is for internal use only and will be removed
*/
@ApiStatus.Internal
@Deprecated(since = "1.20.4", forRemoval = true)
public void setLastDamageCause(@Nullable EntityDamageEvent event);
@@ -1029,23 +1028,43 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
/**
* Check if entity is in bubble column
*
* @deprecated check the block at the position of the entity
*/
boolean isInBubbleColumn();
@Deprecated(since = "1.21.5")
default boolean isInBubbleColumn() {
return this.getWorld().getBlockAt(this.getLocation()).getType() == Material.BUBBLE_COLUMN;
}
/**
* Check if entity is in water or rain
*
* @deprecated use {@link #isInWater()}} and {@link #isInRain()}
*/
boolean isInWaterOrRain();
@Deprecated(since = "1.21.5")
default boolean isInWaterOrRain() {
return this.isInWater() || this.isInRain();
}
/**
* Check if entity is in water or bubble column
*
* @deprecated use {@link #isInWater()}, bubble column is considered as water
*/
boolean isInWaterOrBubbleColumn();
@Deprecated(since = "1.21.5")
default boolean isInWaterOrBubbleColumn() {
return this.isInWater();
}
/**
* Check if entity is in water or rain or bubble column
*
* @deprecated use {@link #isInWaterOrRain()}, bubble column is considered as water
*/
boolean isInWaterOrRainOrBubbleColumn();
@Deprecated(since = "1.21.5")
default boolean isInWaterOrRainOrBubbleColumn() {
return this.isInWaterOrRain();
}
/**
* Check if entity is in lava

View File

@@ -45,299 +45,159 @@ import org.jetbrains.annotations.Nullable;
public enum EntityType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - translatable
// These strings MUST match the strings in nms.EntityTypes and are case sensitive.
/**
* An item resting on the ground.
* <p>
* Spawn with {@link World#dropItem(Location, ItemStack)} or {@link
* World#dropItemNaturally(Location, ItemStack)}
*/
ITEM("item", Item.class, 1),
/**
* An experience orb.
*/
EXPERIENCE_ORB("experience_orb", ExperienceOrb.class, 2),
/**
* @see AreaEffectCloud
*/
// Start generate - EntityType
// @GeneratedFrom 1.21.5
ACACIA_BOAT("acacia_boat", AcaciaBoat.class, -1),
ACACIA_CHEST_BOAT("acacia_chest_boat", AcaciaChestBoat.class, -1),
ALLAY("allay", Allay.class, -1),
AREA_EFFECT_CLOUD("area_effect_cloud", AreaEffectCloud.class, 3),
/**
* @see ElderGuardian
*/
ELDER_GUARDIAN("elder_guardian", ElderGuardian.class, 4),
/**
* @see WitherSkeleton
*/
WITHER_SKELETON("wither_skeleton", WitherSkeleton.class, 5),
/**
* @see Stray
*/
STRAY("stray", Stray.class, 6),
/**
* A flying chicken egg.
*/
EGG("egg", Egg.class, 7),
/**
* A leash attached to a fencepost.
*/
LEASH_KNOT("leash_knot", LeashHitch.class, 8),
/**
* A painting on a wall.
*/
PAINTING("painting", Painting.class, 9),
/**
* An arrow projectile; may get stuck in the ground.
*/
ARROW("arrow", Arrow.class, 10),
/**
* A flying snowball.
*/
SNOWBALL("snowball", Snowball.class, 11),
/**
* A flying large fireball, as thrown by a Ghast for example.
*/
FIREBALL("fireball", LargeFireball.class, 12),
/**
* A flying small fireball, such as thrown by a Blaze or player.
*/
SMALL_FIREBALL("small_fireball", SmallFireball.class, 13),
/**
* A flying ender pearl.
*/
ENDER_PEARL("ender_pearl", EnderPearl.class, 14),
/**
* An ender eye signal.
*/
EYE_OF_ENDER("eye_of_ender", EnderSignal.class, 15),
/**
* A flying splash potion.
*/
POTION("potion", ThrownPotion.class, 16),
/**
* A flying experience bottle.
*/
EXPERIENCE_BOTTLE("experience_bottle", ThrownExpBottle.class, 17),
/**
* An item frame on a wall.
*/
ITEM_FRAME("item_frame", ItemFrame.class, 18),
/**
* A flying wither skull projectile.
*/
WITHER_SKULL("wither_skull", WitherSkull.class, 19),
/**
* Primed TNT that is about to explode.
*/
TNT("tnt", TNTPrimed.class, 20),
/**
* A block that is going to or is about to fall.
*/
FALLING_BLOCK("falling_block", FallingBlock.class, 21),
/**
* Internal representation of a Firework once it has been launched.
*/
FIREWORK_ROCKET("firework_rocket", Firework.class, 22),
/**
* @see Husk
*/
HUSK("husk", Husk.class, 23),
/**
* Like {@link #ARROW} but causes the {@link PotionEffectType#GLOWING} effect on all team members.
*/
SPECTRAL_ARROW("spectral_arrow", SpectralArrow.class, 24),
/**
* Bullet fired by {@link #SHULKER}.
*/
SHULKER_BULLET("shulker_bullet", ShulkerBullet.class, 25),
/**
* Like {@link #FIREBALL} but with added effects.
*/
DRAGON_FIREBALL("dragon_fireball", DragonFireball.class, 26),
/**
* @see ZombieVillager
*/
ZOMBIE_VILLAGER("zombie_villager", ZombieVillager.class, 27),
/**
* @see SkeletonHorse
*/
SKELETON_HORSE("skeleton_horse", SkeletonHorse.class, 28),
/**
* @see ZombieHorse
*/
ZOMBIE_HORSE("zombie_horse", ZombieHorse.class, 29),
/**
* Mechanical entity with an inventory for placing weapons / armor into.
*/
ARMADILLO("armadillo", Armadillo.class, -1),
ARMOR_STAND("armor_stand", ArmorStand.class, 30),
/**
* @see Donkey
*/
DONKEY("donkey", Donkey.class, 31),
/**
* @see Mule
*/
MULE("mule", Mule.class, 32),
/**
* @see EvokerFangs
*/
EVOKER_FANGS("evoker_fangs", EvokerFangs.class, 33),
/**
* @see Evoker
*/
EVOKER("evoker", Evoker.class, 34),
/**
* @see Vex
*/
VEX("vex", Vex.class, 35),
/**
* @see Vindicator
*/
VINDICATOR("vindicator", Vindicator.class, 36),
/**
* @see Illusioner
*/
ILLUSIONER("illusioner", Illusioner.class, 37),
/**
* @see CommandMinecart
*/
COMMAND_BLOCK_MINECART("command_block_minecart", CommandMinecart.class, 40),
/**
* @see RideableMinecart
*/
MINECART("minecart", RideableMinecart.class, 42),
/**
* @see StorageMinecart
*/
CHEST_MINECART("chest_minecart", StorageMinecart.class, 43),
/**
* @see PoweredMinecart
*/
FURNACE_MINECART("furnace_minecart", PoweredMinecart.class, 44),
/**
* @see ExplosiveMinecart
*/
TNT_MINECART("tnt_minecart", ExplosiveMinecart.class, 45),
/**
* @see HopperMinecart
*/
HOPPER_MINECART("hopper_minecart", HopperMinecart.class, 46),
/**
* @see SpawnerMinecart
*/
SPAWNER_MINECART("spawner_minecart", SpawnerMinecart.class, 47),
CREEPER("creeper", Creeper.class, 50),
SKELETON("skeleton", Skeleton.class, 51),
SPIDER("spider", Spider.class, 52),
GIANT("giant", Giant.class, 53),
ZOMBIE("zombie", Zombie.class, 54),
SLIME("slime", Slime.class, 55),
GHAST("ghast", Ghast.class, 56),
ZOMBIFIED_PIGLIN("zombified_piglin", PigZombie.class, 57),
ENDERMAN("enderman", Enderman.class, 58),
CAVE_SPIDER("cave_spider", CaveSpider.class, 59),
SILVERFISH("silverfish", Silverfish.class, 60),
BLAZE("blaze", Blaze.class, 61),
MAGMA_CUBE("magma_cube", MagmaCube.class, 62),
ENDER_DRAGON("ender_dragon", EnderDragon.class, 63),
WITHER("wither", Wither.class, 64),
BAT("bat", Bat.class, 65),
WITCH("witch", Witch.class, 66),
ENDERMITE("endermite", Endermite.class, 67),
GUARDIAN("guardian", Guardian.class, 68),
SHULKER("shulker", Shulker.class, 69),
PIG("pig", Pig.class, 90),
SHEEP("sheep", Sheep.class, 91),
COW("cow", Cow.class, 92),
CHICKEN("chicken", Chicken.class, 93),
SQUID("squid", Squid.class, 94),
WOLF("wolf", Wolf.class, 95),
MOOSHROOM("mooshroom", MushroomCow.class, 96),
SNOW_GOLEM("snow_golem", Snowman.class, 97),
OCELOT("ocelot", Ocelot.class, 98),
IRON_GOLEM("iron_golem", IronGolem.class, 99),
HORSE("horse", Horse.class, 100),
RABBIT("rabbit", Rabbit.class, 101),
POLAR_BEAR("polar_bear", PolarBear.class, 102),
LLAMA("llama", Llama.class, 103),
LLAMA_SPIT("llama_spit", LlamaSpit.class, 104),
PARROT("parrot", Parrot.class, 105),
VILLAGER("villager", Villager.class, 120),
END_CRYSTAL("end_crystal", EnderCrystal.class, 200),
TURTLE("turtle", Turtle.class, -1),
PHANTOM("phantom", Phantom.class, -1),
TRIDENT("trident", Trident.class, -1),
COD("cod", Cod.class, -1),
SALMON("salmon", Salmon.class, -1),
PUFFERFISH("pufferfish", PufferFish.class, -1),
TROPICAL_FISH("tropical_fish", TropicalFish.class, -1),
DROWNED("drowned", Drowned.class, -1),
DOLPHIN("dolphin", Dolphin.class, -1),
CAT("cat", Cat.class, -1),
PANDA("panda", Panda.class, -1),
PILLAGER("pillager", Pillager.class, -1),
RAVAGER("ravager", Ravager.class, -1),
TRADER_LLAMA("trader_llama", TraderLlama.class, -1),
WANDERING_TRADER("wandering_trader", WanderingTrader.class, -1),
FOX("fox", Fox.class, -1),
BEE("bee", Bee.class, -1),
HOGLIN("hoglin", Hoglin.class, -1),
PIGLIN("piglin", Piglin.class, -1),
STRIDER("strider", Strider.class, -1),
ZOGLIN("zoglin", Zoglin.class, -1),
PIGLIN_BRUTE("piglin_brute", PiglinBrute.class, -1),
ARROW("arrow", Arrow.class, 10),
AXOLOTL("axolotl", Axolotl.class, -1),
BAMBOO_CHEST_RAFT("bamboo_chest_raft", BambooChestRaft.class, -1),
BAMBOO_RAFT("bamboo_raft", BambooRaft.class, -1),
BAT("bat", Bat.class, 65),
BEE("bee", Bee.class, -1),
BIRCH_BOAT("birch_boat", BirchBoat.class, -1),
BIRCH_CHEST_BOAT("birch_chest_boat", BirchChestBoat.class, -1),
BLAZE("blaze", Blaze.class, 61),
BLOCK_DISPLAY("block_display", BlockDisplay.class, -1),
BOGGED("bogged", Bogged.class, -1),
BREEZE("breeze", Breeze.class, -1),
BREEZE_WIND_CHARGE("breeze_wind_charge", BreezeWindCharge.class, -1),
CAMEL("camel", Camel.class, -1),
CAT("cat", Cat.class, -1),
CAVE_SPIDER("cave_spider", CaveSpider.class, 59),
CHERRY_BOAT("cherry_boat", CherryBoat.class, -1),
CHERRY_CHEST_BOAT("cherry_chest_boat", CherryChestBoat.class, -1),
CHEST_MINECART("chest_minecart", StorageMinecart.class, 43),
CHICKEN("chicken", Chicken.class, 93),
COD("cod", Cod.class, -1),
COMMAND_BLOCK_MINECART("command_block_minecart", CommandMinecart.class, 40),
COW("cow", Cow.class, 92),
CREAKING("creaking", Creaking.class, -1),
CREEPER("creeper", Creeper.class, 50),
DARK_OAK_BOAT("dark_oak_boat", DarkOakBoat.class, -1),
DARK_OAK_CHEST_BOAT("dark_oak_chest_boat", DarkOakChestBoat.class, -1),
DOLPHIN("dolphin", Dolphin.class, -1),
DONKEY("donkey", Donkey.class, 31),
DRAGON_FIREBALL("dragon_fireball", DragonFireball.class, 26),
DROWNED("drowned", Drowned.class, -1),
EGG("egg", Egg.class, 7),
ELDER_GUARDIAN("elder_guardian", ElderGuardian.class, 4),
END_CRYSTAL("end_crystal", EnderCrystal.class, 200),
ENDER_DRAGON("ender_dragon", EnderDragon.class, 63),
ENDER_PEARL("ender_pearl", EnderPearl.class, 14),
ENDERMAN("enderman", Enderman.class, 58),
ENDERMITE("endermite", Endermite.class, 67),
EVOKER("evoker", Evoker.class, 34),
EVOKER_FANGS("evoker_fangs", EvokerFangs.class, 33),
EXPERIENCE_BOTTLE("experience_bottle", ThrownExpBottle.class, 17),
EXPERIENCE_ORB("experience_orb", ExperienceOrb.class, 2),
EYE_OF_ENDER("eye_of_ender", EnderSignal.class, 15),
FALLING_BLOCK("falling_block", FallingBlock.class, 21),
FIREBALL("fireball", Fireball.class, 12),
FIREWORK_ROCKET("firework_rocket", Firework.class, 22),
FISHING_BOBBER("fishing_bobber", FishHook.class, -1, false),
FOX("fox", Fox.class, -1),
FROG("frog", Frog.class, -1),
FURNACE_MINECART("furnace_minecart", PoweredMinecart.class, 44),
GHAST("ghast", Ghast.class, 56),
GIANT("giant", Giant.class, 53),
GLOW_ITEM_FRAME("glow_item_frame", GlowItemFrame.class, -1),
GLOW_SQUID("glow_squid", GlowSquid.class, -1),
GOAT("goat", Goat.class, -1),
MARKER("marker", Marker.class, -1),
ALLAY("allay", Allay.class, -1),
FROG("frog", Frog.class, -1),
TADPOLE("tadpole", Tadpole.class, -1),
WARDEN("warden", Warden.class, -1),
CAMEL("camel", Camel.class, -1),
BLOCK_DISPLAY("block_display", BlockDisplay.class, -1),
GUARDIAN("guardian", Guardian.class, 68),
HOGLIN("hoglin", Hoglin.class, -1),
HOPPER_MINECART("hopper_minecart", HopperMinecart.class, 46),
HORSE("horse", Horse.class, 100),
HUSK("husk", Husk.class, 23),
ILLUSIONER("illusioner", Illusioner.class, 37),
INTERACTION("interaction", Interaction.class, -1),
IRON_GOLEM("iron_golem", IronGolem.class, 99),
ITEM("item", Item.class, 1),
ITEM_DISPLAY("item_display", ItemDisplay.class, -1),
SNIFFER("sniffer", Sniffer.class, -1),
TEXT_DISPLAY("text_display", TextDisplay.class, -1),
BREEZE("breeze", Breeze.class, -1),
WIND_CHARGE("wind_charge", WindCharge.class, -1),
BREEZE_WIND_CHARGE("breeze_wind_charge", BreezeWindCharge.class, -1),
ARMADILLO("armadillo", Armadillo.class, -1),
BOGGED("bogged", Bogged.class, -1),
OMINOUS_ITEM_SPAWNER("ominous_item_spawner", OminousItemSpawner.class, -1),
ACACIA_BOAT("acacia_boat", AcaciaBoat.class, -1),
ACACIA_CHEST_BOAT("acacia_chest_boat", AcaciaChestBoat.class, -1),
BAMBOO_RAFT("bamboo_raft", BambooRaft.class, -1),
BAMBOO_CHEST_RAFT("bamboo_chest_raft", BambooChestRaft.class, -1),
BIRCH_BOAT("birch_boat", BirchBoat.class, -1),
BIRCH_CHEST_BOAT("birch_chest_boat", BirchChestBoat.class, -1),
CHERRY_BOAT("cherry_boat", CherryBoat.class, -1),
CHERRY_CHEST_BOAT("cherry_chest_boat", CherryChestBoat.class, -1),
DARK_OAK_BOAT("dark_oak_boat", DarkOakBoat.class, -1),
DARK_OAK_CHEST_BOAT("dark_oak_chest_boat", DarkOakChestBoat.class, -1),
ITEM_FRAME("item_frame", ItemFrame.class, 18),
JUNGLE_BOAT("jungle_boat", JungleBoat.class, -1),
JUNGLE_CHEST_BOAT("jungle_chest_boat", JungleChestBoat.class, -1),
LEASH_KNOT("leash_knot", LeashHitch.class, 8),
LIGHTNING_BOLT("lightning_bolt", LightningStrike.class, -1),
LINGERING_POTION("lingering_potion", LingeringPotion.class, -1),
LLAMA("llama", Llama.class, 103),
LLAMA_SPIT("llama_spit", LlamaSpit.class, 104),
MAGMA_CUBE("magma_cube", MagmaCube.class, 62),
MANGROVE_BOAT("mangrove_boat", MangroveBoat.class, -1),
MANGROVE_CHEST_BOAT("mangrove_chest_boat", MangroveChestBoat.class, -1),
MARKER("marker", Marker.class, -1),
MINECART("minecart", Minecart.class, 42),
MOOSHROOM("mooshroom", MushroomCow.class, 96),
MULE("mule", Mule.class, 32),
OAK_BOAT("oak_boat", OakBoat.class, -1),
OAK_CHEST_BOAT("oak_chest_boat", OakChestBoat.class, -1),
OCELOT("ocelot", Ocelot.class, 98),
OMINOUS_ITEM_SPAWNER("ominous_item_spawner", OminousItemSpawner.class, -1),
PAINTING("painting", Painting.class, 9),
PALE_OAK_BOAT("pale_oak_boat", PaleOakBoat.class, -1),
PALE_OAK_CHEST_BOAT("pale_oak_chest_boat", PaleOakChestBoat.class, -1),
PANDA("panda", Panda.class, -1),
PARROT("parrot", Parrot.class, 105),
PHANTOM("phantom", Phantom.class, -1),
PIG("pig", Pig.class, 90),
PIGLIN("piglin", Piglin.class, -1),
PIGLIN_BRUTE("piglin_brute", PiglinBrute.class, -1),
PILLAGER("pillager", Pillager.class, -1),
PLAYER("player", Player.class, -1, false),
POLAR_BEAR("polar_bear", PolarBear.class, 102),
PUFFERFISH("pufferfish", PufferFish.class, -1),
RABBIT("rabbit", Rabbit.class, 101),
RAVAGER("ravager", Ravager.class, -1),
SALMON("salmon", Salmon.class, -1),
SHEEP("sheep", Sheep.class, 91),
SHULKER("shulker", Shulker.class, 69),
SHULKER_BULLET("shulker_bullet", ShulkerBullet.class, 25),
SILVERFISH("silverfish", Silverfish.class, 60),
SKELETON("skeleton", Skeleton.class, 51),
SKELETON_HORSE("skeleton_horse", SkeletonHorse.class, 28),
SLIME("slime", Slime.class, 55),
SMALL_FIREBALL("small_fireball", SmallFireball.class, 13),
SNIFFER("sniffer", Sniffer.class, -1),
SNOW_GOLEM("snow_golem", Snowman.class, 97),
SNOWBALL("snowball", Snowball.class, 11),
SPAWNER_MINECART("spawner_minecart", SpawnerMinecart.class, 47),
SPECTRAL_ARROW("spectral_arrow", SpectralArrow.class, 24),
SPIDER("spider", Spider.class, 52),
SPLASH_POTION("splash_potion", SplashPotion.class, 16),
SPRUCE_BOAT("spruce_boat", SpruceBoat.class, -1),
SPRUCE_CHEST_BOAT("spruce_chest_boat", SpruceChestBoat.class, -1),
CREAKING("creaking", Creaking.class, -1),
/**
* A fishing line and bobber.
*/
FISHING_BOBBER("fishing_bobber", FishHook.class, -1, false),
/**
* A bolt of lightning.
* <p>
* Spawn with {@link World#strikeLightning(Location)}.
*/
LIGHTNING_BOLT("lightning_bolt", LightningStrike.class, -1),
PLAYER("player", Player.class, -1, false),
SQUID("squid", Squid.class, 94),
STRAY("stray", Stray.class, 6),
STRIDER("strider", Strider.class, -1),
TADPOLE("tadpole", Tadpole.class, -1),
TEXT_DISPLAY("text_display", TextDisplay.class, -1),
TNT("tnt", TNTPrimed.class, 20),
TNT_MINECART("tnt_minecart", ExplosiveMinecart.class, 45),
TRADER_LLAMA("trader_llama", TraderLlama.class, -1),
TRIDENT("trident", Trident.class, -1),
TROPICAL_FISH("tropical_fish", TropicalFish.class, -1),
TURTLE("turtle", Turtle.class, -1),
VEX("vex", Vex.class, 35),
VILLAGER("villager", Villager.class, 120),
VINDICATOR("vindicator", Vindicator.class, 36),
WANDERING_TRADER("wandering_trader", WanderingTrader.class, -1),
WARDEN("warden", Warden.class, -1),
WIND_CHARGE("wind_charge", WindCharge.class, -1),
WITCH("witch", Witch.class, 66),
WITHER("wither", Wither.class, 64),
WITHER_SKELETON("wither_skeleton", WitherSkeleton.class, 5),
WITHER_SKULL("wither_skull", WitherSkull.class, 19),
WOLF("wolf", Wolf.class, 95),
ZOGLIN("zoglin", Zoglin.class, -1),
ZOMBIE("zombie", Zombie.class, 54),
ZOMBIE_HORSE("zombie_horse", ZombieHorse.class, 29),
ZOMBIE_VILLAGER("zombie_villager", ZombieVillager.class, 27),
ZOMBIFIED_PIGLIN("zombified_piglin", PigZombie.class, 57),
// End generate - EntityType
/**
* An unknown entity without an Entity Class
*/

View File

@@ -65,7 +65,6 @@ public interface Evoker extends Spellcaster {
@Deprecated(since = "1.11.2")
void setCurrentSpell(@Nullable Spell spell);
// Paper start
/**
* @return the sheep being targeted by the {@link Spell#WOLOLO wololo spell}, or {@code null} if none
*/
@@ -78,5 +77,4 @@ public interface Evoker extends Spellcaster {
* @param sheep new wololo target
*/
void setWololoTarget(@Nullable Sheep sheep);
// Paper end
}

View File

@@ -47,7 +47,7 @@ public interface FallingBlock extends Entity {
org.bukkit.block.BlockState getBlockState();
/**
* Sets the {@link BlockData} and possibly present tile entity data for the falling block.
* Sets the {@link BlockData} and possibly present block entity data for the falling block.
*
* @param blockState the BlockState to use
*/

View File

@@ -89,8 +89,11 @@ public interface Fox extends Animals, Sittable {
* Represents the various different fox types there are.
*/
public enum Type {
// Start generate - FoxType
// @GeneratedFrom 1.21.5
RED,
SNOW;
// End generate - FoxType
}
// Paper start - Add more fox behavior API

View File

@@ -3,6 +3,8 @@ package org.bukkit.entity;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
@@ -50,22 +52,18 @@ public interface Frog extends Animals {
*/
interface Variant extends OldEnum<Variant>, Keyed {
/**
* Temperate (brown-orange) frog.
*/
Variant TEMPERATE = getVariant("temperate");
/**
* Warm (gray) frog.
*/
Variant WARM = getVariant("warm");
/**
* Cold (green) frog.
*/
// Start generate - FrogVariant
// @GeneratedFrom 1.21.5
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");
Variant WARM = getVariant("warm");
// End generate - FrogVariant
@NotNull
private static Variant getVariant(@NotNull String key) {
return Registry.FROG_VARIANT.getOrThrow(NamespacedKey.minecraft(key));
return RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
}
/**
@@ -76,7 +74,7 @@ public interface Frog extends Animals {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Variant valueOf(@NotNull String name) {
Variant variant = Registry.FROG_VARIANT.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Variant variant = RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT).get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
Preconditions.checkArgument(variant != null, "No frog variant found with the name %s", name);
return variant;
}
@@ -88,7 +86,7 @@ public interface Frog extends Animals {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Variant[] values() {
return Lists.newArrayList(Registry.FROG_VARIANT).toArray(new Variant[0]);
return Lists.newArrayList(RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT)).toArray(new Variant[0]);
}
}
}

View File

@@ -19,7 +19,6 @@ public interface Ghast extends Flying, Enemy {
*/
void setCharging(boolean flag);
// Paper start
/**
* Returns the explosion power of shot fireballs.
*
@@ -34,5 +33,4 @@ public interface Ghast extends Flying, Enemy {
* @throws IllegalArgumentException if the explosion power is less than 0 or greater than 127
*/
void setExplosionPower(int explosionPower);
// Paper end
}

View File

@@ -53,11 +53,9 @@ public interface Goat extends Animals {
*/
void setScreaming(boolean screaming);
// Paper start - Goat ram API
/**
* Makes the goat ram at the specified entity
* @param entity the entity to ram at
*/
void ram(@org.jetbrains.annotations.NotNull LivingEntity entity);
// Paper end
}

View File

@@ -299,16 +299,16 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
/**
* Force-closes the currently open inventory view for this player, if any.
*/
public void closeInventory();
default void closeInventory() {
this.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.PLUGIN);
}
// Paper start
/**
* Force-closes the currently open inventory view for this player, if any.
*
* @param reason why the inventory is closing
*/
public void closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason);
// Paper end
void closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason);
/**
* Returns the ItemStack currently in your hand, can be empty.
@@ -382,7 +382,6 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
public void setCooldown(Material material, int ticks);
// Paper start
/**
* Sets player hurt direction
*
@@ -390,16 +389,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
@Override
void setHurtDirection(float hurtDirection);
// Paper end
// Paper start
/**
* If the player has slept enough to count towards passing the night.
*
* @return true if the player has slept enough
*/
public boolean isDeeplySleeping();
// Paper end
/**
* Check whether a cooldown is active on the specified item.
@@ -440,7 +436,6 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
public int getSleepTicks();
// Paper start - Potential bed api
/**
* Gets the Location of the player's bed, null if they have not slept
* in one. This method will not attempt to validate if the current bed
@@ -466,14 +461,12 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
@Nullable
Location getPotentialRespawnLocation();
// Paper end
// Paper start
/**
* @return the player's fishing hook if they are fishing
*/
@Nullable
FishHook getFishHook();
// Paper end
/**
* Attempts to make the entity sleep at the given location.

View File

@@ -2,9 +2,6 @@ package org.bukkit.entity;
/**
* Represents a thrown lingering potion bottle
*
* @deprecated should not be used for anything, use {@link ThrownPotion} and
* set the potion via the methods there.
*/
@Deprecated(since = "1.20.5", forRemoval = true) // Paper
public interface LingeringPotion extends ThrownPotion { }
public interface LingeringPotion extends ThrownPotion {
}

View File

@@ -663,14 +663,12 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@NotNull
public Collection<PotionEffect> getActivePotionEffects();
// Paper start - LivingEntity#clearActivePotionEffects();
/**
* Removes all active potion effects for this entity.
*
* @return true if any were removed
*/
boolean clearActivePotionEffects();
// Paper end
/**
* Checks whether the living entity has block line of sight to another.
@@ -683,7 +681,6 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
public boolean hasLineOfSight(@NotNull Entity other);
// Paper start
/**
* Checks whether the living entity has block line of sight to the given block.
* <p>
@@ -694,7 +691,6 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @return true if there is a line of sight, false if not
*/
public boolean hasLineOfSight(@NotNull Location location);
// Paper end
/**
* Returns if the living entity despawns when away from players or not.
@@ -1060,23 +1056,6 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@Deprecated(since = "1.20.5", forRemoval = true) @org.jetbrains.annotations.Contract("-> fail") // Paper
public EntityCategory getCategory();
/**
* Sets whether the entity is invisible or not.
*
* @param invisible If the entity is invisible
*/
@Override // Paper - move invisibility up to Entity
public void setInvisible(boolean invisible);
/**
* Gets whether the entity is invisible or not.
*
* @return Whether the entity is invisible
*/
@Override // Paper - move invisibility up to Entity
public boolean isInvisible();
// Paper start
/**
* Get the number of arrows stuck in this entity
* @return Number of arrows stuck
@@ -1108,9 +1087,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param delay Delay in ticks
*/
void setShieldBlockingDelay(int delay);
// Paper end
// Paper start - missing entity API
/**
* Retrieves the sideways movement direction of the entity.
* <p>
@@ -1167,7 +1144,6 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @return Forwards movement direction, ranging from -1 (backward) to 1 (forward).
*/
float getForwardsMovement();
// Paper end - missing entity API
// Paper start - active item API
/**

View File

@@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull;
/**
* Represents a mushroom {@link Cow}
*/
public interface MushroomCow extends Cow, io.papermc.paper.entity.Shearable { // Paper
public interface MushroomCow extends AbstractCow, io.papermc.paper.entity.Shearable { // Paper
/**
* Checks for the presence of custom potion effects to be applied to the

View File

@@ -185,6 +185,8 @@ public interface Panda extends Animals, Sittable {
public enum Gene {
// Start generate - PandaGene
// @GeneratedFrom 1.21.5
NORMAL(false),
LAZY(false),
WORRIED(false),
@@ -192,6 +194,7 @@ public interface Panda extends Animals, Sittable {
BROWN(true),
WEAK(true),
AGGRESSIVE(false);
// End generate - PandaGene
private final boolean recessive;

View File

@@ -1,7 +1,8 @@
package org.bukkit.entity;
import org.jetbrains.annotations.NotNull;
import org.bukkit.Location;
import org.jetbrains.annotations.Nullable;
import java.util.UUID;
/**
* Represents a phantom.
@@ -14,18 +15,17 @@ public interface Phantom extends Flying, Enemy {
public int getSize();
/**
* @param sz The new size of the phantom.
* @param size The new size of the phantom.
*/
public void setSize(int sz);
public void setSize(int size);
// Paper start
/**
* Get the UUID of the entity that caused this phantom to spawn
*
* @return UUID
*/
@Nullable
public java.util.UUID getSpawningEntity();
public UUID getSpawningEntity();
/**
* Check if this phantom will burn in the sunlight
@@ -47,14 +47,13 @@ public interface Phantom extends Flying, Enemy {
*
* @return circling location
*/
@org.jetbrains.annotations.NotNull
org.bukkit.Location getAnchorLocation();
@Nullable
Location getAnchorLocation();
/**
* Sets the location that this phantom circles around when not attacking a player
*
* @param location circling location (world is ignored, will always use the entity's world)
*/
void setAnchorLocation(@org.jetbrains.annotations.NotNull org.bukkit.Location location);
// Paper end
void setAnchorLocation(@Nullable Location location);
}

View File

@@ -1,6 +1,47 @@
package org.bukkit.entity;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jspecify.annotations.NullMarked;
/**
* Represents a Pig.
*/
public interface Pig extends Steerable, Vehicle { }
@NullMarked
public interface Pig extends Steerable, Vehicle {
/**
* Gets the variant of this pig.
*
* @return the pig variant
*/
Variant getVariant();
/**
* Sets the variant of this pig.
*
* @param variant the pig variant
*/
void setVariant(Variant variant);
/**
* Represents the variant of a pig.
*/
interface Variant extends Keyed {
// Start generate - PigVariant
// @GeneratedFrom 1.21.5
Variant COLD = getVariant("cold");
Variant TEMPERATE = getVariant("temperate");
Variant WARM = getVariant("warm");
// End generate - PigVariant
private static Variant getVariant(String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PIG_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
}
}
}

View File

@@ -1,19 +1,21 @@
package org.bukkit.entity;
import org.jetbrains.annotations.Contract;
/**
* Represents a Pig Zombie.
* Represents a Zombified piglin.
*/
public interface PigZombie extends Zombie {
/**
* Get the pig zombie's current anger level.
* Get the zombified piglin's current anger level.
*
* @return The anger level.
*/
int getAnger();
/**
* Set the pig zombie's current anger level.
* Set the zombified piglin's current anger level.
*
* @param level The anger level. Higher levels of anger take longer to
* wear off.
@@ -23,29 +25,31 @@ public interface PigZombie extends Zombie {
/**
* Shorthand; sets to either 0 or the default level.
*
* @param angry Whether the zombie should be angry.
* @param angry Whether the piglin should be angry.
*/
void setAngry(boolean angry);
/**
* Shorthand; gets whether the zombie is angry.
* Shorthand; gets whether the piglin is angry.
*
* @return True if the zombie is angry, otherwise false.
* @return True if the piglin is angry, otherwise false.
*/
boolean isAngry();
/**
* <b>Not applicable to this entity</b>
*
* @return false
* @return {@code false}
*/
@Override
@Contract("-> false")
public boolean isConverting();
/**
* <b>Not applicable to this entity</b>
*/
@Override
@Contract("-> fail")
public int getConversionTime();
/**
@@ -54,5 +58,6 @@ public interface PigZombie extends Zombie {
* @param time unused
*/
@Override
@Contract("_ -> fail")
public void setConversionTime(int time);
}

View File

@@ -91,7 +91,6 @@ public interface Piglin extends PiglinAbstract, InventoryHolder, com.destroystok
@NotNull
public Set<Material> getBarterList();
// Paper start
/**
* Causes the piglin to appear as if they are charging
* a crossbow.
@@ -131,6 +130,5 @@ public interface Piglin extends PiglinAbstract, InventoryHolder, com.destroystok
* @return is dancing
*/
boolean isDancing();
// Paper end
}

View File

@@ -332,18 +332,21 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public void kickPlayer(@Nullable String message);
// Paper start
/**
* Kicks the player with the default kick message.
*
* @see #kick(net.kyori.adventure.text.Component)
*/
void kick();
/**
* Kicks player with custom kick message.
*
* @param message kick message
*/
void kick(final net.kyori.adventure.text.@Nullable Component message);
default void kick(final net.kyori.adventure.text.@Nullable Component message) {
this.kick(message, org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN);
}
/**
* Kicks player with custom kick message and cause.
@@ -352,7 +355,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param cause kick cause
*/
void kick(final net.kyori.adventure.text.@Nullable Component message, org.bukkit.event.player.PlayerKickEvent.Cause cause);
// Paper end
/**
* Adds this user to the {@link ProfileBanList}. If a previous ban exists, this will
@@ -543,31 +545,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public boolean isSleepingIgnored();
/**
* Gets the Location where the player will spawn at their bed, null if
* they have not slept in one or their current bed spawn is invalid.
*
* @return Bed Spawn Location if bed exists, otherwise null.
*
* @see #getRespawnLocation()
* @deprecated Misleading name. This method also returns the location of
* respawn anchors.
*/
@Nullable
@Override
@Deprecated(since = "1.20.4")
public Location getBedSpawnLocation();
/**
* Gets the Location where the player will spawn at, null if they
* don't have a valid respawn point.
*
* @return respawn location if exists, otherwise null.
*/
@Nullable
@Override
public Location getRespawnLocation();
/**
* Sets the Location where the player will spawn at their bed.
*
@@ -973,7 +950,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* than 1.19.4
*/
@Deprecated(since = "1.20")
public void sendBlockChanges(Collection<BlockState> blocks, boolean suppressLightUpdates);
default void sendBlockChanges(Collection<BlockState> blocks, boolean suppressLightUpdates) {
this.sendBlockChanges(blocks);
}
/**
* Send block damage. This fakes block break progress at a certain location
@@ -1294,7 +1273,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendMap(MapView map);
// Paper start
/**
* Shows the player the win screen that normally is only displayed after one kills the ender dragon
* and exits the end for the first time.
@@ -1333,9 +1311,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @see <a href="https://minecraft.wiki/wiki/End_Poem">https://minecraft.wiki/wiki/End_Poem</a>
*/
public void setHasSeenWinScreen(boolean hasSeenWinScreen);
// Paper end
// Paper start
/**
* Permanently Bans the Profile and IP address currently used by the player.
*
@@ -1346,7 +1322,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
// For reference, Bukkit defines this as nullable, while they impl isn't, we'll follow API.
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerFull(@Nullable String reason) {
return banPlayerFull(reason, null, null);
return this.banPlayerFull(reason, null, null);
}
/**
@@ -1359,7 +1335,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerFull(@Nullable String reason, @Nullable String source) {
return banPlayerFull(reason, null, source);
return this.banPlayerFull(reason, null, source);
}
/**
@@ -1372,7 +1348,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerFull(@Nullable String reason, java.util.@Nullable Date expires) {
return banPlayerFull(reason, expires, null);
return this.banPlayerFull(reason, expires, null);
}
/**
@@ -1386,8 +1362,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerFull(@Nullable String reason, java.util.@Nullable Date expires, @Nullable String source) {
banPlayer(reason, expires, source);
return banPlayerIP(reason, expires, source, true);
this.banPlayer(reason, expires, source);
return this.banPlayerIP(reason, expires, source, true);
}
/**
@@ -1401,7 +1377,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerIP(@Nullable String reason, boolean kickPlayer) {
return banPlayerIP(reason, null, null, kickPlayer);
return this.banPlayerIP(reason, null, null, kickPlayer);
}
/**
@@ -1415,7 +1391,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerIP(@Nullable String reason, @Nullable String source, boolean kickPlayer) {
return banPlayerIP(reason, null, source, kickPlayer);
return this.banPlayerIP(reason, null, source, kickPlayer);
}
/**
@@ -1429,7 +1405,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerIP(@Nullable String reason, java.util.@Nullable Date expires, boolean kickPlayer) {
return banPlayerIP(reason, expires, null, kickPlayer);
return this.banPlayerIP(reason, expires, null, kickPlayer);
}
/**
@@ -1442,7 +1418,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerIP(@Nullable String reason) {
return banPlayerIP(reason, null, null);
return this.banPlayerIP(reason, null, null);
}
/**
@@ -1455,7 +1431,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerIP(@Nullable String reason, @Nullable String source) {
return banPlayerIP(reason, null, source);
return this.banPlayerIP(reason, null, source);
}
/**
@@ -1468,7 +1444,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerIP(@Nullable String reason, java.util.@Nullable Date expires) {
return banPlayerIP(reason, expires, null);
return this.banPlayerIP(reason, expires, null);
}
/**
@@ -1482,7 +1458,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated(since = "1.20.4")
public default org.bukkit.@Nullable BanEntry banPlayerIP(@Nullable String reason, java.util.@Nullable Date expires, @Nullable String source) {
return banPlayerIP(reason, expires, source, true);
return this.banPlayerIP(reason, expires, source, true);
}
/**
@@ -1499,7 +1475,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public default org.bukkit.@Nullable BanEntry banPlayerIP(@Nullable String reason, java.util.@Nullable Date expires, @Nullable String source, boolean kickPlayer) {
org.bukkit.BanEntry banEntry = org.bukkit.Bukkit.getServer().getBanList(org.bukkit.BanList.Type.IP).addBan(getAddress().getAddress().getHostAddress(), reason, expires, source);
if (kickPlayer && isOnline()) {
getPlayer().kickPlayer(reason);
this.getPlayer().kickPlayer(reason);
}
return banEntry;
@@ -1546,7 +1522,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
@Deprecated
public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) {
spigot().sendMessage(component);
this.spigot().sendMessage(component);
}
/**
@@ -1558,7 +1534,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
@Deprecated
public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) {
spigot().sendMessage(components);
this.spigot().sendMessage(components);
}
/**
@@ -1570,7 +1546,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Deprecated
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
spigot().sendMessage(position, components);
this.spigot().sendMessage(position, components);
}
/**

View File

@@ -3,7 +3,6 @@ package org.bukkit.entity;
/**
* Represents a polar bear.
*/
// Paper start
public interface PolarBear extends Animals {
/**
@@ -21,4 +20,3 @@ public interface PolarBear extends Animals {
void setStanding(boolean standing);
}
// Paper end

View File

@@ -3,7 +3,6 @@ package org.bukkit.entity;
/**
* Illager beast.
*/
// Paper start - Missing Entity Behavior
public interface Ravager extends Raider {
/**
@@ -60,4 +59,3 @@ public interface Ravager extends Raider {
void setRoarTicks(int ticks);
}
// Paper end

View File

@@ -27,17 +27,11 @@ public interface Salmon extends io.papermc.paper.entity.SchoolableFish { // Pape
*/
public enum Variant {
/**
* Small salmon.
*/
// Start generate - SalmonVariant
// @GeneratedFrom 1.21.5
SMALL,
/**
* Default salmon.
*/
MEDIUM,
/**
* Large salmon.
*/
LARGE;
// End generate - SalmonVariant
}
}

View File

@@ -41,7 +41,6 @@ public interface Skeleton extends AbstractSkeleton {
*/
void setConversionTime(int time);
// Paper start
/**
* Gets the time the skeleton
* has been inside powdered snow.
@@ -49,7 +48,6 @@ public interface Skeleton extends AbstractSkeleton {
* @return time in ticks
*/
int inPowderedSnowTime();
// Paper end
/**
* A legacy enum that defines the different variances of skeleton-like

View File

@@ -44,17 +44,19 @@ public interface SkeletonHorse extends AbstractHorse {
*/
void setTrapTime(int trapTime);
// Paper start
/**
* @deprecated use {@link #isTrapped()}
*/
@Deprecated
boolean isTrap();
default boolean isTrap() {
return this.isTrapped();
}
/**
* @deprecated use {@link #setTrapped(boolean)}
*/
@Deprecated
void setTrap(boolean trap);
// Paper end
default void setTrap(boolean trap) {
this.setTrapped(trap);
}
}

View File

@@ -25,7 +25,6 @@ public interface Slime extends Mob, Enemy {
*/
public void setSize(int sz);
// Paper start
/**
* Get whether this slime can randomly wander/jump around on its own
*
@@ -39,5 +38,4 @@ public interface Slime extends Mob, Enemy {
* @param canWander true if can wander
*/
public void setWander(boolean canWander);
// Paper end
}

View File

@@ -74,6 +74,8 @@ public interface Sniffer extends Animals {
* Represents the current state of the Sniffer.
*/
public enum State {
// Start generate - SnifferState
// @GeneratedFrom 1.21.5
IDLING,
FEELING_HAPPY,
SCENTING,
@@ -81,5 +83,6 @@ public interface Sniffer extends Animals {
SEARCHING,
DIGGING,
RISING;
// End generate - SnifferState
}
}

View File

@@ -2,9 +2,6 @@ package org.bukkit.entity;
/**
* Represents a thrown splash potion bottle
*
* @deprecated should not be used for anything, use {@link ThrownPotion} and
* set the potion via the methods there.
*/
@Deprecated(since = "1.14", forRemoval = true) // Paper
public interface SplashPotion extends ThrownPotion { }
public interface SplashPotion extends ThrownPotion {
}

View File

@@ -65,7 +65,6 @@ public interface TNTPrimed extends Explosive {
return this.getOrigin();
}
// Paper start
/**
* Sets the visual block data of this
* primed tnt.
@@ -85,5 +84,4 @@ public interface TNTPrimed extends Explosive {
*/
@org.jetbrains.annotations.NotNull
org.bukkit.block.data.BlockData getBlockData();
// Paper end
}

View File

@@ -19,7 +19,6 @@ public interface Tadpole extends Fish {
*/
public void setAge(int age);
// Paper start - Tadpole age lock api
/**
* Lock the age of the animal, setting this will prevent the animal from
* maturing.
@@ -34,5 +33,4 @@ public interface Tadpole extends Fish {
* @return the current agelock
*/
boolean getAgeLock();
// Paper end
}

View File

@@ -28,7 +28,6 @@ public interface TextDisplay extends Display {
@Deprecated // Paper
void setText(@Nullable String text);
// Paper start
/**
* Gets the displayed text.
*
@@ -42,7 +41,6 @@ public interface TextDisplay extends Display {
* @param text the new text
*/
void text(net.kyori.adventure.text.@Nullable Component text);
// Paper end
/**
* Gets the maximum line width before wrapping.

View File

@@ -60,6 +60,8 @@ public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { /
*/
public static enum Pattern {
// Start generate - TropicalFishPattern
// @GeneratedFrom 1.21.5
KOB,
SUNSTREAK,
SNOOPER,
@@ -72,5 +74,6 @@ public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { /
BLOCKFISH,
BETTY,
CLAYFISH;
// End generate - TropicalFishPattern
}
}

View File

@@ -171,13 +171,22 @@ public interface Villager extends AbstractVillager {
*/
interface Type extends OldEnum<Type>, Keyed {
// Start generate - VillagerType
// @GeneratedFrom 1.21.5
Type DESERT = getType("desert");
Type JUNGLE = getType("jungle");
Type PLAINS = getType("plains");
Type SAVANNA = getType("savanna");
Type SNOW = getType("snow");
Type SWAMP = getType("swamp");
Type TAIGA = getType("taiga");
// End generate - VillagerType
@NotNull
private static Type getType(@NotNull String key) {
@@ -214,77 +223,94 @@ public interface Villager extends AbstractVillager {
*/
interface Profession extends OldEnum<Profession>, Keyed, net.kyori.adventure.translation.Translatable {
Profession NONE = getProfession("none");
// Start generate - VillagerProfession
// @GeneratedFrom 1.21.5
/**
* Armorer profession. Wears a black apron. Armorers primarily trade for
* iron armor, chainmail armor, and sometimes diamond armor.
*/
Profession ARMORER = getProfession("armorer");
/**
* Butcher profession. Wears a white apron. Butchers primarily trade for
* raw and cooked food.
*/
Profession BUTCHER = getProfession("butcher");
/**
* Cartographer profession. Wears a white robe. Cartographers primarily
* trade for explorer maps and some paper.
*/
Profession CARTOGRAPHER = getProfession("cartographer");
/**
* Cleric profession. Wears a purple robe. Clerics primarily trade for
* rotten flesh, gold ingot, redstone, lapis, ender pearl, glowstone,
* and bottle o' enchanting.
*/
Profession CLERIC = getProfession("cleric");
/**
* Farmer profession. Wears a brown robe. Farmers primarily trade for
* food-related items.
*/
Profession FARMER = getProfession("farmer");
/**
* Fisherman profession. Wears a brown robe. Fisherman primarily trade
* for fish, as well as possibly selling string and/or coal.
*/
Profession FISHERMAN = getProfession("fisherman");
/**
* Fletcher profession. Wears a brown robe. Fletchers primarily trade
* for string, bows, and arrows.
*/
Profession FLETCHER = getProfession("fletcher");
/**
* Leatherworker profession. Wears a white apron. Leatherworkers
* primarily trade for leather, and leather armor, as well as saddles.
*/
Profession LEATHERWORKER = getProfession("leatherworker");
/**
* Librarian profession. Wears a white robe. Librarians primarily trade
* for paper, books, and enchanted books.
*/
Profession LIBRARIAN = getProfession("librarian");
/**
* Mason profession.
*/
Profession MASON = getProfession("mason");
/**
* Nitwit profession. Wears a green apron, cannot trade. Nitwit
* villagers do not do anything. They do not have any trades by default.
*/
Profession NITWIT = getProfession("nitwit");
Profession NONE = getProfession("none");
/**
* Shepherd profession. Wears a brown robe. Shepherds primarily trade for
* wool items, and shears.
*/
Profession SHEPHERD = getProfession("shepherd");
/**
* Toolsmith profession. Wears a black apron. Tool smiths primarily
* trade for iron and diamond tools.
*/
Profession TOOLSMITH = getProfession("toolsmith");
/**
* Weaponsmith profession. Wears a black apron. Weapon smiths primarily
* trade for iron and diamond weapons, sometimes enchanted.
*/
Profession WEAPONSMITH = getProfession("weaponsmith");
// End generate - VillagerProfession
@NotNull
private static Profession getProfession(@NotNull String key) {
@@ -322,7 +348,6 @@ public interface Villager extends AbstractVillager {
// Paper end
}
// Paper start - Add villager reputation API
/**
* Get the {@link com.destroystokyo.paper.entity.villager.Reputation reputation}
* for a specific player by {@link UUID}.
@@ -366,5 +391,4 @@ public interface Villager extends AbstractVillager {
* reputation regardless of its impact and the player associated.
*/
public void clearReputations();
// Paper end
}

View File

@@ -29,7 +29,6 @@ public interface WanderingTrader extends AbstractVillager {
*/
public void setDespawnDelay(int despawnDelay);
// Paper start - Add more WanderingTrader API
/**
* Set if the Wandering Trader can and will drink an invisibility potion.
* @param bool whether the mob will drink
@@ -74,5 +73,4 @@ public interface WanderingTrader extends AbstractVillager {
* @param location location to wander towards (world is ignored, will always use the entity's world)
*/
void setWanderingTowards(@org.jetbrains.annotations.Nullable org.bukkit.Location location);
// Paper end
}

View File

@@ -30,7 +30,6 @@ public interface Warden extends Monster {
*/
int getAnger(@NotNull Entity entity);
// Paper start
/**
* Gets the highest anger level of this warden.
* <p>
@@ -40,7 +39,6 @@ public interface Warden extends Monster {
* @return highest anger level
*/
int getHighestAnger();
// Paper end
/**
* Increases the anger level of this warden.

View File

@@ -69,7 +69,6 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
RIGHT
}
// Paper start
/**
* @return whether the wither is charged
*/
@@ -106,5 +105,4 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
* This is called in vanilla directly after spawning the wither.
*/
void enterInvulnerabilityPhase();
// Paper end
}

View File

@@ -90,24 +90,78 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
*/
void setVariant(@NotNull Variant variant);
/**
* Get the sound variant of this wolf.
*
* @return wolf sound variant
*/
@NotNull
SoundVariant getSoundVariant();
/**
* Set the sound variant of this wolf.
*
* @param soundVariant wolf sound variant
*/
void setSoundVariant(@NotNull SoundVariant soundVariant);
/**
* Represents the variant of a wolf.
*/
interface Variant extends Keyed {
Variant PALE = getVariant("pale");
Variant SPOTTED = getVariant("spotted");
Variant SNOWY = getVariant("snowy");
Variant BLACK = getVariant("black");
// Start generate - WolfVariant
// @GeneratedFrom 1.21.5
Variant ASHEN = getVariant("ashen");
Variant RUSTY = getVariant("rusty");
Variant WOODS = getVariant("woods");
Variant BLACK = getVariant("black");
Variant CHESTNUT = getVariant("chestnut");
Variant PALE = getVariant("pale");
Variant RUSTY = getVariant("rusty");
Variant SNOWY = getVariant("snowy");
Variant SPOTTED = getVariant("spotted");
Variant STRIPED = getVariant("striped");
Variant WOODS = getVariant("woods");
// End generate - WolfVariant
@NotNull
private static Variant getVariant(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.WOLF_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
}
}
/**
* Represents the sound variant of a wolf.
*/
interface SoundVariant extends Keyed {
// Start generate - WolfSoundVariant
// @GeneratedFrom 1.21.5
SoundVariant ANGRY = getSoundVariant("angry");
SoundVariant BIG = getSoundVariant("big");
SoundVariant CLASSIC = getSoundVariant("classic");
SoundVariant CUTE = getSoundVariant("cute");
SoundVariant GRUMPY = getSoundVariant("grumpy");
SoundVariant PUGLIN = getSoundVariant("puglin");
SoundVariant SAD = getSoundVariant("sad");
// End generate - WolfSoundVariant
@NotNull
private static SoundVariant getSoundVariant(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.WOLF_SOUND_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
}
}
}

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