Update to Minecraft 1.20

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2023-06-08 01:30:00 +10:00
parent 217583e495
commit 59e77b485a
49 changed files with 316 additions and 631 deletions

View File

@@ -2,9 +2,7 @@ package org.bukkit.block;
import java.util.Locale;
import org.bukkit.Keyed;
import org.bukkit.MinecraftExperimental;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -74,8 +72,6 @@ public enum Biome implements Keyed {
FROZEN_PEAKS,
JAGGED_PEAKS,
STONY_PEAKS,
@MinecraftExperimental
@ApiStatus.Experimental
CHERRY_GROVE,
/**
* Represents a custom Biome

View File

@@ -0,0 +1,28 @@
package org.bukkit.block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.loot.Lootable;
import org.jetbrains.annotations.Nullable;
/**
* Represents a captured state of suspicious sand or gravel.
*/
public interface BrushableBlock extends Lootable, TileState {
/**
* Get the item which will be revealed when the sand is fully brushed away
* and uncovered.
*
* @return the item
*/
@Nullable
public ItemStack getItem();
/**
* Sets the item which will be revealed when the sand is fully brushed away
* and uncovered.
*
* @param item the item
*/
public void setItem(@Nullable ItemStack item);
}

View File

@@ -0,0 +1,7 @@
package org.bukkit.block;
/**
* Represents a captured state of a calibrated sculk sensor
*/
public interface CalibratedSculkSensor extends SculkSensor {
}

View File

@@ -1,16 +1,12 @@
package org.bukkit.block;
import org.bukkit.MinecraftExperimental;
import org.bukkit.inventory.BlockInventoryHolder;
import org.bukkit.inventory.ChiseledBookshelfInventory;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
* Represents a captured state of a chiseled bookshelf.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface ChiseledBookshelf extends TileState, BlockInventoryHolder {
/**

View File

@@ -2,15 +2,12 @@ package org.bukkit.block;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.MinecraftExperimental;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a captured state of a decorated pot.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface DecoratedPot extends TileState {
@@ -21,18 +18,4 @@ public interface DecoratedPot extends TileState {
*/
@NotNull
public List<Material> getShards();
/**
* Add a shard item which will be dropped when this pot is broken.
*
* @param material shard item
*/
public void addShard(@NotNull Material material);
/**
* Set the shards which will be dropped when this pot is broken.
*
* @param shard list of items
*/
public void setShards(@Nullable List<Material> shard);
}

View File

@@ -1,12 +1,7 @@
package org.bukkit.block;
import org.bukkit.MinecraftExperimental;
import org.jetbrains.annotations.ApiStatus;
/**
* Represents a captured state of a hanging sign.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface HangingSign extends Sign {
}

View File

@@ -4,7 +4,6 @@ import org.bukkit.DyeColor;
import org.bukkit.block.sign.Side;
import org.bukkit.block.sign.SignSide;
import org.bukkit.material.Colorable;
import org.jetbrains.annotations.ApiStatus.Experimental;
import org.jetbrains.annotations.NotNull;
/**
@@ -16,8 +15,9 @@ public interface Sign extends TileState, Colorable {
* Gets all the lines of text currently on the {@link Side#FRONT} of this sign.
*
* @return Array of Strings containing each line of text
* @see #getSide(Side)
* @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#getLines()}.
*/
@Deprecated
@NotNull
public String[] getLines();
@@ -29,8 +29,9 @@ public interface Sign extends TileState, Colorable {
* @param index Line number to get the text from, starting at 0
* @return Text on the given line
* @throws IndexOutOfBoundsException Thrown when the line does not exist
* @see #getSide(Side)
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#getLine(int)}.
*/
@Deprecated
@NotNull
public String getLine(int index) throws IndexOutOfBoundsException;
@@ -43,8 +44,9 @@ public interface Sign extends TileState, Colorable {
* @param index Line number to set the text at, starting from 0
* @param line New text to set at the specified index
* @throws IndexOutOfBoundsException If the index is out of the range 0..3
* @see #getSide(Side)
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#setLine(int, String)}.
*/
@Deprecated
public void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException;
/**
@@ -73,31 +75,37 @@ public interface Sign extends TileState, Colorable {
* Gets whether this sign has glowing text. Only affects the {@link Side#FRONT}.
*
* @return if this sign has glowing text
* @see #getSide(Side)
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#isGlowingText()}.
*/
@Deprecated
public boolean isGlowingText();
/**
* Sets whether this sign has glowing text. Only affects the {@link Side#FRONT}.
*
* @param glowing if this sign has glowing text
* @see #getSide(Side)
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#setGlowingText(boolean)}.
*/
@Deprecated
public void setGlowingText(boolean glowing);
/**
* {@inheritDoc}
*
* @see #getSide(Side)
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#getColor()}.
*/
@NotNull
@Override
@Deprecated
public DyeColor getColor();
/**
* {@inheritDoc}
*
* @see #getSide(Side)
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#setColor(org.bukkit.DyeColor)}.
*/
@Override
@Deprecated
public void setColor(@NotNull DyeColor color);
/**
@@ -106,7 +114,6 @@ public interface Sign extends TileState, Colorable {
* @param side the side of the sign
* @return the selected side of the sign
*/
@Experimental
@NotNull
public SignSide getSide(@NotNull Side side);
}

View File

@@ -1,13 +1,11 @@
package org.bukkit.block;
import org.bukkit.Material;
import org.bukkit.MinecraftExperimental;
import org.bukkit.NamespacedKey;
import org.bukkit.OfflinePlayer;
import org.bukkit.SkullType;
import org.bukkit.block.data.BlockData;
import org.bukkit.profile.PlayerProfile;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -96,8 +94,6 @@ public interface Skull extends TileState {
*
* @return the key of the sound, or null
*/
@MinecraftExperimental
@ApiStatus.Experimental
@Nullable
public NamespacedKey getNoteBlockSound();
@@ -110,8 +106,6 @@ public interface Skull extends TileState {
* @param noteBlockSound the key of the sound to be played, or null
*
*/
@MinecraftExperimental
@ApiStatus.Experimental
public void setNoteBlockSound(@Nullable NamespacedKey noteBlockSound);
/**

View File

@@ -1,32 +1,10 @@
package org.bukkit.block;
import org.bukkit.MinecraftExperimental;
import org.bukkit.inventory.ItemStack;
import org.bukkit.loot.Lootable;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
/**
* Represents a captured state of suspicious sand.
*
* @see BrushableBlock
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface SuspiciousSand extends Lootable, TileState {
/**
* Get the item which will be revealed when the sand is fully brushed away
* and uncovered.
*
* @return the item
*/
@Nullable
public ItemStack getItem();
/**
* Sets the item which will be revealed when the sand is fully brushed away
* and uncovered.
*
* @param item the item
*/
public void setItem(@Nullable ItemStack item);
@Deprecated
public interface SuspiciousSand extends BrushableBlock {
}

View File

@@ -1,15 +1,9 @@
package org.bukkit.block.data.type;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.data.BlockData;
import org.jetbrains.annotations.ApiStatus;
package org.bukkit.block.data;
/**
* 'dusted' represents how far uncovered by brush the block is.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface SuspiciousSand extends BlockData {
public interface Brushable extends BlockData {
/**
* Gets the value of the 'dusted' property.

View File

@@ -0,0 +1,28 @@
package org.bukkit.block.data;
/**
* 'hatch' is the number of entities which may hatch from these eggs.
*/
public interface Hatchable extends BlockData {
/**
* Gets the value of the 'hatch' property.
*
* @return the 'hatch' value
*/
int getHatch();
/**
* Sets the value of the 'hatch' property.
*
* @param hatch the new 'hatch' value
*/
void setHatch(int hatch);
/**
* Gets the maximum allowed value of the 'hatch' property.
*
* @return the maximum 'hatch' value
*/
int getMaximumHatch();
}

View File

@@ -0,0 +1,5 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.Directional;
public interface CalibratedSculkSensor extends Directional, SculkSensor { }

View File

@@ -1,9 +1,7 @@
package org.bukkit.block.data.type;
import java.util.Set;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.data.Directional;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -13,8 +11,6 @@ import org.jetbrains.annotations.NotNull;
* <br>
* Block may have 0, 1... {@link #getMaximumOccupiedSlots()}-1 occupied slots.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface ChiseledBookshelf extends Directional {
/**

View File

@@ -1,11 +1,7 @@
package org.bukkit.block.data.type;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Waterlogged;
import org.jetbrains.annotations.ApiStatus;
@MinecraftExperimental
@ApiStatus.Experimental
public interface DecoratedPot extends Directional, Waterlogged {
}

View File

@@ -1,12 +1,8 @@
package org.bukkit.block.data.type;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.data.Attachable;
import org.bukkit.block.data.Rotatable;
import org.bukkit.block.data.Waterlogged;
import org.jetbrains.annotations.ApiStatus;
@MinecraftExperimental
@ApiStatus.Experimental
public interface HangingSign extends Attachable, Rotatable, Waterlogged {
}

View File

@@ -1,14 +1,10 @@
package org.bukkit.block.data.type;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.data.Directional;
import org.jetbrains.annotations.ApiStatus;
/**
* 'flower_amount' represents the number of petals.
*/
@MinecraftExperimental
@ApiStatus.Experimental
public interface PinkPetals extends Directional {
/**

View File

@@ -0,0 +1,7 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.Ageable;
import org.bukkit.block.data.Bisected;
public interface PitcherCrop extends Ageable, Bisected {
}

View File

@@ -1,13 +1,11 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Hatchable;
/**
* 'hatch' is the number of turtles which may hatch from these eggs.
* <br>
* 'eggs' is the number of eggs which appear in this block.
*/
public interface TurtleEgg extends BlockData {
public interface TurtleEgg extends Hatchable {
/**
* Gets the value of the 'eggs' property.
@@ -36,25 +34,4 @@ public interface TurtleEgg extends BlockData {
* @return the maximum 'eggs' value
*/
int getMaximumEggs();
/**
* Gets the value of the 'hatch' property.
*
* @return the 'hatch' value
*/
int getHatch();
/**
* Sets the value of the 'hatch' property.
*
* @param hatch the new 'hatch' value
*/
void setHatch(int hatch);
/**
* Gets the maximum allowed value of the 'hatch' property.
*
* @return the maximum 'hatch' value
*/
int getMaximumHatch();
}

View File

@@ -1,11 +1,7 @@
package org.bukkit.block.data.type;
import org.bukkit.MinecraftExperimental;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Waterlogged;
import org.jetbrains.annotations.ApiStatus;
@MinecraftExperimental
@ApiStatus.Experimental
public interface WallHangingSign extends Directional, Waterlogged {
}

View File

@@ -6,4 +6,5 @@ package org.bukkit.block.sign;
public enum Side {
FRONT,
BACK;
}

View File

@@ -1,13 +1,11 @@
package org.bukkit.block.sign;
import org.bukkit.material.Colorable;
import org.jetbrains.annotations.ApiStatus.Experimental;
import org.jetbrains.annotations.NotNull;
/**
* Represents a side of a sign.
*/
@Experimental
public interface SignSide extends Colorable {
/**