mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 01:29:32 +01:00
3b9db2b194
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: bb4e97c6 Add support for Java 23 bc6874dd Bump asm to 9.7.1 50e8a00b PR-1064: Add specific getTopInventory methods for InventoryView derivatives 758b0a0f SPIGOT-7911: Fix Location#isWorldLoaded() for re-loaded worlds 133a64a7 Improve Registry#getOrThrow messages be0f5957 PR-1058: Add tests for Minecraft registry <-> Bukkit fields d1b31df2 PR-1062: Clarify BeaconView documentation 3fab4384 PR-1060: Cache Material to BlockType and ItemType conversion 967a7301 SPIGOT-7906: Increase YAML nesting limit to 100 6ecf033d SPIGOT-7899: Smithing recipes don't require inputs CraftBukkit Changes: 0a7bd6c81 PR-1493: Improve reroute performance and add some tests 54941524c Add support for Java 23 f4d957fff SPIGOT-7915: Fix World#getKeepSpawnInMemory() using Spawn Radius rather than Spawn Chunk Radius ded183674 Fix HIDE_ENCHANTS flag in items without enchantments 308785a0a Bump asm to 9.7.1 and re-add ClassReader to ClassWriter 72ce823cd PR-1487: Add specific getTopInventory methods for InventoryView derivatives 11a5e840c SPIGOT-7907, PR-1484: Improve merchant recipe item matching behavior to more closely align with older versions 45b66f7e4 SPIGOT-7909: Always set HIDE_ENCHANTS flag to item if flag is set 963459791 Increase outdated build delay fc5b2d75f SPIGOT-7910: Fix launching breeze wind charge from API and improve dispenser launch API c7d6428f2 SPIGOT-7856, PR-1483: End platform not dropping items after replacing blocks 2a5572b52 SPIGOT-7780, PR-1482: Cannot edit chunks during unload event 527041ab5 SPIGOT-7902, PR-1477: Fix CraftMetaPotion#hasCustomEffects() does not check if customEffects (List) is empty 5529a1769 Implement base methods for tags 30fbdbaaf Improve Registry#getOrThrow messages 6b71a7322 PR-1475: Add tests for Minecraft registry <-> Bukkit fields 5f24c255c SPIGOT-7908: Mark junit-platform-suite-engine as test scope e4c92ef65 PR-1473: Change tests to use suites, to run tests in different environments and feature flags d25e1e722 PR-1481: Fix BeaconView#set[X]Effect(null) d69a05362 PR-1480: Fix PerMaterialTest#isEdible test running for legacy materials bb3284a89 PR-1479: Use custom #isBlock method in legacy init instead of the one in Material, since it relies on legacy being init 98c57cbbe SPIGOT-7904: Fix NPE for PlayerItemBreakEvent f35bae9ec Fix missing hasJukeboxPlayable 8a6f8b6d8 SPIGOT-7881: CTRL+Pick Block saves position data into item 7913b3be7 SPIGOT-7899: Smithing recipes don't require inputs
140 lines
5.8 KiB
Diff
140 lines
5.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Fri, 27 Sep 2024 17:12:50 -0700
|
|
Subject: [PATCH] Improve entity effect API
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/EntityEffect.java b/src/main/java/org/bukkit/EntityEffect.java
|
|
index 5341957b10cccd7bce5a7595699b1d90412a01d0..83d623cc824ddeeae7350c9f9a757fcf8e97c9ea 100644
|
|
--- a/src/main/java/org/bukkit/EntityEffect.java
|
|
+++ b/src/main/java/org/bukkit/EntityEffect.java
|
|
@@ -112,11 +112,25 @@ public enum EntityEffect {
|
|
// 5 - unused
|
|
/**
|
|
* The smoke when taming an entity fails.
|
|
+ * @deprecated use {@link EntityEffect#TAMING_FAILED}
|
|
*/
|
|
+ @Deprecated(since = "1.21") // Paper
|
|
WOLF_SMOKE(6, Tameable.class),
|
|
+ // Paper start - rename "wolf" effects
|
|
+ /**
|
|
+ * The smoke when taming an entity fails.
|
|
+ */
|
|
+ TAMING_FAILED(6, Tameable.class),
|
|
+ /**
|
|
+ * The hearts when taming an entity succeeds.
|
|
+ */
|
|
+ TAMING_SUCCEEDED(7, Tameable.class),
|
|
+ // Paper end - rename "wolf" effects
|
|
/**
|
|
* The hearts when taming an entity succeeds.
|
|
+ * @deprecated use {@link EntityEffect#TAMING_SUCCEEDED}
|
|
*/
|
|
+ @Deprecated(since = "1.21") // Paper
|
|
WOLF_HEARTS(7, Tameable.class),
|
|
/**
|
|
* When a wolf shakes (after being wet).
|
|
@@ -204,7 +218,9 @@ public enum EntityEffect {
|
|
ARMOR_STAND_HIT(32, ArmorStand.class),
|
|
/**
|
|
* Entity hurt by thorns attack.
|
|
+ * @deprecated in favor of {@link LivingEntity#playHurtAnimation(float)} or {@link Entity#broadcastHurtAnimation(java.util.Collection)}
|
|
*/
|
|
+ @Deprecated(since = "1.19.4", forRemoval = true) // Paper
|
|
THORNS_HURT(33, LivingEntity.class),
|
|
/**
|
|
* Iron golem puts away rose.
|
|
@@ -216,11 +232,15 @@ public enum EntityEffect {
|
|
TOTEM_RESURRECT(35, LivingEntity.class),
|
|
/**
|
|
* Entity hurt due to drowning damage.
|
|
+ * @deprecated in favor of {@link LivingEntity#playHurtAnimation(float)} or {@link Entity#broadcastHurtAnimation(java.util.Collection)}
|
|
*/
|
|
+ @Deprecated(since = "1.19.4", forRemoval = true)
|
|
HURT_DROWN(36, LivingEntity.class),
|
|
/**
|
|
* Entity hurt due to explosion damage.
|
|
+ * @deprecated in favor of {@link LivingEntity#playHurtAnimation(float)} or {@link Entity#broadcastHurtAnimation(java.util.Collection)}
|
|
*/
|
|
+ @Deprecated(since = "1.19.4", forRemoval = true)
|
|
HURT_EXPLOSION(37, LivingEntity.class),
|
|
/**
|
|
* Dolphin has been fed and is locating a structure.
|
|
@@ -244,11 +264,15 @@ public enum EntityEffect {
|
|
VILLAGER_SPLASH(42, Villager.class),
|
|
/**
|
|
* Player's bad omen effect removed to start or increase raid difficult.
|
|
+ * @deprecated raid system was overhauled in 1.20.5
|
|
*/
|
|
+ @Deprecated(since = "1.20.5", forRemoval = true)
|
|
PLAYER_BAD_OMEN_RAID(43, Player.class),
|
|
/**
|
|
* Entity hurt due to berry bush. Prickly!
|
|
+ * @deprecated in favor of {@link LivingEntity#playHurtAnimation(float)} or {@link Entity#broadcastHurtAnimation(java.util.Collection)}
|
|
*/
|
|
+ @Deprecated(since = "1.19.4", forRemoval = true)
|
|
HURT_BERRY_BUSH(44, LivingEntity.class),
|
|
/**
|
|
* Fox chews the food in its mouth
|
|
@@ -331,7 +355,17 @@ public enum EntityEffect {
|
|
* Sniffer must have a target and be in {@link Sniffer.State#SEARCHING} or
|
|
* {@link Sniffer.State#DIGGING}
|
|
*/
|
|
- SNIFFER_DIG(63, Sniffer.class);
|
|
+ SNIFFER_DIG(63, Sniffer.class),
|
|
+ // Paper start - add missing EntityEffect
|
|
+ /**
|
|
+ * Armadillo peeks out of its shell
|
|
+ */
|
|
+ ARMADILLO_PEEK(64, org.bukkit.entity.Armadillo.class),
|
|
+ /**
|
|
+ * {@link org.bukkit.inventory.EquipmentSlot#BODY} armor piece breaks
|
|
+ */
|
|
+ BODY_BREAK(65, LivingEntity.class);
|
|
+ // Paper end - add missing EntityEffect
|
|
|
|
private final byte data;
|
|
private final Class<? extends Entity> applicable;
|
|
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
|
index 725ef320f929d5e3d141c1ed3246d73a7d741f31..d0ae8a94db20281d3664d74718c65234eb2e5f83 100644
|
|
--- a/src/main/java/org/bukkit/entity/Entity.java
|
|
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
|
@@ -1159,4 +1159,17 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
|
*/
|
|
@NotNull String getScoreboardEntryName();
|
|
// Paper end - entity scoreboard name
|
|
+
|
|
+ // Paper start - broadcast hurt animation
|
|
+ /**
|
|
+ * Broadcasts a hurt animation. This fakes incoming damage towards the target entity.
|
|
+ * <p>
|
|
+ * The target players cannot include {@code this} player. For self-damage, use
|
|
+ * {@link Player#sendHurtAnimation(float)}.
|
|
+ *
|
|
+ * @param players the players to broadcast to (cannot include {@code this}
|
|
+ * @throws IllegalArgumentException if {@code this} is contained in {@code players}
|
|
+ */
|
|
+ void broadcastHurtAnimation(@NotNull java.util.Collection<Player> players);
|
|
+ // Paper end - broadcast hurt animation
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
|
index 7c56182acaf827f4b1a986a61cea8e9960604c98..8086acceacbceb2c5a7228fff005e41a86d37008 100644
|
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
|
@@ -3859,4 +3859,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
@Override
|
|
Spigot spigot();
|
|
// Spigot end
|
|
+
|
|
+ // Paper start - entity effect API
|
|
+ /**
|
|
+ * Plays an entity effect to this player for the target entity
|
|
+ * <p>
|
|
+ * If the effect is not applicable to this class of entity, it will not play.
|
|
+ *
|
|
+ * @param effect the entity effect
|
|
+ * @param target the target entity
|
|
+ */
|
|
+ void sendEntityEffect(org.bukkit.@NotNull EntityEffect effect, @NotNull Entity target);
|
|
+ // Paper end - entity effect API
|
|
}
|