diff --git a/paper-api/pom.xml b/paper-api/pom.xml index 53905a9204..1c911797a7 100644 --- a/paper-api/pom.xml +++ b/paper-api/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/paper-api/src/main/java/org/bukkit/GameEvent.java b/paper-api/src/main/java/org/bukkit/GameEvent.java index 0468d1f4b9..6c9689baca 100644 --- a/paper-api/src/main/java/org/bukkit/GameEvent.java +++ b/paper-api/src/main/java/org/bukkit/GameEvent.java @@ -52,8 +52,11 @@ public abstract class GameEvent implements Keyed { @Deprecated public static final GameEvent ENTITY_KILLED = getEvent("entity_die"); 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"); @@ -77,7 +80,7 @@ public abstract class GameEvent implements Keyed { public static final GameEvent PROJECTILE_LAND = getEvent("projectile_land"); public static final GameEvent PROJECTILE_SHOOT = getEvent("projectile_shoot"); @Deprecated - public static final GameEvent RAVAGER_ROAR = getEvent("entity_roar"); + public static final GameEvent RAVAGER_ROAR = getEvent("entity_action"); @Deprecated public static final GameEvent RING_BELL = getEvent("block_change"); public static final GameEvent SCULK_SENSOR_TENDRILS_CLICKING = getEvent("sculk_sensor_tendrils_clicking"); @@ -91,8 +94,9 @@ 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"); @Deprecated - public static final GameEvent WOLF_SHAKING = getEvent("entity_shake"); + public static final GameEvent WOLF_SHAKING = getEvent("entity_action"); 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/paper-api/src/main/java/org/bukkit/GameRule.java b/paper-api/src/main/java/org/bukkit/GameRule.java index 753bfcec44..9443baf6de 100644 --- a/paper-api/src/main/java/org/bukkit/GameRule.java +++ b/paper-api/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/paper-api/src/main/java/org/bukkit/Sound.java b/paper-api/src/main/java/org/bukkit/Sound.java index 4cbc963f26..688a7faa5b 100644 --- a/paper-api/src/main/java/org/bukkit/Sound.java +++ b/paper-api/src/main/java/org/bukkit/Sound.java @@ -598,6 +598,12 @@ public enum Sound implements Keyed { BLOCK_SOUL_SOIL_HIT("block.soul_soil.hit"), BLOCK_SOUL_SOIL_PLACE("block.soul_soil.place"), BLOCK_SOUL_SOIL_STEP("block.soul_soil.step"), + BLOCK_SPONGE_ABSORB("block.sponge.absorb"), + BLOCK_SPONGE_BREAK("block.sponge.break"), + BLOCK_SPONGE_FALL("block.sponge.fall"), + BLOCK_SPONGE_HIT("block.sponge.hit"), + BLOCK_SPONGE_PLACE("block.sponge.place"), + BLOCK_SPONGE_STEP("block.sponge.step"), BLOCK_SPORE_BLOSSOM_BREAK("block.spore_blossom.break"), BLOCK_SPORE_BLOSSOM_FALL("block.spore_blossom.fall"), BLOCK_SPORE_BLOSSOM_HIT("block.spore_blossom.hit"), @@ -660,6 +666,11 @@ public enum Sound implements Keyed { BLOCK_WET_GRASS_HIT("block.wet_grass.hit"), BLOCK_WET_GRASS_PLACE("block.wet_grass.place"), BLOCK_WET_GRASS_STEP("block.wet_grass.step"), + BLOCK_WET_SPONGE_BREAK("block.wet_sponge.break"), + BLOCK_WET_SPONGE_FALL("block.wet_sponge.fall"), + BLOCK_WET_SPONGE_HIT("block.wet_sponge.hit"), + BLOCK_WET_SPONGE_PLACE("block.wet_sponge.place"), + BLOCK_WET_SPONGE_STEP("block.wet_sponge.step"), BLOCK_WOODEN_BUTTON_CLICK_OFF("block.wooden_button.click_off"), BLOCK_WOODEN_BUTTON_CLICK_ON("block.wooden_button.click_on"), BLOCK_WOODEN_DOOR_CLOSE("block.wooden_door.close"), diff --git a/paper-api/src/main/java/org/bukkit/Tag.java b/paper-api/src/main/java/org/bukkit/Tag.java index 1504dca4ec..02f75db7ac 100644 --- a/paper-api/src/main/java/org/bukkit/Tag.java +++ b/paper-api/src/main/java/org/bukkit/Tag.java @@ -260,6 +260,10 @@ public interface Tag extends Keyed { * Vanilla block tag representing all terracotta. */ Tag TERRACOTTA = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("terracotta"), Material.class); + /** + * Vanilla block tag representing all concrete powder. + */ + Tag CONCRETE_POWDER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("concrete_powder"), Material.class); /** * Vanilla block tag representing all blocks which complete the find tree * tutorial. @@ -499,6 +503,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"), Material.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"), Material.class); /** * Vanilla block tag representing all blocks that block vibration signals. */ @@ -950,6 +958,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/paper-api/src/main/java/org/bukkit/attribute/Attribute.java b/paper-api/src/main/java/org/bukkit/attribute/Attribute.java index 13eac9ad2c..fc15b9d4fb 100644 --- a/paper-api/src/main/java/org/bukkit/attribute/Attribute.java +++ b/paper-api/src/main/java/org/bukkit/attribute/Attribute.java @@ -53,6 +53,10 @@ public enum Attribute implements Keyed { * Luck bonus of an Entity. */ GENERIC_LUCK("generic.luck"), + /** + * Maximum absorption of an Entity. + */ + MAX_ABSORPTION("generic.max_absorption"), /** * Strength with which a horse will jump. */ diff --git a/paper-api/src/main/java/org/bukkit/packs/DataPack.java b/paper-api/src/main/java/org/bukkit/packs/DataPack.java index 744d8c055b..e424680e54 100644 --- a/paper-api/src/main/java/org/bukkit/packs/DataPack.java +++ b/paper-api/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/paper-api/src/main/java/org/bukkit/potion/PotionEffect.java b/paper-api/src/main/java/org/bukkit/potion/PotionEffect.java index 66dfed07bf..88f720aba1 100644 --- a/paper-api/src/main/java/org/bukkit/potion/PotionEffect.java +++ b/paper-api/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/paper-api/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java b/paper-api/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java index c3a86bb191..6994981bde 100644 --- a/paper-api/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java +++ b/paper-api/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java @@ -27,7 +27,7 @@ public class PotionEffectTypeWrapper extends PotionEffectType { */ @NotNull public PotionEffectType getType() { - return PotionEffectType.getById(getId()); + return PotionEffectType.getByKey(getKey()); } @Override