Update to Minecraft 1.19.3

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2022-12-08 03:13:00 +11:00
parent 6ea8b24628
commit 7a87d86241
30 changed files with 831 additions and 40 deletions

View File

@ -5,7 +5,7 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version> <version>1.19.3-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Bukkit</name> <name>Bukkit</name>
@ -35,14 +35,14 @@
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>31.0.1-jre</version> <version>31.1-jre</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- bundled with Minecraft, should be kept in sync --> <!-- bundled with Minecraft, should be kept in sync -->
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>2.8.9</version> <version>2.10</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -1013,7 +1013,9 @@ public final class Bukkit {
* message to the client when the player sends a message * message to the client when the player sends a message
* *
* @return true if the server should send a preview, false otherwise * @return true if the server should send a preview, false otherwise
* @deprecated chat previews have been removed
*/ */
@Deprecated
public static boolean shouldSendChatPreviews() { public static boolean shouldSendChatPreviews() {
return server.shouldSendChatPreviews(); return server.shouldSendChatPreviews();
} }

View File

@ -177,6 +177,31 @@ public final class GameRule<T> {
* Whether mobs will target all player entities once angered. * Whether mobs will target all player entities once angered.
*/ */
public static final GameRule<Boolean> UNIVERSAL_ANGER = new GameRule<>("universalAnger", Boolean.class); public static final GameRule<Boolean> UNIVERSAL_ANGER = new GameRule<>("universalAnger", Boolean.class);
/**
* Whether block explosions will destroy dropped items.
*/
public static final GameRule<Boolean> BLOCK_EXPLOSION_DROP_DECAY = new GameRule<>("blockExplosionDropDecay", Boolean.class);
/**
* * Whether mob explosions will destroy dropped items.
*/
public static final GameRule<Boolean> MOB_EXPLOSION_DROP_DECAY = new GameRule<>("mobExplosionDropDecay", Boolean.class);
/**
* Whether tnt explosions will destroy dropped items.
*/
public static final GameRule<Boolean> TNT_EXPLOSION_DROP_DECAY = new GameRule<>("tntExplosionDropDecay", Boolean.class);
/**
* Whether water blocks can convert into water source blocks.
*/
public static final GameRule<Boolean> WATER_SOURCE_CONVERSION = new GameRule<>("waterSourceConversion", Boolean.class);
/**
* Whether lava blocks can convert into lava source blocks.
*/
public static final GameRule<Boolean> LAVA_SOURCE_CONVERSION = new GameRule<>("lavaSourceConversion", Boolean.class);
/**
* Whether global level events such as ender dragon, wither, and completed
* end portal effects will propagate across the entire server.
*/
public static final GameRule<Boolean> GLOBAL_SOUND_EVENTS = new GameRule<>("globalSoundEvents", Boolean.class);
// Numerical rules // Numerical rules
/** /**
@ -215,6 +240,7 @@ public final class GameRule<T> {
* advance. * advance.
*/ */
public static final GameRule<Integer> PLAYERS_SLEEPING_PERCENTAGE = new GameRule<>("playersSleepingPercentage", Integer.class); public static final GameRule<Integer> PLAYERS_SLEEPING_PERCENTAGE = new GameRule<>("playersSleepingPercentage", Integer.class);
public static final GameRule<Integer> SNOW_ACCUMULATION_HEIGHT = new GameRule<>("snowAccumulationHeight", Integer.class);
// All GameRules instantiated above this for organizational purposes // All GameRules instantiated above this for organizational purposes
private final String name; private final String name;

File diff suppressed because it is too large Load Diff

View File

@ -859,7 +859,9 @@ public interface Server extends PluginMessageRecipient {
* message to the client when the player types a message * message to the client when the player types a message
* *
* @return true if the server should send a preview, false otherwise * @return true if the server should send a preview, false otherwise
* @deprecated chat previews have been removed
*/ */
@Deprecated
public boolean shouldSendChatPreviews(); public boolean shouldSendChatPreviews();
/** /**

View File

@ -11,5 +11,6 @@ public enum SkullType {
ZOMBIE, ZOMBIE,
PLAYER, PLAYER,
CREEPER, CREEPER,
DRAGON; DRAGON,
PIGLIN;
} }

View File

@ -76,6 +76,26 @@ public enum Sound implements Keyed {
BLOCK_BAMBOO_SAPLING_HIT("block.bamboo_sapling.hit"), BLOCK_BAMBOO_SAPLING_HIT("block.bamboo_sapling.hit"),
BLOCK_BAMBOO_SAPLING_PLACE("block.bamboo_sapling.place"), BLOCK_BAMBOO_SAPLING_PLACE("block.bamboo_sapling.place"),
BLOCK_BAMBOO_STEP("block.bamboo.step"), BLOCK_BAMBOO_STEP("block.bamboo.step"),
BLOCK_BAMBOO_WOOD_BREAK("block.bamboo_wood.break"),
BLOCK_BAMBOO_WOOD_BUTTON_CLICK_OFF("block.bamboo_wood_button.click_off"),
BLOCK_BAMBOO_WOOD_BUTTON_CLICK_ON("block.bamboo_wood_button.click_on"),
BLOCK_BAMBOO_WOOD_DOOR_CLOSE("block.bamboo_wood_door.close"),
BLOCK_BAMBOO_WOOD_DOOR_OPEN("block.bamboo_wood_door.open"),
BLOCK_BAMBOO_WOOD_FALL("block.bamboo_wood.fall"),
BLOCK_BAMBOO_WOOD_FENCE_GATE_CLOSE("block.bamboo_wood_fence_gate.close"),
BLOCK_BAMBOO_WOOD_FENCE_GATE_OPEN("block.bamboo_wood_fence_gate.open"),
BLOCK_BAMBOO_WOOD_HANGING_SIGN_BREAK("block.bamboo_wood_hanging_sign.break"),
BLOCK_BAMBOO_WOOD_HANGING_SIGN_FALL("block.bamboo_wood_hanging_sign.fall"),
BLOCK_BAMBOO_WOOD_HANGING_SIGN_HIT("block.bamboo_wood_hanging_sign.hit"),
BLOCK_BAMBOO_WOOD_HANGING_SIGN_PLACE("block.bamboo_wood_hanging_sign.place"),
BLOCK_BAMBOO_WOOD_HANGING_SIGN_STEP("block.bamboo_wood_hanging_sign.step"),
BLOCK_BAMBOO_WOOD_HIT("block.bamboo_wood.hit"),
BLOCK_BAMBOO_WOOD_PLACE("block.bamboo_wood.place"),
BLOCK_BAMBOO_WOOD_PRESSURE_PLATE_CLICK_OFF("block.bamboo_wood_pressure_plate.click_off"),
BLOCK_BAMBOO_WOOD_PRESSURE_PLATE_CLICK_ON("block.bamboo_wood_pressure_plate.click_on"),
BLOCK_BAMBOO_WOOD_STEP("block.bamboo_wood.step"),
BLOCK_BAMBOO_WOOD_TRAPDOOR_CLOSE("block.bamboo_wood_trapdoor.close"),
BLOCK_BAMBOO_WOOD_TRAPDOOR_OPEN("block.bamboo_wood_trapdoor.open"),
BLOCK_BARREL_CLOSE("block.barrel.close"), BLOCK_BARREL_CLOSE("block.barrel.close"),
BLOCK_BARREL_OPEN("block.barrel.open"), BLOCK_BARREL_OPEN("block.barrel.open"),
BLOCK_BASALT_BREAK("block.basalt.break"), BLOCK_BASALT_BREAK("block.basalt.break"),
@ -141,6 +161,15 @@ public enum Sound implements Keyed {
BLOCK_CHEST_CLOSE("block.chest.close"), BLOCK_CHEST_CLOSE("block.chest.close"),
BLOCK_CHEST_LOCKED("block.chest.locked"), BLOCK_CHEST_LOCKED("block.chest.locked"),
BLOCK_CHEST_OPEN("block.chest.open"), BLOCK_CHEST_OPEN("block.chest.open"),
BLOCK_CHISELED_BOOKSHELF_BREAK("block.chiseled_bookshelf.break"),
BLOCK_CHISELED_BOOKSHELF_FALL("block.chiseled_bookshelf.fall"),
BLOCK_CHISELED_BOOKSHELF_HIT("block.chiseled_bookshelf.hit"),
BLOCK_CHISELED_BOOKSHELF_INSERT("block.chiseled_bookshelf.insert"),
BLOCK_CHISELED_BOOKSHELF_INSERT_ENCHANTED("block.chiseled_bookshelf.insert.enchanted"),
BLOCK_CHISELED_BOOKSHELF_PICKUP("block.chiseled_bookshelf.pickup"),
BLOCK_CHISELED_BOOKSHELF_PICKUP_ENCHANTED("block.chiseled_bookshelf.pickup.enchanted"),
BLOCK_CHISELED_BOOKSHELF_PLACE("block.chiseled_bookshelf.place"),
BLOCK_CHISELED_BOOKSHELF_STEP("block.chiseled_bookshelf.step"),
BLOCK_CHORUS_FLOWER_DEATH("block.chorus_flower.death"), BLOCK_CHORUS_FLOWER_DEATH("block.chorus_flower.death"),
BLOCK_CHORUS_FLOWER_GROW("block.chorus_flower.grow"), BLOCK_CHORUS_FLOWER_GROW("block.chorus_flower.grow"),
BLOCK_COMPARATOR_CLICK("block.comparator.click"), BLOCK_COMPARATOR_CLICK("block.comparator.click"),
@ -246,6 +275,11 @@ public enum Sound implements Keyed {
BLOCK_HANGING_ROOTS_HIT("block.hanging_roots.hit"), BLOCK_HANGING_ROOTS_HIT("block.hanging_roots.hit"),
BLOCK_HANGING_ROOTS_PLACE("block.hanging_roots.place"), BLOCK_HANGING_ROOTS_PLACE("block.hanging_roots.place"),
BLOCK_HANGING_ROOTS_STEP("block.hanging_roots.step"), BLOCK_HANGING_ROOTS_STEP("block.hanging_roots.step"),
BLOCK_HANGING_SIGN_BREAK("block.hanging_sign.break"),
BLOCK_HANGING_SIGN_FALL("block.hanging_sign.fall"),
BLOCK_HANGING_SIGN_HIT("block.hanging_sign.hit"),
BLOCK_HANGING_SIGN_PLACE("block.hanging_sign.place"),
BLOCK_HANGING_SIGN_STEP("block.hanging_sign.step"),
BLOCK_HONEY_BLOCK_BREAK("block.honey_block.break"), BLOCK_HONEY_BLOCK_BREAK("block.honey_block.break"),
BLOCK_HONEY_BLOCK_FALL("block.honey_block.fall"), BLOCK_HONEY_BLOCK_FALL("block.honey_block.fall"),
BLOCK_HONEY_BLOCK_HIT("block.honey_block.hit"), BLOCK_HONEY_BLOCK_HIT("block.honey_block.hit"),
@ -348,6 +382,26 @@ public enum Sound implements Keyed {
BLOCK_NETHER_SPROUTS_PLACE("block.nether_sprouts.place"), BLOCK_NETHER_SPROUTS_PLACE("block.nether_sprouts.place"),
BLOCK_NETHER_SPROUTS_STEP("block.nether_sprouts.step"), BLOCK_NETHER_SPROUTS_STEP("block.nether_sprouts.step"),
BLOCK_NETHER_WART_BREAK("block.nether_wart.break"), BLOCK_NETHER_WART_BREAK("block.nether_wart.break"),
BLOCK_NETHER_WOOD_BREAK("block.nether_wood.break"),
BLOCK_NETHER_WOOD_BUTTON_CLICK_OFF("block.nether_wood_button.click_off"),
BLOCK_NETHER_WOOD_BUTTON_CLICK_ON("block.nether_wood_button.click_on"),
BLOCK_NETHER_WOOD_DOOR_CLOSE("block.nether_wood_door.close"),
BLOCK_NETHER_WOOD_DOOR_OPEN("block.nether_wood_door.open"),
BLOCK_NETHER_WOOD_FALL("block.nether_wood.fall"),
BLOCK_NETHER_WOOD_FENCE_GATE_CLOSE("block.nether_wood_fence_gate.close"),
BLOCK_NETHER_WOOD_FENCE_GATE_OPEN("block.nether_wood_fence_gate.open"),
BLOCK_NETHER_WOOD_HANGING_SIGN_BREAK("block.nether_wood_hanging_sign.break"),
BLOCK_NETHER_WOOD_HANGING_SIGN_FALL("block.nether_wood_hanging_sign.fall"),
BLOCK_NETHER_WOOD_HANGING_SIGN_HIT("block.nether_wood_hanging_sign.hit"),
BLOCK_NETHER_WOOD_HANGING_SIGN_PLACE("block.nether_wood_hanging_sign.place"),
BLOCK_NETHER_WOOD_HANGING_SIGN_STEP("block.nether_wood_hanging_sign.step"),
BLOCK_NETHER_WOOD_HIT("block.nether_wood.hit"),
BLOCK_NETHER_WOOD_PLACE("block.nether_wood.place"),
BLOCK_NETHER_WOOD_PRESSURE_PLATE_CLICK_OFF("block.nether_wood_pressure_plate.click_off"),
BLOCK_NETHER_WOOD_PRESSURE_PLATE_CLICK_ON("block.nether_wood_pressure_plate.click_on"),
BLOCK_NETHER_WOOD_STEP("block.nether_wood.step"),
BLOCK_NETHER_WOOD_TRAPDOOR_CLOSE("block.nether_wood_trapdoor.close"),
BLOCK_NETHER_WOOD_TRAPDOOR_OPEN("block.nether_wood_trapdoor.open"),
BLOCK_NOTE_BLOCK_BANJO("block.note_block.banjo"), BLOCK_NOTE_BLOCK_BANJO("block.note_block.banjo"),
BLOCK_NOTE_BLOCK_BASEDRUM("block.note_block.basedrum"), BLOCK_NOTE_BLOCK_BASEDRUM("block.note_block.basedrum"),
BLOCK_NOTE_BLOCK_BASS("block.note_block.bass"), BLOCK_NOTE_BLOCK_BASS("block.note_block.bass"),
@ -360,6 +414,12 @@ public enum Sound implements Keyed {
BLOCK_NOTE_BLOCK_GUITAR("block.note_block.guitar"), BLOCK_NOTE_BLOCK_GUITAR("block.note_block.guitar"),
BLOCK_NOTE_BLOCK_HARP("block.note_block.harp"), BLOCK_NOTE_BLOCK_HARP("block.note_block.harp"),
BLOCK_NOTE_BLOCK_HAT("block.note_block.hat"), BLOCK_NOTE_BLOCK_HAT("block.note_block.hat"),
BLOCK_NOTE_BLOCK_IMITATE_CREEPER("block.note_block.imitate.creeper"),
BLOCK_NOTE_BLOCK_IMITATE_ENDER_DRAGON("block.note_block.imitate.ender_dragon"),
BLOCK_NOTE_BLOCK_IMITATE_PIGLIN("block.note_block.imitate.piglin"),
BLOCK_NOTE_BLOCK_IMITATE_SKELETON("block.note_block.imitate.skeleton"),
BLOCK_NOTE_BLOCK_IMITATE_WITHER_SKELETON("block.note_block.imitate.wither_skeleton"),
BLOCK_NOTE_BLOCK_IMITATE_ZOMBIE("block.note_block.imitate.zombie"),
BLOCK_NOTE_BLOCK_IRON_XYLOPHONE("block.note_block.iron_xylophone"), BLOCK_NOTE_BLOCK_IRON_XYLOPHONE("block.note_block.iron_xylophone"),
BLOCK_NOTE_BLOCK_PLING("block.note_block.pling"), BLOCK_NOTE_BLOCK_PLING("block.note_block.pling"),
BLOCK_NOTE_BLOCK_SNARE("block.note_block.snare"), BLOCK_NOTE_BLOCK_SNARE("block.note_block.snare"),
@ -602,6 +662,17 @@ public enum Sound implements Keyed {
ENTITY_BLAZE_SHOOT("entity.blaze.shoot"), ENTITY_BLAZE_SHOOT("entity.blaze.shoot"),
ENTITY_BOAT_PADDLE_LAND("entity.boat.paddle_land"), ENTITY_BOAT_PADDLE_LAND("entity.boat.paddle_land"),
ENTITY_BOAT_PADDLE_WATER("entity.boat.paddle_water"), ENTITY_BOAT_PADDLE_WATER("entity.boat.paddle_water"),
ENTITY_CAMEL_AMBIENT("entity.camel.ambient"),
ENTITY_CAMEL_DASH("entity.camel.dash"),
ENTITY_CAMEL_DASH_READY("entity.camel.dash_ready"),
ENTITY_CAMEL_DEATH("entity.camel.death"),
ENTITY_CAMEL_EAT("entity.camel.eat"),
ENTITY_CAMEL_HURT("entity.camel.hurt"),
ENTITY_CAMEL_SADDLE("entity.camel.saddle"),
ENTITY_CAMEL_SIT("entity.camel.sit"),
ENTITY_CAMEL_STAND("entity.camel.stand"),
ENTITY_CAMEL_STEP("entity.camel.step"),
ENTITY_CAMEL_STEP_SAND("entity.camel.step_sand"),
ENTITY_CAT_AMBIENT("entity.cat.ambient"), ENTITY_CAT_AMBIENT("entity.cat.ambient"),
ENTITY_CAT_BEG_FOR_FOOD("entity.cat.beg_for_food"), ENTITY_CAT_BEG_FOR_FOOD("entity.cat.beg_for_food"),
ENTITY_CAT_DEATH("entity.cat.death"), ENTITY_CAT_DEATH("entity.cat.death"),

View File

@ -95,11 +95,6 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla block tag representing all log and bark variants that burn. * Vanilla block tag representing all log and bark variants that burn.
*/ */
Tag<Material> LOGS_THAT_BURN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("logs_that_burn"), Material.class); Tag<Material> LOGS_THAT_BURN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("logs_that_burn"), Material.class);
/**
* Vanilla block tag representing all log bark variants that appear
* naturally in the overworld.
*/
Tag<Material> OVERWORLD_NATURAL_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("overworld_natural_logs"), Material.class);
/** /**
* Vanilla block tag representing all log and bark variants. * Vanilla block tag representing all log and bark variants.
*/ */
@ -140,6 +135,10 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla block tag representing all warped stems. * Vanilla block tag representing all warped stems.
*/ */
Tag<Material> WARPED_STEMS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("warped_stems"), Material.class); Tag<Material> WARPED_STEMS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("warped_stems"), Material.class);
/**
* Vanilla block tag representing all bamboo blocks.
*/
Tag<Material> BAMBOO_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("bamboo_blocks"), Material.class);
/** /**
* Vanilla block tag representing all banner blocks. * Vanilla block tag representing all banner blocks.
*/ */
@ -237,10 +236,6 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla block tag representing all copper ores. * Vanilla block tag representing all copper ores.
*/ */
Tag<Material> COPPER_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("copper_ores"), Material.class); Tag<Material> COPPER_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("copper_ores"), Material.class);
/**
* Vanilla block tag representing all non flammable wood.
*/
Tag<Material> NON_FLAMMABLE_WOOD = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("non_flammable_wood"), Material.class);
/** /**
* Vanilla block tag representing all candles. * Vanilla block tag representing all candles.
*/ */
@ -307,9 +302,25 @@ public interface Tag<T extends Keyed> extends Keyed {
*/ */
Tag<Material> WALL_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wall_signs"), Material.class); Tag<Material> WALL_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wall_signs"), Material.class);
/** /**
* Vanilla block tag representing all signs. * Vanilla block tag representing all regular signs.
*/ */
Tag<Material> SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("signs"), Material.class); Tag<Material> SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("signs"), Material.class);
/**
* Vanilla block tag representing all ceiling signs.
*/
Tag<Material> CEILING_HANGING_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("ceiling_hanging_signs"), Material.class);
/**
* Vanilla block tag representing all wall hanging signs.
*/
Tag<Material> WALL_HANGING_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wall_hanging_signs"), Material.class);
/**
* Vanilla block tag representing all hanging signs.
*/
Tag<Material> ALL_HANGING_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("all_hanging_signs"), Material.class);
/**
* Vanilla block tag representing all signs, regardless of type.
*/
Tag<Material> ALL_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("all_signs"), Material.class);
/** /**
* Vanilla block tag representing all blocks immune to dragons. * Vanilla block tag representing all blocks immune to dragons.
*/ */
@ -661,6 +672,10 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla block tag representing blocks which snow can survive on. * Vanilla block tag representing blocks which snow can survive on.
*/ */
Tag<Material> SNOW_LAYER_CAN_SURVIVE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snow_layer_can_survive_on"), Material.class); Tag<Material> SNOW_LAYER_CAN_SURVIVE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snow_layer_can_survive_on"), Material.class);
/**
* Vanilla block tag representing blocks which cannot be dismounted into.
*/
Tag<Material> INVALID_SPAWN_INSIDE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("invalid_spawn_inside"), Material.class);
/** /**
* Key for the built in item registry. * Key for the built in item registry.
*/ */
@ -717,6 +732,10 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla item tag representing all books that may be placed on lecterns. * Vanilla item tag representing all books that may be placed on lecterns.
*/ */
Tag<Material> ITEMS_LECTERN_BOOKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("lectern_books"), Material.class); Tag<Material> ITEMS_LECTERN_BOOKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("lectern_books"), Material.class);
/**
* Vanilla item tag representing all books that may be placed on bookshelves.
*/
Tag<Material> ITEMS_BOOKSHELF_BOOKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("bookshelf_books"), Material.class);
/** /**
* Vanilla item tag representing all items that may be placed in beacons. * Vanilla item tag representing all items that may be placed in beacons.
*/ */
@ -733,6 +752,15 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla item tag representing all compasses. * Vanilla item tag representing all compasses.
*/ */
Tag<Material> ITEMS_COMPASSES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("compasses"), Material.class); Tag<Material> ITEMS_COMPASSES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("compasses"), Material.class);
/**
* Vanilla item tag representing all hanging signs.
*/
Tag<Material> ITEMS_HANGING_SIGNS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("hanging_signs"), Material.class);
/**
* Vanilla item tag representing all items which will ignite creepers when
* interacted with.
*/
Tag<Material> ITEMS_CREEPER_IGNITERS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("creeper_igniters"), Material.class);
/** /**
* Vanilla item tag representing all items that confer freeze immunity on * Vanilla item tag representing all items that confer freeze immunity on
* the wearer. * the wearer.

View File

@ -0,0 +1,40 @@
package org.bukkit.block;
import org.bukkit.inventory.BlockInventoryHolder;
import org.bukkit.inventory.ChiseledBookshelfInventory;
import org.jetbrains.annotations.NotNull;
/**
* Represents a captured state of a chiseled bookshelf.
*/
public interface ChiseledBookshelf extends TileState, BlockInventoryHolder {
/**
* Gets the last interacted inventory slot.
*
* @return the last interacted slot
*/
int getLastInteractedSlot();
/**
* Sets the last interacted inventory slot.
*
* @param lastInteractedSlot the new last interacted slot
*/
void setLastInteractedSlot(int lastInteractedSlot);
/**
* @return inventory
* @see Container#getInventory()
*/
@NotNull
@Override
ChiseledBookshelfInventory getInventory();
/**
* @return snapshot inventory
* @see Container#getSnapshotInventory()
*/
@NotNull
ChiseledBookshelfInventory getSnapshotInventory();
}

