Update to Minecraft 1.20.5

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2024-04-24 01:15:00 +10:00
parent 899f2acb84
commit f3502f6dac
54 changed files with 1814 additions and 741 deletions

View File

@@ -0,0 +1,18 @@
package org.bukkit.entity;
import org.bukkit.MinecraftExperimental;
import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Wind Charge.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface AbstractWindCharge extends Fireball {
/**
* Immediately explode this WindCharge.
*/
public void explode();
}

View File

@@ -3,7 +3,6 @@ package org.bukkit.entity;
import java.util.List;
import org.bukkit.Color;
import org.bukkit.Particle;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
@@ -146,38 +145,19 @@ public interface AreaEffectCloud extends Entity {
*/
<T> void setParticle(@NotNull Particle particle, @Nullable T data);
/**
* Sets the underlying potion data
*
* @param data PotionData to set the base potion state to
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #setBasePotionType} instead.
*/
@Deprecated
void setBasePotionData(@NotNull PotionData data);
/**
* Returns the potion data about the base potion
*
* @return a PotionData object
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #getBasePotionType()} instead.
*/
@NotNull
@Deprecated
PotionData getBasePotionData();
/**
* Sets the underlying potion type
*
* @param type PotionType to set the base potion state to
*/
void setBasePotionType(@NotNull PotionType type);
void setBasePotionType(@Nullable PotionType type);
/**
* Returns the potion type about the base potion
*
* @return a PotionType object
*/
@NotNull
@Nullable
PotionType getBasePotionType();
/**

View File

@@ -0,0 +1,8 @@
package org.bukkit.entity;
/**
* Represents an Armadillo.
*/
public interface Armadillo extends Animals {
}

View File

@@ -2,7 +2,6 @@ package org.bukkit.entity;
import java.util.List;
import org.bukkit.Color;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
@@ -11,38 +10,19 @@ import org.jetbrains.annotations.Nullable;
public interface Arrow extends AbstractArrow {
/**
* Sets the underlying potion data
*
* @param data PotionData to set the base potion state to
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #setBasePotionType} instead.
*/
@Deprecated
void setBasePotionData(@NotNull PotionData data);
/**
* Returns the potion data about the base potion
*
* @return a PotionData object
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #getBasePotionType()} instead.
*/
@NotNull
@Deprecated
PotionData getBasePotionData();
/**
* Sets the underlying potion type
*
* @param type PotionType to set the base potion state to
*/
void setBasePotionType(@NotNull PotionType type);
void setBasePotionType(@Nullable PotionType type);
/**
* Returns the potion type about the base potion
*
* @return a PotionType object
*/
@NotNull
@Nullable
PotionType getBasePotionType();
/**

View File

@@ -0,0 +1,12 @@
package org.bukkit.entity;
import org.bukkit.MinecraftExperimental;
import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Bogged Skeleton.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface Bogged extends AbstractSkeleton {
}

View File

@@ -0,0 +1,13 @@
package org.bukkit.entity;
import org.bukkit.MinecraftExperimental;
import org.jetbrains.annotations.ApiStatus;
/**
* Represents a Wind Charge.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface BreezeWindCharge extends AbstractWindCharge {
}

View File

@@ -292,6 +292,16 @@ public enum EntityType implements Keyed, Translatable {
@MinecraftExperimental
@ApiStatus.Experimental
WIND_CHARGE("wind_charge", WindCharge.class, -1),
@MinecraftExperimental
@ApiStatus.Experimental
BREEZE_WIND_CHARGE("breeze_wind_charge", BreezeWindCharge.class, -1),
ARMADILLO("armadillo", Armadillo.class, -1),
@MinecraftExperimental
@ApiStatus.Experimental
BOGGED("bogged", Bogged.class, -1),
@MinecraftExperimental
@ApiStatus.Experimental
OMINOUS_ITEM_SPAWNER("ominous_item_spawner", OminousItemSpawner.class, -1),
/**
* A fishing line and bobber.
*/

View File

@@ -758,8 +758,10 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* debuffs.
*
* @return the entity category
* @deprecated entity groupings are now managed by tags, not categories
*/
@NotNull
@Deprecated
public EntityCategory getCategory();
/**

View File

@@ -0,0 +1,43 @@
package org.bukkit.entity;
import org.bukkit.MinecraftExperimental;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
/**
* Represents an ominous item spawner.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface OminousItemSpawner extends Entity {
/**
* Gets the item which will be spawned by this spawner.
*
* @return the item
*/
@Nullable
ItemStack getItem();
/**
* Sets the item which will be spawned by this spawner.
*
* @param item the item
*/
void setItem(@Nullable ItemStack item);
/**
* Gets the ticks after which this item will be spawned.
*
* @return total spawn ticks
*/
long getSpawnItemAfterTicks();
/**
* Sets the ticks after which this item will be spawned.
*
* @param ticks total spawn ticks
*/
void setSpawnItemAfterTicks(long ticks);
}

View File

@@ -8,6 +8,7 @@ import java.util.Collection;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import org.bukkit.BanEntry;
import org.bukkit.DyeColor;
import org.bukkit.Effect;
@@ -15,6 +16,7 @@ import org.bukkit.GameMode;
import org.bukkit.Instrument;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Note;
import org.bukkit.OfflinePlayer;
import org.bukkit.Particle;
@@ -165,6 +167,48 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Nullable
public InetSocketAddress getAddress();
/**
* Gets if this connection has been transferred from another server.
*
* @return true if the connection has been transferred
*/
public boolean isTransferred();
/**
* Retrieves a cookie from this player.
*
* @param key the key identifying the cookie cookie
* @return a {@link CompletableFuture} that will be completed when the
* Cookie response is received or otherwise available. If the cookie is not
* set in the client, the {@link CompletableFuture} will complete with a
* null value.
*/
@NotNull
@ApiStatus.Experimental
CompletableFuture<byte[]> retrieveCookie(@NotNull NamespacedKey key);
/**
* Stores a cookie in this player's client.
*
* @param key the key identifying the cookie cookie
* @param value the data to store in the cookie
* @throws IllegalStateException if a cookie cannot be stored at this time
*/
@ApiStatus.Experimental
void storeCookie(@NotNull NamespacedKey key, @NotNull byte[] value);
/**
* Requests this player to connect to a different server specified by host
* and port.
*
* @param host the host of the server to transfer to
* @param port the port of the server to transfer to
* @throws IllegalStateException if a transfer cannot take place at this
* time
*/
@ApiStatus.Experimental
void transfer(@NotNull String host, int port);
/**
* Sends this sender a message raw
*

View File

@@ -62,6 +62,10 @@ public interface Skeleton extends AbstractSkeleton {
/**
* Stray skeleton. Generally found in ice biomes. Shoots tipped arrows.
*/
STRAY;
STRAY,
/**
* Bogged skeleton.
*/
BOGGED;
}
}

