diff --git a/pom.xml b/pom.xml index 09c297b0..051eafb8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.bukkit bukkit - 1.13.2-R0.1-SNAPSHOT + 1.14-pre5-SNAPSHOT jar Bukkit @@ -57,12 +57,6 @@ 2.6 compile - - com.googlecode.json-simple - json-simple - 1.1.1 - compile - com.google.guava diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java index cfbcaf72..c6548738 100644 --- a/src/main/java/org/bukkit/Art.java +++ b/src/main/java/org/bukkit/Art.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable; /** * Represents the art on a painting */ -public enum Art { +public enum Art implements Keyed { KEBAB(0, 1, 1), AZTEC(1, 1, 1), ALBAN(2, 1, 1), @@ -39,7 +39,8 @@ public enum Art { SKELETON(24, 4, 3), DONKEY_KONG(25, 4, 3); - private int id, width, height; + private final int id, width, height; + private final NamespacedKey key; private static final HashMap BY_NAME = Maps.newHashMap(); private static final HashMap BY_ID = Maps.newHashMap(); @@ -47,6 +48,7 @@ public enum Art { this.id = id; this.width = width; this.height = height; + this.key = NamespacedKey.minecraft(name().toLowerCase(java.util.Locale.ENGLISH)); } /** @@ -78,6 +80,12 @@ public enum Art { return id; } + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + /** * Get a painting by its numeric ID * diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 0da3c3a4..beca3b49 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -192,31 +192,6 @@ public final class Bukkit { return server.getIp(); } - /** - * Get the name of this server. - * - * @return the name of this server - * @deprecated not a standard server property - */ - @Deprecated - @NotNull - public static String getServerName() { - return server.getServerName(); - } - - /** - * Get an ID of this server. The ID is a simple generally alphanumeric ID - * that can be used for uniquely identifying this server. - * - * @return the ID of this server - * @deprecated not a standard server property - */ - @Deprecated - @NotNull - public static String getServerId() { - return server.getServerId(); - } - /** * Get world type (level-type setting) for default world. * diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java index 661ebd1f..e583f86d 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -104,18 +104,6 @@ public interface Chunk { */ boolean load(); - /** - * Unloads and optionally saves the Chunk - * - * @param save Controls whether the chunk is saved - * @param safe Controls whether to unload the chunk when players are - * nearby - * @return true if the chunk has unloaded successfully, otherwise false - * @deprecated it is never safe to remove a chunk in use - */ - @Deprecated - boolean unload(boolean save, boolean safe); - /** * Unloads and optionally saves the Chunk * diff --git a/src/main/java/org/bukkit/Instrument.java b/src/main/java/org/bukkit/Instrument.java index f21497ff..ad9bfb57 100644 --- a/src/main/java/org/bukkit/Instrument.java +++ b/src/main/java/org/bukkit/Instrument.java @@ -51,7 +51,31 @@ public enum Instrument { /** * Xylophone is normally played when a note block is on top of a bone block. */ - XYLOPHONE(0x9); + XYLOPHONE(0x9), + /** + * Iron Xylophone is normally played when a note block is on top of a iron block. + */ + IRON_XYLOPHONE(0xA), + /** + * Cow Bell is normally played when a note block is on top of a soul sand block. + */ + COW_BELL(0xB), + /** + * Didgeridoo is normally played when a note block is on top of a pumpkin block. + */ + DIDGERIDOO(0xC), + /** + * Bit is normally played when a note block is on top of a emerald block. + */ + BIT(0xD), + /** + * Banjo is normally played when a note block is on top of a hay block. + */ + BANJO(0xE), + /** + * Pling is normally played when a note block is on top of a glowstone block. + */ + PLING(0xF); private final byte type; private final static Map BY_DATA = Maps.newHashMap(); diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 6120955b..c4f7dc98 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -20,10 +20,13 @@ import org.bukkit.block.data.Rotatable; import org.bukkit.block.data.Snowable; import org.bukkit.block.data.Rail; import org.bukkit.block.data.Waterlogged; +import org.bukkit.block.data.type.Bamboo; import org.bukkit.block.data.type.Bed; +import org.bukkit.block.data.type.Bell; import org.bukkit.block.data.type.BrewingStand; import org.bukkit.block.data.type.BubbleColumn; import org.bukkit.block.data.type.Cake; +import org.bukkit.block.data.type.Campfire; import org.bukkit.block.data.type.Chest; import org.bukkit.block.data.type.Cocoa; import org.bukkit.block.data.type.CommandBlock; @@ -43,7 +46,9 @@ import org.bukkit.block.data.type.GlassPane; import org.bukkit.block.data.type.Hopper; import org.bukkit.block.data.type.Jukebox; import org.bukkit.block.data.type.Ladder; +import org.bukkit.block.data.type.Lantern; import org.bukkit.block.data.type.Leaves; +import org.bukkit.block.data.type.Lectern; import org.bukkit.block.data.type.NoteBlock; import org.bukkit.block.data.type.Observer; import org.bukkit.block.data.type.Piston; @@ -53,6 +58,7 @@ import org.bukkit.block.data.type.RedstoneWallTorch; import org.bukkit.block.data.type.RedstoneWire; import org.bukkit.block.data.type.Repeater; import org.bukkit.block.data.type.Sapling; +import org.bukkit.block.data.type.Scaffolding; import org.bukkit.block.data.type.SeaPickle; import org.bukkit.block.data.type.Sign; import org.bukkit.block.data.type.Slab; @@ -110,6 +116,10 @@ public enum Material implements Keyed { * BlockData: {@link Sapling} */ ACACIA_SAPLING(20806, Sapling.class), + /** + * BlockData: {@link Sign} + */ + ACACIA_SIGN(29808, 16, Sign.class), /** * BlockData: {@link Slab} */ @@ -122,6 +132,10 @@ public enum Material implements Keyed { * BlockData: {@link TrapDoor} */ ACACIA_TRAPDOOR(18343, TrapDoor.class), + /** + * BlockData: {@link WallSign} + */ + ACACIA_WALL_SIGN(20316, 16, WallSign.class), /** * BlockData: {@link Orientable} */ @@ -133,6 +147,18 @@ public enum Material implements Keyed { AIR(9648, 0), ALLIUM(6871), ANDESITE(25975), + /** + * BlockData: {@link Slab} + */ + ANDESITE_SLAB(32124, Slab.class), + /** + * BlockData: {@link Stairs} + */ + ANDESITE_STAIRS(17747, Stairs.class), + /** + * BlockData: {@link Fence} + */ + ANDESITE_WALL(14938, Fence.class), /** * BlockData: {@link Directional} */ @@ -150,6 +176,15 @@ public enum Material implements Keyed { ATTACHED_PUMPKIN_STEM(12724, Directional.class), AZURE_BLUET(17608), BAKED_POTATO(14624), + /** + * BlockData: {@link Bamboo} + */ + BAMBOO(18728, Bamboo.class), + BAMBOO_SAPLING(8478), + /** + * BlockData: {@link Directional} + */ + BARREL(22396, Directional.class), BARRIER(26453), BAT_SPAWN_EGG(14607), BEACON(6608), @@ -162,6 +197,10 @@ public enum Material implements Keyed { BEETROOTS(22075, Ageable.class), BEETROOT_SEEDS(21282), BEETROOT_SOUP(16036, 1), + /** + * BlockData: {@link Bell} + */ + BELL(20000, Bell.class), BIRCH_BOAT(28104, 1), /** * BlockData: {@link Switch} @@ -196,6 +235,10 @@ public enum Material implements Keyed { * BlockData: {@link Sapling} */ BIRCH_SAPLING(31533, Sapling.class), + /** + * BlockData: {@link Sign} + */ + BIRCH_SIGN(11351, 16, Sign.class), /** * BlockData: {@link Slab} */ @@ -208,6 +251,10 @@ public enum Material implements Keyed { * BlockData: {@link TrapDoor} */ BIRCH_TRAPDOOR(32585, TrapDoor.class), + /** + * BlockData: {@link WallSign} + */ + BIRCH_WALL_SIGN(9887, 16, WallSign.class), /** * BlockData: {@link Orientable} */ @@ -223,6 +270,7 @@ public enum Material implements Keyed { BLACK_CARPET(6056), BLACK_CONCRETE(13338), BLACK_CONCRETE_POWDER(16150), + BLACK_DYE(6202), /** * BlockData: {@link Directional} */ @@ -242,6 +290,10 @@ public enum Material implements Keyed { */ BLACK_WALL_BANNER(4919, Directional.class), BLACK_WOOL(16693), + /** + * BlockData: {@link Furnace} + */ + BLAST_FURNACE(31157, Furnace.class), BLAZE_POWDER(18941), BLAZE_ROD(8289), BLAZE_SPAWN_EGG(4759), @@ -256,6 +308,7 @@ public enum Material implements Keyed { BLUE_CARPET(13292), BLUE_CONCRETE(18756), BLUE_CONCRETE_POWDER(17773), + BLUE_DYE(11588), /** * BlockData: {@link Directional} */ @@ -315,6 +368,10 @@ public enum Material implements Keyed { * BlockData: {@link Stairs} */ BRICK_STAIRS(21534, Stairs.class), + /** + * BlockData: {@link Fence} + */ + BRICK_WALL(18995, Fence.class), /** * BlockData: {@link Rotatable} */ @@ -326,6 +383,7 @@ public enum Material implements Keyed { BROWN_CARPET(23352), BROWN_CONCRETE(19006), BROWN_CONCRETE_POWDER(21485), + BROWN_DYE(7648), /** * BlockData: {@link Directional} */ @@ -372,21 +430,26 @@ public enum Material implements Keyed { * BlockData: {@link Ageable} */ CACTUS(12191, Ageable.class), - CACTUS_GREEN(17296), /** * BlockData: {@link Cake} */ CAKE(27048, 1, Cake.class), + /** + * BlockData: {@link Campfire} + */ + CAMPFIRE(8488, Campfire.class), CARROT(22824), /** * BlockData: {@link Ageable} */ CARROTS(17258, Ageable.class), CARROT_ON_A_STICK(27809, 1, 25), + CARTOGRAPHY_TABLE(28529), /** * BlockData: {@link Directional} */ CARVED_PUMPKIN(25833, Directional.class), + CAT_SPAWN_EGG(29583), /** * BlockData: {@link Levelled} */ @@ -477,9 +540,11 @@ public enum Material implements Keyed { COOKED_RABBIT(4454), COOKED_SALMON(5615), COOKIE(27431), + CORNFLOWER(15405), COW_SPAWN_EGG(14761), CRACKED_STONE_BRICKS(27869), CRAFTING_TABLE(20706), + CREEPER_BANNER_PATTERN(15774, 1), /** * BlockData: {@link Rotatable} */ @@ -489,8 +554,17 @@ public enum Material implements Keyed { * BlockData: {@link Directional} */ CREEPER_WALL_HEAD(30123, Directional.class), + CROSSBOW(4340, 1, 326), CUT_RED_SANDSTONE(26842), + /** + * BlockData: {@link Slab} + */ + CUT_RED_SANDSTONE_SLAB(-11, Slab.class), CUT_SANDSTONE(6118), + /** + * BlockData: {@link Slab} + */ + CUT_SANDSTONE_SLAB(-10, Slab.class), /** * BlockData: {@link Rotatable} */ @@ -527,7 +601,6 @@ public enum Material implements Keyed { */ DAMAGED_ANVIL(10274, Directional.class), DANDELION(30558), - DANDELION_YELLOW(21789), DARK_OAK_BOAT(28618, 1), /** * BlockData: {@link Switch} @@ -562,6 +635,10 @@ public enum Material implements Keyed { * BlockData: {@link Sapling} */ DARK_OAK_SAPLING(14933, Sapling.class), + /** + * BlockData: {@link Sign} + */ + DARK_OAK_SIGN(15127, 16, Sign.class), /** * BlockData: {@link Slab} */ @@ -574,6 +651,10 @@ public enum Material implements Keyed { * BlockData: {@link TrapDoor} */ DARK_OAK_TRAPDOOR(10355, TrapDoor.class), + /** + * BlockData: {@link WallSign} + */ + DARK_OAK_WALL_SIGN(9508, 16, WallSign.class), /** * BlockData: {@link Orientable} */ @@ -676,6 +757,18 @@ public enum Material implements Keyed { DIAMOND_SHOVEL(25415, 1, 1561), DIAMOND_SWORD(27707, 1, 1561), DIORITE(24688), + /** + * BlockData: {@link Slab} + */ + DIORITE_SLAB(10715, Slab.class), + /** + * BlockData: {@link Stairs} + */ + DIORITE_STAIRS(13134, Stairs.class), + /** + * BlockData: {@link Fence} + */ + DIORITE_WALL(17412, Fence.class), DIRT(10580), /** * BlockData: {@link Dispenser} @@ -730,6 +823,18 @@ public enum Material implements Keyed { END_ROD(24832, Directional.class), END_STONE(29686), END_STONE_BRICKS(20314), + /** + * BlockData: {@link Slab} + */ + END_STONE_BRICK_SLAB(23239, Slab.class), + /** + * BlockData: {@link Stairs} + */ + END_STONE_BRICK_STAIRS(28831, Stairs.class), + /** + * BlockData: {@link Fence} + */ + END_STONE_BRICK_WALL(27225, Fence.class), EVOKER_SPAWN_EGG(21271), EXPERIENCE_BOTTLE(12858), /** @@ -761,9 +866,12 @@ public enum Material implements Keyed { */ FIRE_CORAL_WALL_FAN(20100, CoralWallFan.class), FISHING_ROD(4167, 1, 64), + FLETCHING_TABLE(30838), FLINT(23596), FLINT_AND_STEEL(28620, 1, 64), + FLOWER_BANNER_PATTERN(5762, 1), FLOWER_POT(30567), + FOX_SPAWN_EGG(-1), /** * BlockData: {@link Ageable} */ @@ -778,10 +886,11 @@ public enum Material implements Keyed { GLASS(6195), GLASS_BOTTLE(6116), /** - * BlockData: {@link GlassPane} + * BlockData: {@link Fence} */ - GLASS_PANE(5709, GlassPane.class), + GLASS_PANE(5709, Fence.class), GLISTERING_MELON_SLICE(20158), + GLOBE_BANNER_PATTERN(-99, 1), GLOWSTONE(32713), GLOWSTONE_DUST(6665), GOLDEN_APPLE(27732), @@ -801,6 +910,18 @@ public enum Material implements Keyed { GOLD_NUGGET(28814), GOLD_ORE(32625), GRANITE(21091), + /** + * BlockData: {@link Slab} + */ + GRANITE_SLAB(25898, Slab.class), + /** + * BlockData: {@link Stairs} + */ + GRANITE_STAIRS(21840, Stairs.class), + /** + * BlockData: {@link Fence} + */ + GRANITE_WALL(23279, Fence.class), GRASS(6155), /** * BlockData: {@link Snowable} @@ -850,6 +971,7 @@ public enum Material implements Keyed { GREEN_CARPET(7780), GREEN_CONCRETE(17949), GREEN_CONCRETE_POWDER(6904), + GREEN_DYE(23215), /** * BlockData: {@link Directional} */ @@ -869,6 +991,10 @@ public enum Material implements Keyed { */ GREEN_WALL_BANNER(15046, Directional.class), GREEN_WOOL(25085), + /** + * BlockData: {@link Directional} + */ + GRINDSTONE(26260, Directional.class), GUARDIAN_SPAWN_EGG(20113), GUNPOWDER(29974), /** @@ -939,6 +1065,10 @@ public enum Material implements Keyed { * BlockData: {@link Directional} */ JACK_O_LANTERN(31612, Directional.class), + /** + * BlockData: {@link Directional} + */ + JIGSAW(17398, Directional.class), /** * BlockData: {@link Jukebox} */ @@ -977,6 +1107,10 @@ public enum Material implements Keyed { * BlockData: {@link Sapling} */ JUNGLE_SAPLING(17951, Sapling.class), + /** + * BlockData: {@link Sign} + */ + JUNGLE_SIGN(24717, 16, Sign.class), /** * BlockData: {@link Slab} */ @@ -989,6 +1123,10 @@ public enum Material implements Keyed { * BlockData: {@link TrapDoor} */ JUNGLE_TRAPDOOR(8626, TrapDoor.class), + /** + * BlockData: {@link WallSign} + */ + JUNGLE_WALL_SIGN(29629, 16, WallSign.class), /** * BlockData: {@link Orientable} */ @@ -1003,6 +1141,10 @@ public enum Material implements Keyed { * BlockData: {@link Ladder} */ LADDER(23599, Ladder.class), + /** + * BlockData: {@link Lantern} + */ + LANTERN(5992, Lantern.class), LAPIS_BLOCK(14485), LAPIS_LAZULI(11075), LAPIS_ORE(22934), @@ -1020,7 +1162,12 @@ public enum Material implements Keyed { LEATHER_BOOTS(15282, 1, 65), LEATHER_CHESTPLATE(29275, 1, 80), LEATHER_HELMET(11624, 1, 55), + LEATHER_HORSE_ARMOR(-2, 1), LEATHER_LEGGINGS(28210, 1, 75), + /** + * BlockData: {@link Lectern} + */ + LECTERN(23490, Lectern.class), /** * BlockData: {@link Switch} */ @@ -1095,6 +1242,7 @@ public enum Material implements Keyed { * BlockData: {@link Bisected} */ LILAC(22837, Bisected.class), + LILY_OF_THE_VALLEY(7185), LILY_PAD(19271), /** * BlockData: {@link Rotatable} @@ -1129,6 +1277,10 @@ public enum Material implements Keyed { LIME_WOOL(10443), LINGERING_POTION(25857, 1), LLAMA_SPAWN_EGG(23640), + /** + * BlockData: {@link Directional} + */ + LOOM(14276, Directional.class), /** * BlockData: {@link Rotatable} */ @@ -1173,16 +1325,37 @@ public enum Material implements Keyed { MELON_STEM(8247, Ageable.class), MILK_BUCKET(9680, 1), MINECART(14352, 1), + MOJANG_BANNER_PATTERN(11903, 1), MOOSHROOM_SPAWN_EGG(22125), /** * BlockData: {@link MultipleFacing} */ MOSSY_COBBLESTONE(21900, MultipleFacing.class), + /** + * BlockData: {@link Slab} + */ + MOSSY_COBBLESTONE_SLAB(12139, Slab.class), + /** + * BlockData: {@link Stairs} + */ + MOSSY_COBBLESTONE_STAIRS(29210, Stairs.class), /** * BlockData: {@link Fence} */ MOSSY_COBBLESTONE_WALL(11536, Fence.class), MOSSY_STONE_BRICKS(16415), + /** + * BlockData: {@link Slab} + */ + MOSSY_STONE_BRICK_SLAB(14002, Slab.class), + /** + * BlockData: {@link Stairs} + */ + MOSSY_STONE_BRICK_STAIRS(27578, Stairs.class), + /** + * BlockData: {@link Fence} + */ + MOSSY_STONE_BRICK_WALL(18259, Fence.class), /** * BlockData: {@link TechnicalPiston} */ @@ -1227,6 +1400,10 @@ public enum Material implements Keyed { * BlockData: {@link Stairs} */ NETHER_BRICK_STAIRS(12085, Stairs.class), + /** + * BlockData: {@link Fence} + */ + NETHER_BRICK_WALL(10398, Fence.class), /** * BlockData: {@link Orientable} */ @@ -1276,6 +1453,10 @@ public enum Material implements Keyed { * BlockData: {@link Sapling} */ OAK_SAPLING(9636, Sapling.class), + /** + * BlockData: {@link Sign} + */ + OAK_SIGN(8192, 16, Sign.class), /** * BlockData: {@link Slab} */ @@ -1288,6 +1469,10 @@ public enum Material implements Keyed { * BlockData: {@link TrapDoor} */ OAK_TRAPDOOR(16927, TrapDoor.class), + /** + * BlockData: {@link WallSign} + */ + OAK_WALL_SIGN(12984, 16, WallSign.class), /** * BlockData: {@link Orientable} */ @@ -1333,6 +1518,7 @@ public enum Material implements Keyed { OXEYE_DAISY(11709), PACKED_ICE(28993), PAINTING(23945), + PANDA_SPAWN_EGG(23759), PAPER(9923), PARROT_SPAWN_EGG(23614), /** @@ -1346,6 +1532,7 @@ public enum Material implements Keyed { PHANTOM_MEMBRANE(18398), PHANTOM_SPAWN_EGG(24648), PIG_SPAWN_EGG(22584), + PILLAGER_SPAWN_EGG(28659), /** * BlockData: {@link Rotatable} */ @@ -1401,8 +1588,32 @@ public enum Material implements Keyed { POISONOUS_POTATO(32640), POLAR_BEAR_SPAWN_EGG(17015), POLISHED_ANDESITE(8335), + /** + * BlockData: {@link Slab} + */ + POLISHED_ANDESITE_SLAB(24573, Slab.class), + /** + * BlockData: {@link Stairs} + */ + POLISHED_ANDESITE_STAIRS(7573, Stairs.class), POLISHED_DIORITE(31615), + /** + * BlockData: {@link Slab} + */ + POLISHED_DIORITE_SLAB(18303, Slab.class), + /** + * BlockData: {@link Stairs} + */ + POLISHED_DIORITE_STAIRS(4625, Stairs.class), POLISHED_GRANITE(5477), + /** + * BlockData: {@link Slab} + */ + POLISHED_GRANITE_SLAB(4521, Slab.class), + /** + * BlockData: {@link Stairs} + */ + POLISHED_GRANITE_STAIRS(29588, Stairs.class), POPPED_CHORUS_FRUIT(27844), POPPY(12851), PORKCHOP(30896), @@ -1415,15 +1626,18 @@ public enum Material implements Keyed { POTTED_ACACIA_SAPLING(14096), POTTED_ALLIUM(13184), POTTED_AZURE_BLUET(8754), + POTTED_BAMBOO(22542), POTTED_BIRCH_SAPLING(32484), POTTED_BLUE_ORCHID(6599), POTTED_BROWN_MUSHROOM(14481), POTTED_CACTUS(8777), + POTTED_CORNFLOWER(28917), POTTED_DANDELION(9727), POTTED_DARK_OAK_SAPLING(6486), POTTED_DEAD_BUSH(13020), POTTED_FERN(23315), POTTED_JUNGLE_SAPLING(7525), + POTTED_LILY_OF_THE_VALLEY(9364), POTTED_OAK_SAPLING(11905), POTTED_ORANGE_TULIP(28807), POTTED_OXEYE_DAISY(19707), @@ -1433,6 +1647,7 @@ public enum Material implements Keyed { POTTED_RED_TULIP(28594), POTTED_SPRUCE_SAPLING(29498), POTTED_WHITE_TULIP(24330), + POTTED_WITHER_ROSE(26876), /** * BlockData: {@link RedstoneRail} */ @@ -1457,9 +1672,13 @@ public enum Material implements Keyed { * BlockData: {@link Stairs} */ PRISMARINE_STAIRS(19217, Stairs.class), + /** + * BlockData: {@link Fence} + */ + PRISMARINE_WALL(18184, Fence.class), PUFFERFISH(8115), PUFFERFISH_BUCKET(8861, 1), - PUFFERFISH_SPAWN_EGG(24573), + PUFFERFISH_SPAWN_EGG(24570), PUMPKIN(19170), PUMPKIN_PIE(28725), PUMPKIN_SEEDS(28985), @@ -1530,6 +1749,7 @@ public enum Material implements Keyed { RABBIT_HIDE(12467), RABBIT_SPAWN_EGG(26496), RABBIT_STEW(10611, 1), + RAVAGER_SPAWN_EGG(31284), /** * BlockData: {@link Rail} */ @@ -1567,6 +1787,7 @@ public enum Material implements Keyed { RED_CARPET(5424), RED_CONCRETE(8032), RED_CONCRETE_POWDER(13286), + RED_DYE(5728), /** * BlockData: {@link Directional} */ @@ -1577,6 +1798,18 @@ public enum Material implements Keyed { */ RED_MUSHROOM_BLOCK(20766, MultipleFacing.class), RED_NETHER_BRICKS(18056), + /** + * BlockData: {@link Slab} + */ + RED_NETHER_BRICK_SLAB(12462, Slab.class), + /** + * BlockData: {@link Stairs} + */ + RED_NETHER_BRICK_STAIRS(26374, Stairs.class), + /** + * BlockData: {@link Fence} + */ + RED_NETHER_BRICK_WALL(4580, Fence.class), RED_SAND(16279), RED_SANDSTONE(9092), /** @@ -1587,6 +1820,10 @@ public enum Material implements Keyed { * BlockData: {@link Stairs} */ RED_SANDSTONE_STAIRS(25466, Stairs.class), + /** + * BlockData: {@link Fence} + */ + RED_SANDSTONE_WALL(4753, Fence.class), /** * BlockData: {@link Directional} */ @@ -1615,7 +1852,6 @@ public enum Material implements Keyed { * BlockData: {@link Bisected} */ ROSE_BUSH(6080, Bisected.class), - ROSE_RED(15694), ROTTEN_FLESH(21591), SADDLE(30206, 1), SALMON(18516), @@ -1631,6 +1867,14 @@ public enum Material implements Keyed { * BlockData: {@link Stairs} */ SANDSTONE_STAIRS(18474, Stairs.class), + /** + * BlockData: {@link Fence} + */ + SANDSTONE_WALL(18470, Fence.class), + /** + * BlockData: {@link Scaffolding} + */ + SCAFFOLDING(15757, Scaffolding.class), SCUTE(11914), SEAGRASS(23942), SEA_LANTERN(16984), @@ -1647,10 +1891,6 @@ public enum Material implements Keyed { SHULKER_BOX(7776, 1, Directional.class), SHULKER_SHELL(27848), SHULKER_SPAWN_EGG(31848), - /** - * BlockData: {@link Sign} - */ - SIGN(16918, 16, Sign.class), SILVERFISH_SPAWN_EGG(14537), SKELETON_HORSE_SPAWN_EGG(21356), /** @@ -1662,13 +1902,47 @@ public enum Material implements Keyed { * BlockData: {@link Directional} */ SKELETON_WALL_SKULL(31650, Directional.class), + SKULL_BANNER_PATTERN(7680, 1), SLIME_BALL(5242), SLIME_BLOCK(31892), SLIME_SPAWN_EGG(6550), + SMITHING_TABLE(9082), + /** + * BlockData: {@link Furnace} + */ + SMOKER(24781, Furnace.class), SMOOTH_QUARTZ(14415), + /** + * BlockData: {@link Slab} + */ + SMOOTH_QUARTZ_SLAB(26543, Slab.class), + /** + * BlockData: {@link Stairs} + */ + SMOOTH_QUARTZ_STAIRS(19560, Stairs.class), SMOOTH_RED_SANDSTONE(25180), + /** + * BlockData: {@link Slab} + */ + SMOOTH_RED_SANDSTONE_SLAB(16304, Slab.class), + /** + * BlockData: {@link Stairs} + */ + SMOOTH_RED_SANDSTONE_STAIRS(17561, Stairs.class), SMOOTH_SANDSTONE(30039), + /** + * BlockData: {@link Slab} + */ + SMOOTH_SANDSTONE_SLAB(9030, Slab.class), + /** + * BlockData: {@link Stairs} + */ + SMOOTH_SANDSTONE_STAIRS(21183, Stairs.class), SMOOTH_STONE(21910), + /** + * BlockData: {@link Slab} + */ + SMOOTH_STONE_SLAB(24129, Slab.class), /** * BlockData: {@link Snow} */ @@ -1716,6 +1990,10 @@ public enum Material implements Keyed { * BlockData: {@link Sapling} */ SPRUCE_SAPLING(19874, Sapling.class), + /** + * BlockData: {@link Sign} + */ + SPRUCE_SIGN(21502, 16, Sign.class), /** * BlockData: {@link Slab} */ @@ -1728,6 +2006,10 @@ public enum Material implements Keyed { * BlockData: {@link TrapDoor} */ SPRUCE_TRAPDOOR(10289, TrapDoor.class), + /** + * BlockData: {@link WallSign} + */ + SPRUCE_WALL_SIGN(7352, 16, WallSign.class), /** * BlockData: {@link Orientable} */ @@ -1739,6 +2021,10 @@ public enum Material implements Keyed { */ STICKY_PISTON(18127, Piston.class), STONE(22948), + /** + * BlockData: {@link Directional} + */ + STONECUTTER(25170, Directional.class), STONE_AXE(6338, 1, 131), STONE_BRICKS(6962), /** @@ -1749,6 +2035,10 @@ public enum Material implements Keyed { * BlockData: {@link Stairs} */ STONE_BRICK_STAIRS(27032, Stairs.class), + /** + * BlockData: {@link Fence} + */ + STONE_BRICK_WALL(29073, Fence.class), /** * BlockData: {@link Switch} */ @@ -1764,6 +2054,10 @@ public enum Material implements Keyed { * BlockData: {@link Slab} */ STONE_SLAB(19838, Slab.class), + /** + * BlockData: {@link Stairs} + */ + STONE_STAIRS(23784, Stairs.class), STONE_SWORD(25084, 1, 131), STRAY_SPAWN_EGG(30153), STRING(12806), @@ -1829,6 +2123,12 @@ public enum Material implements Keyed { * BlockData: {@link Bisected} */ SUNFLOWER(7408, Bisected.class), + SUSPICIOUS_STEW(8173, 1), + SWEET_BERRIES(19747), + /** + * BlockData: {@link Ageable} + */ + SWEET_BERRY_BUSH(11958, Ageable.class), /** * BlockData: {@link Bisected} */ @@ -1846,6 +2146,7 @@ public enum Material implements Keyed { TNT_MINECART(4277, 1), TORCH(6063), TOTEM_OF_UNDYING(10139, 1), + TRADER_LLAMA_SPAWN_EGG(13512), /** * BlockData: {@link Chest} */ @@ -1889,10 +2190,7 @@ public enum Material implements Keyed { */ VINE(14564, MultipleFacing.class), VOID_AIR(13668), - /** - * BlockData: {@link WallSign} - */ - WALL_SIGN(10644, WallSign.class), + WANDERING_TRADER_SPAWN_EGG(12312), /** * BlockData: {@link Directional} */ @@ -1919,6 +2217,7 @@ public enum Material implements Keyed { WHITE_CARPET(15117), WHITE_CONCRETE(6281), WHITE_CONCRETE_POWDER(10363), + WHITE_DYE(10758), /** * BlockData: {@link Directional} */ @@ -1940,6 +2239,7 @@ public enum Material implements Keyed { WHITE_WALL_BANNER(15967, Directional.class), WHITE_WOOL(8624), WITCH_SPAWN_EGG(11837), + WITHER_ROSE(8619), /** * BlockData: {@link Rotatable} */ @@ -1968,6 +2268,7 @@ public enum Material implements Keyed { YELLOW_CARPET(18149), YELLOW_CONCRETE(15722), YELLOW_CONCRETE_POWDER(10655), + YELLOW_DYE(5952), /** * BlockData: {@link Directional} */ @@ -1999,6 +2300,10 @@ public enum Material implements Keyed { * BlockData: {@link Directional} */ ZOMBIE_WALL_HEAD(16296, Directional.class), + /** + * BlockData: {@link Levelled} + */ + COMPOSTER(-4, Levelled.class), // ----- Legacy Separator ----- @Deprecated LEGACY_AIR(0, 0), @@ -3125,22 +3430,31 @@ public enum Material implements Keyed { case ACACIA_PLANKS: case ACACIA_PRESSURE_PLATE: case ACACIA_SAPLING: + case ACACIA_SIGN: case ACACIA_SLAB: case ACACIA_STAIRS: case ACACIA_TRAPDOOR: + case ACACIA_WALL_SIGN: case ACACIA_WOOD: case ACTIVATOR_RAIL: case AIR: case ALLIUM: case ANDESITE: + case ANDESITE_SLAB: + case ANDESITE_STAIRS: + case ANDESITE_WALL: case ANVIL: case ATTACHED_MELON_STEM: case ATTACHED_PUMPKIN_STEM: case AZURE_BLUET: + case BAMBOO: + case BAMBOO_SAPLING: + case BARREL: case BARRIER: case BEACON: case BEDROCK: case BEETROOTS: + case BELL: case BIRCH_BUTTON: case BIRCH_DOOR: case BIRCH_FENCE: @@ -3150,9 +3464,11 @@ public enum Material implements Keyed { case BIRCH_PLANKS: case BIRCH_PRESSURE_PLATE: case BIRCH_SAPLING: + case BIRCH_SIGN: case BIRCH_SLAB: case BIRCH_STAIRS: case BIRCH_TRAPDOOR: + case BIRCH_WALL_SIGN: case BIRCH_WOOD: case BLACK_BANNER: case BLACK_BED: @@ -3166,6 +3482,7 @@ public enum Material implements Keyed { case BLACK_TERRACOTTA: case BLACK_WALL_BANNER: case BLACK_WOOL: + case BLAST_FURNACE: case BLUE_BANNER: case BLUE_BED: case BLUE_CARPET: @@ -3190,6 +3507,7 @@ public enum Material implements Keyed { case BRICKS: case BRICK_SLAB: case BRICK_STAIRS: + case BRICK_WALL: case BROWN_BANNER: case BROWN_BED: case BROWN_CARPET: @@ -3211,7 +3529,9 @@ public enum Material implements Keyed { case BUBBLE_CORAL_WALL_FAN: case CACTUS: case CAKE: + case CAMPFIRE: case CARROTS: + case CARTOGRAPHY_TABLE: case CARVED_PUMPKIN: case CAULDRON: case CAVE_AIR: @@ -3236,13 +3556,17 @@ public enum Material implements Keyed { case COCOA: case COMMAND_BLOCK: case COMPARATOR: + case COMPOSTER: case CONDUIT: + case CORNFLOWER: case CRACKED_STONE_BRICKS: case CRAFTING_TABLE: case CREEPER_HEAD: case CREEPER_WALL_HEAD: case CUT_RED_SANDSTONE: + case CUT_RED_SANDSTONE_SLAB: case CUT_SANDSTONE: + case CUT_SANDSTONE_SLAB: case CYAN_BANNER: case CYAN_BED: case CYAN_CARPET: @@ -3266,9 +3590,11 @@ public enum Material implements Keyed { case DARK_OAK_PLANKS: case DARK_OAK_PRESSURE_PLATE: case DARK_OAK_SAPLING: + case DARK_OAK_SIGN: case DARK_OAK_SLAB: case DARK_OAK_STAIRS: case DARK_OAK_TRAPDOOR: + case DARK_OAK_WALL_SIGN: case DARK_OAK_WOOD: case DARK_PRISMARINE: case DARK_PRISMARINE_SLAB: @@ -3299,6 +3625,9 @@ public enum Material implements Keyed { case DIAMOND_BLOCK: case DIAMOND_ORE: case DIORITE: + case DIORITE_SLAB: + case DIORITE_STAIRS: + case DIORITE_WALL: case DIRT: case DISPENSER: case DRAGON_EGG: @@ -3316,6 +3645,9 @@ public enum Material implements Keyed { case END_ROD: case END_STONE: case END_STONE_BRICKS: + case END_STONE_BRICK_SLAB: + case END_STONE_BRICK_STAIRS: + case END_STONE_BRICK_WALL: case FARMLAND: case FERN: case FIRE: @@ -3323,6 +3655,7 @@ public enum Material implements Keyed { case FIRE_CORAL_BLOCK: case FIRE_CORAL_FAN: case FIRE_CORAL_WALL_FAN: + case FLETCHING_TABLE: case FLOWER_POT: case FROSTED_ICE: case FURNACE: @@ -3332,6 +3665,9 @@ public enum Material implements Keyed { case GOLD_BLOCK: case GOLD_ORE: case GRANITE: + case GRANITE_SLAB: + case GRANITE_STAIRS: + case GRANITE_WALL: case GRASS: case GRASS_BLOCK: case GRASS_PATH: @@ -3360,6 +3696,7 @@ public enum Material implements Keyed { case GREEN_TERRACOTTA: case GREEN_WALL_BANNER: case GREEN_WOOL: + case GRINDSTONE: case HAY_BLOCK: case HEAVY_WEIGHTED_PRESSURE_PLATE: case HOPPER: @@ -3380,6 +3717,7 @@ public enum Material implements Keyed { case IRON_ORE: case IRON_TRAPDOOR: case JACK_O_LANTERN: + case JIGSAW: case JUKEBOX: case JUNGLE_BUTTON: case JUNGLE_DOOR: @@ -3390,17 +3728,21 @@ public enum Material implements Keyed { case JUNGLE_PLANKS: case JUNGLE_PRESSURE_PLATE: case JUNGLE_SAPLING: + case JUNGLE_SIGN: case JUNGLE_SLAB: case JUNGLE_STAIRS: case JUNGLE_TRAPDOOR: + case JUNGLE_WALL_SIGN: case JUNGLE_WOOD: case KELP: case KELP_PLANT: case LADDER: + case LANTERN: case LAPIS_BLOCK: case LAPIS_ORE: case LARGE_FERN: case LAVA: + case LECTERN: case LEVER: case LIGHT_BLUE_BANNER: case LIGHT_BLUE_BED: @@ -3428,6 +3770,7 @@ public enum Material implements Keyed { case LIGHT_GRAY_WOOL: case LIGHT_WEIGHTED_PRESSURE_PLATE: case LILAC: + case LILY_OF_THE_VALLEY: case LILY_PAD: case LIME_BANNER: case LIME_BED: @@ -3441,6 +3784,7 @@ public enum Material implements Keyed { case LIME_TERRACOTTA: case LIME_WALL_BANNER: case LIME_WOOL: + case LOOM: case MAGENTA_BANNER: case MAGENTA_BED: case MAGENTA_CARPET: @@ -3457,8 +3801,13 @@ public enum Material implements Keyed { case MELON: case MELON_STEM: case MOSSY_COBBLESTONE: + case MOSSY_COBBLESTONE_SLAB: + case MOSSY_COBBLESTONE_STAIRS: case MOSSY_COBBLESTONE_WALL: case MOSSY_STONE_BRICKS: + case MOSSY_STONE_BRICK_SLAB: + case MOSSY_STONE_BRICK_STAIRS: + case MOSSY_STONE_BRICK_WALL: case MOVING_PISTON: case MUSHROOM_STEM: case MYCELIUM: @@ -3467,6 +3816,7 @@ public enum Material implements Keyed { case NETHER_BRICK_FENCE: case NETHER_BRICK_SLAB: case NETHER_BRICK_STAIRS: + case NETHER_BRICK_WALL: case NETHER_PORTAL: case NETHER_QUARTZ_ORE: case NETHER_WART: @@ -3481,9 +3831,11 @@ public enum Material implements Keyed { case OAK_PLANKS: case OAK_PRESSURE_PLATE: case OAK_SAPLING: + case OAK_SIGN: case OAK_SLAB: case OAK_STAIRS: case OAK_TRAPDOOR: + case OAK_WALL_SIGN: case OAK_WOOD: case OBSERVER: case OBSIDIAN: @@ -3523,22 +3875,31 @@ public enum Material implements Keyed { case PLAYER_WALL_HEAD: case PODZOL: case POLISHED_ANDESITE: + case POLISHED_ANDESITE_SLAB: + case POLISHED_ANDESITE_STAIRS: case POLISHED_DIORITE: + case POLISHED_DIORITE_SLAB: + case POLISHED_DIORITE_STAIRS: case POLISHED_GRANITE: + case POLISHED_GRANITE_SLAB: + case POLISHED_GRANITE_STAIRS: case POPPY: case POTATOES: case POTTED_ACACIA_SAPLING: case POTTED_ALLIUM: case POTTED_AZURE_BLUET: + case POTTED_BAMBOO: case POTTED_BIRCH_SAPLING: case POTTED_BLUE_ORCHID: case POTTED_BROWN_MUSHROOM: case POTTED_CACTUS: + case POTTED_CORNFLOWER: case POTTED_DANDELION: case POTTED_DARK_OAK_SAPLING: case POTTED_DEAD_BUSH: case POTTED_FERN: case POTTED_JUNGLE_SAPLING: + case POTTED_LILY_OF_THE_VALLEY: case POTTED_OAK_SAPLING: case POTTED_ORANGE_TULIP: case POTTED_OXEYE_DAISY: @@ -3548,6 +3909,7 @@ public enum Material implements Keyed { case POTTED_RED_TULIP: case POTTED_SPRUCE_SAPLING: case POTTED_WHITE_TULIP: + case POTTED_WITHER_ROSE: case POWERED_RAIL: case PRISMARINE: case PRISMARINE_BRICKS: @@ -3555,6 +3917,7 @@ public enum Material implements Keyed { case PRISMARINE_BRICK_STAIRS: case PRISMARINE_SLAB: case PRISMARINE_STAIRS: + case PRISMARINE_WALL: case PUMPKIN: case PUMPKIN_STEM: case PURPLE_BANNER: @@ -3593,10 +3956,14 @@ public enum Material implements Keyed { case RED_MUSHROOM: case RED_MUSHROOM_BLOCK: case RED_NETHER_BRICKS: + case RED_NETHER_BRICK_SLAB: + case RED_NETHER_BRICK_STAIRS: + case RED_NETHER_BRICK_WALL: case RED_SAND: case RED_SANDSTONE: case RED_SANDSTONE_SLAB: case RED_SANDSTONE_STAIRS: + case RED_SANDSTONE_WALL: case RED_SHULKER_BOX: case RED_STAINED_GLASS: case RED_STAINED_GLASS_PANE: @@ -3611,18 +3978,28 @@ public enum Material implements Keyed { case SANDSTONE: case SANDSTONE_SLAB: case SANDSTONE_STAIRS: + case SANDSTONE_WALL: + case SCAFFOLDING: case SEAGRASS: case SEA_LANTERN: case SEA_PICKLE: case SHULKER_BOX: - case SIGN: case SKELETON_SKULL: case SKELETON_WALL_SKULL: case SLIME_BLOCK: + case SMITHING_TABLE: + case SMOKER: case SMOOTH_QUARTZ: + case SMOOTH_QUARTZ_SLAB: + case SMOOTH_QUARTZ_STAIRS: case SMOOTH_RED_SANDSTONE: + case SMOOTH_RED_SANDSTONE_SLAB: + case SMOOTH_RED_SANDSTONE_STAIRS: case SMOOTH_SANDSTONE: + case SMOOTH_SANDSTONE_SLAB: + case SMOOTH_SANDSTONE_STAIRS: case SMOOTH_STONE: + case SMOOTH_STONE_SLAB: case SNOW: case SNOW_BLOCK: case SOUL_SAND: @@ -3637,18 +4014,23 @@ public enum Material implements Keyed { case SPRUCE_PLANKS: case SPRUCE_PRESSURE_PLATE: case SPRUCE_SAPLING: + case SPRUCE_SIGN: case SPRUCE_SLAB: case SPRUCE_STAIRS: case SPRUCE_TRAPDOOR: + case SPRUCE_WALL_SIGN: case SPRUCE_WOOD: case STICKY_PISTON: case STONE: + case STONECUTTER: case STONE_BRICKS: case STONE_BRICK_SLAB: case STONE_BRICK_STAIRS: + case STONE_BRICK_WALL: case STONE_BUTTON: case STONE_PRESSURE_PLATE: case STONE_SLAB: + case STONE_STAIRS: case STRIPPED_ACACIA_LOG: case STRIPPED_ACACIA_WOOD: case STRIPPED_BIRCH_LOG: @@ -3665,6 +4047,7 @@ public enum Material implements Keyed { case STRUCTURE_VOID: case SUGAR_CANE: case SUNFLOWER: + case SWEET_BERRY_BUSH: case TALL_GRASS: case TALL_SEAGRASS: case TERRACOTTA: @@ -3680,7 +4063,6 @@ public enum Material implements Keyed { case TURTLE_EGG: case VINE: case VOID_AIR: - case WALL_SIGN: case WALL_TORCH: case WATER: case WET_SPONGE: @@ -3698,6 +4080,7 @@ public enum Material implements Keyed { case WHITE_TULIP: case WHITE_WALL_BANNER: case WHITE_WOOL: + case WITHER_ROSE: case WITHER_SKELETON_SKULL: case WITHER_SKELETON_WALL_SKULL: case YELLOW_BANNER: @@ -3764,6 +4147,8 @@ public enum Material implements Keyed { case ROTTEN_FLESH: case SALMON: case SPIDER_EYE: + case SUSPICIOUS_STEW: + case SWEET_BERRIES: case TROPICAL_FISH: // ----- Legacy Separator ----- case LEGACY_BREAD: @@ -3931,15 +4316,23 @@ public enum Material implements Keyed { case ACACIA_LOG: case ACACIA_PLANKS: case ACACIA_PRESSURE_PLATE: + case ACACIA_SIGN: case ACACIA_SLAB: case ACACIA_STAIRS: case ACACIA_TRAPDOOR: + case ACACIA_WALL_SIGN: case ACACIA_WOOD: case ANDESITE: + case ANDESITE_SLAB: + case ANDESITE_STAIRS: + case ANDESITE_WALL: case ANVIL: + case BAMBOO: + case BARREL: case BARRIER: case BEACON: case BEDROCK: + case BELL: case BIRCH_DOOR: case BIRCH_FENCE: case BIRCH_FENCE_GATE: @@ -3947,9 +4340,11 @@ public enum Material implements Keyed { case BIRCH_LOG: case BIRCH_PLANKS: case BIRCH_PRESSURE_PLATE: + case BIRCH_SIGN: case BIRCH_SLAB: case BIRCH_STAIRS: case BIRCH_TRAPDOOR: + case BIRCH_WALL_SIGN: case BIRCH_WOOD: case BLACK_BANNER: case BLACK_BED: @@ -3962,6 +4357,7 @@ public enum Material implements Keyed { case BLACK_TERRACOTTA: case BLACK_WALL_BANNER: case BLACK_WOOL: + case BLAST_FURNACE: case BLUE_BANNER: case BLUE_BED: case BLUE_CONCRETE: @@ -3981,6 +4377,7 @@ public enum Material implements Keyed { case BRICKS: case BRICK_SLAB: case BRICK_STAIRS: + case BRICK_WALL: case BROWN_BANNER: case BROWN_BED: case BROWN_CONCRETE: @@ -3996,6 +4393,8 @@ public enum Material implements Keyed { case BUBBLE_CORAL_BLOCK: case CACTUS: case CAKE: + case CAMPFIRE: + case CARTOGRAPHY_TABLE: case CARVED_PUMPKIN: case CAULDRON: case CHAIN_COMMAND_BLOCK: @@ -4014,11 +4413,14 @@ public enum Material implements Keyed { case COBBLESTONE_STAIRS: case COBBLESTONE_WALL: case COMMAND_BLOCK: + case COMPOSTER: case CONDUIT: case CRACKED_STONE_BRICKS: case CRAFTING_TABLE: case CUT_RED_SANDSTONE: + case CUT_RED_SANDSTONE_SLAB: case CUT_SANDSTONE: + case CUT_SANDSTONE_SLAB: case CYAN_BANNER: case CYAN_BED: case CYAN_CONCRETE: @@ -4038,9 +4440,11 @@ public enum Material implements Keyed { case DARK_OAK_LOG: case DARK_OAK_PLANKS: case DARK_OAK_PRESSURE_PLATE: + case DARK_OAK_SIGN: case DARK_OAK_SLAB: case DARK_OAK_STAIRS: case DARK_OAK_TRAPDOOR: + case DARK_OAK_WALL_SIGN: case DARK_OAK_WOOD: case DARK_PRISMARINE: case DARK_PRISMARINE_SLAB: @@ -4069,6 +4473,9 @@ public enum Material implements Keyed { case DIAMOND_BLOCK: case DIAMOND_ORE: case DIORITE: + case DIORITE_SLAB: + case DIORITE_STAIRS: + case DIORITE_WALL: case DIRT: case DISPENSER: case DRAGON_EGG: @@ -4081,8 +4488,12 @@ public enum Material implements Keyed { case END_PORTAL_FRAME: case END_STONE: case END_STONE_BRICKS: + case END_STONE_BRICK_SLAB: + case END_STONE_BRICK_STAIRS: + case END_STONE_BRICK_WALL: case FARMLAND: case FIRE_CORAL_BLOCK: + case FLETCHING_TABLE: case FROSTED_ICE: case FURNACE: case GLASS: @@ -4091,6 +4502,9 @@ public enum Material implements Keyed { case GOLD_BLOCK: case GOLD_ORE: case GRANITE: + case GRANITE_SLAB: + case GRANITE_STAIRS: + case GRANITE_WALL: case GRASS_BLOCK: case GRASS_PATH: case GRAVEL: @@ -4116,6 +4530,7 @@ public enum Material implements Keyed { case GREEN_TERRACOTTA: case GREEN_WALL_BANNER: case GREEN_WOOL: + case GRINDSTONE: case HAY_BLOCK: case HEAVY_WEIGHTED_PRESSURE_PLATE: case HOPPER: @@ -4133,6 +4548,7 @@ public enum Material implements Keyed { case IRON_ORE: case IRON_TRAPDOOR: case JACK_O_LANTERN: + case JIGSAW: case JUKEBOX: case JUNGLE_DOOR: case JUNGLE_FENCE: @@ -4141,12 +4557,16 @@ public enum Material implements Keyed { case JUNGLE_LOG: case JUNGLE_PLANKS: case JUNGLE_PRESSURE_PLATE: + case JUNGLE_SIGN: case JUNGLE_SLAB: case JUNGLE_STAIRS: case JUNGLE_TRAPDOOR: + case JUNGLE_WALL_SIGN: case JUNGLE_WOOD: + case LANTERN: case LAPIS_BLOCK: case LAPIS_ORE: + case LECTERN: case LIGHT_BLUE_BANNER: case LIGHT_BLUE_BED: case LIGHT_BLUE_CONCRETE: @@ -4181,6 +4601,7 @@ public enum Material implements Keyed { case LIME_TERRACOTTA: case LIME_WALL_BANNER: case LIME_WOOL: + case LOOM: case MAGENTA_BANNER: case MAGENTA_BED: case MAGENTA_CONCRETE: @@ -4195,8 +4616,13 @@ public enum Material implements Keyed { case MAGMA_BLOCK: case MELON: case MOSSY_COBBLESTONE: + case MOSSY_COBBLESTONE_SLAB: + case MOSSY_COBBLESTONE_STAIRS: case MOSSY_COBBLESTONE_WALL: case MOSSY_STONE_BRICKS: + case MOSSY_STONE_BRICK_SLAB: + case MOSSY_STONE_BRICK_STAIRS: + case MOSSY_STONE_BRICK_WALL: case MOVING_PISTON: case MUSHROOM_STEM: case MYCELIUM: @@ -4205,6 +4631,7 @@ public enum Material implements Keyed { case NETHER_BRICK_FENCE: case NETHER_BRICK_SLAB: case NETHER_BRICK_STAIRS: + case NETHER_BRICK_WALL: case NETHER_QUARTZ_ORE: case NETHER_WART_BLOCK: case NOTE_BLOCK: @@ -4215,9 +4642,11 @@ public enum Material implements Keyed { case OAK_LOG: case OAK_PLANKS: case OAK_PRESSURE_PLATE: + case OAK_SIGN: case OAK_SLAB: case OAK_STAIRS: case OAK_TRAPDOOR: + case OAK_WALL_SIGN: case OAK_WOOD: case OBSERVER: case OBSIDIAN: @@ -4249,14 +4678,21 @@ public enum Material implements Keyed { case PISTON_HEAD: case PODZOL: case POLISHED_ANDESITE: + case POLISHED_ANDESITE_SLAB: + case POLISHED_ANDESITE_STAIRS: case POLISHED_DIORITE: + case POLISHED_DIORITE_SLAB: + case POLISHED_DIORITE_STAIRS: case POLISHED_GRANITE: + case POLISHED_GRANITE_SLAB: + case POLISHED_GRANITE_STAIRS: case PRISMARINE: case PRISMARINE_BRICKS: case PRISMARINE_BRICK_SLAB: case PRISMARINE_BRICK_STAIRS: case PRISMARINE_SLAB: case PRISMARINE_STAIRS: + case PRISMARINE_WALL: case PUMPKIN: case PURPLE_BANNER: case PURPLE_BED: @@ -4287,10 +4723,14 @@ public enum Material implements Keyed { case RED_GLAZED_TERRACOTTA: case RED_MUSHROOM_BLOCK: case RED_NETHER_BRICKS: + case RED_NETHER_BRICK_SLAB: + case RED_NETHER_BRICK_STAIRS: + case RED_NETHER_BRICK_WALL: case RED_SAND: case RED_SANDSTONE: case RED_SANDSTONE_SLAB: case RED_SANDSTONE_STAIRS: + case RED_SANDSTONE_WALL: case RED_SHULKER_BOX: case RED_STAINED_GLASS: case RED_STAINED_GLASS_PANE: @@ -4302,14 +4742,23 @@ public enum Material implements Keyed { case SANDSTONE: case SANDSTONE_SLAB: case SANDSTONE_STAIRS: + case SANDSTONE_WALL: case SEA_LANTERN: case SHULKER_BOX: - case SIGN: case SLIME_BLOCK: + case SMITHING_TABLE: + case SMOKER: case SMOOTH_QUARTZ: + case SMOOTH_QUARTZ_SLAB: + case SMOOTH_QUARTZ_STAIRS: case SMOOTH_RED_SANDSTONE: + case SMOOTH_RED_SANDSTONE_SLAB: + case SMOOTH_RED_SANDSTONE_STAIRS: case SMOOTH_SANDSTONE: + case SMOOTH_SANDSTONE_SLAB: + case SMOOTH_SANDSTONE_STAIRS: case SMOOTH_STONE: + case SMOOTH_STONE_SLAB: case SNOW_BLOCK: case SOUL_SAND: case SPAWNER: @@ -4321,17 +4770,22 @@ public enum Material implements Keyed { case SPRUCE_LOG: case SPRUCE_PLANKS: case SPRUCE_PRESSURE_PLATE: + case SPRUCE_SIGN: case SPRUCE_SLAB: case SPRUCE_STAIRS: case SPRUCE_TRAPDOOR: + case SPRUCE_WALL_SIGN: case SPRUCE_WOOD: case STICKY_PISTON: case STONE: + case STONECUTTER: case STONE_BRICKS: case STONE_BRICK_SLAB: case STONE_BRICK_STAIRS: + case STONE_BRICK_WALL: case STONE_PRESSURE_PLATE: case STONE_SLAB: + case STONE_STAIRS: case STRIPPED_ACACIA_LOG: case STRIPPED_ACACIA_WOOD: case STRIPPED_BIRCH_LOG: @@ -4350,7 +4804,6 @@ public enum Material implements Keyed { case TRAPPED_CHEST: case TUBE_CORAL_BLOCK: case TURTLE_EGG: - case WALL_SIGN: case WET_SPONGE: case WHITE_BANNER: case WHITE_BED: @@ -4796,10 +5249,15 @@ public enum Material implements Keyed { case ACACIA_LOG: case ACACIA_PLANKS: case ACACIA_PRESSURE_PLATE: + case ACACIA_SIGN: case ACACIA_SLAB: case ACACIA_STAIRS: case ACACIA_TRAPDOOR: + case ACACIA_WALL_SIGN: case ACACIA_WOOD: + case BAMBOO: + case BAMBOO_SAPLING: + case BARREL: case BIRCH_DOOR: case BIRCH_FENCE: case BIRCH_FENCE_GATE: @@ -4807,9 +5265,11 @@ public enum Material implements Keyed { case BIRCH_LOG: case BIRCH_PLANKS: case BIRCH_PRESSURE_PLATE: + case BIRCH_SIGN: case BIRCH_SLAB: case BIRCH_STAIRS: case BIRCH_TRAPDOOR: + case BIRCH_WALL_SIGN: case BIRCH_WOOD: case BLACK_BANNER: case BLACK_BED: @@ -4828,7 +5288,10 @@ public enum Material implements Keyed { case BROWN_MUSHROOM_BLOCK: case BROWN_WALL_BANNER: case BROWN_WOOL: + case CAMPFIRE: + case CARTOGRAPHY_TABLE: case CHEST: + case COMPOSTER: case CRAFTING_TABLE: case CYAN_BANNER: case CYAN_BED: @@ -4842,13 +5305,16 @@ public enum Material implements Keyed { case DARK_OAK_LOG: case DARK_OAK_PLANKS: case DARK_OAK_PRESSURE_PLATE: + case DARK_OAK_SIGN: case DARK_OAK_SLAB: case DARK_OAK_STAIRS: case DARK_OAK_TRAPDOOR: + case DARK_OAK_WALL_SIGN: case DARK_OAK_WOOD: case DAYLIGHT_DETECTOR: case DEAD_BUSH: case FERN: + case FLETCHING_TABLE: case GRASS: case GRAY_BANNER: case GRAY_BED: @@ -4868,11 +5334,14 @@ public enum Material implements Keyed { case JUNGLE_LOG: case JUNGLE_PLANKS: case JUNGLE_PRESSURE_PLATE: + case JUNGLE_SIGN: case JUNGLE_SLAB: case JUNGLE_STAIRS: case JUNGLE_TRAPDOOR: + case JUNGLE_WALL_SIGN: case JUNGLE_WOOD: case LARGE_FERN: + case LECTERN: case LIGHT_BLUE_BANNER: case LIGHT_BLUE_BED: case LIGHT_BLUE_CARPET: @@ -4889,6 +5358,7 @@ public enum Material implements Keyed { case LIME_CARPET: case LIME_WALL_BANNER: case LIME_WOOL: + case LOOM: case MAGENTA_BANNER: case MAGENTA_BED: case MAGENTA_CARPET: @@ -4903,9 +5373,11 @@ public enum Material implements Keyed { case OAK_LOG: case OAK_PLANKS: case OAK_PRESSURE_PLATE: + case OAK_SIGN: case OAK_SLAB: case OAK_STAIRS: case OAK_TRAPDOOR: + case OAK_WALL_SIGN: case OAK_WOOD: case ORANGE_BANNER: case ORANGE_BED: @@ -4930,7 +5402,7 @@ public enum Material implements Keyed { case RED_WALL_BANNER: case RED_WOOL: case ROSE_BUSH: - case SIGN: + case SMITHING_TABLE: case SPRUCE_DOOR: case SPRUCE_FENCE: case SPRUCE_FENCE_GATE: @@ -4938,9 +5410,11 @@ public enum Material implements Keyed { case SPRUCE_LOG: case SPRUCE_PLANKS: case SPRUCE_PRESSURE_PLATE: + case SPRUCE_SIGN: case SPRUCE_SLAB: case SPRUCE_STAIRS: case SPRUCE_TRAPDOOR: + case SPRUCE_WALL_SIGN: case SPRUCE_WOOD: case STRIPPED_ACACIA_LOG: case STRIPPED_ACACIA_WOOD: @@ -4959,7 +5433,6 @@ public enum Material implements Keyed { case TNT: case TRAPPED_CHEST: case VINE: - case WALL_SIGN: case WHITE_BANNER: case WHITE_BED: case WHITE_CARPET: @@ -5054,6 +5527,7 @@ public enum Material implements Keyed { case ACACIA_WOOD: case ALLIUM: case AZURE_BLUET: + case BAMBOO: case BIRCH_FENCE: case BIRCH_FENCE_GATE: case BIRCH_LEAVES: @@ -5071,6 +5545,8 @@ public enum Material implements Keyed { case BROWN_CARPET: case BROWN_WOOL: case COAL_BLOCK: + case COMPOSTER: + case CORNFLOWER: case CYAN_CARPET: case CYAN_WOOL: case DANDELION: @@ -5100,11 +5576,13 @@ public enum Material implements Keyed { case JUNGLE_STAIRS: case JUNGLE_WOOD: case LARGE_FERN: + case LECTERN: case LIGHT_BLUE_CARPET: case LIGHT_BLUE_WOOL: case LIGHT_GRAY_CARPET: case LIGHT_GRAY_WOOL: case LILAC: + case LILY_OF_THE_VALLEY: case LIME_CARPET: case LIME_WOOL: case MAGENTA_CARPET: @@ -5132,6 +5610,7 @@ public enum Material implements Keyed { case RED_TULIP: case RED_WOOL: case ROSE_BUSH: + case SCAFFOLDING: case SPRUCE_FENCE: case SPRUCE_FENCE_GATE: case SPRUCE_LEAVES: @@ -5153,12 +5632,14 @@ public enum Material implements Keyed { case STRIPPED_SPRUCE_LOG: case STRIPPED_SPRUCE_WOOD: case SUNFLOWER: + case SWEET_BERRY_BUSH: case TALL_GRASS: case TNT: case VINE: case WHITE_CARPET: case WHITE_TULIP: case WHITE_WOOL: + case WITHER_ROSE: case YELLOW_CARPET: case YELLOW_WOOL: // ----- Legacy Separator ----- @@ -5223,10 +5704,13 @@ public enum Material implements Keyed { case ACACIA_PLANKS: case ACACIA_PRESSURE_PLATE: case ACACIA_SAPLING: + case ACACIA_SIGN: case ACACIA_SLAB: case ACACIA_STAIRS: case ACACIA_TRAPDOOR: case ACACIA_WOOD: + case BAMBOO: + case BARREL: case BIRCH_BOAT: case BIRCH_BUTTON: case BIRCH_DOOR: @@ -5236,6 +5720,7 @@ public enum Material implements Keyed { case BIRCH_PLANKS: case BIRCH_PRESSURE_PLATE: case BIRCH_SAPLING: + case BIRCH_SIGN: case BIRCH_SLAB: case BIRCH_STAIRS: case BIRCH_TRAPDOOR: @@ -5253,11 +5738,14 @@ public enum Material implements Keyed { case BROWN_BANNER: case BROWN_CARPET: case BROWN_WOOL: + case CARTOGRAPHY_TABLE: case CHARCOAL: case CHEST: case COAL: case COAL_BLOCK: + case COMPOSTER: case CRAFTING_TABLE: + case CROSSBOW: case CYAN_BANNER: case CYAN_CARPET: case CYAN_WOOL: @@ -5270,13 +5758,16 @@ public enum Material implements Keyed { case DARK_OAK_PLANKS: case DARK_OAK_PRESSURE_PLATE: case DARK_OAK_SAPLING: + case DARK_OAK_SIGN: case DARK_OAK_SLAB: case DARK_OAK_STAIRS: case DARK_OAK_TRAPDOOR: case DARK_OAK_WOOD: case DAYLIGHT_DETECTOR: + case DEAD_BUSH: case DRIED_KELP_BLOCK: case FISHING_ROD: + case FLETCHING_TABLE: case GRAY_BANNER: case GRAY_CARPET: case GRAY_WOOL: @@ -5293,12 +5784,14 @@ public enum Material implements Keyed { case JUNGLE_PLANKS: case JUNGLE_PRESSURE_PLATE: case JUNGLE_SAPLING: + case JUNGLE_SIGN: case JUNGLE_SLAB: case JUNGLE_STAIRS: case JUNGLE_TRAPDOOR: case JUNGLE_WOOD: case LADDER: case LAVA_BUCKET: + case LECTERN: case LIGHT_BLUE_BANNER: case LIGHT_BLUE_CARPET: case LIGHT_BLUE_WOOL: @@ -5308,6 +5801,7 @@ public enum Material implements Keyed { case LIME_BANNER: case LIME_CARPET: case LIME_WOOL: + case LOOM: case MAGENTA_BANNER: case MAGENTA_CARPET: case MAGENTA_WOOL: @@ -5321,6 +5815,7 @@ public enum Material implements Keyed { case OAK_PLANKS: case OAK_PRESSURE_PLATE: case OAK_SAPLING: + case OAK_SIGN: case OAK_SLAB: case OAK_STAIRS: case OAK_TRAPDOOR: @@ -5337,7 +5832,8 @@ public enum Material implements Keyed { case RED_BANNER: case RED_CARPET: case RED_WOOL: - case SIGN: + case SCAFFOLDING: + case SMITHING_TABLE: case SPRUCE_BOAT: case SPRUCE_BUTTON: case SPRUCE_DOOR: @@ -5347,6 +5843,7 @@ public enum Material implements Keyed { case SPRUCE_PLANKS: case SPRUCE_PRESSURE_PLATE: case SPRUCE_SAPLING: + case SPRUCE_SIGN: case SPRUCE_SLAB: case SPRUCE_STAIRS: case SPRUCE_TRAPDOOR: @@ -5462,6 +5959,7 @@ public enum Material implements Keyed { case ACACIA_PLANKS: case ACACIA_WOOD: case ANDESITE: + case BARREL: case BARRIER: case BEDROCK: case BIRCH_LOG: @@ -5470,12 +5968,15 @@ public enum Material implements Keyed { case BLACK_CONCRETE: case BLACK_CONCRETE_POWDER: case BLACK_GLAZED_TERRACOTTA: + case BLACK_SHULKER_BOX: case BLACK_TERRACOTTA: case BLACK_WOOL: + case BLAST_FURNACE: case BLUE_CONCRETE: case BLUE_CONCRETE_POWDER: case BLUE_GLAZED_TERRACOTTA: case BLUE_ICE: + case BLUE_SHULKER_BOX: case BLUE_TERRACOTTA: case BLUE_WOOL: case BONE_BLOCK: @@ -5486,9 +5987,11 @@ public enum Material implements Keyed { case BROWN_CONCRETE_POWDER: case BROWN_GLAZED_TERRACOTTA: case BROWN_MUSHROOM_BLOCK: + case BROWN_SHULKER_BOX: case BROWN_TERRACOTTA: case BROWN_WOOL: case BUBBLE_CORAL_BLOCK: + case CARTOGRAPHY_TABLE: case CARVED_PUMPKIN: case CHAIN_COMMAND_BLOCK: case CHISELED_QUARTZ_BLOCK: @@ -5508,6 +6011,7 @@ public enum Material implements Keyed { case CYAN_CONCRETE: case CYAN_CONCRETE_POWDER: case CYAN_GLAZED_TERRACOTTA: + case CYAN_SHULKER_BOX: case CYAN_TERRACOTTA: case CYAN_WOOL: case DARK_OAK_LOG: @@ -5531,6 +6035,7 @@ public enum Material implements Keyed { case END_STONE: case END_STONE_BRICKS: case FIRE_CORAL_BLOCK: + case FLETCHING_TABLE: case FURNACE: case GOLD_BLOCK: case GOLD_ORE: @@ -5540,11 +6045,13 @@ public enum Material implements Keyed { case GRAY_CONCRETE: case GRAY_CONCRETE_POWDER: case GRAY_GLAZED_TERRACOTTA: + case GRAY_SHULKER_BOX: case GRAY_TERRACOTTA: case GRAY_WOOL: case GREEN_CONCRETE: case GREEN_CONCRETE_POWDER: case GREEN_GLAZED_TERRACOTTA: + case GREEN_SHULKER_BOX: case GREEN_TERRACOTTA: case GREEN_WOOL: case HAY_BLOCK: @@ -5558,6 +6065,7 @@ public enum Material implements Keyed { case IRON_BLOCK: case IRON_ORE: case JACK_O_LANTERN: + case JIGSAW: case JUKEBOX: case JUNGLE_LOG: case JUNGLE_PLANKS: @@ -5567,21 +6075,26 @@ public enum Material implements Keyed { case LIGHT_BLUE_CONCRETE: case LIGHT_BLUE_CONCRETE_POWDER: case LIGHT_BLUE_GLAZED_TERRACOTTA: + case LIGHT_BLUE_SHULKER_BOX: case LIGHT_BLUE_TERRACOTTA: case LIGHT_BLUE_WOOL: case LIGHT_GRAY_CONCRETE: case LIGHT_GRAY_CONCRETE_POWDER: case LIGHT_GRAY_GLAZED_TERRACOTTA: + case LIGHT_GRAY_SHULKER_BOX: case LIGHT_GRAY_TERRACOTTA: case LIGHT_GRAY_WOOL: case LIME_CONCRETE: case LIME_CONCRETE_POWDER: case LIME_GLAZED_TERRACOTTA: + case LIME_SHULKER_BOX: case LIME_TERRACOTTA: case LIME_WOOL: + case LOOM: case MAGENTA_CONCRETE: case MAGENTA_CONCRETE_POWDER: case MAGENTA_GLAZED_TERRACOTTA: + case MAGENTA_SHULKER_BOX: case MAGENTA_TERRACOTTA: case MAGENTA_WOOL: case MAGMA_BLOCK: @@ -5602,12 +6115,14 @@ public enum Material implements Keyed { case ORANGE_CONCRETE: case ORANGE_CONCRETE_POWDER: case ORANGE_GLAZED_TERRACOTTA: + case ORANGE_SHULKER_BOX: case ORANGE_TERRACOTTA: case ORANGE_WOOL: case PACKED_ICE: case PINK_CONCRETE: case PINK_CONCRETE_POWDER: case PINK_GLAZED_TERRACOTTA: + case PINK_SHULKER_BOX: case PINK_TERRACOTTA: case PINK_WOOL: case PODZOL: @@ -5620,6 +6135,7 @@ public enum Material implements Keyed { case PURPLE_CONCRETE: case PURPLE_CONCRETE_POWDER: case PURPLE_GLAZED_TERRACOTTA: + case PURPLE_SHULKER_BOX: case PURPLE_TERRACOTTA: case PURPLE_WOOL: case PURPUR_BLOCK: @@ -5635,12 +6151,16 @@ public enum Material implements Keyed { case RED_NETHER_BRICKS: case RED_SAND: case RED_SANDSTONE: + case RED_SHULKER_BOX: case RED_TERRACOTTA: case RED_WOOL: case REPEATING_COMMAND_BLOCK: case SAND: case SANDSTONE: + case SHULKER_BOX: case SLIME_BLOCK: + case SMITHING_TABLE: + case SMOKER: case SMOOTH_QUARTZ: case SMOOTH_RED_SANDSTONE: case SMOOTH_SANDSTONE: @@ -5673,11 +6193,13 @@ public enum Material implements Keyed { case WHITE_CONCRETE: case WHITE_CONCRETE_POWDER: case WHITE_GLAZED_TERRACOTTA: + case WHITE_SHULKER_BOX: case WHITE_TERRACOTTA: case WHITE_WOOL: case YELLOW_CONCRETE: case YELLOW_CONCRETE_POWDER: case YELLOW_GLAZED_TERRACOTTA: + case YELLOW_SHULKER_BOX: case YELLOW_TERRACOTTA: case YELLOW_WOOL: // ----- Legacy Separator ----- @@ -5838,9 +6360,12 @@ public enum Material implements Keyed { public boolean isItem() { switch (this) { // + case ACACIA_WALL_SIGN: case ATTACHED_MELON_STEM: case ATTACHED_PUMPKIN_STEM: + case BAMBOO_SAPLING: case BEETROOTS: + case BIRCH_WALL_SIGN: case BLACK_WALL_BANNER: case BLUE_WALL_BANNER: case BRAIN_CORAL_WALL_FAN: @@ -5852,6 +6377,7 @@ public enum Material implements Keyed { case COCOA: case CREEPER_WALL_HEAD: case CYAN_WALL_BANNER: + case DARK_OAK_WALL_SIGN: case DEAD_BRAIN_CORAL_WALL_FAN: case DEAD_BUBBLE_CORAL_WALL_FAN: case DEAD_FIRE_CORAL_WALL_FAN: @@ -5866,6 +6392,7 @@ public enum Material implements Keyed { case GRAY_WALL_BANNER: case GREEN_WALL_BANNER: case HORN_CORAL_WALL_FAN: + case JUNGLE_WALL_SIGN: case KELP_PLANT: case LAVA: case LIGHT_BLUE_WALL_BANNER: @@ -5875,6 +6402,7 @@ public enum Material implements Keyed { case MELON_STEM: case MOVING_PISTON: case NETHER_PORTAL: + case OAK_WALL_SIGN: case ORANGE_WALL_BANNER: case PINK_WALL_BANNER: case PISTON_HEAD: @@ -5883,15 +6411,18 @@ public enum Material implements Keyed { case POTTED_ACACIA_SAPLING: case POTTED_ALLIUM: case POTTED_AZURE_BLUET: + case POTTED_BAMBOO: case POTTED_BIRCH_SAPLING: case POTTED_BLUE_ORCHID: case POTTED_BROWN_MUSHROOM: case POTTED_CACTUS: + case POTTED_CORNFLOWER: case POTTED_DANDELION: case POTTED_DARK_OAK_SAPLING: case POTTED_DEAD_BUSH: case POTTED_FERN: case POTTED_JUNGLE_SAPLING: + case POTTED_LILY_OF_THE_VALLEY: case POTTED_OAK_SAPLING: case POTTED_ORANGE_TULIP: case POTTED_OXEYE_DAISY: @@ -5901,17 +6432,19 @@ public enum Material implements Keyed { case POTTED_RED_TULIP: case POTTED_SPRUCE_SAPLING: case POTTED_WHITE_TULIP: + case POTTED_WITHER_ROSE: case PUMPKIN_STEM: case PURPLE_WALL_BANNER: case REDSTONE_WALL_TORCH: case REDSTONE_WIRE: case RED_WALL_BANNER: case SKELETON_WALL_SKULL: + case SPRUCE_WALL_SIGN: + case SWEET_BERRY_BUSH: case TALL_SEAGRASS: case TRIPWIRE: case TUBE_CORAL_WALL_FAN: case VOID_AIR: - case WALL_SIGN: case WALL_TORCH: case WATER: case WHITE_WALL_BANNER: @@ -6001,18 +6534,26 @@ public enum Material implements Keyed { case ACACIA_DOOR: case ACACIA_FENCE: case ACACIA_FENCE_GATE: + case ACACIA_SIGN: case ACACIA_STAIRS: case ACACIA_TRAPDOOR: + case ACACIA_WALL_SIGN: + case ANDESITE_STAIRS: case ANVIL: + case BARREL: case BEACON: + case BELL: case BIRCH_BUTTON: case BIRCH_DOOR: case BIRCH_FENCE: case BIRCH_FENCE_GATE: + case BIRCH_SIGN: case BIRCH_STAIRS: case BIRCH_TRAPDOOR: + case BIRCH_WALL_SIGN: case BLACK_BED: case BLACK_SHULKER_BOX: + case BLAST_FURNACE: case BLUE_BED: case BLUE_SHULKER_BOX: case BREWING_STAND: @@ -6020,6 +6561,8 @@ public enum Material implements Keyed { case BROWN_BED: case BROWN_SHULKER_BOX: case CAKE: + case CAMPFIRE: + case CARTOGRAPHY_TABLE: case CAULDRON: case CHAIN_COMMAND_BLOCK: case CHEST: @@ -6027,6 +6570,7 @@ public enum Material implements Keyed { case COBBLESTONE_STAIRS: case COMMAND_BLOCK: case COMPARATOR: + case COMPOSTER: case CRAFTING_TABLE: case CYAN_BED: case CYAN_SHULKER_BOX: @@ -6035,31 +6579,42 @@ public enum Material implements Keyed { case DARK_OAK_DOOR: case DARK_OAK_FENCE: case DARK_OAK_FENCE_GATE: + case DARK_OAK_SIGN: case DARK_OAK_STAIRS: case DARK_OAK_TRAPDOOR: + case DARK_OAK_WALL_SIGN: case DARK_PRISMARINE_STAIRS: case DAYLIGHT_DETECTOR: + case DIORITE_STAIRS: case DISPENSER: case DRAGON_EGG: case DROPPER: case ENCHANTING_TABLE: case ENDER_CHEST: + case END_STONE_BRICK_STAIRS: + case FLETCHING_TABLE: case FLOWER_POT: case FURNACE: + case GRANITE_STAIRS: case GRAY_BED: case GRAY_SHULKER_BOX: case GREEN_BED: case GREEN_SHULKER_BOX: + case GRINDSTONE: case HOPPER: case IRON_DOOR: case IRON_TRAPDOOR: + case JIGSAW: case JUKEBOX: case JUNGLE_BUTTON: case JUNGLE_DOOR: case JUNGLE_FENCE: case JUNGLE_FENCE_GATE: + case JUNGLE_SIGN: case JUNGLE_STAIRS: case JUNGLE_TRAPDOOR: + case JUNGLE_WALL_SIGN: + case LECTERN: case LEVER: case LIGHT_BLUE_BED: case LIGHT_BLUE_SHULKER_BOX: @@ -6067,8 +6622,11 @@ public enum Material implements Keyed { case LIGHT_GRAY_SHULKER_BOX: case LIME_BED: case LIME_SHULKER_BOX: + case LOOM: case MAGENTA_BED: case MAGENTA_SHULKER_BOX: + case MOSSY_COBBLESTONE_STAIRS: + case MOSSY_STONE_BRICK_STAIRS: case MOVING_PISTON: case NETHER_BRICK_FENCE: case NETHER_BRICK_STAIRS: @@ -6077,24 +6635,32 @@ public enum Material implements Keyed { case OAK_DOOR: case OAK_FENCE: case OAK_FENCE_GATE: + case OAK_SIGN: case OAK_STAIRS: case OAK_TRAPDOOR: + case OAK_WALL_SIGN: case ORANGE_BED: case ORANGE_SHULKER_BOX: case PINK_BED: case PINK_SHULKER_BOX: + case POLISHED_ANDESITE_STAIRS: + case POLISHED_DIORITE_STAIRS: + case POLISHED_GRANITE_STAIRS: case POTTED_ACACIA_SAPLING: case POTTED_ALLIUM: case POTTED_AZURE_BLUET: + case POTTED_BAMBOO: case POTTED_BIRCH_SAPLING: case POTTED_BLUE_ORCHID: case POTTED_BROWN_MUSHROOM: case POTTED_CACTUS: + case POTTED_CORNFLOWER: case POTTED_DANDELION: case POTTED_DARK_OAK_SAPLING: case POTTED_DEAD_BUSH: case POTTED_FERN: case POTTED_JUNGLE_SAPLING: + case POTTED_LILY_OF_THE_VALLEY: case POTTED_OAK_SAPLING: case POTTED_ORANGE_TULIP: case POTTED_OXEYE_DAISY: @@ -6104,6 +6670,7 @@ public enum Material implements Keyed { case POTTED_RED_TULIP: case POTTED_SPRUCE_SAPLING: case POTTED_WHITE_TULIP: + case POTTED_WITHER_ROSE: case PRISMARINE_BRICK_STAIRS: case PRISMARINE_STAIRS: case PUMPKIN: @@ -6113,25 +6680,34 @@ public enum Material implements Keyed { case QUARTZ_STAIRS: case REDSTONE_ORE: case RED_BED: + case RED_NETHER_BRICK_STAIRS: case RED_SANDSTONE_STAIRS: case RED_SHULKER_BOX: case REPEATER: case REPEATING_COMMAND_BLOCK: case SANDSTONE_STAIRS: case SHULKER_BOX: - case SIGN: + case SMITHING_TABLE: + case SMOKER: + case SMOOTH_QUARTZ_STAIRS: + case SMOOTH_RED_SANDSTONE_STAIRS: + case SMOOTH_SANDSTONE_STAIRS: case SPRUCE_BUTTON: case SPRUCE_DOOR: case SPRUCE_FENCE: case SPRUCE_FENCE_GATE: + case SPRUCE_SIGN: case SPRUCE_STAIRS: case SPRUCE_TRAPDOOR: + case SPRUCE_WALL_SIGN: + case STONECUTTER: case STONE_BRICK_STAIRS: case STONE_BUTTON: + case STONE_STAIRS: case STRUCTURE_BLOCK: + case SWEET_BERRY_BUSH: case TNT: case TRAPPED_CHEST: - case WALL_SIGN: case WHITE_BED: case WHITE_SHULKER_BOX: case YELLOW_BED: @@ -6163,6 +6739,7 @@ public enum Material implements Keyed { case END_GATEWAY: case END_PORTAL: case END_PORTAL_FRAME: + case JIGSAW: case MOVING_PISTON: case NETHER_PORTAL: case REPEATING_COMMAND_BLOCK: @@ -6313,6 +6890,7 @@ public enum Material implements Keyed { case YELLOW_CONCRETE_POWDER: return 0.5F; case CLAY: + case COMPOSTER: case FARMLAND: case GRASS_BLOCK: case GRAVEL: @@ -6337,6 +6915,9 @@ public enum Material implements Keyed { case CUT_SANDSTONE: case CYAN_WOOL: case END_STONE_BRICKS: + case END_STONE_BRICK_SLAB: + case END_STONE_BRICK_STAIRS: + case END_STONE_BRICK_WALL: case GRAY_WOOL: case GREEN_WOOL: case LIGHT_BLUE_WOOL: @@ -6352,12 +6933,20 @@ public enum Material implements Keyed { case QUARTZ_STAIRS: case RED_SANDSTONE: case RED_SANDSTONE_STAIRS: + case RED_SANDSTONE_WALL: case RED_WOOL: case SANDSTONE: case SANDSTONE_STAIRS: + case SANDSTONE_WALL: case WHITE_WOOL: case YELLOW_WOOL: return 0.8F; + case ACACIA_SIGN: + case ACACIA_WALL_SIGN: + case BAMBOO: + case BAMBOO_SAPLING: + case BIRCH_SIGN: + case BIRCH_WALL_SIGN: case BLACK_BANNER: case BLACK_WALL_BANNER: case BLUE_BANNER: @@ -6369,6 +6958,8 @@ public enum Material implements Keyed { case CREEPER_WALL_HEAD: case CYAN_BANNER: case CYAN_WALL_BANNER: + case DARK_OAK_SIGN: + case DARK_OAK_WALL_SIGN: case DRAGON_HEAD: case DRAGON_WALL_HEAD: case GRAY_BANNER: @@ -6376,6 +6967,8 @@ public enum Material implements Keyed { case GREEN_BANNER: case GREEN_WALL_BANNER: case JACK_O_LANTERN: + case JUNGLE_SIGN: + case JUNGLE_WALL_SIGN: case LIGHT_BLUE_BANNER: case LIGHT_BLUE_WALL_BANNER: case LIGHT_GRAY_BANNER: @@ -6386,6 +6979,8 @@ public enum Material implements Keyed { case MAGENTA_WALL_BANNER: case MELON: case NETHER_WART_BLOCK: + case OAK_SIGN: + case OAK_WALL_SIGN: case ORANGE_BANNER: case ORANGE_WALL_BANNER: case PINK_BANNER: @@ -6397,10 +6992,10 @@ public enum Material implements Keyed { case PURPLE_WALL_BANNER: case RED_BANNER: case RED_WALL_BANNER: - case SIGN: case SKELETON_SKULL: case SKELETON_WALL_SKULL: - case WALL_SIGN: + case SPRUCE_SIGN: + case SPRUCE_WALL_SIGN: case WHITE_BANNER: case WHITE_WALL_BANNER: case WITHER_SKELETON_SKULL: @@ -6446,6 +7041,9 @@ public enum Material implements Keyed { case YELLOW_GLAZED_TERRACOTTA: return 1.4F; case ANDESITE: + case ANDESITE_SLAB: + case ANDESITE_STAIRS: + case ANDESITE_WALL: case BOOKSHELF: case BRAIN_CORAL_BLOCK: case BUBBLE_CORAL_BLOCK: @@ -6460,25 +7058,43 @@ public enum Material implements Keyed { case DEAD_HORN_CORAL_BLOCK: case DEAD_TUBE_CORAL_BLOCK: case DIORITE: + case DIORITE_SLAB: + case DIORITE_STAIRS: + case DIORITE_WALL: case FIRE_CORAL_BLOCK: case GRANITE: + case GRANITE_SLAB: + case GRANITE_STAIRS: + case GRANITE_WALL: case HORN_CORAL_BLOCK: case MOSSY_STONE_BRICKS: + case MOSSY_STONE_BRICK_SLAB: + case MOSSY_STONE_BRICK_STAIRS: + case MOSSY_STONE_BRICK_WALL: case POLISHED_ANDESITE: + case POLISHED_ANDESITE_SLAB: + case POLISHED_ANDESITE_STAIRS: case POLISHED_DIORITE: + case POLISHED_DIORITE_SLAB: + case POLISHED_DIORITE_STAIRS: case POLISHED_GRANITE: + case POLISHED_GRANITE_SLAB: + case POLISHED_GRANITE_STAIRS: case PRISMARINE: case PRISMARINE_BRICKS: case PRISMARINE_BRICK_SLAB: case PRISMARINE_BRICK_STAIRS: case PRISMARINE_SLAB: case PRISMARINE_STAIRS: + case PRISMARINE_WALL: case PURPUR_BLOCK: case PURPUR_PILLAR: case PURPUR_STAIRS: case STONE: case STONE_BRICKS: case STONE_BRICK_STAIRS: + case STONE_BRICK_WALL: + case STONE_STAIRS: case TUBE_CORAL_BLOCK: return 1.5F; case BLACK_CONCRETE: @@ -6518,12 +7134,16 @@ public enum Material implements Keyed { case BRICKS: case BRICK_SLAB: case BRICK_STAIRS: + case BRICK_WALL: case BROWN_SHULKER_BOX: + case CAMPFIRE: case CAULDRON: case COBBLESTONE: case COBBLESTONE_SLAB: case COBBLESTONE_STAIRS: case COBBLESTONE_WALL: + case CUT_RED_SANDSTONE_SLAB: + case CUT_SANDSTONE_SLAB: case CYAN_SHULKER_BOX: case DARK_OAK_FENCE: case DARK_OAK_FENCE_GATE: @@ -6534,6 +7154,7 @@ public enum Material implements Keyed { case DARK_OAK_WOOD: case GRAY_SHULKER_BOX: case GREEN_SHULKER_BOX: + case GRINDSTONE: case JUKEBOX: case JUNGLE_FENCE: case JUNGLE_FENCE_GATE: @@ -6547,11 +7168,14 @@ public enum Material implements Keyed { case LIME_SHULKER_BOX: case MAGENTA_SHULKER_BOX: case MOSSY_COBBLESTONE: + case MOSSY_COBBLESTONE_SLAB: + case MOSSY_COBBLESTONE_STAIRS: case MOSSY_COBBLESTONE_WALL: case NETHER_BRICKS: case NETHER_BRICK_FENCE: case NETHER_BRICK_SLAB: case NETHER_BRICK_STAIRS: + case NETHER_BRICK_WALL: case OAK_FENCE: case OAK_FENCE_GATE: case OAK_LOG: @@ -6566,14 +7190,24 @@ public enum Material implements Keyed { case PURPUR_SLAB: case QUARTZ_SLAB: case RED_NETHER_BRICKS: + case RED_NETHER_BRICK_SLAB: + case RED_NETHER_BRICK_STAIRS: + case RED_NETHER_BRICK_WALL: case RED_SANDSTONE_SLAB: case RED_SHULKER_BOX: case SANDSTONE_SLAB: case SHULKER_BOX: case SMOOTH_QUARTZ: + case SMOOTH_QUARTZ_SLAB: + case SMOOTH_QUARTZ_STAIRS: case SMOOTH_RED_SANDSTONE: + case SMOOTH_RED_SANDSTONE_SLAB: + case SMOOTH_RED_SANDSTONE_STAIRS: case SMOOTH_SANDSTONE: + case SMOOTH_SANDSTONE_SLAB: + case SMOOTH_SANDSTONE_STAIRS: case SMOOTH_STONE: + case SMOOTH_STONE_SLAB: case SPRUCE_FENCE: case SPRUCE_FENCE_GATE: case SPRUCE_LOG: @@ -6598,8 +7232,14 @@ public enum Material implements Keyed { case WHITE_SHULKER_BOX: case YELLOW_SHULKER_BOX: return 2.0F; + case BARREL: + case CARTOGRAPHY_TABLE: case CHEST: case CRAFTING_TABLE: + case FLETCHING_TABLE: + case LECTERN: + case LOOM: + case SMITHING_TABLE: case TRAPPED_CHEST: return 2.5F; case BLUE_ICE: @@ -6633,13 +7273,18 @@ public enum Material implements Keyed { case SPRUCE_DOOR: case SPRUCE_TRAPDOOR: return 3.0F; + case BLAST_FURNACE: case DISPENSER: case DROPPER: case FURNACE: + case LANTERN: + case SMOKER: + case STONECUTTER: return 3.5F; case COBWEB: return 4.0F; case ANVIL: + case BELL: case CHIPPED_ANVIL: case COAL_BLOCK: case DAMAGED_ANVIL: @@ -6823,6 +7468,7 @@ public enum Material implements Keyed { case YELLOW_CONCRETE_POWDER: return 0.5F; case CLAY: + case COMPOSTER: case FARMLAND: case GRASS_BLOCK: case GRAVEL: @@ -6854,6 +7500,9 @@ public enum Material implements Keyed { case CUT_SANDSTONE: case CYAN_WOOL: case END_STONE_BRICKS: + case END_STONE_BRICK_SLAB: + case END_STONE_BRICK_STAIRS: + case END_STONE_BRICK_WALL: case GRAY_WOOL: case GREEN_WOOL: case LIGHT_BLUE_WOOL: @@ -6869,12 +7518,20 @@ public enum Material implements Keyed { case QUARTZ_STAIRS: case RED_SANDSTONE: case RED_SANDSTONE_STAIRS: + case RED_SANDSTONE_WALL: case RED_WOOL: case SANDSTONE: case SANDSTONE_STAIRS: + case SANDSTONE_WALL: case WHITE_WOOL: case YELLOW_WOOL: return 0.8F; + case ACACIA_SIGN: + case ACACIA_WALL_SIGN: + case BAMBOO: + case BAMBOO_SAPLING: + case BIRCH_SIGN: + case BIRCH_WALL_SIGN: case BLACK_BANNER: case BLACK_WALL_BANNER: case BLUE_BANNER: @@ -6886,6 +7543,8 @@ public enum Material implements Keyed { case CREEPER_WALL_HEAD: case CYAN_BANNER: case CYAN_WALL_BANNER: + case DARK_OAK_SIGN: + case DARK_OAK_WALL_SIGN: case DRAGON_HEAD: case DRAGON_WALL_HEAD: case GRAY_BANNER: @@ -6893,6 +7552,8 @@ public enum Material implements Keyed { case GREEN_BANNER: case GREEN_WALL_BANNER: case JACK_O_LANTERN: + case JUNGLE_SIGN: + case JUNGLE_WALL_SIGN: case LIGHT_BLUE_BANNER: case LIGHT_BLUE_WALL_BANNER: case LIGHT_GRAY_BANNER: @@ -6903,6 +7564,8 @@ public enum Material implements Keyed { case MAGENTA_WALL_BANNER: case MELON: case NETHER_WART_BLOCK: + case OAK_SIGN: + case OAK_WALL_SIGN: case ORANGE_BANNER: case ORANGE_WALL_BANNER: case PINK_BANNER: @@ -6914,10 +7577,10 @@ public enum Material implements Keyed { case PURPLE_WALL_BANNER: case RED_BANNER: case RED_WALL_BANNER: - case SIGN: case SKELETON_SKULL: case SKELETON_WALL_SKULL: - case WALL_SIGN: + case SPRUCE_SIGN: + case SPRUCE_WALL_SIGN: case WHITE_BANNER: case WHITE_WALL_BANNER: case WITHER_SKELETON_SKULL: @@ -6971,6 +7634,7 @@ public enum Material implements Keyed { case BLUE_SHULKER_BOX: case BONE_BLOCK: case BROWN_SHULKER_BOX: + case CAMPFIRE: case CAULDRON: case CYAN_SHULKER_BOX: case DARK_OAK_LOG: @@ -7007,9 +7671,15 @@ public enum Material implements Keyed { case WHITE_SHULKER_BOX: case YELLOW_SHULKER_BOX: return 2.0F; + case BARREL: + case CARTOGRAPHY_TABLE: case CHEST: case CRAFTING_TABLE: case DRIED_KELP_BLOCK: + case FLETCHING_TABLE: + case LECTERN: + case LOOM: + case SMITHING_TABLE: case TRAPPED_CHEST: return 2.5F; case BLUE_ICE: @@ -7070,9 +7740,13 @@ public enum Material implements Keyed { case SPRUCE_STAIRS: case SPRUCE_TRAPDOOR: return 3.0F; + case BLAST_FURNACE: case DISPENSER: case DROPPER: case FURNACE: + case LANTERN: + case SMOKER: + case STONECUTTER: return 3.5F; case COBWEB: return 4.0F; @@ -7096,15 +7770,20 @@ public enum Material implements Keyed { return 4.2F; case HOPPER: return 4.8F; + case BELL: case IRON_DOOR: case IRON_TRAPDOOR: case SPAWNER: return 5.0F; case ANDESITE: + case ANDESITE_SLAB: + case ANDESITE_STAIRS: + case ANDESITE_WALL: case BRAIN_CORAL_BLOCK: case BRICKS: case BRICK_SLAB: case BRICK_STAIRS: + case BRICK_WALL: case BUBBLE_CORAL_BLOCK: case CHISELED_STONE_BRICKS: case COAL_BLOCK: @@ -7113,6 +7792,8 @@ public enum Material implements Keyed { case COBBLESTONE_STAIRS: case COBBLESTONE_WALL: case CRACKED_STONE_BRICKS: + case CUT_RED_SANDSTONE_SLAB: + case CUT_SANDSTONE_SLAB: case DARK_PRISMARINE: case DARK_PRISMARINE_SLAB: case DARK_PRISMARINE_STAIRS: @@ -7123,31 +7804,51 @@ public enum Material implements Keyed { case DEAD_TUBE_CORAL_BLOCK: case DIAMOND_BLOCK: case DIORITE: + case DIORITE_SLAB: + case DIORITE_STAIRS: + case DIORITE_WALL: case EMERALD_BLOCK: case FIRE_CORAL_BLOCK: case GOLD_BLOCK: case GRANITE: + case GRANITE_SLAB: + case GRANITE_STAIRS: + case GRANITE_WALL: + case GRINDSTONE: case HORN_CORAL_BLOCK: case IRON_BARS: case IRON_BLOCK: case JUKEBOX: case MOSSY_COBBLESTONE: + case MOSSY_COBBLESTONE_SLAB: + case MOSSY_COBBLESTONE_STAIRS: case MOSSY_COBBLESTONE_WALL: case MOSSY_STONE_BRICKS: + case MOSSY_STONE_BRICK_SLAB: + case MOSSY_STONE_BRICK_STAIRS: + case MOSSY_STONE_BRICK_WALL: case NETHER_BRICKS: case NETHER_BRICK_FENCE: case NETHER_BRICK_SLAB: case NETHER_BRICK_STAIRS: + case NETHER_BRICK_WALL: case PETRIFIED_OAK_SLAB: case POLISHED_ANDESITE: + case POLISHED_ANDESITE_SLAB: + case POLISHED_ANDESITE_STAIRS: case POLISHED_DIORITE: + case POLISHED_DIORITE_SLAB: + case POLISHED_DIORITE_STAIRS: case POLISHED_GRANITE: + case POLISHED_GRANITE_SLAB: + case POLISHED_GRANITE_STAIRS: case PRISMARINE: case PRISMARINE_BRICKS: case PRISMARINE_BRICK_SLAB: case PRISMARINE_BRICK_STAIRS: case PRISMARINE_SLAB: case PRISMARINE_STAIRS: + case PRISMARINE_WALL: case PURPUR_BLOCK: case PURPUR_PILLAR: case PURPUR_SLAB: @@ -7155,17 +7856,29 @@ public enum Material implements Keyed { case QUARTZ_SLAB: case REDSTONE_BLOCK: case RED_NETHER_BRICKS: + case RED_NETHER_BRICK_SLAB: + case RED_NETHER_BRICK_STAIRS: + case RED_NETHER_BRICK_WALL: case RED_SANDSTONE_SLAB: case SANDSTONE_SLAB: case SMOOTH_QUARTZ: + case SMOOTH_QUARTZ_SLAB: + case SMOOTH_QUARTZ_STAIRS: case SMOOTH_RED_SANDSTONE: + case SMOOTH_RED_SANDSTONE_SLAB: + case SMOOTH_RED_SANDSTONE_STAIRS: case SMOOTH_SANDSTONE: + case SMOOTH_SANDSTONE_SLAB: + case SMOOTH_SANDSTONE_STAIRS: case SMOOTH_STONE: + case SMOOTH_STONE_SLAB: case STONE: case STONE_BRICKS: case STONE_BRICK_SLAB: case STONE_BRICK_STAIRS: + case STONE_BRICK_WALL: case STONE_SLAB: + case STONE_STAIRS: case TUBE_CORAL_BLOCK: return 6.0F; case DRAGON_EGG: @@ -7188,6 +7901,7 @@ public enum Material implements Keyed { case END_GATEWAY: case END_PORTAL: case END_PORTAL_FRAME: + case JIGSAW: case REPEATING_COMMAND_BLOCK: case STRUCTURE_BLOCK: return 3600000.0F; diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java index 3b2314a9..68cb7442 100644 --- a/src/main/java/org/bukkit/Particle.java +++ b/src/main/java/org/bukkit/Particle.java @@ -60,6 +60,14 @@ public enum Particle { BUBBLE_COLUMN_UP, NAUTILUS, DOLPHIN, + SNEEZE, + CAMPFIRE_COSY_SMOKE, + CAMPFIRE_SIGNAL_SMOKE, + COMPOSTER, + FLASH, + FALLING_LAVA, + LANDING_LAVA, + FALLING_WATER, // ----- Legacy Separator ----- LEGACY_BLOCK_CRACK(MaterialData.class), LEGACY_BLOCK_DUST(MaterialData.class), diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java new file mode 100644 index 00000000..e1d0252b --- /dev/null +++ b/src/main/java/org/bukkit/Registry.java @@ -0,0 +1,155 @@ +package org.bukkit; + +import com.google.common.collect.ImmutableMap; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Map; +import org.bukkit.advancement.Advancement; +import org.bukkit.block.Biome; +import org.bukkit.boss.KeyedBossBar; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.EntityType; +import org.bukkit.loot.LootTables; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a registry of Bukkit objects that may be retrieved by + * {@link NamespacedKey}. + * + * @param type of item in the registry + */ +public interface Registry extends Iterable { + + /** + * Server advancements. + * + * @see Bukkit#getAdvancement(org.bukkit.NamespacedKey) + * @see Bukkit#advancementIterator() + */ + Registry ADVANCEMENT = new Registry() { + + @Nullable + @Override + public Advancement get(@NotNull NamespacedKey key) { + return Bukkit.getAdvancement(key); + } + + @NotNull + @Override + public Iterator iterator() { + return Bukkit.advancementIterator(); + } + }; + /** + * Server art. + * + * @see Art + */ + Registry ART = new SimpleRegistry<>(Art.class); + /** + * Server biomes. + * + * @see Biome + */ + Registry BIOME = new SimpleRegistry<>(Biome.class); + /** + * Custom boss bars. + * + * @see Bukkit#getBossBar(org.bukkit.NamespacedKey) + * @see Bukkit#getBossBars() + */ + Registry BOSS_BARS = new Registry() { + + @Nullable + @Override + public KeyedBossBar get(@NotNull NamespacedKey key) { + return Bukkit.getBossBar(key); + } + + @NotNull + @Override + public Iterator iterator() { + return Bukkit.getBossBars(); + } + }; + /** + * Server enchantments. + * + * @see Enchantment#getByKey(org.bukkit.NamespacedKey) + */ + Registry ENCHANTMENT = new Registry() { + + @Nullable + @Override + public Enchantment get(@NotNull NamespacedKey key) { + return Enchantment.getByKey(key); + } + + @NotNull + @Override + public Iterator iterator() { + return Arrays.asList(Enchantment.values()).iterator(); + } + }; + /** + * Server entity types. + * + * @see EntityType + */ + Registry ENTITY_TYPE = new SimpleRegistry<>(EntityType.class); + /** + * Default server loot tables. + * + * @see LootTables + */ + Registry LOOT_TABLES = new SimpleRegistry<>(LootTables.class); + /** + * Server materials. + * + * @see Material + */ + Registry MATERIAL = new SimpleRegistry<>(Material.class); + /** + * Server statistics. + * + * @see Statistic + */ + Registry STATISTIC = new SimpleRegistry<>(Statistic.class); + + /** + * Get the object by its key. + * + * @param key non-null key + * @return item or null if does not exist + */ + @Nullable + T get(@NotNull NamespacedKey key); + + final static class SimpleRegistry & Keyed> implements Registry { + + private final Map map; + + protected SimpleRegistry(@NotNull Class type) { + ImmutableMap.Builder builder = ImmutableMap.builder(); + + for (T entry : type.getEnumConstants()) { + builder.put(entry.getKey(), entry); + } + + map = builder.build(); + } + + @Nullable + @Override + public T get(@NotNull NamespacedKey key) { + return map.get(key); + } + + @NotNull + @Override + public Iterator iterator() { + return map.values().iterator(); + } + } +} diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 502a8581..f3aa7aef 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -161,27 +161,6 @@ public interface Server extends PluginMessageRecipient { @NotNull public String getIp(); - /** - * Get the name of this server. - * - * @return the name of this server - * @deprecated not a standard server property - */ - @Deprecated - @NotNull - public String getServerName(); - - /** - * Get an ID of this server. The ID is a simple generally alphanumeric ID - * that can be used for uniquely identifying this server. - * - * @return the ID of this server - * @deprecated not a standard server property - */ - @Deprecated - @NotNull - public String getServerId(); - /** * Get world type (level-type setting) for default world. * diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java index d84ad5b9..91e5f0f0 100644 --- a/src/main/java/org/bukkit/Sound.java +++ b/src/main/java/org/bukkit/Sound.java @@ -24,22 +24,40 @@ public enum Sound { BLOCK_ANVIL_PLACE, BLOCK_ANVIL_STEP, BLOCK_ANVIL_USE, + BLOCK_BAMBOO_BREAK, + BLOCK_BAMBOO_FALL, + BLOCK_BAMBOO_HIT, + BLOCK_BAMBOO_PLACE, + BLOCK_BAMBOO_SAPLING_BREAK, + BLOCK_BAMBOO_SAPLING_HIT, + BLOCK_BAMBOO_SAPLING_PLACE, + BLOCK_BAMBOO_STEP, + BLOCK_BARREL_CLOSE, + BLOCK_BARREL_OPEN, BLOCK_BEACON_ACTIVATE, BLOCK_BEACON_AMBIENT, BLOCK_BEACON_DEACTIVATE, BLOCK_BEACON_POWER_SELECT, + BLOCK_BELL_RESONATE, + BLOCK_BELL_USE, + BLOCK_BLASTFURNACE_FIRE_CRACKLE, BLOCK_BREWING_STAND_BREW, BLOCK_BUBBLE_COLUMN_BUBBLE_POP, BLOCK_BUBBLE_COLUMN_UPWARDS_AMBIENT, BLOCK_BUBBLE_COLUMN_UPWARDS_INSIDE, BLOCK_BUBBLE_COLUMN_WHIRLPOOL_AMBIENT, BLOCK_BUBBLE_COLUMN_WHIRLPOOL_INSIDE, + BLOCK_CAMPFIRE_CRACKLE, BLOCK_CHEST_CLOSE, BLOCK_CHEST_LOCKED, BLOCK_CHEST_OPEN, BLOCK_CHORUS_FLOWER_DEATH, BLOCK_CHORUS_FLOWER_GROW, BLOCK_COMPARATOR_CLICK, + BLOCK_COMPOSTER_EMPTY, + BLOCK_COMPOSTER_FILL, + BLOCK_COMPOSTER_FILL_SUCCESS, + BLOCK_COMPOSTER_READY, BLOCK_CONDUIT_ACTIVATE, BLOCK_CONDUIT_AMBIENT, BLOCK_CONDUIT_AMBIENT_SHORT, @@ -50,6 +68,7 @@ public enum Sound { BLOCK_CORAL_BLOCK_HIT, BLOCK_CORAL_BLOCK_PLACE, BLOCK_CORAL_BLOCK_STEP, + BLOCK_CROP_BREAK, BLOCK_DISPENSER_DISPENSE, BLOCK_DISPENSER_FAIL, BLOCK_DISPENSER_LAUNCH, @@ -79,6 +98,7 @@ public enum Sound { BLOCK_GRAVEL_HIT, BLOCK_GRAVEL_PLACE, BLOCK_GRAVEL_STEP, + BLOCK_GRINDSTONE_USE, BLOCK_IRON_DOOR_CLOSE, BLOCK_IRON_DOOR_OPEN, BLOCK_IRON_TRAPDOOR_CLOSE, @@ -88,6 +108,11 @@ public enum Sound { BLOCK_LADDER_HIT, BLOCK_LADDER_PLACE, BLOCK_LADDER_STEP, + BLOCK_LANTERN_BREAK, + BLOCK_LANTERN_FALL, + BLOCK_LANTERN_HIT, + BLOCK_LANTERN_PLACE, + BLOCK_LANTERN_STEP, BLOCK_LAVA_AMBIENT, BLOCK_LAVA_EXTINGUISH, BLOCK_LAVA_POP, @@ -100,14 +125,20 @@ public enum Sound { BLOCK_METAL_PRESSURE_PLATE_CLICK_OFF, BLOCK_METAL_PRESSURE_PLATE_CLICK_ON, BLOCK_METAL_STEP, + BLOCK_NETHER_WART_BREAK, + BLOCK_NOTE_BLOCK_BANJO, BLOCK_NOTE_BLOCK_BASEDRUM, BLOCK_NOTE_BLOCK_BASS, BLOCK_NOTE_BLOCK_BELL, + BLOCK_NOTE_BLOCK_BIT, BLOCK_NOTE_BLOCK_CHIME, + BLOCK_NOTE_BLOCK_COW_BELL, + BLOCK_NOTE_BLOCK_DIDGERIDOO, BLOCK_NOTE_BLOCK_FLUTE, BLOCK_NOTE_BLOCK_GUITAR, BLOCK_NOTE_BLOCK_HARP, BLOCK_NOTE_BLOCK_HAT, + BLOCK_NOTE_BLOCK_IRON_XYLOPHONE, BLOCK_NOTE_BLOCK_PLING, BLOCK_NOTE_BLOCK_SNARE, BLOCK_NOTE_BLOCK_XYLOPHONE, @@ -123,6 +154,11 @@ public enum Sound { BLOCK_SAND_HIT, BLOCK_SAND_PLACE, BLOCK_SAND_STEP, + BLOCK_SCAFFOLDING_BREAK, + BLOCK_SCAFFOLDING_FALL, + BLOCK_SCAFFOLDING_HIT, + BLOCK_SCAFFOLDING_PLACE, + BLOCK_SCAFFOLDING_STEP, BLOCK_SHULKER_BOX_CLOSE, BLOCK_SHULKER_BOX_OPEN, BLOCK_SLIME_BLOCK_BREAK, @@ -130,6 +166,7 @@ public enum Sound { BLOCK_SLIME_BLOCK_HIT, BLOCK_SLIME_BLOCK_PLACE, BLOCK_SLIME_BLOCK_STEP, + BLOCK_SMOKER_SMOKE, BLOCK_SNOW_BREAK, BLOCK_SNOW_FALL, BLOCK_SNOW_HIT, @@ -144,6 +181,8 @@ public enum Sound { BLOCK_STONE_PRESSURE_PLATE_CLICK_OFF, BLOCK_STONE_PRESSURE_PLATE_CLICK_ON, BLOCK_STONE_STEP, + BLOCK_SWEET_BERRY_BUSH_BREAK, + BLOCK_SWEET_BERRY_BUSH_PLACE, BLOCK_TRIPWIRE_ATTACH, BLOCK_TRIPWIRE_CLICK_OFF, BLOCK_TRIPWIRE_CLICK_ON, @@ -193,11 +232,14 @@ public enum Sound { ENTITY_BOAT_PADDLE_LAND, ENTITY_BOAT_PADDLE_WATER, ENTITY_CAT_AMBIENT, + ENTITY_CAT_BEG_FOR_FOOD, ENTITY_CAT_DEATH, + ENTITY_CAT_EAT, ENTITY_CAT_HISS, ENTITY_CAT_HURT, ENTITY_CAT_PURR, ENTITY_CAT_PURREOW, + ENTITY_CAT_STRAY_AMBIENT, ENTITY_CHICKEN_AMBIENT, ENTITY_CHICKEN_DEATH, ENTITY_CHICKEN_EGG, @@ -270,6 +312,7 @@ public enum Sound { ENTITY_ENDER_PEARL_THROW, ENTITY_EVOKER_AMBIENT, ENTITY_EVOKER_CAST_SPELL, + ENTITY_EVOKER_CELEBRATE, ENTITY_EVOKER_DEATH, ENTITY_EVOKER_FANGS_ATTACK, ENTITY_EVOKER_HURT, @@ -290,6 +333,16 @@ public enum Sound { ENTITY_FISHING_BOBBER_SPLASH, ENTITY_FISHING_BOBBER_THROW, ENTITY_FISH_SWIM, + ENTITY_FOX_AGGRO, + ENTITY_FOX_AMBIENT, + ENTITY_FOX_BITE, + ENTITY_FOX_DEATH, + ENTITY_FOX_EAT, + ENTITY_FOX_HURT, + ENTITY_FOX_SCREECH, + ENTITY_FOX_SLEEP, + ENTITY_FOX_SNIFF, + ENTITY_FOX_SPIT, ENTITY_GENERIC_BIG_FALL, ENTITY_GENERIC_BURN, ENTITY_GENERIC_DEATH, @@ -380,13 +433,31 @@ public enum Sound { ENTITY_MAGMA_CUBE_SQUISH_SMALL, ENTITY_MINECART_INSIDE, ENTITY_MINECART_RIDING, + ENTITY_MOOSHROOM_CONVERT, + ENTITY_MOOSHROOM_EAT, + ENTITY_MOOSHROOM_MILK, ENTITY_MOOSHROOM_SHEAR, + ENTITY_MOOSHROOM_SUSPICIOUS_MILK, ENTITY_MULE_AMBIENT, ENTITY_MULE_CHEST, ENTITY_MULE_DEATH, ENTITY_MULE_HURT, + ENTITY_OCELOT_AMBIENT, + ENTITY_OCELOT_DEATH, + ENTITY_OCELOT_HURT, ENTITY_PAINTING_BREAK, ENTITY_PAINTING_PLACE, + ENTITY_PANDA_AGGRESSIVE_AMBIENT, + ENTITY_PANDA_AMBIENT, + ENTITY_PANDA_BITE, + ENTITY_PANDA_CANT_BREED, + ENTITY_PANDA_DEATH, + ENTITY_PANDA_EAT, + ENTITY_PANDA_HURT, + ENTITY_PANDA_PRE_SNEEZE, + ENTITY_PANDA_SNEEZE, + ENTITY_PANDA_STEP, + ENTITY_PANDA_WORRIED_AMBIENT, ENTITY_PARROT_AMBIENT, ENTITY_PARROT_DEATH, ENTITY_PARROT_EAT, @@ -401,11 +472,15 @@ public enum Sound { ENTITY_PARROT_IMITATE_ENDER_DRAGON, ENTITY_PARROT_IMITATE_EVOKER, ENTITY_PARROT_IMITATE_GHAST, + ENTITY_PARROT_IMITATE_GUARDIAN, ENTITY_PARROT_IMITATE_HUSK, ENTITY_PARROT_IMITATE_ILLUSIONER, ENTITY_PARROT_IMITATE_MAGMA_CUBE, + ENTITY_PARROT_IMITATE_PANDA, ENTITY_PARROT_IMITATE_PHANTOM, + ENTITY_PARROT_IMITATE_PILLAGER, ENTITY_PARROT_IMITATE_POLAR_BEAR, + ENTITY_PARROT_IMITATE_RAVAGER, ENTITY_PARROT_IMITATE_SHULKER, ENTITY_PARROT_IMITATE_SILVERFISH, ENTITY_PARROT_IMITATE_SKELETON, @@ -433,6 +508,10 @@ public enum Sound { ENTITY_PIG_HURT, ENTITY_PIG_SADDLE, ENTITY_PIG_STEP, + ENTITY_PILLAGER_AMBIENT, + ENTITY_PILLAGER_CELEBRATE, + ENTITY_PILLAGER_DEATH, + ENTITY_PILLAGER_HURT, ENTITY_PLAYER_ATTACK_CRIT, ENTITY_PLAYER_ATTACK_KNOCKBACK, ENTITY_PLAYER_ATTACK_NODAMAGE, @@ -446,6 +525,7 @@ public enum Sound { ENTITY_PLAYER_HURT, ENTITY_PLAYER_HURT_DROWN, ENTITY_PLAYER_HURT_ON_FIRE, + ENTITY_PLAYER_HURT_SWEET_BERRY_BUSH, ENTITY_PLAYER_LEVELUP, ENTITY_PLAYER_SMALL_FALL, ENTITY_PLAYER_SPLASH, @@ -469,6 +549,14 @@ public enum Sound { ENTITY_RABBIT_DEATH, ENTITY_RABBIT_HURT, ENTITY_RABBIT_JUMP, + ENTITY_RAVAGER_AMBIENT, + ENTITY_RAVAGER_ATTACK, + ENTITY_RAVAGER_CELEBRATE, + ENTITY_RAVAGER_DEATH, + ENTITY_RAVAGER_HURT, + ENTITY_RAVAGER_ROAR, + ENTITY_RAVAGER_STEP, + ENTITY_RAVAGER_STUNNED, ENTITY_SALMON_AMBIENT, ENTITY_SALMON_DEATH, ENTITY_SALMON_FLOP, @@ -555,15 +643,41 @@ public enum Sound { ENTITY_VEX_DEATH, ENTITY_VEX_HURT, ENTITY_VILLAGER_AMBIENT, + ENTITY_VILLAGER_CELEBRATE, ENTITY_VILLAGER_DEATH, ENTITY_VILLAGER_HURT, ENTITY_VILLAGER_NO, ENTITY_VILLAGER_TRADE, + ENTITY_VILLAGER_WORK_ARMORER, + ENTITY_VILLAGER_WORK_BUTCHER, + ENTITY_VILLAGER_WORK_CARTOGRAPHER, + ENTITY_VILLAGER_WORK_CLERIC, + ENTITY_VILLAGER_WORK_FARMER, + ENTITY_VILLAGER_WORK_FISHERMAN, + ENTITY_VILLAGER_WORK_FLETCHER, + ENTITY_VILLAGER_WORK_LEATHERWORKER, + ENTITY_VILLAGER_WORK_LIBRARIAN, + ENTITY_VILLAGER_WORK_MASON, + ENTITY_VILLAGER_WORK_SHEPHERD, + ENTITY_VILLAGER_WORK_TOOLSMITH, + ENTITY_VILLAGER_WORK_WEAPONSMITH, ENTITY_VILLAGER_YES, ENTITY_VINDICATOR_AMBIENT, + ENTITY_VINDICATOR_CELEBRATE, ENTITY_VINDICATOR_DEATH, ENTITY_VINDICATOR_HURT, + ENTITY_WANDERING_TRADER_AMBIENT, + ENTITY_WANDERING_TRADER_DEATH, + ENTITY_WANDERING_TRADER_DISAPPEARED, + ENTITY_WANDERING_TRADER_DRINK_MILK, + ENTITY_WANDERING_TRADER_DRINK_POTION, + ENTITY_WANDERING_TRADER_HURT, + ENTITY_WANDERING_TRADER_NO, + ENTITY_WANDERING_TRADER_REAPPEARED, + ENTITY_WANDERING_TRADER_TRADE, + ENTITY_WANDERING_TRADER_YES, ENTITY_WITCH_AMBIENT, + ENTITY_WITCH_CELEBRATE, ENTITY_WITCH_DEATH, ENTITY_WITCH_DRINK, ENTITY_WITCH_HURT, @@ -610,6 +724,7 @@ public enum Sound { ENTITY_ZOMBIE_VILLAGER_DEATH, ENTITY_ZOMBIE_VILLAGER_HURT, ENTITY_ZOMBIE_VILLAGER_STEP, + EVENT_RAID_HORN, ITEM_ARMOR_EQUIP_CHAIN, ITEM_ARMOR_EQUIP_DIAMOND, ITEM_ARMOR_EQUIP_ELYTRA, @@ -619,6 +734,8 @@ public enum Sound { ITEM_ARMOR_EQUIP_LEATHER, ITEM_ARMOR_EQUIP_TURTLE, ITEM_AXE_STRIP, + ITEM_BOOK_PAGE_TURN, + ITEM_BOOK_PUT, ITEM_BOTTLE_EMPTY, ITEM_BOTTLE_FILL, ITEM_BOTTLE_FILL_DRAGONBREATH, @@ -629,13 +746,24 @@ public enum Sound { ITEM_BUCKET_FILL_FISH, ITEM_BUCKET_FILL_LAVA, ITEM_CHORUS_FRUIT_TELEPORT, + ITEM_CROP_PLANT, + ITEM_CROSSBOW_HIT, + ITEM_CROSSBOW_LOADING_END, + ITEM_CROSSBOW_LOADING_MIDDLE, + ITEM_CROSSBOW_LOADING_START, + ITEM_CROSSBOW_QUICK_CHARGE_1, + ITEM_CROSSBOW_QUICK_CHARGE_2, + ITEM_CROSSBOW_QUICK_CHARGE_3, + ITEM_CROSSBOW_SHOOT, ITEM_ELYTRA_FLYING, ITEM_FIRECHARGE_USE, ITEM_FLINTANDSTEEL_USE, ITEM_HOE_TILL, + ITEM_NETHER_WART_PLANT, ITEM_SHIELD_BLOCK, ITEM_SHIELD_BREAK, ITEM_SHOVEL_FLATTEN, + ITEM_SWEET_BERRIES_PICK_FROM_BUSH, ITEM_TOTEM_USE, ITEM_TRIDENT_HIT, ITEM_TRIDENT_HIT_GROUND, @@ -666,6 +794,11 @@ public enum Sound { MUSIC_NETHER, MUSIC_UNDER_WATER, UI_BUTTON_CLICK, + UI_CARTOGRAPHY_TABLE_TAKE_RESULT, + UI_LOOM_SELECT_PATTERN, + UI_LOOM_TAKE_RESULT, + UI_STONECUTTER_SELECT_RECIPE, + UI_STONECUTTER_TAKE_RESULT, UI_TOAST_CHALLENGE_COMPLETE, UI_TOAST_IN, UI_TOAST_OUT, diff --git a/src/main/java/org/bukkit/Statistic.java b/src/main/java/org/bukkit/Statistic.java index f5a834fe..c54c0012 100644 --- a/src/main/java/org/bukkit/Statistic.java +++ b/src/main/java/org/bukkit/Statistic.java @@ -1,11 +1,12 @@ package org.bukkit; +import java.util.Locale; import org.jetbrains.annotations.NotNull; /** * Represents a countable statistic, which is tracked by the server. */ -public enum Statistic { +public enum Statistic implements Keyed { DAMAGE_DEALT, DAMAGE_TAKEN, DEATHS, @@ -74,9 +75,21 @@ public enum Statistic { DAMAGE_BLOCKED_BY_SHIELD, DAMAGE_ABSORBED, DAMAGE_RESISTED, - CLEAN_SHULKER_BOX; + CLEAN_SHULKER_BOX, + OPEN_BARREL, + INTERACT_WITH_BLAST_FURNACE, + INTERACT_WITH_SMOKER, + INTERACT_WITH_LECTERN, + INTERACT_WITH_CAMPFIRE, + INTERACT_WITH_CARTOGRAPHY_TABLE, + INTERACT_WITH_LOOM, + INTERACT_WITH_STONECUTTER, + BELL_RING, + RAID_TRIGGER, + RAID_WIN; private final Type type; + private final NamespacedKey key; private Statistic() { this(Type.UNTYPED); @@ -84,6 +97,7 @@ public enum Statistic { private Statistic(/*@NotNull*/ Type type) { this.type = type; + this.key = NamespacedKey.minecraft(name().toLowerCase(Locale.ROOT)); } /** @@ -123,6 +137,12 @@ public enum Statistic { return type == Type.BLOCK; } + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + /** * The type of statistic. * diff --git a/src/main/java/org/bukkit/StructureType.java b/src/main/java/org/bukkit/StructureType.java index 02d79545..a99c8115 100644 --- a/src/main/java/org/bukkit/StructureType.java +++ b/src/main/java/org/bukkit/StructureType.java @@ -31,7 +31,7 @@ public class StructureType { * They are the only place where cave spider spawners and minecarts with * chests can be found naturally. */ - public static final StructureType MINESHAFT = register(new StructureType("Mineshaft", MapCursor.Type.RED_X)); + public static final StructureType MINESHAFT = register(new StructureType("mineshaft", MapCursor.Type.RED_X)); /** * Villages are naturally generating structures that form above ground. @@ -39,7 +39,7 @@ public class StructureType { * They are usually generated in desert, plains, taiga, and savanna biomes * and are a site for villager spawns, with whom the player can trade. */ - public static final StructureType VILLAGE = register(new StructureType("Village", MapCursor.Type.MANSION)); + public static final StructureType VILLAGE = register(new StructureType("village", MapCursor.Type.MANSION)); /** * Nether fortresses are very large complexes that mainly consist of @@ -48,7 +48,7 @@ public class StructureType { * They contain blaze spawners, nether wart farms, and loot chests. They are * only generated in the nether dimension. */ - public static final StructureType NETHER_FORTRESS = register(new StructureType("Fortress", MapCursor.Type.RED_X)); + public static final StructureType NETHER_FORTRESS = register(new StructureType("fortress", MapCursor.Type.RED_X)); /** * Strongholds are underground structures that consist of many rooms, @@ -56,7 +56,7 @@ public class StructureType { *
* They can be found using an {@link Material#ENDER_EYE}. */ - public static final StructureType STRONGHOLD = register(new StructureType("Stronghold", MapCursor.Type.MANSION)); + public static final StructureType STRONGHOLD = register(new StructureType("stronghold", MapCursor.Type.MANSION)); /** * Jungle pyramids (also known as jungle temples) are found in jungles. @@ -65,7 +65,7 @@ public class StructureType { * consist of three floors, with the bottom floor containing treasure * chests. */ - public static final StructureType JUNGLE_PYRAMID = register(new StructureType("Jungle_Pyramid", MapCursor.Type.RED_X)); + public static final StructureType JUNGLE_PYRAMID = register(new StructureType("jungle_pyramid", MapCursor.Type.RED_X)); /** * Ocean ruins are clusters of many different blocks that generate @@ -74,27 +74,27 @@ public class StructureType { * They come in my different variations. The cold variants consist primarily * of stone brick, and the warm variants consist of sandstone. */ - public static final StructureType OCEAN_RUIN = register(new StructureType("Ocean_Ruin", MapCursor.Type.TEMPLE)); + public static final StructureType OCEAN_RUIN = register(new StructureType("ocean_ruin", MapCursor.Type.TEMPLE)); /** * Desert pyramids (also known as desert temples) are found in deserts. *
* They are usually composed of sandstone and stained terracotta. */ - public static final StructureType DESERT_PYRAMID = register(new StructureType("Desert_Pyramid", MapCursor.Type.RED_X)); + public static final StructureType DESERT_PYRAMID = register(new StructureType("desert_pyramid", MapCursor.Type.RED_X)); /** * Igloos are structures that generate in snowy biomes. *
* They consist of the house, as well as a basement. */ - public static final StructureType IGLOO = register(new StructureType("Igloo", MapCursor.Type.RED_X)); + public static final StructureType IGLOO = register(new StructureType("igloo", MapCursor.Type.RED_X)); /** * Swamp huts (also known as witch huts) generate in swamp biomes and have * the ability to spawn witches. */ - public static final StructureType SWAMP_HUT = register(new StructureType("Swamp_Hut", MapCursor.Type.RED_X)); + public static final StructureType SWAMP_HUT = register(new StructureType("swamp_hut", MapCursor.Type.RED_X)); /** * Ocean monuments are underwater structures. @@ -103,7 +103,7 @@ public class StructureType { * lanterns. They are the only place guardians and elder guardians spawn * naturally. */ - public static final StructureType OCEAN_MONUMENT = register(new StructureType("Monument", MapCursor.Type.TEMPLE)); + public static final StructureType OCEAN_MONUMENT = register(new StructureType("monument", MapCursor.Type.TEMPLE)); /** * End Cities are tall castle-like structures that generate in the outer @@ -112,7 +112,7 @@ public class StructureType { * They consist primarily of end stone bricks, purpur blocks, and end rods. * They are the only place where shulkers can be found. */ - public static final StructureType END_CITY = register(new StructureType("EndCity", MapCursor.Type.RED_X)); + public static final StructureType END_CITY = register(new StructureType("endcity", MapCursor.Type.RED_X)); /** * Mansions (also known as woodland mansions) are massive house structures @@ -121,13 +121,13 @@ public class StructureType { * They are the only place where evokers, vindicators, and vexes spawn * naturally (but only once) */ - public static final StructureType WOODLAND_MANSION = register(new StructureType("Mansion", MapCursor.Type.MANSION)); + public static final StructureType WOODLAND_MANSION = register(new StructureType("mansion", MapCursor.Type.MANSION)); /** * Buried treasure consists of a single chest buried in the beach sand or * gravel, with random loot in it. */ - public static final StructureType BURIED_TREASURE = register(new StructureType("Buried_Treasure", MapCursor.Type.RED_X)); + public static final StructureType BURIED_TREASURE = register(new StructureType("buried_treasure", MapCursor.Type.RED_X)); /** * Shipwrecks are structures that generate on the floor of oceans or @@ -136,7 +136,12 @@ public class StructureType { * They are made up of wood materials, and contain 1-3 loot chests. They can * generate sideways, upside-down, or upright. */ - public static final StructureType SHIPWRECK = register(new StructureType("Shipwreck", MapCursor.Type.RED_X)); + public static final StructureType SHIPWRECK = register(new StructureType("shipwreck", MapCursor.Type.RED_X)); + + /** + * Pillager outposts may contain crossbows. + */ + public static final StructureType PILLAGER_OUTPOST = register(new StructureType("pillager_outpost", MapCursor.Type.RED_X)); /* **************** * STRUCTURE TYPES REGISTERED ABOVE THIS diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java index 03d1f258..cb8daefb 100644 --- a/src/main/java/org/bukkit/Tag.java +++ b/src/main/java/org/bukkit/Tag.java @@ -57,6 +57,10 @@ public interface Tag extends Keyed { * Vanilla block tag representing all wooden slabs. */ Tag WOODEN_SLABS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_slabs"), Material.class); + /** + * Vanilla block tag representing all wooden fences. + */ + Tag WOODEN_FENCES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wooden_fences"), Material.class); /** * Vanilla block tag representing all wooden pressure plates. */ @@ -118,6 +122,10 @@ public interface Tag extends Keyed { * Vanilla block tag representing all slabs. */ Tag SLABS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("slabs"), Material.class); + /** + * Vanilla block tag representing all walls. + */ + Tag WALLS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("walls"), Material.class); /** * Vanilla block tag representing all damaged and undamaged anvils. */ @@ -139,6 +147,18 @@ public interface Tag extends Keyed { * Vanilla block tag representing all empty and filled flower pots. */ Tag FLOWER_POTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("flower_pots"), Material.class); + /** + * Vanilla block tag representing all small flowers. + */ + Tag SMALL_FLOWERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("small_flowers"), Material.class); + /** + * Vanilla block tag representing all beds. + */ + Tag BEDS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("beds"), Material.class); + /** + * Vanilla block tag representing all fences. + */ + Tag FENCES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("fences"), Material.class); /** * Vanilla block tag denoting blocks that enderman may pick up and hold. */ @@ -175,6 +195,26 @@ public interface Tag extends Keyed { * Vanilla block tag representing all coral. */ Tag CORALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("corals"), Material.class); + /** + * Vanilla block tag denoting all blocks bamboo may be planted on. + */ + Tag BAMBOO_PLANTABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("bamboo_plantable_on"), Material.class); + /** + * Vanilla block tag denoting dirt like blocks. + */ + Tag DIRT_LIKE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dirt_like"), Material.class); + /** + * Vanilla block tag representing all standing signs. + */ + Tag STANDING_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("standing_signs"), Material.class); + /** + * Vanilla block tag representing all wall signs. + */ + Tag WALL_SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("wall_signs"), Material.class); + /** + * Vanilla block tag representing all signs. + */ + Tag SIGNS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("signs"), Material.class); /** * Key for the built in item registry. */ @@ -191,6 +231,18 @@ public interface Tag extends Keyed { * Vanilla item tag representing all fish items. */ Tag ITEMS_FISHES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("fishes"), Material.class); + /** + * Vanilla item tag representing all music disc items. + */ + Tag ITEMS_MUSIC_DISCS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("music_discs"), Material.class); + /** + * Vanilla item tag representing all coal items. + */ + Tag ITEMS_COALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("coals"), Material.class); + /** + * Vanilla item tag representing all arrow items. + */ + Tag ITEMS_ARROWS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("arrows"), Material.class); /** * Returns whether or not this tag has an entry for the specified item. diff --git a/src/main/java/org/bukkit/TravelAgent.java b/src/main/java/org/bukkit/TravelAgent.java deleted file mode 100644 index f1a89e7c..00000000 --- a/src/main/java/org/bukkit/TravelAgent.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.bukkit; - -import org.jetbrains.annotations.NotNull; - -/** - * The Travel Agent handles the creation and the research of Nether and End - * portals when Entities try to use one. - *

- * It is used in {@link org.bukkit.event.entity.EntityPortalEvent} and in - * {@link org.bukkit.event.player.PlayerPortalEvent} to help developers - * reproduce and/or modify Vanilla behaviour. - */ -public interface TravelAgent { - - /** - * Set the Block radius to search in for available portals. - * - * @param radius the radius in which to search for a portal from the - * location - * @return this travel agent - */ - @NotNull - public TravelAgent setSearchRadius(int radius); - - /** - * Gets the search radius value for finding an available portal. - * - * @return the currently set search radius - */ - public int getSearchRadius(); - - /** - * Sets the maximum radius from the given location to create a portal. - * - * @param radius the radius in which to create a portal from the location - * @return this travel agent - */ - @NotNull - public TravelAgent setCreationRadius(int radius); - - /** - * Gets the maximum radius from the given location to create a portal. - * - * @return the currently set creation radius - */ - public int getCreationRadius(); - - /** - * Returns whether the TravelAgent will attempt to create a destination - * portal or not. - * - * @return whether the TravelAgent should create a destination portal or - * not - */ - public boolean getCanCreatePortal(); - - /** - * Sets whether the TravelAgent should attempt to create a destination - * portal or not. - * - * @param create Sets whether the TravelAgent should create a destination - * portal or not - */ - public void setCanCreatePortal(boolean create); - - /** - * Attempt to find a portal near the given location, if a portal is not - * found it will attempt to create one. - * - * @param location the location where the search for a portal should begin - * @return the location of a portal which has been found or returns the - * location passed to the method if unsuccessful - * @see #createPortal(Location) - */ - @NotNull - public Location findOrCreate(@NotNull Location location); - - /** - * Attempt to find a portal near the given location. - * - * @param location the desired location of the portal - * @return the location of the nearest portal to the location - */ - @NotNull - public Location findPortal(@NotNull Location location); - - /** - * Attempt to create a portal near the given location. - *

- * In the case of a Nether portal teleportation, this will attempt to - * create a Nether portal. - *

- * In the case of an Ender portal teleportation, this will (re-)create the - * obsidian platform and clean blocks above it. - * - * @param location the desired location of the portal - * @return true if a portal was successfully created - */ - public boolean createPortal(@NotNull Location location); -} diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java index a4aabfe7..247d194f 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -28,6 +28,8 @@ public interface UnsafeValues { BlockData fromLegacy(Material material, byte data); + Material getMaterial(String material, int version); + int getDataVersion(); ItemStack modifyItemStack(ItemStack stack, String arguments); diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 0c84737a..3abeab09 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -169,7 +169,11 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param z Z-coordinate of the chunk * @return true if the chunk is loaded and in use by one or more players, * otherwise false + * @deprecated This method was added to facilitate chunk garbage collection. + * As of the current Minecraft version chunks are now strictly managed and + * will not be loaded for more than 1 tick unless they are in use. */ + @Deprecated public boolean isChunkInUse(int x, int z); /** @@ -199,8 +203,8 @@ public interface World extends PluginMessageRecipient, Metadatable { /** * Safely unloads and saves the {@link Chunk} at the specified coordinates *

- * This method is analogous to {@link #unloadChunk(int, int, boolean, - * boolean)} where safe and save is true + * This method is analogous to {@link #unloadChunk(int, int, boolean)} + * where save is true. * * @param chunk the chunk to unload * @return true if the chunk has unloaded successfully, otherwise false @@ -210,8 +214,8 @@ public interface World extends PluginMessageRecipient, Metadatable { /** * Safely unloads and saves the {@link Chunk} at the specified coordinates *

- * This method is analogous to {@link #unloadChunk(int, int, boolean, - * boolean)} where safe and saveis true + * This method is analogous to {@link #unloadChunk(int, int, boolean)} + * where save is true. * * @param x X-coordinate of the chunk * @param z Z-coordinate of the chunk @@ -221,10 +225,7 @@ public interface World extends PluginMessageRecipient, Metadatable { /** * Safely unloads and optionally saves the {@link Chunk} at the specified - * coordinates - *

- * This method is analogous to {@link #unloadChunk(int, int, boolean, - * boolean)} where save is true + * coordinates. * * @param x X-coordinate of the chunk * @param z Z-coordinate of the chunk @@ -233,27 +234,9 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public boolean unloadChunk(int x, int z, boolean save); - /** - * Unloads and optionally saves the {@link Chunk} at the specified - * coordinates - * - * @param x X-coordinate of the chunk - * @param z Z-coordinate of the chunk - * @param save Controls whether the chunk is saved - * @param safe Controls whether to unload the chunk when players are - * nearby - * @return true if the chunk has unloaded successfully, otherwise false - * @deprecated it is never safe to remove a chunk in use - */ - @Deprecated - public boolean unloadChunk(int x, int z, boolean save, boolean safe); - /** * Safely queues the {@link Chunk} at the specified coordinates for - * unloading - *

- * This method is analogous to {@link #unloadChunkRequest(int, int, - * boolean)} where safe is true + * unloading. * * @param x X-coordinate of the chunk * @param z Z-coordinate of the chunk @@ -261,18 +244,6 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public boolean unloadChunkRequest(int x, int z); - /** - * Queues the {@link Chunk} at the specified coordinates for unloading - * - * @param x X-coordinate of the chunk - * @param z Z-coordinate of the chunk - * @param safe Controls whether to queue the chunk when players are nearby - * @return Whether the chunk was actually queued - * @deprecated it is never safe to remove a chunk in use - */ - @Deprecated - public boolean unloadChunkRequest(int x, int z, boolean safe); - /** * Regenerates the {@link Chunk} at the specified coordinates * diff --git a/src/main/java/org/bukkit/block/Barrel.java b/src/main/java/org/bukkit/block/Barrel.java new file mode 100644 index 00000000..5eacc44a --- /dev/null +++ b/src/main/java/org/bukkit/block/Barrel.java @@ -0,0 +1,8 @@ +package org.bukkit.block; + +import org.bukkit.loot.Lootable; + +/** + * Represents a captured state of a Barrel. + */ +public interface Barrel extends Container, Lootable { } diff --git a/src/main/java/org/bukkit/block/Beacon.java b/src/main/java/org/bukkit/block/Beacon.java index e5332c0a..8814730b 100644 --- a/src/main/java/org/bukkit/block/Beacon.java +++ b/src/main/java/org/bukkit/block/Beacon.java @@ -3,7 +3,6 @@ package org.bukkit.block; import java.util.Collection; import org.bukkit.Nameable; import org.bukkit.entity.LivingEntity; -import org.bukkit.inventory.BeaconInventory; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; @@ -12,15 +11,7 @@ import org.jetbrains.annotations.Nullable; /** * Represents a captured state of a beacon. */ -public interface Beacon extends Container, Nameable { - - @NotNull - @Override - BeaconInventory getInventory(); - - @NotNull - @Override - BeaconInventory getSnapshotInventory(); +public interface Beacon extends BlockState, Lockable, Nameable { /** * Returns the list of players within the beacon's range of effect. diff --git a/src/main/java/org/bukkit/block/Bell.java b/src/main/java/org/bukkit/block/Bell.java new file mode 100644 index 00000000..43f64148 --- /dev/null +++ b/src/main/java/org/bukkit/block/Bell.java @@ -0,0 +1,6 @@ +package org.bukkit.block; + +/** + * Represents a captured state of Bell. + */ +public interface Bell extends BlockState { } diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java index a3b310b7..55386ffe 100644 --- a/src/main/java/org/bukkit/block/Biome.java +++ b/src/main/java/org/bukkit/block/Biome.java @@ -1,9 +1,14 @@ package org.bukkit.block; +import java.util.Locale; +import org.bukkit.Keyed; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; + /** * Holds all accepted Biomes in the default server */ -public enum Biome { +public enum Biome implements Keyed { OCEAN, PLAINS, DESERT, @@ -76,5 +81,19 @@ public enum Biome { SHATTERED_SAVANNA_PLATEAU, ERODED_BADLANDS, MODIFIED_WOODED_BADLANDS_PLATEAU, - MODIFIED_BADLANDS_PLATEAU + MODIFIED_BADLANDS_PLATEAU, + BAMBOO_JUNGLE, + BAMBOO_JUNGLE_HILLS; + + private final NamespacedKey key; + + private Biome() { + this.key = NamespacedKey.minecraft(name().toLowerCase(Locale.ROOT)); + } + + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } } diff --git a/src/main/java/org/bukkit/block/BlastFurnace.java b/src/main/java/org/bukkit/block/BlastFurnace.java new file mode 100644 index 00000000..3c4d8571 --- /dev/null +++ b/src/main/java/org/bukkit/block/BlastFurnace.java @@ -0,0 +1,6 @@ +package org.bukkit.block; + +/** + * Represents a captured state of a blast furnace. + */ +public interface BlastFurnace extends Furnace { } diff --git a/src/main/java/org/bukkit/block/BrewingStand.java b/src/main/java/org/bukkit/block/BrewingStand.java index 7611a126..fe155f14 100644 --- a/src/main/java/org/bukkit/block/BrewingStand.java +++ b/src/main/java/org/bukkit/block/BrewingStand.java @@ -1,13 +1,12 @@ package org.bukkit.block; -import org.bukkit.Nameable; import org.bukkit.inventory.BrewerInventory; import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a brewing stand. */ -public interface BrewingStand extends Container, Nameable { +public interface BrewingStand extends Container { /** * How much time is left in the brewing cycle. diff --git a/src/main/java/org/bukkit/block/Campfire.java b/src/main/java/org/bukkit/block/Campfire.java new file mode 100644 index 00000000..1d3584c8 --- /dev/null +++ b/src/main/java/org/bukkit/block/Campfire.java @@ -0,0 +1,69 @@ +package org.bukkit.block; + +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.Nullable; + +/** + * Represents a captured state of a campfire. + */ +public interface Campfire extends BlockState { + + /** + * @see Inventory#getSize() + * + * @return The size of the inventory + */ + int getSize(); + + /** + * @see Inventory#getItem(int) + * + * @param index The index of the Slot's ItemStack to return + * @return The ItemStack in the slot + */ + @Nullable + ItemStack getItem(int index); + + /** + * @see Inventory#setItem(int, org.bukkit.inventory.ItemStack) + * + * @param index The index where to put the ItemStack + * @param item The ItemStack to set + */ + void setItem(int index, @Nullable ItemStack item); + + /** + * Get cook time.This is the amount of time the item has been cooking for. + * + * @param index + * @return Cook time + */ + int getCookTime(int index); + + /** + * Set cook time.This is the amount of time the item has been cooking for. + * + * @param index + * @param cookTime Cook time + */ + void setCookTime(int index, int cookTime); + + /** + * Get cook time total.This is the amount of time the item is required to + * cook for. + * + * @param index + * @return Cook time total + */ + int getCookTimeTotal(int index); + + /** + * Set cook time.This is the amount of time the item is required to cook + * for. + * + * @param index + * @param cookTimeTotal Cook time total + */ + void setCookTimeTotal(int index, int cookTimeTotal); +} diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java index c553891e..c67d7110 100644 --- a/src/main/java/org/bukkit/block/Chest.java +++ b/src/main/java/org/bukkit/block/Chest.java @@ -1,6 +1,5 @@ package org.bukkit.block; -import org.bukkit.Nameable; import org.bukkit.inventory.Inventory; import org.bukkit.loot.Lootable; import org.jetbrains.annotations.NotNull; @@ -8,7 +7,7 @@ import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a chest. */ -public interface Chest extends Container, Nameable, Lootable { +public interface Chest extends Container, Lootable { /** * Gets the inventory of the chest block represented by this block state. diff --git a/src/main/java/org/bukkit/block/Container.java b/src/main/java/org/bukkit/block/Container.java index 96888ba8..a03bdfd3 100644 --- a/src/main/java/org/bukkit/block/Container.java +++ b/src/main/java/org/bukkit/block/Container.java @@ -1,13 +1,14 @@ package org.bukkit.block; +import org.bukkit.Nameable; +import org.bukkit.inventory.BlockInventoryHolder; import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a container block. */ -public interface Container extends BlockState, InventoryHolder, Lockable { +public interface Container extends BlockState, BlockInventoryHolder, Lockable, Nameable { /** * Gets the inventory of the block represented by this block state. diff --git a/src/main/java/org/bukkit/block/Dropper.java b/src/main/java/org/bukkit/block/Dropper.java index 2e8c3f71..d68401b7 100644 --- a/src/main/java/org/bukkit/block/Dropper.java +++ b/src/main/java/org/bukkit/block/Dropper.java @@ -1,12 +1,11 @@ package org.bukkit.block; -import org.bukkit.Nameable; import org.bukkit.loot.Lootable; /** * Represents a captured state of a dropper. */ -public interface Dropper extends Container, Nameable, Lootable { +public interface Dropper extends Container, Lootable { /** * Tries to drop a randomly selected item from the dropper's inventory, diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java index db3d22fa..c5a8c96f 100644 --- a/src/main/java/org/bukkit/block/Furnace.java +++ b/src/main/java/org/bukkit/block/Furnace.java @@ -1,13 +1,12 @@ package org.bukkit.block; -import org.bukkit.Nameable; import org.bukkit.inventory.FurnaceInventory; import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a furnace. */ -public interface Furnace extends Container, Nameable { +public interface Furnace extends Container { /** * Get burn time. diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java index 73fce5f3..58e49309 100644 --- a/src/main/java/org/bukkit/block/Hopper.java +++ b/src/main/java/org/bukkit/block/Hopper.java @@ -1,9 +1,8 @@ package org.bukkit.block; -import org.bukkit.Nameable; import org.bukkit.loot.Lootable; /** * Represents a captured state of a hopper. */ -public interface Hopper extends Container, Nameable, Lootable { } +public interface Hopper extends Container, Lootable { } diff --git a/src/main/java/org/bukkit/block/Jigsaw.java b/src/main/java/org/bukkit/block/Jigsaw.java new file mode 100644 index 00000000..b5296e0d --- /dev/null +++ b/src/main/java/org/bukkit/block/Jigsaw.java @@ -0,0 +1,6 @@ +package org.bukkit.block; + +/** + * Represents a captured state of a jigsaw. + */ +public interface Jigsaw extends BlockState { } diff --git a/src/main/java/org/bukkit/block/Lectern.java b/src/main/java/org/bukkit/block/Lectern.java new file mode 100644 index 00000000..d3066044 --- /dev/null +++ b/src/main/java/org/bukkit/block/Lectern.java @@ -0,0 +1,45 @@ +package org.bukkit.block; + +import org.bukkit.inventory.BlockInventoryHolder; +import org.bukkit.inventory.Inventory; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a captured state of a lectern. + */ +public interface Lectern extends BlockState, BlockInventoryHolder { + + /** + * Get the current lectern page. + * + * @return current page + */ + int getPage(); + + /** + * Set the current lectern page. + * + * If the page is greater than the number of pages of the book currently in + * the inventory, then behavior is undefined. + * + * @param page new page + */ + void setPage(int page); + + /** + * @see Container#getInventory() + * + * @return inventory + */ + @NotNull + @Override + Inventory getInventory(); + + /** + * @see Container#getSnapshotInventory() + * + * @return snapshot inventory + */ + @NotNull + Inventory getSnapshotInventory(); +} diff --git a/src/main/java/org/bukkit/block/ShulkerBox.java b/src/main/java/org/bukkit/block/ShulkerBox.java index 5a6bed64..938f9aea 100644 --- a/src/main/java/org/bukkit/block/ShulkerBox.java +++ b/src/main/java/org/bukkit/block/ShulkerBox.java @@ -1,14 +1,13 @@ package org.bukkit.block; import org.bukkit.DyeColor; -import org.bukkit.Nameable; import org.bukkit.loot.Lootable; import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a ShulkerBox. */ -public interface ShulkerBox extends Container, Nameable, Lootable { +public interface ShulkerBox extends Container, Lootable { /** * Get the {@link DyeColor} corresponding to this ShulkerBox diff --git a/src/main/java/org/bukkit/block/Smoker.java b/src/main/java/org/bukkit/block/Smoker.java new file mode 100644 index 00000000..7601c30d --- /dev/null +++ b/src/main/java/org/bukkit/block/Smoker.java @@ -0,0 +1,6 @@ +package org.bukkit.block; + +/** + * Represents a captured state of a smoker. + */ +public interface Smoker extends Furnace { } diff --git a/src/main/java/org/bukkit/block/data/type/Bamboo.java b/src/main/java/org/bukkit/block/data/type/Bamboo.java new file mode 100644 index 00000000..96b5add2 --- /dev/null +++ b/src/main/java/org/bukkit/block/data/type/Bamboo.java @@ -0,0 +1,44 @@ +package org.bukkit.block.data.type; + +import org.bukkit.block.data.Ageable; +import org.jetbrains.annotations.NotNull; + +/** + * 'leaves' represents the size of the leaves on this bamboo block. + */ +public interface Bamboo extends Ageable, Sapling { + + /** + * Gets the value of the 'leaves' property. + * + * @return the 'leaves' value + */ + @NotNull + Leaves getLeaves(); + + /** + * Sets the value of the 'leaves' property. + * + * @param leaves the new 'leaves' value + */ + void setLeaves(@NotNull Leaves leaves); + + /** + * Bamboo leaf size. + */ + public enum Leaves { + + /** + * No leaves. + */ + NONE, + /** + * Small leaves. + */ + SMALL, + /** + * Large leaves. + */ + LARGE; + } +} diff --git a/src/main/java/org/bukkit/block/data/type/Bell.java b/src/main/java/org/bukkit/block/data/type/Bell.java new file mode 100644 index 00000000..a786eda0 --- /dev/null +++ b/src/main/java/org/bukkit/block/data/type/Bell.java @@ -0,0 +1,32 @@ +package org.bukkit.block.data.type; + +import org.bukkit.block.data.Directional; + +/** + * 'attachment' denotes how the bell is attached to its block. + */ +public interface Bell extends Directional { + + /** + * What the bell is attached to. + */ + public enum Attachment { + + /** + * Placed on floor. + */ + FLOOR, + /** + * Placed on ceiling. + */ + CEILING, + /** + * Placed on one wall. + */ + SINGLE_WALL, + /** + * Placed between two walls. + */ + DOUBLE_WALL; + } +} diff --git a/src/main/java/org/bukkit/block/data/type/Campfire.java b/src/main/java/org/bukkit/block/data/type/Campfire.java new file mode 100644 index 00000000..bc5159b4 --- /dev/null +++ b/src/main/java/org/bukkit/block/data/type/Campfire.java @@ -0,0 +1,25 @@ +package org.bukkit.block.data.type; + +import org.bukkit.block.data.Lightable; +import org.bukkit.block.data.Waterlogged; + +/** + * 'signal_fire' denotes whether the fire is extra smokey due to having a hay + * bale placed beneath it. + */ +public interface Campfire extends Lightable, Waterlogged { + + /** + * Gets the value of the 'signal_fire' property. + * + * @return the 'signal_fire' value + */ + boolean isSignalFire(); + + /** + * Sets the value of the 'signal_fire' property. + * + * @param signalFire the new 'signal_fire' value + */ + void setSignalFire(boolean signalFire); +} diff --git a/src/main/java/org/bukkit/block/data/type/Lantern.java b/src/main/java/org/bukkit/block/data/type/Lantern.java new file mode 100644 index 00000000..2ae2cf59 --- /dev/null +++ b/src/main/java/org/bukkit/block/data/type/Lantern.java @@ -0,0 +1,21 @@ +package org.bukkit.block.data.type; + +/** + * 'hanging' denotes whether the lantern is hanging from a block. + */ +public interface Lantern { + + /** + * Gets the value of the 'hanging' property. + * + * @return the 'hanging' value + */ + boolean isHanging(); + + /** + * Sets the value of the 'hanging' property. + * + * @param hanging the new 'hanging' value + */ + void setHanging(boolean hanging); +} diff --git a/src/main/java/org/bukkit/block/data/type/Lectern.java b/src/main/java/org/bukkit/block/data/type/Lectern.java new file mode 100644 index 00000000..11b4a173 --- /dev/null +++ b/src/main/java/org/bukkit/block/data/type/Lectern.java @@ -0,0 +1,18 @@ +package org.bukkit.block.data.type; + +import org.bukkit.block.data.Directional; +import org.bukkit.block.data.Powerable; + +/** + * 'has_book' is a quick flag to check whether this lectern has a book inside + * it. + */ +public interface Lectern extends Directional, Powerable { + + /** + * Gets the value of the 'has_book' property. + * + * @return the 'has_book' value + */ + boolean hasBook(); +} diff --git a/src/main/java/org/bukkit/block/data/type/Scaffolding.java b/src/main/java/org/bukkit/block/data/type/Scaffolding.java new file mode 100644 index 00000000..1f6859ee --- /dev/null +++ b/src/main/java/org/bukkit/block/data/type/Scaffolding.java @@ -0,0 +1,49 @@ +package org.bukkit.block.data.type; + +import org.bukkit.block.data.Waterlogged; + +/** + * 'bottom' indicates whether the scaffolding is floating or not. + *
+ * 'distance' indicates the distance from a scaffolding block placed above a + * 'bottom' scaffold. + *
+ * When 'distance' reaches {@link #getMaximumDistance()} the block will drop. + */ +public interface Scaffolding extends Waterlogged { + + /** + * Gets the value of the 'bottom' property. + * + * @return the 'bottom' value + */ + boolean isBottom(); + + /** + * Sets the value of the 'bottom' property. + * + * @param bottom the new 'bottom' value + */ + void setBottom(boolean bottom); + + /** + * Gets the value of the 'distance' property. + * + * @return the 'distance' value + */ + int getDistance(); + + /** + * Sets the value of the 'distance' property. + * + * @param distance the new 'distance' value + */ + void setDistance(int distance); + + /** + * Gets the maximum allowed value of the 'distance' property. + * + * @return the maximum 'distance' value + */ + int getMaximumDistance(); +} diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java index 88bde6a9..b8126985 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -44,8 +44,7 @@ public class VersionCommand extends BukkitCommand { if (args.length == 0) { sender.sendMessage("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")"); - sender.sendMessage(ChatColor.YELLOW + "This is a final build for 1.13.2. Please see https://www.spigotmc.org/go/1.13.2 for details about upgrading."); - // sendVersion(sender); + sendVersion(sender); } else { StringBuilder name = new StringBuilder(); diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java index 705b948e..f871cfce 100644 --- a/src/main/java/org/bukkit/enchantments/Enchantment.java +++ b/src/main/java/org/bukkit/enchantments/Enchantment.java @@ -176,6 +176,21 @@ public abstract class Enchantment implements Keyed { */ public static final Enchantment CHANNELING = new EnchantmentWrapper("channeling"); + /** + * Shoot multiple arrows from crossbows + */ + public static final Enchantment MULTISHOT = new EnchantmentWrapper("multishot"); + + /** + * Charges crossbows quickly + */ + public static final Enchantment QUICK_CHARGE = new EnchantmentWrapper("quick_charge"); + + /** + * Crossbow projectiles pierce entities + */ + public static final Enchantment PIERCING = new EnchantmentWrapper("piercing"); + /** * Allows mending the item using experience orbs */ diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java index 9f30c869..8ff0901c 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java @@ -191,6 +191,16 @@ public enum EnchantmentTarget { public boolean includes(@NotNull Material item) { return item.equals(Material.TRIDENT); } + }, + + /** + * Allow the Enchantment to be placed on crossbows. + */ + CROSSBOW { + @Override + public boolean includes(@NotNull Material item) { + return item.equals(Material.CROSSBOW); + } }; /** diff --git a/src/main/java/org/bukkit/entity/AbstractVillager.java b/src/main/java/org/bukkit/entity/AbstractVillager.java new file mode 100644 index 00000000..8fde1f4b --- /dev/null +++ b/src/main/java/org/bukkit/entity/AbstractVillager.java @@ -0,0 +1,24 @@ +package org.bukkit.entity; + +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.Merchant; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a villager NPC + */ +public interface AbstractVillager extends Ageable, NPC, InventoryHolder, Merchant { + + /** + * Gets this villager's inventory. + *
+ * Note that this inventory is not the Merchant inventory, rather, it is the + * items that a villager might have collected (from harvesting crops, etc.) + * + * {@inheritDoc} + */ + @NotNull + @Override + Inventory getInventory(); +} diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java new file mode 100644 index 00000000..c2566104 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Cat.java @@ -0,0 +1,41 @@ +package org.bukkit.entity; + +import org.jetbrains.annotations.NotNull; + +/** + * Meow. + */ +public interface Cat extends Animals, Tameable, Sittable { + + /** + * Gets the current type of this cat. + * + * @return Type of the cat. + */ + @NotNull + public Type getCatType(); + + /** + * Sets the current type of this cat. + * + * @param type New type of this cat. + */ + public void setCatType(@NotNull Type type); + + /** + * Represents the various different cat types there are. + */ + public enum Type { + TABBY, + BLACK, + RED, + SIAMESE, + BRITISH_SHORTHAIR, + CALICO, + PERSIAN, + RAGDOLL, + WHITE, + JELLIE, + ALL_BLACK; + } +} diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java index 395f74c1..ea342b28 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java @@ -1,8 +1,10 @@ package org.bukkit.entity; +import com.google.common.base.Preconditions; import java.util.HashMap; import java.util.Map; +import org.bukkit.Keyed; import org.bukkit.entity.minecart.CommandMinecart; import org.bukkit.entity.minecart.HopperMinecart; import org.bukkit.entity.minecart.SpawnerMinecart; @@ -12,12 +14,14 @@ import org.bukkit.entity.minecart.PoweredMinecart; import org.bukkit.entity.minecart.StorageMinecart; import org.bukkit.inventory.ItemStack; import org.bukkit.Location; +import org.bukkit.NamespacedKey; import org.bukkit.World; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public enum EntityType { +public enum EntityType implements Keyed { // These strings MUST match the strings in nms.EntityTypes and are case sensitive. /** @@ -62,7 +66,7 @@ public enum EntityType { /** * An arrow projectile; may get stuck in the ground. */ - ARROW("arrow", Arrow.class, 10), + ARROW("arrow", TippedArrow.class, 10), /** * A flying snowball. */ @@ -86,7 +90,7 @@ public enum EntityType { /** * A flying splash potion. */ - SPLASH_POTION("potion", SplashPotion.class, 16, false), + SPLASH_POTION("potion", ThrownPotion.class, 16, false), /** * A flying experience bottle. */ @@ -116,7 +120,7 @@ public enum EntityType { */ HUSK("husk", Husk.class, 23), /** - * Like {@link #TIPPED_ARROW} but causes the {@link PotionEffectType#GLOWING} effect on all team members. + * Like {@link #ARROW} but causes the {@link PotionEffectType#GLOWING} effect on all team members. */ SPECTRAL_ARROW("spectral_arrow", SpectralArrow.class, 24), /** @@ -250,11 +254,13 @@ public enum EntityType { TROPICAL_FISH("tropical_fish", TropicalFish.class, -1), DROWNED("drowned", Drowned.class, -1), DOLPHIN("dolphin", Dolphin.class, -1), - // These don't have an entity ID in nms.EntityTypes. - /** - * A flying lingering potion - */ - LINGERING_POTION(null, LingeringPotion.class, -1, false), + 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), /** * A fishing line and bobber. */ @@ -265,23 +271,17 @@ public enum EntityType { * Spawn with {@link World#strikeLightning(Location)}. */ LIGHTNING("lightning_bolt", LightningStrike.class, -1, false), - WEATHER(null, Weather.class, -1, false), PLAYER("player", Player.class, -1, false), - COMPLEX_PART(null, ComplexEntityPart.class, -1, false), - /** - * Like {@link #ARROW} but tipped with a specific potion which is applied on - * contact. - */ - TIPPED_ARROW(null, TippedArrow.class, -1), /** * An unknown entity without an Entity Class */ UNKNOWN(null, null, -1, false); - private String name; - private Class clazz; - private short typeId; - private boolean independent, living; + private final String name; + private final Class clazz; + private final short typeId; + private final boolean independent, living; + private final NamespacedKey key; private static final Map NAME_MAP = new HashMap(); private static final Map ID_MAP = new HashMap(); @@ -320,9 +320,8 @@ public enum EntityType { this.clazz = clazz; this.typeId = (short) typeId; this.independent = independent; - if (clazz != null) { - this.living = LivingEntity.class.isAssignableFrom(clazz); - } + this.living = clazz != null && LivingEntity.class.isAssignableFrom(clazz); + this.key = (name == null) ? null : NamespacedKey.minecraft(name); } /** @@ -336,6 +335,14 @@ public enum EntityType { return name; } + @NotNull + @Override + public NamespacedKey getKey() { + Preconditions.checkArgument(key != null, "EntityType doesn't have key! Is it UNKNOWN?"); + + return key; + } + @Nullable public Class getEntityClass() { return clazz; diff --git a/src/main/java/org/bukkit/entity/Fox.java b/src/main/java/org/bukkit/entity/Fox.java new file mode 100644 index 00000000..c5eac880 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Fox.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * What does the fox say? + */ +public interface Fox extends Animals {} diff --git a/src/main/java/org/bukkit/entity/Illager.java b/src/main/java/org/bukkit/entity/Illager.java index b723fbac..a288dfa2 100644 --- a/src/main/java/org/bukkit/entity/Illager.java +++ b/src/main/java/org/bukkit/entity/Illager.java @@ -3,4 +3,4 @@ package org.bukkit.entity; /** * Represents a type of "Illager". */ -public interface Illager extends Monster { } +public interface Illager extends Raider { } diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java index c8b5154e..76aad05f 100644 --- a/src/main/java/org/bukkit/entity/LightningStrike.java +++ b/src/main/java/org/bukkit/entity/LightningStrike.java @@ -3,7 +3,7 @@ package org.bukkit.entity; /** * Represents an instance of a lightning strike. May or may not do damage. */ -public interface LightningStrike extends Weather { +public interface LightningStrike extends Entity { /** * Returns whether the strike is an effect that does no damage. diff --git a/src/main/java/org/bukkit/entity/LingeringPotion.java b/src/main/java/org/bukkit/entity/LingeringPotion.java index 5aca7cb8..f124b35e 100644 --- a/src/main/java/org/bukkit/entity/LingeringPotion.java +++ b/src/main/java/org/bukkit/entity/LingeringPotion.java @@ -2,5 +2,7 @@ package org.bukkit.entity; /** * Represents a thrown lingering potion bottle + * + * @deprecated lingering status depends on only on the potion item. */ public interface LingeringPotion extends ThrownPotion { } diff --git a/src/main/java/org/bukkit/entity/Ocelot.java b/src/main/java/org/bukkit/entity/Ocelot.java index fe75169e..c20b8e55 100644 --- a/src/main/java/org/bukkit/entity/Ocelot.java +++ b/src/main/java/org/bukkit/entity/Ocelot.java @@ -7,7 +7,7 @@ import org.jetbrains.annotations.Nullable; /** * A wild tameable cat */ -public interface Ocelot extends Animals, Tameable, Sittable { +public interface Ocelot extends Animals { /** * Gets the current type of this cat. @@ -26,7 +26,10 @@ public interface Ocelot extends Animals, Tameable, Sittable { /** * Represents the various different cat types there are. + * + * @deprecated Cats are now a separate entity. */ + @Deprecated public enum Type { WILD_OCELOT(0), BLACK_CAT(1), diff --git a/src/main/java/org/bukkit/entity/Panda.java b/src/main/java/org/bukkit/entity/Panda.java new file mode 100644 index 00000000..a6a7429e --- /dev/null +++ b/src/main/java/org/bukkit/entity/Panda.java @@ -0,0 +1,66 @@ +package org.bukkit.entity; + +import org.jetbrains.annotations.NotNull; + +/** + * Panda entity. + */ +public interface Panda extends Animals { + + /** + * Gets this Panda's main gene. + * + * @return main gene + */ + @NotNull + Gene getMainGene(); + + /** + * Sets this Panda's main gene. + * + * @param gene main gene + */ + void setMainGene(@NotNull Gene gene); + + /** + * Gets this Panda's hidden gene. + * + * @return hidden gene + */ + @NotNull + Gene getHiddenGene(); + + /** + * Sets this Panda's hidden gene. + * + * @param gene hidden gene + */ + void setHiddenGene(@NotNull Gene gene); + + public enum Gene { + + NORMAL(false), + LAZY(false), + WORRIED(false), + PLAYFUL(false), + BROWN(true), + WEAK(true), + AGGRESSIVE(false); + + private final boolean recessive; + + private Gene(boolean recessive) { + this.recessive = recessive; + } + + /** + * Gets whether this gene is recessive, i.e. required in both parents to + * propagate to children. + * + * @return recessive status + */ + public boolean isRecessive() { + return recessive; + } + } +} diff --git a/src/main/java/org/bukkit/entity/Pillager.java b/src/main/java/org/bukkit/entity/Pillager.java new file mode 100644 index 00000000..9a2252fe --- /dev/null +++ b/src/main/java/org/bukkit/entity/Pillager.java @@ -0,0 +1,8 @@ +package org.bukkit.entity; + +import org.bukkit.inventory.InventoryHolder; + +/** + * Illager entity. + */ +public interface Pillager extends Illager, InventoryHolder { } diff --git a/src/main/java/org/bukkit/entity/Raider.java b/src/main/java/org/bukkit/entity/Raider.java new file mode 100644 index 00000000..ac73eaf3 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Raider.java @@ -0,0 +1,36 @@ +package org.bukkit.entity; + +import org.bukkit.block.Block; +import org.jetbrains.annotations.Nullable; + +public interface Raider extends Monster { + + /** + * Gets the block the raider is targeting to patrol. + * + * @return target block or null + */ + @Nullable + Block getPatrolTarget(); + + /** + * Sets the block the raider is targeting to patrol. + * + * @param block target block or null. Must be in same world as the entity + */ + void setPatrolTarget(@Nullable Block block); + + /** + * Gets whether this entity is a patrol leader. + * + * @return patrol leader status + */ + boolean isPatrolLeader(); + + /** + * Sets whether this entity is a patrol leader. + * + * @param leader patrol leader status + */ + void setPatrolLeader(boolean leader); +} diff --git a/src/main/java/org/bukkit/entity/Ravager.java b/src/main/java/org/bukkit/entity/Ravager.java new file mode 100644 index 00000000..4374d520 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Ravager.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Illager beast. + */ +public interface Ravager extends Raider { } diff --git a/src/main/java/org/bukkit/entity/SplashPotion.java b/src/main/java/org/bukkit/entity/SplashPotion.java index 2a210254..9cb08fe7 100644 --- a/src/main/java/org/bukkit/entity/SplashPotion.java +++ b/src/main/java/org/bukkit/entity/SplashPotion.java @@ -2,5 +2,8 @@ package org.bukkit.entity; /** * Represents a thrown splash potion bottle + * + * @deprecated splash status depends on only on the potion item. */ +@Deprecated public interface SplashPotion extends ThrownPotion { } diff --git a/src/main/java/org/bukkit/entity/TraderLlama.java b/src/main/java/org/bukkit/entity/TraderLlama.java new file mode 100644 index 00000000..78966d19 --- /dev/null +++ b/src/main/java/org/bukkit/entity/TraderLlama.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a trader Llama. + */ +public interface TraderLlama extends Llama { } diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java index d8dfb438..05fd0786 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java @@ -1,19 +1,11 @@ package org.bukkit.entity; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.LinkedListMultimap; -import com.google.common.collect.Multimap; -import java.util.List; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; -import org.bukkit.inventory.Merchant; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * Represents a villager NPC */ -public interface Villager extends Ageable, NPC, InventoryHolder, Merchant { +public interface Villager extends AbstractVillager { /** * Gets the current profession of this villager. @@ -30,243 +22,86 @@ public interface Villager extends Ageable, NPC, InventoryHolder, Merchant { */ public void setProfession(@NotNull Profession profession); - /** - * Get the current {@link Career} for this Villager. - * - * @return the {@link Career} - */ - @NotNull - public Career getCareer(); - - /** - * Set the new {@link Career} for this Villager. - * This method will reset the villager's trades to the new career. - * - * @param career the new career, or null to clear the career to a random one - * @throws IllegalArgumentException when the new {@link Career} cannot be - * used with this Villager's current {@link Profession}. - */ - public void setCareer(@Nullable Career career); - - /** - * Set the new {@link Career} for this Villager. - * - * @param career the new career, or null to clear the career to a random one - * @param resetTrades true to reset this Villager's trades to the new - * career's (if any) - * @throws IllegalArgumentException when the new {@link Career} cannot be - * used with this Villager's current {@link Profession}. - */ - public void setCareer(@Nullable Career career, boolean resetTrades); - - /** - * Gets this villager's inventory. - *
- * Note that this inventory is not the Merchant inventory, rather, it is the - * items that a villager might have collected (from harvesting crops, etc.) - * - * {@inheritDoc} - */ - @NotNull - @Override - Inventory getInventory(); - - /** - * Gets this villager's riches, the number of emeralds this villager has - * been given. - * - * @return the villager's riches - */ - int getRiches(); - - /** - * Sets this villager's riches. - * - * @see Villager#getRiches() - * - * @param riches the new riches - */ - void setRiches(int riches); - /** * Represents the various different Villager professions there may be. * Villagers have different trading options depending on their profession, */ public enum Profession { + NONE, /** - * Normal. Reserved for Zombies. - * @deprecated Unused - */ - @Deprecated - NORMAL(true), - /** - * Farmer profession. Wears a brown robe. - */ - FARMER(false), - /** - * Librarian profession. Wears a white robe. - */ - LIBRARIAN(false), - /** - * Priest profession. Wears a purple robe. - */ - PRIEST(false), - /** - * Blacksmith profession. Wears a black apron. - */ - BLACKSMITH(false), - /** - * Butcher profession. Wears a white apron. - */ - BUTCHER(false), - /** - * Nitwit profession. Wears a green apron, cannot trade. - */ - NITWIT(false), - /** - * Husk. Reserved for Zombies - * @deprecated Unused - */ - @Deprecated - HUSK(true); - private final boolean zombie; - - private Profession(boolean zombie) { - this.zombie = zombie; - } - - /** - * Returns if this profession can only be used by zombies. - * - * @return zombie profession status - * @deprecated Unused - */ - @Deprecated - public boolean isZombie() { - return zombie; - } - - /** - * Get an immutable list of {@link Career} belonging to this Profession. - * - * @return an immutable list of careers for this profession, or an empty - * map if this Profession has no careers. - */ - @NotNull - public List getCareers() { - return Career.getCareers(this); - } - } - - /** - * The Career of this Villager. - * Each {@link Profession} has a set of careers it is applicable to. Each - * career dictates the trading options that are generated. - */ - public enum Career { - /* - NOTE: The Career entries are order-specific. They should be maintained in the numerical order they are used in the CB implementation. - (e.g. Farmer careers are 1,2,3,4 so Career should reflect that numerical order in their ordinal status) - */ - // Farmer careers - /** - * Farmers primarily trade for food-related items. - */ - FARMER(Profession.FARMER), - /** - * Fisherman primarily trade for fish, as well as possibly selling - * string and/or coal. - */ - FISHERMAN(Profession.FARMER), - /** - * Shepherds primarily trade for wool items, and shears. - */ - SHEPHERD(Profession.FARMER), - /** - * Fletchers primarily trade for string, bows, and arrows. - */ - FLETCHER(Profession.FARMER), - // Librarian careers - /** - * Librarians primarily trade for paper, books, and enchanted books. - */ - LIBRARIAN(Profession.LIBRARIAN), - /** - * Cartographers primarily trade for explorer maps and some paper. - */ - CARTOGRAPHER(Profession.LIBRARIAN), - // Priest careers - /** - * Clerics primarily trade for rotten flesh, gold ingot, redstone, - * lapis, ender pearl, glowstone, and bottle o' enchanting. - */ - CLERIC(Profession.PRIEST), - // Blacksmith careers - /** + * Armorer profession. Wears a black apron. * Armorers primarily trade for iron armor, chainmail armor, and * sometimes diamond armor. */ - ARMORER(Profession.BLACKSMITH), - /** - * Weapon smiths primarily trade for iron and diamond weapons, sometimes - * enchanted. - */ - WEAPON_SMITH(Profession.BLACKSMITH), - /** - * Tool smiths primarily trade for iron and diamond tools. - */ - TOOL_SMITH(Profession.BLACKSMITH), - // Butcher careers + ARMORER, /** + * Butcher profession. Wears a white apron. * Butchers primarily trade for raw and cooked food. */ - BUTCHER(Profession.BUTCHER), + BUTCHER, /** + * Cartographer profession. Wears a white robe. + * Cartographers primarily trade for explorer maps and some paper. + */ + CARTOGRAPHER, + /** + * Cleric profession. Wears a purple robe. + * Clerics primarily trade for rotten flesh, gold ingot, redstone, + * lapis, ender pearl, glowstone, and bottle o' enchanting. + */ + CLERIC, + /** + * Farmer profession. Wears a brown robe. + * Farmers primarily trade for food-related items. + */ + FARMER, + /** + * Fisherman profession. Wears a brown robe. + * Fisherman primarily trade for fish, as well as possibly selling + * string and/or coal. + */ + FISHERMAN, + /** + * Fletcher profession. Wears a brown robe. + * Fletchers primarily trade for string, bows, and arrows. + */ + FLETCHER, + /** + * Leatherworker profession. Wears a white apron. * Leatherworkers primarily trade for leather, and leather armor, as * well as saddles. */ - LEATHERWORKER(Profession.BUTCHER), - // Nitwit + LEATHERWORKER, /** + * Librarian profession. Wears a white robe. + * Librarians primarily trade for paper, books, and enchanted books. + */ + LIBRARIAN, + /** + * Mason profession. + */ + MASON, + /** + * Nitwit profession. Wears a green apron, cannot trade. * Nitwit villagers do not do anything. They do not have any trades by * default. */ - NITWIT(Profession.NITWIT); - - private static final Multimap careerMap = LinkedListMultimap.create(); - private final Profession profession; - - private Career(/*@NotNull*/ Profession profession) { - this.profession = profession; - } - + NITWIT, /** - * Get the {@link Profession} this {@link Career} belongs to. - * - * @return the {@link Profession}. + * Sheperd profession. Wears a brown robe. + * Shepherds primarily trade for wool items, and shears. */ - @NotNull - public Profession getProfession() { - return profession; - } - + SHEPHERD, /** - * Get an immutable list of {@link Career}s that can be used with a - * given {@link Profession} - * - * @param profession the profession to get careers for - * @return an immutable list of Careers that can be used by a - * profession, or an empty map if the profession was not found + * Toolsmith profession. Wears a black apron. + * Tool smiths primarily trade for iron and diamond tools. */ - @NotNull - public static List getCareers(@NotNull Profession profession) { - return careerMap.containsKey(profession) ? ImmutableList.copyOf(careerMap.get(profession)) : ImmutableList.of(); - } - - static { - for (Career career : Career.values()) { - careerMap.put(career.profession, career); - } - } + TOOLSMITH, + /** + * Weaponsmith profession. Wears a black apron. + * Weapon smiths primarily trade for iron and diamond weapons, sometimes + * enchanted. + */ + WEAPONSMITH; } } diff --git a/src/main/java/org/bukkit/entity/WanderingTrader.java b/src/main/java/org/bukkit/entity/WanderingTrader.java new file mode 100644 index 00000000..3547e159 --- /dev/null +++ b/src/main/java/org/bukkit/entity/WanderingTrader.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents a wandering trader NPC + */ +public interface WanderingTrader extends AbstractVillager { } diff --git a/src/main/java/org/bukkit/entity/Weather.java b/src/main/java/org/bukkit/entity/Weather.java deleted file mode 100644 index 6d77851f..00000000 --- a/src/main/java/org/bukkit/entity/Weather.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.bukkit.entity; - -/** - * Represents a Weather related entity, such as a storm - */ -public interface Weather extends Entity {} diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java index 9c5dc1f9..b4343903 100644 --- a/src/main/java/org/bukkit/entity/Witch.java +++ b/src/main/java/org/bukkit/entity/Witch.java @@ -3,5 +3,5 @@ package org.bukkit.entity; /** * Represents a Witch */ -public interface Witch extends Monster { +public interface Witch extends Raider { } diff --git a/src/main/java/org/bukkit/event/block/BlockCookEvent.java b/src/main/java/org/bukkit/event/block/BlockCookEvent.java new file mode 100644 index 00000000..be7af544 --- /dev/null +++ b/src/main/java/org/bukkit/event/block/BlockCookEvent.java @@ -0,0 +1,74 @@ +package org.bukkit.event.block; + +import org.bukkit.block.Block; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +/** + * Called when an ItemStack is successfully cooked in a block. + */ +public class BlockCookEvent extends BlockEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private final ItemStack source; + private ItemStack result; + private boolean cancelled; + + public BlockCookEvent(@NotNull final Block block, @NotNull final ItemStack source, @NotNull final ItemStack result) { + super(block); + this.source = source; + this.result = result; + this.cancelled = false; + } + + /** + * Gets the smelted ItemStack for this event + * + * @return smelting source ItemStack + */ + @NotNull + public ItemStack getSource() { + return source; + } + + /** + * Gets the resultant ItemStack for this event + * + * @return smelting result ItemStack + */ + @NotNull + public ItemStack getResult() { + return result; + } + + /** + * Sets the resultant ItemStack for this event + * + * @param result new result ItemStack + */ + public void setResult(@NotNull ItemStack result) { + this.result = result; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancel) { + this.cancelled = cancel; + } + + @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + + @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java index ec759948..153bcf1b 100644 --- a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java @@ -1,7 +1,6 @@ package org.bukkit.event.entity; import org.bukkit.Location; -import org.bukkit.TravelAgent; import org.bukkit.entity.Entity; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; @@ -15,63 +14,9 @@ import org.jetbrains.annotations.Nullable; */ public class EntityPortalEvent extends EntityTeleportEvent { private static final HandlerList handlers = new HandlerList(); - protected boolean useTravelAgent = true; - protected TravelAgent travelAgent; - public EntityPortalEvent(@NotNull final Entity entity, @NotNull final Location from, @Nullable final Location to, @NotNull final TravelAgent pta) { + public EntityPortalEvent(@NotNull final Entity entity, @NotNull final Location from, @Nullable final Location to) { super(entity, from, to); - this.travelAgent = pta; - } - - /** - * Sets whether or not the Travel Agent will be used. - *

- * If this is set to true, the TravelAgent will try to find a Portal at - * the {@link #getTo()} Location, and will try to create one if there is - * none. - *

- * If this is set to false, the {@link #getEntity()} will only be - * teleported to the {@link #getTo()} Location. - * - * @param useTravelAgent whether to use the Travel Agent - */ - public void useTravelAgent(boolean useTravelAgent) { - this.useTravelAgent = useTravelAgent; - } - - /** - * Gets whether or not the Travel Agent will be used. - *

- * If this is set to true, the TravelAgent will try to find a Portal at - * the {@link #getTo()} Location, and will try to create one if there is - * none. - *

- * If this is set to false, the {@link #getEntity()} will only be - * teleported to the {@link #getTo()} Location. - * - * @return whether to use the Travel Agent - */ - public boolean useTravelAgent() { - return useTravelAgent; - } - - /** - * Gets the Travel Agent used (or not) in this event. - * - * @return the Travel Agent used (or not) in this event - */ - @NotNull - public TravelAgent getPortalTravelAgent() { - return this.travelAgent; - } - - /** - * Sets the Travel Agent used (or not) in this event. - * - * @param travelAgent the Travel Agent used (or not) in this event - */ - public void setPortalTravelAgent(@NotNull TravelAgent travelAgent) { - this.travelAgent = travelAgent; } @NotNull diff --git a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java index 57f6203d..ec12b57e 100644 --- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java @@ -2,7 +2,6 @@ package org.bukkit.event.entity; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Projectile; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import org.bukkit.inventory.ItemStack; @@ -19,7 +18,7 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { private final float force; private boolean cancelled; - public EntityShootBowEvent(@NotNull final LivingEntity shooter, @Nullable final ItemStack bow, @NotNull final Projectile projectile, final float force) { + public EntityShootBowEvent(@NotNull final LivingEntity shooter, @Nullable final ItemStack bow, @NotNull final Entity projectile, final float force) { super(shooter); this.bow = bow; this.projectile = projectile; diff --git a/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java b/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java index 37d0ffa1..db667785 100644 --- a/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java @@ -151,6 +151,10 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable { * entity */ CLOSEST_ENTITY, + /** + * When a raiding entity selects the same target as one of its compatriots. + */ + FOLLOW_LEADER, /** * When another entity tempts this entity by having a desired item such * as wheat in it's hand. diff --git a/src/main/java/org/bukkit/event/entity/VillagerAcquireTradeEvent.java b/src/main/java/org/bukkit/event/entity/VillagerAcquireTradeEvent.java index 95740eb7..58155105 100644 --- a/src/main/java/org/bukkit/event/entity/VillagerAcquireTradeEvent.java +++ b/src/main/java/org/bukkit/event/entity/VillagerAcquireTradeEvent.java @@ -1,6 +1,6 @@ package org.bukkit.event.entity; -import org.bukkit.entity.Villager; +import org.bukkit.entity.AbstractVillager; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import org.bukkit.inventory.MerchantRecipe; @@ -16,7 +16,7 @@ public class VillagerAcquireTradeEvent extends EntityEvent implements Cancellabl // private MerchantRecipe recipe; - public VillagerAcquireTradeEvent(@NotNull Villager what, @NotNull MerchantRecipe recipe) { + public VillagerAcquireTradeEvent(@NotNull AbstractVillager what, @NotNull MerchantRecipe recipe) { super(what); this.recipe = recipe; } @@ -52,8 +52,8 @@ public class VillagerAcquireTradeEvent extends EntityEvent implements Cancellabl @NotNull @Override - public Villager getEntity() { - return (Villager) super.getEntity(); + public AbstractVillager getEntity() { + return (AbstractVillager) super.getEntity(); } @NotNull diff --git a/src/main/java/org/bukkit/event/entity/VillagerReplenishTradeEvent.java b/src/main/java/org/bukkit/event/entity/VillagerReplenishTradeEvent.java index 738469dd..ff5f484c 100644 --- a/src/main/java/org/bukkit/event/entity/VillagerReplenishTradeEvent.java +++ b/src/main/java/org/bukkit/event/entity/VillagerReplenishTradeEvent.java @@ -1,6 +1,6 @@ package org.bukkit.event.entity; -import org.bukkit.entity.Villager; +import org.bukkit.entity.AbstractVillager; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import org.bukkit.inventory.MerchantRecipe; @@ -20,7 +20,7 @@ public class VillagerReplenishTradeEvent extends EntityEvent implements Cancella private MerchantRecipe recipe; private int bonus; - public VillagerReplenishTradeEvent(@NotNull Villager what, @NotNull MerchantRecipe recipe, int bonus) { + public VillagerReplenishTradeEvent(@NotNull AbstractVillager what, @NotNull MerchantRecipe recipe, int bonus) { super(what); this.recipe = recipe; this.bonus = bonus; @@ -77,8 +77,8 @@ public class VillagerReplenishTradeEvent extends EntityEvent implements Cancella @NotNull @Override - public Villager getEntity() { - return (Villager) super.getEntity(); + public AbstractVillager getEntity() { + return (AbstractVillager) super.getEntity(); } @NotNull diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java index 98196837..066e7dd9 100644 --- a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java +++ b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java @@ -1,73 +1,16 @@ package org.bukkit.event.inventory; import org.bukkit.block.Block; -import org.bukkit.event.Cancellable; -import org.bukkit.event.HandlerList; -import org.bukkit.event.block.BlockEvent; +import org.bukkit.event.block.BlockCookEvent; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; /** * Called when an ItemStack is successfully smelted in a furnace. */ -public class FurnaceSmeltEvent extends BlockEvent implements Cancellable { - private static final HandlerList handlers = new HandlerList(); - private final ItemStack source; - private ItemStack result; - private boolean cancelled; +public class FurnaceSmeltEvent extends BlockCookEvent { public FurnaceSmeltEvent(@NotNull final Block furnace, @NotNull final ItemStack source, @NotNull final ItemStack result) { - super(furnace); - this.source = source; - this.result = result; - this.cancelled = false; - } - - /** - * Gets the smelted ItemStack for this event - * - * @return smelting source ItemStack - */ - @NotNull - public ItemStack getSource() { - return source; - } - - /** - * Gets the resultant ItemStack for this event - * - * @return smelting result ItemStack - */ - @NotNull - public ItemStack getResult() { - return result; - } - - /** - * Sets the resultant ItemStack for this event - * - * @param result new result ItemStack - */ - public void setResult(@NotNull ItemStack result) { - this.result = result; - } - - public boolean isCancelled() { - return cancelled; - } - - public void setCancelled(boolean cancel) { - this.cancelled = cancel; - } - - @NotNull - @Override - public HandlerList getHandlers() { - return handlers; - } - - @NotNull - public static HandlerList getHandlerList() { - return handlers; + super(furnace, source, result); } } diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java index d69ce3ec..a0a5c21a 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryType.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java @@ -92,6 +92,39 @@ public enum InventoryType { * A shulker box inventory, with 27 slots of type CONTAINER. */ SHULKER_BOX(27, "Shulker Box"), + /** + * A barrel box inventory, with 27 slots of type CONTAINER. + */ + BARREL(27, "Barrel"), + /** + * A blast furnace inventory, with a RESULT slot, a CRAFTING slot, and a + * FUEL slot. + */ + BLAST_FURNACE(3, "Blast Furnace"), + /** + * A lectern inventory, with 1 BOOK slot. + */ + LECTERN(1, "Lectern", false), + /** + * A smoker inventory, with a RESULT slot, a CRAFTING slot, and a FUEL slot. + */ + SMOKER(3, "Smoker"), + /** + * Loom inventory, with 3 INPUT slots, and 1 RESULT slot. + */ + LOOM(4, "Loom"), + /** + * Cartography inventory with 2 INPUT slots, and 1 RESULT slot. + */ + CARTOGRAPHY(3, "Cartography Table"), + /** + * Grindstone inventory with 2 INPUT slots, and 1 RESULT slot. + */ + GRINDSTONE(3, "Repair & Disenchant"), + /** + * Stonecutter inventory with 1 INPUT slot, and 1 RESULT slot. + */ + STONECUTTER(2, "Stonecutter") ; private final int size; diff --git a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java index f8821c78..5b755078 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java @@ -1,7 +1,6 @@ package org.bukkit.event.player; import org.bukkit.Location; -import org.bukkit.TravelAgent; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; @@ -15,68 +14,13 @@ import org.jetbrains.annotations.Nullable; */ public class PlayerPortalEvent extends PlayerTeleportEvent { private static final HandlerList handlers = new HandlerList(); - protected boolean useTravelAgent = true; - protected TravelAgent travelAgent; - public PlayerPortalEvent(@NotNull final Player player, @NotNull final Location from, @Nullable final Location to, @NotNull final TravelAgent pta) { + public PlayerPortalEvent(@NotNull final Player player, @NotNull final Location from, @Nullable final Location to) { super(player, from, to); - this.travelAgent = pta; } - public PlayerPortalEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull TravelAgent pta, @NotNull TeleportCause cause) { + public PlayerPortalEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull TeleportCause cause) { super(player, from, to, cause); - this.travelAgent = pta; - } - - /** - * Sets whether or not the Travel Agent will be used. - *

- * If this is set to true, the TravelAgent will try to find a Portal at - * the {@link #getTo()} Location, and will try to create one if there is - * none. - *

- * If this is set to false, the {@link #getPlayer()} will only be - * teleported to the {@link #getTo()} Location. - * - * @param useTravelAgent whether to use the Travel Agent - */ - public void useTravelAgent(boolean useTravelAgent) { - this.useTravelAgent = useTravelAgent; - } - - /** - * Gets whether or not the Travel Agent will be used. - *

- * If this is set to true, the TravelAgent will try to find a Portal at - * the {@link #getTo()} Location, and will try to create one if there is - * none. - *

- * If this is set to false, the {@link #getPlayer()}} will only be - * teleported to the {@link #getTo()} Location. - * - * @return whether to use the Travel Agent - */ - public boolean useTravelAgent() { - return useTravelAgent && travelAgent != null; - } - - /** - * Gets the Travel Agent used (or not) in this event. - * - * @return the Travel Agent used (or not) in this event - */ - @NotNull - public TravelAgent getPortalTravelAgent() { - return this.travelAgent; - } - - /** - * Sets the Travel Agent used (or not) in this event. - * - * @param travelAgent the Travel Agent used (or not) in this event - */ - public void setPortalTravelAgent(@NotNull TravelAgent travelAgent) { - this.travelAgent = travelAgent; } @NotNull diff --git a/src/main/java/org/bukkit/event/server/ServerEvent.java b/src/main/java/org/bukkit/event/server/ServerEvent.java index eb00d6af..46b11901 100644 --- a/src/main/java/org/bukkit/event/server/ServerEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerEvent.java @@ -6,4 +6,12 @@ import org.bukkit.event.Event; * Miscellaneous server events */ public abstract class ServerEvent extends Event { + + public ServerEvent() { + super(); + } + + public ServerEvent(boolean isAsync) { + super(isAsync); + } } diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java index d873763d..f8c89cca 100644 --- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java @@ -23,6 +23,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable private int maxPlayers; public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final int numPlayers, final int maxPlayers) { + super(true); Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers); this.address = address; this.motd = motd; @@ -40,6 +41,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * @param maxPlayers the max number of players */ protected ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final int maxPlayers) { + super(true); this.numPlayers = MAGIC_PLAYER_COUNT; this.address = address; this.motd = motd; diff --git a/src/main/java/org/bukkit/inventory/BlastingRecipe.java b/src/main/java/org/bukkit/inventory/BlastingRecipe.java new file mode 100644 index 00000000..74a025a9 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/BlastingRecipe.java @@ -0,0 +1,19 @@ +package org.bukkit.inventory; + +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a campfire recipe. + */ +public class BlastingRecipe extends CookingRecipe { + + public BlastingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) { + super(key, result, source, experience, cookingTime); + } + + public BlastingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) { + super(key, result, input, experience, cookingTime); + } +} diff --git a/src/main/java/org/bukkit/inventory/BlockInventoryHolder.java b/src/main/java/org/bukkit/inventory/BlockInventoryHolder.java new file mode 100644 index 00000000..86fbc1be --- /dev/null +++ b/src/main/java/org/bukkit/inventory/BlockInventoryHolder.java @@ -0,0 +1,21 @@ +package org.bukkit.inventory; + +import org.bukkit.block.Block; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a block inventory holder - either a BlockState, or a regular + * Block. + */ +public interface BlockInventoryHolder extends InventoryHolder { + + /** + * Gets the block associated with this holder. + * + * @return the block associated with this holder + * @throws IllegalStateException if the holder is a block state and is not + * placed + */ + @NotNull + Block getBlock(); +} diff --git a/src/main/java/org/bukkit/inventory/CampfireRecipe.java b/src/main/java/org/bukkit/inventory/CampfireRecipe.java new file mode 100644 index 00000000..a1bd3a68 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/CampfireRecipe.java @@ -0,0 +1,19 @@ +package org.bukkit.inventory; + +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a campfire recipe. + */ +public class CampfireRecipe extends CookingRecipe { + + public CampfireRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) { + super(key, result, source, experience, cookingTime); + } + + public CampfireRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) { + super(key, result, input, experience, cookingTime); + } +} diff --git a/src/main/java/org/bukkit/inventory/CartographyInventory.java b/src/main/java/org/bukkit/inventory/CartographyInventory.java new file mode 100644 index 00000000..29c9b268 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/CartographyInventory.java @@ -0,0 +1,6 @@ +package org.bukkit.inventory; + +/** + * Interface to the inventory of a Cartography table. + */ +public interface CartographyInventory extends Inventory { } diff --git a/src/main/java/org/bukkit/inventory/CookingRecipe.java b/src/main/java/org/bukkit/inventory/CookingRecipe.java new file mode 100644 index 00000000..3d14f1af --- /dev/null +++ b/src/main/java/org/bukkit/inventory/CookingRecipe.java @@ -0,0 +1,172 @@ +package org.bukkit.inventory; + +import com.google.common.base.Preconditions; +import java.util.Collections; +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a cooking recipe. + * @param type of recipe + */ +public abstract class CookingRecipe implements Recipe, Keyed { + private final NamespacedKey key; + private ItemStack output; + private RecipeChoice ingredient; + private float experience; + private int cookingTime; + private String group = ""; + + /** + * Create a cooking recipe to craft the specified ItemStack. + * + * @param key The unique recipe key + * @param result The item you want the recipe to create. + * @param source The input material. + * @param experience The experience given by this recipe + * @param cookingTime The cooking time (in ticks) + */ + public CookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) { + this(key, result, new RecipeChoice.MaterialChoice(Collections.singletonList(source)), experience, cookingTime); + } + + /** + * Create a cooking recipe to craft the specified ItemStack. + * + * @param key The unique recipe key + * @param result The item you want the recipe to create. + * @param input The input choices. + * @param experience The experience given by this recipe + * @param cookingTime The cooking time (in ticks) + */ + public CookingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) { + this.key = key; + this.output = new ItemStack(result); + this.ingredient = input; + this.experience = experience; + this.cookingTime = cookingTime; + } + + /** + * Sets the input of this cooking recipe. + * + * @param input The input material. + * @return The changed recipe, so you can chain calls. + */ + @NotNull + public CookingRecipe setInput(@NotNull Material input) { + this.ingredient = new RecipeChoice.MaterialChoice(Collections.singletonList(input)); + return this; + } + + /** + * Get the input material. + * + * @return The input material. + */ + @NotNull + public ItemStack getInput() { + return this.ingredient.getItemStack(); + } + + /** + * Sets the input of this cooking recipe. + * + * @param input The input choice. + * @return The changed recipe, so you can chain calls. + */ + @NotNull + public T setInputChoice(@NotNull RecipeChoice input) { + this.ingredient = input; + return (T) this; + } + + /** + * Get the input choice. + * + * @return The input choice. + */ + @NotNull + public RecipeChoice getInputChoice() { + return this.ingredient.clone(); + } + + /** + * Get the result of this recipe. + * + * @return The resulting stack. + */ + @NotNull + @Override + public ItemStack getResult() { + return output.clone(); + } + + /** + * Sets the experience given by this recipe. + * + * @param experience the experience level + */ + public void setExperience(float experience) { + this.experience = experience; + } + + /** + * Get the experience given by this recipe. + * + * @return experience level + */ + public float getExperience() { + return experience; + } + + /** + * Set the cooking time for this recipe in ticks. + * + * @param cookingTime new cooking time + */ + public void setCookingTime(int cookingTime) { + Preconditions.checkArgument(cookingTime >= 0, "cookingTime must be >= 0"); + this.cookingTime = cookingTime; + } + + /** + * Get the cooking time for this recipe in ticks. + * + * @return cooking time + */ + public int getCookingTime() { + return cookingTime; + } + + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + + /** + * Get the group of this recipe. Recipes with the same group may be grouped + * together when displayed in the client. + * + * @return recipe group. An empty string denotes no group. May not be null. + */ + @NotNull + public String getGroup() { + return group; + } + + /** + * Set the group of this recipe. Recipes with the same group may be grouped + * together when displayed in the client. + * + * @param group recipe group. An empty string denotes no group. May not be + * null. + */ + public void setGroup(@NotNull String group) { + Preconditions.checkArgument(group != null, "group"); + this.group = group; + } +} diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java index d40ffbe7..1d442dc1 100644 --- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java +++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java @@ -1,23 +1,15 @@ package org.bukkit.inventory; -import com.google.common.base.Preconditions; import java.util.Collections; -import org.bukkit.Keyed; import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.material.MaterialData; import org.jetbrains.annotations.NotNull; /** - * Represents a smelting recipe. + * Represents a furnace recipe. */ -public class FurnaceRecipe implements Recipe, Keyed { - private final NamespacedKey key; - private ItemStack output; - private RecipeChoice ingredient; - private float experience; - private int cookingTime; - private String group = ""; +public class FurnaceRecipe extends CookingRecipe { @Deprecated public FurnaceRecipe(@NotNull ItemStack result, @NotNull Material source) { @@ -67,11 +59,7 @@ public class FurnaceRecipe implements Recipe, Keyed { * @param cookingTime The cooking time (in ticks) */ public FurnaceRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) { - this.key = key; - this.output = new ItemStack(result); - this.ingredient = input; - this.experience = experience; - this.cookingTime = cookingTime; + super(key, result, input, experience, cookingTime); } /** @@ -85,15 +73,10 @@ public class FurnaceRecipe implements Recipe, Keyed { return setInput(input.getItemType(), input.getData()); } - /** - * Sets the input of this furnace recipe. - * - * @param input The input material. - * @return The changed recipe, so you can chain calls. - */ @NotNull + @Override public FurnaceRecipe setInput(@NotNull Material input) { - return setInput(input, 0); + return (FurnaceRecipe) super.setInput(input); } /** @@ -106,117 +89,13 @@ public class FurnaceRecipe implements Recipe, Keyed { * @deprecated Magic value */ @Deprecated - @NotNull public FurnaceRecipe setInput(@NotNull Material input, int data) { - this.ingredient = new RecipeChoice.MaterialChoice(Collections.singletonList(input)); - return this; - } - - /** - * Get the input material. - * - * @return The input material. - */ - @NotNull - public ItemStack getInput() { - return this.ingredient.getItemStack(); - } - - /** - * Sets the input of this furnace recipe. - * - * @param input The input choice. - * @return The changed recipe, so you can chain calls. - */ - @NotNull - public FurnaceRecipe setInputChoice(@NotNull RecipeChoice input) { - this.ingredient = input; - return this; - } - - /** - * Get the input choice. - * - * @return The input choice. - */ - @NotNull - public RecipeChoice getInputChoice() { - return this.ingredient.clone(); - } - - /** - * Get the result of this recipe. - * - * @return The resulting stack. - */ - @NotNull - public ItemStack getResult() { - return output.clone(); - } - - /** - * Sets the experience given by this recipe. - * - * @param experience the experience level - */ - public void setExperience(float experience) { - this.experience = experience; - } - - /** - * Get the experience given by this recipe. - * - * @return experience level - */ - public float getExperience() { - return experience; - } - - /** - * Set the cooking time for this recipe in ticks. - * - * @param cookingTime new cooking time - */ - public void setCookingTime(int cookingTime) { - Preconditions.checkArgument(cookingTime >= 0, "cookingTime must be >= 0"); - this.cookingTime = cookingTime; - } - - /** - * Get the cooking time for this recipe in ticks. - * - * @return cooking time - */ - public int getCookingTime() { - return cookingTime; + return setInputChoice(new RecipeChoice.MaterialChoice(Collections.singletonList(input))); } @NotNull @Override - public NamespacedKey getKey() { - return key; - } - - /** - * Get the group of this recipe. Recipes with the same group may be grouped - * together when displayed in the client. - * - * @return recipe group. An empty string denotes no group. May not be null. - */ - @NotNull - public String getGroup() { - return group; - } - - /** - * Set the group of this recipe. Recipes with the same group may be grouped - * together when displayed in the client. - * - * @param group recipe group. An empty string denotes no group. May not be - * null. - */ - public void setGroup(@NotNull String group) { - Preconditions.checkArgument(group != null, "group"); - this.group = group; + public FurnaceRecipe setInputChoice(@NotNull RecipeChoice input) { + return (FurnaceRecipe) super.setInputChoice(input); } } diff --git a/src/main/java/org/bukkit/inventory/GrindstoneInventory.java b/src/main/java/org/bukkit/inventory/GrindstoneInventory.java new file mode 100644 index 00000000..9048892c --- /dev/null +++ b/src/main/java/org/bukkit/inventory/GrindstoneInventory.java @@ -0,0 +1,6 @@ +package org.bukkit.inventory; + +/** + * Interface to the inventory of a Grindstone. + */ +public interface GrindstoneInventory extends Inventory { } diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java index 36e35291..f9a8aff0 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java @@ -60,18 +60,6 @@ public interface Inventory extends Iterable { */ public void setMaxStackSize(int size); - /** - * Returns the name of the inventory - * - * @return The String with the name of the inventory - * @deprecated different instances of the same inventory may have different names; - * it is not clear what this method is meant to return - * @see InventoryView#getTitle() - */ - @Deprecated - @NotNull - public String getName(); - /** * Returns the ItemStack found in the slot at the given index * @@ -345,17 +333,6 @@ public interface Inventory extends Iterable { @NotNull public List getViewers(); - /** - * Returns the title of this inventory. - * - * @return A String with the title. - * @deprecated different instances of the same inventory may have different titles - * @see InventoryView#getTitle() - */ - @Deprecated - @NotNull - public String getTitle(); - /** * Returns what type of inventory this is. * diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java index 38b9132f..b777bec7 100644 --- a/src/main/java/org/bukkit/inventory/InventoryView.java +++ b/src/main/java/org/bukkit/inventory/InventoryView.java @@ -427,7 +427,5 @@ public abstract class InventoryView { * @return The title. */ @NotNull - public final String getTitle() { - return getTopInventory().getTitle(); - } + public abstract String getTitle(); } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java index 7b709457..8628e655 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -480,7 +480,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { damage = 0; } } else { - type = Material.getMaterial((String) args.get("type")); + type = Bukkit.getUnsafe().getMaterial((String) args.get("type"), version); } if (args.containsKey("amount")) { @@ -506,6 +506,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { } else if (args.containsKey("meta")) { // We cannot and will not have meta when enchantments (pre-ItemMeta) exist Object raw = args.get("meta"); if (raw instanceof ItemMeta) { + ((ItemMeta) raw).setVersion(version); result.setItemMeta((ItemMeta) raw); } } diff --git a/src/main/java/org/bukkit/inventory/LecternInventory.java b/src/main/java/org/bukkit/inventory/LecternInventory.java new file mode 100644 index 00000000..4a0c43ac --- /dev/null +++ b/src/main/java/org/bukkit/inventory/LecternInventory.java @@ -0,0 +1,14 @@ +package org.bukkit.inventory; + +import org.bukkit.block.Lectern; +import org.jetbrains.annotations.Nullable; + +/** + * Interface to the inventory of a Lectern. + */ +public interface LecternInventory extends Inventory { + + @Nullable + @Override + public Lectern getHolder(); +} diff --git a/src/main/java/org/bukkit/inventory/LoomInventory.java b/src/main/java/org/bukkit/inventory/LoomInventory.java new file mode 100644 index 00000000..9801b59e --- /dev/null +++ b/src/main/java/org/bukkit/inventory/LoomInventory.java @@ -0,0 +1,6 @@ +package org.bukkit.inventory; + +/** + * Interface to the inventory of a Loom. + */ +public interface LoomInventory extends Inventory { } diff --git a/src/main/java/org/bukkit/inventory/MerchantRecipe.java b/src/main/java/org/bukkit/inventory/MerchantRecipe.java index dabbdf25..149e63b3 100644 --- a/src/main/java/org/bukkit/inventory/MerchantRecipe.java +++ b/src/main/java/org/bukkit/inventory/MerchantRecipe.java @@ -27,16 +27,24 @@ public class MerchantRecipe implements Recipe { private int uses; private int maxUses; private boolean experienceReward; + private int villagerExperience; + private float priceMultiplier; public MerchantRecipe(@NotNull ItemStack result, int maxUses) { this(result, 0, maxUses, false); } public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward) { + this(result, uses, maxUses, experienceReward, 0, 0.0F); + } + + public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier) { this.result = result; this.uses = uses; this.maxUses = maxUses; this.experienceReward = experienceReward; + this.villagerExperience = villagerExperience; + this.priceMultiplier = priceMultiplier; } @NotNull @@ -111,20 +119,58 @@ public class MerchantRecipe implements Recipe { } /** - * Whether to reward experience for the trade. + * Whether to reward experience to the player for the trade. * - * @return whether to reward experience for completing this trade + * @return whether to reward experience to the player for completing this + * trade */ public boolean hasExperienceReward() { return experienceReward; } /** - * Set whether to reward experience for the trade. + * Set whether to reward experience to the player for the trade. * - * @param flag whether to reward experience for completing this trade + * @param flag whether to reward experience to the player for completing + * this trade */ public void setExperienceReward(boolean flag) { this.experienceReward = flag; } + + /** + * Gets the amount of experience the villager earns from this trade. + * + * @return villager experience + */ + public int getVillagerExperience() { + return villagerExperience; + } + + /** + * Sets the amount of experience the villager earns from this trade. + * + * @param villagerExperience new experience amount + */ + public void setVillagerExperience(int villagerExperience) { + this.villagerExperience = villagerExperience; + } + + /** + * Gets the additive price multiplier for the cost of this trade. + * + * @return price multiplier + */ + public float getPriceMultiplier() { + return priceMultiplier; + } + + /** + * Sets the additive price multiplier for the cost of this trade. + * + * @param priceMultiplier new price multiplier + */ + public void setPriceMultiplier(float priceMultiplier) { + this.priceMultiplier = priceMultiplier; + } } diff --git a/src/main/java/org/bukkit/inventory/SmokingRecipe.java b/src/main/java/org/bukkit/inventory/SmokingRecipe.java new file mode 100644 index 00000000..1073d9ae --- /dev/null +++ b/src/main/java/org/bukkit/inventory/SmokingRecipe.java @@ -0,0 +1,19 @@ +package org.bukkit.inventory; + +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a campfire recipe. + */ +public class SmokingRecipe extends CookingRecipe { + + public SmokingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, float experience, int cookingTime) { + super(key, result, source, experience, cookingTime); + } + + public SmokingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, float experience, int cookingTime) { + super(key, result, input, experience, cookingTime); + } +} diff --git a/src/main/java/org/bukkit/inventory/StonecutterInventory.java b/src/main/java/org/bukkit/inventory/StonecutterInventory.java new file mode 100644 index 00000000..dbb034fa --- /dev/null +++ b/src/main/java/org/bukkit/inventory/StonecutterInventory.java @@ -0,0 +1,6 @@ +package org.bukkit.inventory; + +/** + * Interface to the inventory of a Stonecutter. + */ +public interface StonecutterInventory extends Inventory { } diff --git a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java new file mode 100644 index 00000000..0ad14ef0 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java @@ -0,0 +1,126 @@ +package org.bukkit.inventory; + +import com.google.common.base.Preconditions; +import java.util.Collections; +import org.bukkit.Keyed; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a Stonecutting recipe. + */ +public class StonecuttingRecipe implements Recipe, Keyed { + private final NamespacedKey key; + private ItemStack output; + private RecipeChoice ingredient; + private String group = ""; + + /** + * Create a Stonecutting recipe to craft the specified ItemStack. + * + * @param key The unique recipe key + * @param result The item you want the recipe to create. + * @param source The input material. + */ + public StonecuttingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source) { + this(key, result, new RecipeChoice.MaterialChoice(Collections.singletonList(source))); + } + + /** + * Create a cooking recipe to craft the specified ItemStack. + * + * @param key The unique recipe key + * @param result The item you want the recipe to create. + * @param input The input choices. + */ + public StonecuttingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input) { + this.key = key; + this.output = new ItemStack(result); + this.ingredient = input; + } + + /** + * Sets the input of this cooking recipe. + * + * @param input The input material. + * @return The changed recipe, so you can chain calls. + */ + @NotNull + public StonecuttingRecipe setInput(@NotNull Material input) { + this.ingredient = new RecipeChoice.MaterialChoice(Collections.singletonList(input)); + return this; + } + + /** + * Get the input material. + * + * @return The input material. + */ + @NotNull + public ItemStack getInput() { + return this.ingredient.getItemStack(); + } + + /** + * Sets the input of this cooking recipe. + * + * @param input The input choice. + * @return The changed recipe, so you can chain calls. + */ + @NotNull + public StonecuttingRecipe setInputChoice(@NotNull RecipeChoice input) { + this.ingredient = input; + return (StonecuttingRecipe) this; + } + + /** + * Get the input choice. + * + * @return The input choice. + */ + @NotNull + public RecipeChoice getInputChoice() { + return this.ingredient.clone(); + } + + /** + * Get the result of this recipe. + * + * @return The resulting stack. + */ + @NotNull + @Override + public ItemStack getResult() { + return output.clone(); + } + + @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + + /** + * Get the group of this recipe. Recipes with the same group may be grouped + * together when displayed in the client. + * + * @return recipe group. An empty string denotes no group. May not be null. + */ + @NotNull + public String getGroup() { + return group; + } + + /** + * Set the group of this recipe. Recipes with the same group may be grouped + * together when displayed in the client. + * + * @param group recipe group. An empty string denotes no group. May not be + * null. + */ + public void setGroup(@NotNull String group) { + Preconditions.checkArgument(group != null, "group"); + this.group = group; + } +} diff --git a/src/main/java/org/bukkit/inventory/meta/BlockDataMeta.java b/src/main/java/org/bukkit/inventory/meta/BlockDataMeta.java new file mode 100644 index 00000000..473c72dc --- /dev/null +++ b/src/main/java/org/bukkit/inventory/meta/BlockDataMeta.java @@ -0,0 +1,37 @@ +package org.bukkit.inventory.meta; + +import org.bukkit.Material; +import org.bukkit.block.data.BlockData; +import org.jetbrains.annotations.NotNull; + +public interface BlockDataMeta extends ItemMeta { + + /** + * Returns whether the item has block data currently attached to it. + * + * @return whether block data is already attached + */ + boolean hasBlockData(); + + /** + * Returns the currently attached block data for this item or creates a new + * one if one doesn't exist. + * + * The state is a copy, it must be set back (or to another item) with + * {@link #setBlockData(org.bukkit.block.data.BlockData)} + * + * @param material the material we wish to get this data in the context of + * @return the attached data or new data + */ + @NotNull + BlockData getBlockData(@NotNull Material material); + + /** + * Attaches a copy of the passed block data to the item. + * + * @param blockData the block data to attach to the block. + * @throws IllegalArgumentException if the blockData is null or invalid for + * this item. + */ + void setBlockData(@NotNull BlockData blockData); +} diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java index f7008a78..4cd8a941 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java @@ -100,6 +100,39 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { */ void setLore(@Nullable List lore); + /** + * Checks for existence of custom model data. + *

+ * CustomModelData is an integer that may be associated client side with a + * custom item model. + * + * @return true if this has custom model data + */ + boolean hasCustomModelData(); + + /** + * Gets the custom model data that is set. + *

+ * CustomModelData is an integer that may be associated client side with a + * custom item model. + *

+ * Plugins should check that hasCustomModelData() returns true + * before calling this method. + * + * @return the localized name that is set + */ + int getCustomModelData(); + + /** + * Sets the custom model data. + *

+ * CustomModelData is an integer that may be associated client side with a + * custom item model. + * + * @param data the data to set, or null to clear + */ + void setCustomModelData(@Nullable Integer data); + /** * Checks for the existence of any enchantments. * @@ -340,6 +373,15 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { @NotNull CustomItemTagContainer getCustomTagContainer(); + /** + * Internal use only! Do not use under any circumstances! + * + * @param version + * @deprecated + */ + @Deprecated + void setVersion(int version); + @SuppressWarnings("javadoc") @NotNull ItemMeta clone(); diff --git a/src/main/java/org/bukkit/map/MapView.java b/src/main/java/org/bukkit/map/MapView.java index 29dd573a..23b55174 100644 --- a/src/main/java/org/bukkit/map/MapView.java +++ b/src/main/java/org/bukkit/map/MapView.java @@ -173,4 +173,22 @@ public interface MapView { * @param unlimited tracking state */ void setUnlimitedTracking(boolean unlimited); + + /** + * Gets whether the map is locked or not. + * + * A locked map may not be explored further. + * + * @return lock status + */ + boolean isLocked(); + + /** + * Gets whether the map is locked or not. + * + * A locked map may not be explored further. + * + * @param locked status + */ + void setLocked(boolean locked); } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 08d890c1..657d9692 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -487,6 +487,9 @@ public final class SimplePluginManager implements PluginManager { } fireEvent(event); } else { + if (!server.isPrimaryThread()) { + throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from another thread."); + } synchronized (this) { fireEvent(event); } diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java index 059c77d3..941eeab9 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectType.java +++ b/src/main/java/org/bukkit/potion/PotionEffectType.java @@ -165,6 +165,16 @@ public abstract class PotionEffectType { */ public static final PotionEffectType DOLPHINS_GRACE = new PotionEffectTypeWrapper(30); + /** + * oof. + */ + public static final PotionEffectType BAD_OMEN = new PotionEffectTypeWrapper(31); + + /** + * \o/. + */ + public static final PotionEffectType HERO_OF_THE_VILLAGE = new PotionEffectTypeWrapper(32); + private final int id; protected PotionEffectType(int id) { @@ -189,7 +199,9 @@ public abstract class PotionEffectType { * Returns the duration modifier applied to effects of this type. * * @return duration modifier + * @deprecated unused, always 1.0 */ + @Deprecated public abstract double getDurationModifier(); /** @@ -251,7 +263,7 @@ public abstract class PotionEffectType { return "PotionEffectType[" + id + ", " + getName() + "]"; } - private static final PotionEffectType[] byId = new PotionEffectType[31]; + private static final PotionEffectType[] byId = new PotionEffectType[33]; private static final Map byName = new HashMap(); // will break on updates. private static boolean acceptingNew = true; diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java index 6b86128e..4fdb9b22 100644 --- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java +++ b/src/test/java/org/bukkit/plugin/PluginManagerTest.java @@ -89,14 +89,16 @@ public class PluginManagerTest { pm.callEvent(event); } catch (Throwable ex) { store.value = ex; + assertThat(event.getEventName() + " cannot be triggered asynchronously from another thread.", is(ex.getMessage())); + return; } } } ); secondThread.start(); secondThread.join(); - if (store.value != null) { - throw new RuntimeException((Throwable) store.value); + if (store.value == null) { + throw new IllegalStateException("No exception thrown"); } } @@ -112,14 +114,16 @@ public class PluginManagerTest { } } catch (Throwable ex) { store.value = ex; + assertThat(event.getEventName() + " cannot be triggered asynchronously from another thread.", is(ex.getMessage())); + return; } } } ); secondThread.start(); secondThread.join(); - if (store.value != null) { - throw new RuntimeException((Throwable) store.value); + if (store.value == null) { + throw new IllegalStateException("No exception thrown"); } }