View File

@ -0,0 +1,7 @@
package org.bukkit.block;
/**
* Represents a captured state of a hanging sign.
*/
public interface HangingSign extends Sign {
}

View File

@ -0,0 +1,46 @@
package org.bukkit.block.data.type;
import java.util.Set;
import org.bukkit.block.data.Directional;
import org.jetbrains.annotations.NotNull;
/**
* Interface to the 'slot_0_occupied', 'slow_1_occupied' ... 'slot_5_occupied'
* flags on a bookshelf which indicate which slots are occupied rendered on the
* outside.
* <br>
* Block may have 0, 1... {@link #getMaximumOccupiedSlots()}-1 occupied slots.
*/
public interface ChiseledBookshelf extends Directional {
/**
* Checks if the following slot is occupied.
*
* @param slot to check
* @return if slot is occupied
*/
boolean isSlotOccupied(int slot);
/**
* Sets whether the following slot is occupied.
*
* @param slot to set
* @param occupied book
*/
void setSlotOccupied(int slot, boolean occupied);
/**
* Get the indexes of all the occupied slots present on this block.
*
* @return set of all occupied slots
*/
@NotNull
Set<Integer> getOccupiedSlots();
/**
* Get the maximum amount of slots on this block.
*
* @return maximum occupied slots count
*/
int getMaximumOccupiedSlots();
}