View File

@@ -8,11 +8,6 @@ import org.jetbrains.annotations.ApiStatus;
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface WindCharge extends Fireball {
/**
* Immediately explode this WindCharge.
*/
public void explode();
public interface WindCharge extends AbstractWindCharge {
}

View File

@@ -1,6 +1,9 @@
package org.bukkit.entity;
import java.util.Locale;
import org.bukkit.DyeColor;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.NotNull;
/**
@@ -67,4 +70,46 @@ public interface Wolf extends Tameable, Sittable {
* @param interested Whether the wolf is interested
*/
public void setInterested(boolean interested);
/**
* Get the variant of this wolf.
*
* @return wolf variant
*/
@NotNull
Variant getVariant();
/**
* Set the variant of this wolf.
*
* @param variant wolf variant
*/
void setVariant(@NotNull Variant variant);
/**
* Represents the variant of a wolf.
*/
public enum Variant implements Keyed {
PALE,
SPOTTED,
SNOWY,
BLACK,
ASHEN,
RUSTY,
WOODS,
CHESTNUT,
STRIPED;
private final NamespacedKey key;
private Variant() {
this.key = NamespacedKey.minecraft(name().toLowerCase(Locale.ROOT));
}
@NotNull
@Override
public NamespacedKey getKey() {
return key;
}
}
}