diff --git a/pom.xml b/pom.xml index dba87ac0..7e884b8b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.bukkit bukkit - 1.20.1-R0.1-SNAPSHOT + 1.20.2-R0.1-SNAPSHOT jar Bukkit @@ -35,14 +35,14 @@ com.google.guava guava - 31.1-jre + 32.1.2-jre compile com.google.code.gson gson - 2.10 + 2.10.1 compile @@ -55,7 +55,7 @@ org.yaml snakeyaml - 2.0 + 2.2 compile diff --git a/src/main/java/org/bukkit/GameEvent.java b/src/main/java/org/bukkit/GameEvent.java index 6dbfc2ce..9112386f 100644 --- a/src/main/java/org/bukkit/GameEvent.java +++ b/src/main/java/org/bukkit/GameEvent.java @@ -32,8 +32,11 @@ public abstract class GameEvent implements Keyed { public static final GameEvent ENTITY_INTERACT = getEvent("entity_interact"); public static final GameEvent ENTITY_MOUNT = getEvent("entity_mount"); public static final GameEvent ENTITY_PLACE = getEvent("entity_place"); - public static final GameEvent ENTITY_ROAR = getEvent("entity_roar"); - public static final GameEvent ENTITY_SHAKE = getEvent("entity_shake"); + public static final GameEvent ENTITY_ACTION = getEvent("entity_action"); + @Deprecated + public static final GameEvent ENTITY_ROAR = getEvent("entity_action"); + @Deprecated + public static final GameEvent ENTITY_SHAKE = getEvent("entity_action"); public static final GameEvent EQUIP = getEvent("equip"); public static final GameEvent EXPLODE = getEvent("explode"); public static final GameEvent FLAP = getEvent("flap"); @@ -57,6 +60,7 @@ public abstract class GameEvent implements Keyed { public static final GameEvent STEP = getEvent("step"); public static final GameEvent SWIM = getEvent("swim"); public static final GameEvent TELEPORT = getEvent("teleport"); + public static final GameEvent UNEQUIP = getEvent("unequip"); public static final GameEvent RESONATE_1 = getEvent("resonate_1"); public static final GameEvent RESONATE_2 = getEvent("resonate_2"); public static final GameEvent RESONATE_3 = getEvent("resonate_3"); diff --git a/src/main/java/org/bukkit/GameRule.java b/src/main/java/org/bukkit/GameRule.java index 753bfcec..9443baf6 100644 --- a/src/main/java/org/bukkit/GameRule.java +++ b/src/main/java/org/bukkit/GameRule.java @@ -206,6 +206,10 @@ public final class GameRule { * Whether vines will spread. */ public static final GameRule DO_VINES_SPREAD = new GameRule<>("doVinesSpread", Boolean.class); + /** + * Whether ender pearls will vanish on player death. + */ + public static final GameRule ENDER_PEARLS_VANISH_ON_DEATH = new GameRule<>("enderPearlsVanishOnDeath", Boolean.class); // Numerical rules /** diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index c7a75a9f..15e97ae2 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -1193,7 +1193,10 @@ public enum Material implements Keyed, Translatable { GREEN_TERRACOTTA(4105), RED_TERRACOTTA(5086), BLACK_TERRACOTTA(26691), - BARRIER(26453), + /** + * BlockData: {@link Waterlogged} + */ + BARRIER(26453, Waterlogged.class), /** * BlockData: {@link Light} */ diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java index a73c954a..0f191a81 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java @@ -3,6 +3,7 @@ package org.bukkit; import java.util.Collection; import java.util.List; import java.util.Random; +import java.util.function.Consumer; import java.util.function.Predicate; import org.bukkit.block.Biome; import org.bukkit.block.BlockState; @@ -11,7 +12,6 @@ import org.bukkit.block.data.BlockData; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; -import org.bukkit.util.Consumer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java index f33d9ead..e13374f4 100644 --- a/src/main/java/org/bukkit/Tag.java +++ b/src/main/java/org/bukkit/Tag.java @@ -262,6 +262,10 @@ public interface Tag extends Keyed { * Vanilla block tag representing all terracotta. */ Tag> TERRACOTTA = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("terracotta"), BlockType.class); + /** + * Vanilla block tag representing all concrete powder. + */ + Tag> CONCRETE_POWDER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("concrete_powder"), BlockType.class); /** * Vanilla block tag representing all blocks which complete the find tree * tutorial. @@ -501,6 +505,10 @@ public interface Tag extends Keyed { * Vanilla block tag representing all blocks that play combination step sounds. */ Tag> COMBINATION_STEP_SOUND_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("combination_step_sound_blocks"), BlockType.class); + /** + * Vanilla block tag representing all blocks that play step sounds with camels on sand. + */ + Tag> CAMEL_SAND_STEP_SOUND_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("camel_sand_step_sound_blocks"), BlockType.class); /** * Vanilla block tag representing all blocks that block vibration signals. */ @@ -952,6 +960,10 @@ public interface Tag extends Keyed { * Vanilla tag representing entities which are dismounted when underwater. */ Tag> ENTITY_TYPES_DISMOUNTS_UNDERWATER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("dismounts_underwater"), EntityType.class); + /** + * Vanilla tag representing entities which are not controlled by their mount. + */ + Tag> ENTITY_TYPES_NON_CONTROLLING_RIDER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("non_controlling_rider"), EntityType.class); /** * Returns whether or not this tag has an entry for the specified item. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 50e74378..23bf6da6 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -6,6 +6,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.function.Consumer; import java.util.function.Predicate; import org.bukkit.block.Biome; import org.bukkit.block.Block; @@ -33,7 +34,6 @@ import org.bukkit.persistence.PersistentDataHolder; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.messaging.PluginMessageRecipient; import org.bukkit.util.BoundingBox; -import org.bukkit.util.Consumer; import org.bukkit.util.RayTraceResult; import org.bukkit.util.StructureSearchResult; import org.bukkit.util.Vector; @@ -521,7 +521,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient * @param delegate A class to call for each block changed as a result of * this method * @return true if the tree was created successfully, otherwise false - * @see #generateTree(org.bukkit.Location, java.util.Random, org.bukkit.TreeType, org.bukkit.util.Consumer) + * @see #generateTree(org.bukkit.Location, java.util.Random, org.bukkit.TreeType, java.util.function.Consumer) * @deprecated this method does not handle tile entities (bee nests) */ @Deprecated diff --git a/src/main/java/org/bukkit/attribute/Attribute.java b/src/main/java/org/bukkit/attribute/Attribute.java index adccc6e3..542b87d3 100644 --- a/src/main/java/org/bukkit/attribute/Attribute.java +++ b/src/main/java/org/bukkit/attribute/Attribute.java @@ -57,6 +57,10 @@ public abstract class Attribute extends OldEnum implements Keyed { * Luck bonus of an Entity. */ public static final Attribute GENERIC_LUCK = getAttribute("generic.luck"); + /** + * Maximum absorption of an Entity. + */ + MAX_ABSORPTION("generic.max_absorption"), /** * Strength with which a horse will jump. */ diff --git a/src/main/java/org/bukkit/inventory/meta/BundleMeta.java b/src/main/java/org/bukkit/inventory/meta/BundleMeta.java index bc992fdf..e4c69a02 100644 --- a/src/main/java/org/bukkit/inventory/meta/BundleMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/BundleMeta.java @@ -1,10 +1,14 @@ package org.bukkit.inventory.meta; import java.util.List; +import org.bukkit.MinecraftExperimental; import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +@MinecraftExperimental +@ApiStatus.Experimental public interface BundleMeta extends ItemMeta { /** @@ -24,7 +28,7 @@ public interface BundleMeta extends ItemMeta { /** * Sets the items stored in this item. - * + *
* Removes all items when given null. * * @param items the items to set diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java index 83354b2a..b90fd819 100644 --- a/src/main/java/org/bukkit/map/MapCursor.java +++ b/src/main/java/org/bukkit/map/MapCursor.java @@ -222,7 +222,7 @@ public final class MapCursor { /** * Represents the standard types of map cursors. More may be made * available by resource packs - the value is used by the client as an - * index in the file './misc/mapicons.png' from minecraft.jar or from a + * index in the file './assets/minecraft/textures/map/map_icons.png' from minecraft.jar or from a * resource pack. */ public enum Type { @@ -252,7 +252,15 @@ public final class MapCursor { BANNER_GREEN(23), BANNER_RED(24), BANNER_BLACK(25), - RED_X(26); + RED_X(26), + DESERT_VILLAGE(27), + PLAINS_VILLAGE(28), + SAVANNA_VILLAGE(29), + SNOWY_VILLAGE(30), + TAIGA_VILLAGE(31), + JUNGLE_TEMPLE(32), + SWAMP_HUT(33), + ; private byte value; diff --git a/src/main/java/org/bukkit/packs/DataPack.java b/src/main/java/org/bukkit/packs/DataPack.java index 744d8c05..e424680e 100644 --- a/src/main/java/org/bukkit/packs/DataPack.java +++ b/src/main/java/org/bukkit/packs/DataPack.java @@ -34,7 +34,9 @@ public interface DataPack extends Keyed { * This is related to the server version to work. * * @return the pack version + * @deprecated packs can support multiple versions */ + @Deprecated public int getPackFormat(); /** diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java index 66dfed07..88f720ab 100644 --- a/src/main/java/org/bukkit/potion/PotionEffect.java +++ b/src/main/java/org/bukkit/potion/PotionEffect.java @@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap; import java.util.Map; import java.util.NoSuchElementException; import org.bukkit.Color; +import org.bukkit.NamespacedKey; import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.configuration.serialization.SerializableAs; import org.bukkit.entity.LivingEntity; @@ -108,8 +109,14 @@ public class PotionEffect implements ConfigurationSerializable { @NotNull private static PotionEffectType getEffectType(@NotNull Map map) { - int type = getInt(map, TYPE); - PotionEffectType effect = PotionEffectType.getById(type); + PotionEffectType effect; + if (map.get(TYPE) instanceof String) { + String type = (String) map.get(TYPE); + effect = PotionEffectType.getByKey(NamespacedKey.fromString(type)); + } else { + int type = getInt(map, TYPE); + effect = PotionEffectType.getById(type); + } if (effect != null) { return effect; } @@ -136,7 +143,7 @@ public class PotionEffect implements ConfigurationSerializable { @NotNull public Map serialize() { return ImmutableMap.builder() - .put(TYPE, type.getId()) + .put(TYPE, type.getKey().toString()) .put(DURATION, duration) .put(AMPLIFIER, amplifier) .put(AMBIENT, ambient) diff --git a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java index 7a2ee20d..835752c9 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java +++ b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java @@ -34,7 +34,7 @@ public class PotionEffectTypeWrapper extends PotionEffectType { */ @NotNull public PotionEffectType getType() { - return PotionEffectType.getById(getId()); + return PotionEffectType.getByKey(getKey()); } @Override diff --git a/src/main/java/org/bukkit/util/Consumer.java b/src/main/java/org/bukkit/util/Consumer.java index fb9e6b90..dd6bfbc4 100644 --- a/src/main/java/org/bukkit/util/Consumer.java +++ b/src/main/java/org/bukkit/util/Consumer.java @@ -5,13 +5,19 @@ package org.bukkit.util; * result. * * @param the type of the input to the operation + * @deprecated Use {@link java.util.function.Consumer} instead */ -public interface Consumer { +// Bukkit developer note (NOT plugin developers): +// NEVER use this consumer in the API. +// API methods which use this consumer will be remapped to Java's consumer at runtime, resulting in an error. +@Deprecated +public interface Consumer extends java.util.function.Consumer { /** * Performs this operation on the given argument. * * @param t the input argument */ + @Override void accept(T t); }