View File

@ -0,0 +1,8 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.Attachable;
import org.bukkit.block.data.Rotatable;
import org.bukkit.block.data.Waterlogged;
public interface HangingSign extends Attachable, Rotatable, Waterlogged {
}

View File

@ -0,0 +1,7 @@
package org.bukkit.block.data.type;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Waterlogged;
public interface WallHangingSign extends Directional, Waterlogged {
}

View File

@ -192,6 +192,7 @@ public enum EnchantmentTarget {
|| item.equals(Material.SKELETON_SKULL) || item.equals(Material.SKELETON_SKULL)
|| item.equals(Material.WITHER_SKELETON_SKULL) || item.equals(Material.WITHER_SKELETON_SKULL)
|| item.equals(Material.ZOMBIE_HEAD) || item.equals(Material.ZOMBIE_HEAD)
|| item.equals(Material.PIGLIN_HEAD)
|| item.equals(Material.PLAYER_HEAD) || item.equals(Material.PLAYER_HEAD)
|| item.equals(Material.CREEPER_HEAD) || item.equals(Material.CREEPER_HEAD)
|| item.equals(Material.DRAGON_HEAD); || item.equals(Material.DRAGON_HEAD);

View File

@ -143,6 +143,7 @@ public interface Boat extends Vehicle {
ACACIA(Material.ACACIA_PLANKS), ACACIA(Material.ACACIA_PLANKS),
DARK_OAK(Material.DARK_OAK_PLANKS), DARK_OAK(Material.DARK_OAK_PLANKS),
MANGROVE(Material.MANGROVE_PLANKS), MANGROVE(Material.MANGROVE_PLANKS),
BAMBOO(Material.BAMBOO_PLANKS),
; ;
private final Material materialBlock; private final Material materialBlock;

View File

@ -0,0 +1,21 @@
package org.bukkit.entity;
/**
* Represents a Camel.
*/
public interface Camel extends AbstractHorse {
/**
* Gets whether this camel is dashing (sprinting).
*
* @return dashing status
*/
boolean isDashing();
/**
* Sets whether this camel is dashing (sprinting).
*
* @param dashing new dashing status
*/
void setDashing(boolean dashing);
}

View File

@ -276,6 +276,7 @@ public enum EntityType implements Keyed {
FROG("frog", Frog.class, -1), FROG("frog", Frog.class, -1),
TADPOLE("tadpole", Tadpole.class, -1), TADPOLE("tadpole", Tadpole.class, -1),
WARDEN("warden", Warden.class, -1), WARDEN("warden", Warden.class, -1),
CAMEL("camel", Camel.class, -1),
/** /**
* A fishing line and bobber. * A fishing line and bobber.
*/ */

View File

@ -36,7 +36,11 @@ public interface Horse extends AbstractHorse {
/** /**
* Not really a horse :) * Not really a horse :)
*/ */
LLAMA LLAMA,
/**
* Also not really a horse :)
*/
CAMEL,
; ;
} }

View File

@ -46,6 +46,10 @@ public enum Pose {
* Entity is using its tongue. * Entity is using its tongue.
*/ */
USING_TONGUE, USING_TONGUE,
/**
* Entity is sitting.
*/
SITTING,
/** /**
* Entity is roaring. * Entity is roaring.
*/ */

View File

@ -133,7 +133,11 @@ public enum InventoryType {
/** /**
* Pseudo composter inventory with 0 or 1 slots of undefined type. * Pseudo composter inventory with 0 or 1 slots of undefined type.
*/ */
COMPOSTER(1, "Composter") COMPOSTER(1, "Composter"),
/**
* Pseudo chiseled bookshelf inventory, with 6 slots of undefined type.
*/
CHISELED_BOOKSHELF(6, "Chiseled Bookshelf"),
; ;
private final int size; private final int size;

View File

@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
* of the corresponding {@link AsyncPlayerChatEvent} <b>must</b> be formatted in * of the corresponding {@link AsyncPlayerChatEvent} <b>must</b> be formatted in
* the same way. * the same way.
* *
* @deprecated draft API * @deprecated chat previews have been removed
*/ */
@Deprecated @Deprecated
@Warning(false) @Warning(false)

View File

@ -22,32 +22,20 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
private final String hostname; private final String hostname;
private final InetAddress address; private final InetAddress address;
private final boolean shouldSendChatPreviews;
private String motd; private String motd;
private final int numPlayers; private final int numPlayers;
private int maxPlayers; private int maxPlayers;
@Deprecated public ServerListPingEvent(@NotNull final String hostname, @NotNull final InetAddress address, @NotNull final String motd, final int numPlayers, final int maxPlayers) {
public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final boolean shouldSendChatPreviews, final int numPlayers, final int maxPlayers) {
this("", address, motd, shouldSendChatPreviews, numPlayers, maxPlayers);
}
public ServerListPingEvent(@NotNull final String hostname, @NotNull final InetAddress address, @NotNull final String motd, final boolean shouldSendChatPreviews, final int numPlayers, final int maxPlayers) {
super(true); super(true);
Preconditions.checkArgument(numPlayers >= 0, "Cannot have negative number of players online", numPlayers); Preconditions.checkArgument(numPlayers >= 0, "Cannot have negative number of players online", numPlayers);
this.hostname = hostname; this.hostname = hostname;
this.address = address; this.address = address;
this.motd = motd; this.motd = motd;
this.shouldSendChatPreviews = shouldSendChatPreviews;
this.numPlayers = numPlayers; this.numPlayers = numPlayers;
this.maxPlayers = maxPlayers; this.maxPlayers = maxPlayers;
} }
@Deprecated
protected ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, boolean shouldSendChatPreviews, final int maxPlayers) {
this("", address, motd, shouldSendChatPreviews, maxPlayers);
}
/** /**
* This constructor is intended for implementations that provide the * This constructor is intended for implementations that provide the
* {@link #iterator()} method, thus provided the {@link #getNumPlayers()} * {@link #iterator()} method, thus provided the {@link #getNumPlayers()}
@ -56,16 +44,14 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
* @param hostname The hostname that was used to connect to the server * @param hostname The hostname that was used to connect to the server
* @param address the address of the pinger * @param address the address of the pinger
* @param motd the message of the day * @param motd the message of the day
* @param shouldSendChatPreviews if the server should send chat previews
* @param maxPlayers the max number of players * @param maxPlayers the max number of players
*/ */
protected ServerListPingEvent(@NotNull final String hostname, @NotNull final InetAddress address, @NotNull final String motd, boolean shouldSendChatPreviews, final int maxPlayers) { protected ServerListPingEvent(@NotNull final String hostname, @NotNull final InetAddress address, @NotNull final String motd, final int maxPlayers) {
super(true); super(true);
this.numPlayers = MAGIC_PLAYER_COUNT; this.numPlayers = MAGIC_PLAYER_COUNT;
this.hostname = hostname; this.hostname = hostname;
this.address = address; this.address = address;
this.motd = motd; this.motd = motd;
this.shouldSendChatPreviews = shouldSendChatPreviews;
this.maxPlayers = maxPlayers; this.maxPlayers = maxPlayers;
} }
@ -139,9 +125,11 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
* client. * client.
* *
* @return true if chat preview is enabled, false otherwise * @return true if chat preview is enabled, false otherwise
* @deprecated chat previews have been removed
*/ */
@Deprecated
public boolean shouldSendChatPreviews() { public boolean shouldSendChatPreviews() {
return shouldSendChatPreviews; return false;
} }
/** /**

View File

@ -0,0 +1,14 @@
package org.bukkit.inventory;
import org.bukkit.block.ChiseledBookshelf;
import org.jetbrains.annotations.Nullable;
/**
* Interface to the inventory of a chiseled bookshelf.
*/
public interface ChiseledBookshelfInventory extends Inventory {
@Nullable
@Override
public ChiseledBookshelf getHolder();
}

View File

@ -5,6 +5,7 @@ import java.util.Collections;
import org.bukkit.Keyed; import org.bukkit.Keyed;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.inventory.recipe.CookingBookCategory;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
@ -18,6 +19,7 @@ public abstract class CookingRecipe<T extends CookingRecipe> implements Recipe,
private float experience; private float experience;
private int cookingTime; private int cookingTime;
private String group = ""; private String group = "";
private CookingBookCategory category = CookingBookCategory.MISC;
/** /**
* Create a cooking recipe to craft the specified ItemStack. * Create a cooking recipe to craft the specified ItemStack.
@ -167,7 +169,31 @@ public abstract class CookingRecipe<T extends CookingRecipe> implements Recipe,
* null. * null.
*/ */
public void setGroup(@NotNull String group) { public void setGroup(@NotNull String group) {
Preconditions.checkArgument(group != null, "group"); Preconditions.checkArgument(group != null, "group cannot be null");
this.group = group; this.group = group;
} }
/**
* Gets the category which this recipe will appear in the recipe book under.
*
* Defaults to {@link CookingBookCategory#MISC} if not set.
*
* @return recipe book category
*/
@NotNull
public CookingBookCategory getCategory() {
return category;
}
/**
* Sets the category which this recipe will appear in the recipe book under.
*
* Defaults to {@link CookingBookCategory#MISC} if not set.
*
* @param category recipe book category
*/
public void setCategory(@NotNull CookingBookCategory category) {
Preconditions.checkArgument(category != null, "category cannot be null");
this.category = category;
}
} }

View File

@ -7,6 +7,7 @@ import java.util.Map;
import org.bukkit.Keyed; import org.bukkit.Keyed;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.inventory.recipe.CraftingBookCategory;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -19,6 +20,7 @@ public class ShapedRecipe implements Recipe, Keyed {
private String[] rows; private String[] rows;
private Map<Character, RecipeChoice> ingredients = new HashMap<>(); private Map<Character, RecipeChoice> ingredients = new HashMap<>();
private String group = ""; private String group = "";
private CraftingBookCategory category = CraftingBookCategory.MISC;
@Deprecated @Deprecated
public ShapedRecipe(@NotNull ItemStack result) { public ShapedRecipe(@NotNull ItemStack result) {
@ -221,7 +223,31 @@ public class ShapedRecipe implements Recipe, Keyed {
* null. * null.
*/ */
public void setGroup(@NotNull String group) { public void setGroup(@NotNull String group) {
Preconditions.checkArgument(group != null, "group"); Preconditions.checkArgument(group != null, "group cannot be null");
this.group = group; this.group = group;
} }
/**
* Gets the category which this recipe will appear in the recipe book under.
*
* Defaults to {@link CraftingBookCategory#MISC} if not set.
*
* @return recipe book category
*/
@NotNull
public CraftingBookCategory getCategory() {
return category;
}
/**
* Sets the category which this recipe will appear in the recipe book under.
*
* Defaults to {@link CraftingBookCategory#MISC} if not set.
*
* @param category recipe book category
*/
public void setCategory(@NotNull CraftingBookCategory category) {
Preconditions.checkArgument(category != null, "category cannot be null");
this.category = category;
}
} }

View File

@ -8,6 +8,7 @@ import java.util.List;
import org.bukkit.Keyed; import org.bukkit.Keyed;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.inventory.recipe.CraftingBookCategory;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -20,6 +21,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
private final ItemStack output; private final ItemStack output;
private final List<RecipeChoice> ingredients = new ArrayList<>(); private final List<RecipeChoice> ingredients = new ArrayList<>();
private String group = ""; private String group = "";
private CraftingBookCategory category = CraftingBookCategory.MISC;
@Deprecated @Deprecated
public ShapelessRecipe(@NotNull ItemStack result) { public ShapelessRecipe(@NotNull ItemStack result) {
@ -308,7 +310,31 @@ public class ShapelessRecipe implements Recipe, Keyed {
* null. * null.
*/ */
public void setGroup(@NotNull String group) { public void setGroup(@NotNull String group) {
Preconditions.checkArgument(group != null, "group"); Preconditions.checkArgument(group != null, "group cannot be null");
this.group = group; this.group = group;
} }
/**
* Gets the category which this recipe will appear in the recipe book under.
*
* Defaults to {@link CraftingBookCategory#MISC} if not set.
*
* @return recipe book category
*/
@NotNull
public CraftingBookCategory getCategory() {
return category;
}
/**
* Sets the category which this recipe will appear in the recipe book under.
*
* Defaults to {@link CraftingBookCategory#MISC} if not set.
*
* @param category recipe book category
*/
public void setCategory(@NotNull CraftingBookCategory category) {
Preconditions.checkArgument(category != null, "category cannot be null");
this.category = category;
}
} }

View File

@ -121,7 +121,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
* null. * null.
*/ */
public void setGroup(@NotNull String group) { public void setGroup(@NotNull String group) {
Preconditions.checkArgument(group != null, "group"); Preconditions.checkArgument(group != null, "group cannot be null");
this.group = group; this.group = group;
} }
} }

View File

@ -0,0 +1,11 @@
package org.bukkit.inventory.recipe;
/**
* Represents categories within the cooking recipe book.
*/
public enum CookingBookCategory {
FOOD,
BLOCKS,
MISC;
}

View File

@ -0,0 +1,12 @@
package org.bukkit.inventory.recipe;
/**
* Represents categories within the crafting recipe book.
*/
public enum CraftingBookCategory {
BUILDING,
REDSTONE,
EQUIPMENT,
MISC;
}

View File

@ -0,0 +1,4 @@
/**
* New location for recipe-related classes.
*/
package org.bukkit.inventory.recipe;