Paper/patches/api/0287-Missing-Entity-API.patch

1476 lines
50 KiB
Diff
Raw Normal View History

2021-06-22 09:44:02 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Fri, 28 May 2021 21:06:59 -0400
Subject: [PATCH] Missing Entity API
2021-06-22 09:44:02 +02:00
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2022-03-11 15:24:45 +01:00
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: booky10 <boooky10@gmail.com>
2023-09-14 12:54:43 +02:00
Co-authored-by: Amin <amin.haddou@frg.wwschool.de>
2024-03-20 22:33:34 +01:00
Co-authored-by: TrollyLoki <trollyloki@gmail.com>
Co-authored-by: FireInstall <kettnerl@hu-berlin.de>
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
2024-05-30 22:31:45 +02:00
Co-authored-by: TotalledZebra <Holappa57@gmail.com>
2021-06-22 09:44:02 +02:00
2022-11-26 03:21:40 +01:00
diff --git a/src/main/java/io/papermc/paper/entity/SchoolableFish.java b/src/main/java/io/papermc/paper/entity/SchoolableFish.java
new file mode 100644
index 0000000000000000000000000000000000000000..a16329a8d08c74ce58960ff9dcc0af098b8543e9
2022-11-26 03:21:40 +01:00
--- /dev/null
+++ b/src/main/java/io/papermc/paper/entity/SchoolableFish.java
@@ -0,0 +1,47 @@
+package io.papermc.paper.entity;
+
+import org.bukkit.entity.Fish;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
2022-11-26 03:21:40 +01:00
+
+/**
+ * Represents a fish that can school with other fish.
+ */
+@NullMarked
2022-11-26 03:21:40 +01:00
+public interface SchoolableFish extends Fish {
+
+ /**
+ * Forces this fish to follow the given fish.
+ *
+ * @param leader fish to follow
+ */
+ void startFollowing(SchoolableFish leader);
2022-11-26 03:21:40 +01:00
+
+ /**
+ * Causes the fish to stop following their current
+ * leader.
+ */
+ void stopFollowing();
+
+ /**
+ * Gets the amount of fish currently following this fish.
+ *
+ * @return school size
+ */
+ int getSchoolSize();
+
+ /**
+ * Gets the maximum number of fish that will naturally follow this fish.
+ *
+ * @return max school size
+ */
+ int getMaxSchoolSize();
+
+ /**
+ * Gets the fish that this entity is currently following.
+ *
+ * @return following fish
+ */
+ @Nullable SchoolableFish getSchoolLeader();
2022-11-26 03:21:40 +01:00
+
+}
2021-10-21 03:09:42 +02:00
diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java
2022-10-13 13:52:04 +02:00
index 0d88dce9978243a1f995c5fb448c5d71b01136eb..8b1048c94dffd058eb9fd9144f7f59fc9bd219ad 100644
2021-10-21 03:09:42 +02:00
--- a/src/main/java/org/bukkit/entity/AbstractHorse.java
+++ b/src/main/java/org/bukkit/entity/AbstractHorse.java
2022-10-13 13:52:04 +02:00
@@ -106,17 +106,71 @@ public interface AbstractHorse extends Vehicle, InventoryHolder, Tameable {
* Gets whether the horse is currently grazing hay.
*
* @return true if eating hay
+ * @deprecated use {@link #isEatingGrass()}, this name is incorrect
*/
+ @Deprecated // Paper - Horse API
boolean isEatingHaystack();
/**
* Sets whether the horse is grazing hay.
*
* @param eatingHaystack new hay grazing status
+ * @deprecated use {@link #setEatingGrass(boolean)}, this name is incorrect
*/
+ @Deprecated // Paper - Horse API
void setEatingHaystack(boolean eatingHaystack);
2021-10-21 03:09:42 +02:00
@NotNull
@Override
public AbstractHorseInventory getInventory();
+
+ // Paper start - Horse API
+ /**
+ * Gets if a horse is in their eating grass animation.
+ *
+ * @return eating grass animation is active
+ */
+ public boolean isEatingGrass();
+
+ /**
+ * Sets if a horse is in their eating grass animation.
+ *
+ * <p>When true, the horse will lower its neck.</p>
+ *
+ * @param eating eating grass animation is active
+ */
+ public void setEatingGrass(boolean eating);
+
+ /**
+ * Gets if a horse is in their rearing animation.
+ *
+ * @return rearing animation is active
+ */
+ public boolean isRearing();
+
+ /**
+ * Sets if a horse is in their rearing animation.
+ *
+ * <p>When true, the horse will stand on its hind legs.</p>
+ *
+ * @param rearing rearing animation is active
+ */
+ public void setRearing(boolean rearing);
+
+ /**
+ * Gets if a horse is in their eating animation.
+ *
+ * @return eating animation is active
+ */
+ public boolean isEating();
+
+ /**
+ * Sets if a horse is in their eating animation.
+ *
+ * <p>When true, the horse will bob its head.</p>
+ *
+ * @param eating eating animation is active
+ */
+ public void setEating(boolean eating);
+ // Paper end - Horse API
}
diff --git a/src/main/java/org/bukkit/entity/AreaEffectCloud.java b/src/main/java/org/bukkit/entity/AreaEffectCloud.java
Updated Upstream (Bukkit/CraftBukkit) (#10691) Updated Upstream (Bukkit/CraftBukkit) 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: fa99e752 PR-1007: Add ItemMeta#getAsComponentString() 94a91782 Fix copy-pasted BlockType.Typed documentation 9b34ac8c Largely restore deprecated PotionData API 51a6449b PR-1008: Deprecate ITEMS_TOOLS, removed in 1.20.5 702d15fe Fix Javadoc reference 42f6cdf4 PR-919: Add internal ItemType and BlockType, delegate Material methods to them 237bb37b SPIGOT-1166, SPIGOT-7647: Expose Damager BlockState in EntityDamageByBlockEvent 035ea146 SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it 8c7880fb PR-1004: Improve field rename handling and centralize conversion between bukkit and string more 87c90e93 SPIGOT-7650: Add DamageSource for EntityDeathEvent and PlayerDeathEvent CraftBukkit Changes: 4af0f22e8 SPIGOT-7664: Item meta should prevail over block states c2ccc46ec SPIGOT-7666: Fix access to llama and horse special slot 124ac66d7 SPIGOT-7665: Fix ThrownPotion#getEffects() implementation only bringing custom effects 66f1f439a Restore null page behaviour of signed books even though not strictly allowed by API 6118e5398 Fix regression listening to minecraft:brand custom payloads c1a26b366 Fix unnecessary and potential not thread-safe chat visibility check 12360a7ec Remove unused imports 147b098b4 PR-1397: Add ItemMeta#getAsComponentString() 428aefe0e Largely restore deprecated PotionData API afe5b5ee9 PR-1275: Add internal ItemType and BlockType, delegate Material methods to them 8afeafa7d SPIGOT-1166, SPIGOT-7647: Expose Damager BlockState in EntityDamageByBlockEvent 4e7d749d4 SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it 441880757 Support both entity_data and bucket_entity_data on axolotl/fish buckets 0e22fdd1e Fix custom direct BlockState being not correctly set in DamageSource f2182ed47 SPIGOT-7659: TropicalFishBucketMeta should use BUCKET_ENTITY_DATA 2a6207fe1 PR-1393: Improve field rename handling and centralize conversion between bukkit and string more c024a5039 SPIGOT-7650: Add DamageSource for EntityDeathEvent and PlayerDeathEvent 741b84480 PR-1390: Improve internal handling of damage sources 0364df4e1 SPIGOT-7657: Error when loading angry entities
2024-05-11 23:48:37 +02:00
index 1df234d6538f08724297ed4ad916f6d488736171..3eba2a9f60636c7d58d311d46f0447bb6bcc5cfb 100644
--- a/src/main/java/org/bukkit/entity/AreaEffectCloud.java
+++ b/src/main/java/org/bukkit/entity/AreaEffectCloud.java
Updated Upstream (Bukkit/CraftBukkit) (#10691) Updated Upstream (Bukkit/CraftBukkit) 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: fa99e752 PR-1007: Add ItemMeta#getAsComponentString() 94a91782 Fix copy-pasted BlockType.Typed documentation 9b34ac8c Largely restore deprecated PotionData API 51a6449b PR-1008: Deprecate ITEMS_TOOLS, removed in 1.20.5 702d15fe Fix Javadoc reference 42f6cdf4 PR-919: Add internal ItemType and BlockType, delegate Material methods to them 237bb37b SPIGOT-1166, SPIGOT-7647: Expose Damager BlockState in EntityDamageByBlockEvent 035ea146 SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it 8c7880fb PR-1004: Improve field rename handling and centralize conversion between bukkit and string more 87c90e93 SPIGOT-7650: Add DamageSource for EntityDeathEvent and PlayerDeathEvent CraftBukkit Changes: 4af0f22e8 SPIGOT-7664: Item meta should prevail over block states c2ccc46ec SPIGOT-7666: Fix access to llama and horse special slot 124ac66d7 SPIGOT-7665: Fix ThrownPotion#getEffects() implementation only bringing custom effects 66f1f439a Restore null page behaviour of signed books even though not strictly allowed by API 6118e5398 Fix regression listening to minecraft:brand custom payloads c1a26b366 Fix unnecessary and potential not thread-safe chat visibility check 12360a7ec Remove unused imports 147b098b4 PR-1397: Add ItemMeta#getAsComponentString() 428aefe0e Largely restore deprecated PotionData API afe5b5ee9 PR-1275: Add internal ItemType and BlockType, delegate Material methods to them 8afeafa7d SPIGOT-1166, SPIGOT-7647: Expose Damager BlockState in EntityDamageByBlockEvent 4e7d749d4 SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it 441880757 Support both entity_data and bucket_entity_data on axolotl/fish buckets 0e22fdd1e Fix custom direct BlockState being not correctly set in DamageSource f2182ed47 SPIGOT-7659: TropicalFishBucketMeta should use BUCKET_ENTITY_DATA 2a6207fe1 PR-1393: Improve field rename handling and centralize conversion between bukkit and string more c024a5039 SPIGOT-7650: Add DamageSource for EntityDeathEvent and PlayerDeathEvent 741b84480 PR-1390: Improve internal handling of damage sources 0364df4e1 SPIGOT-7657: Error when loading angry entities
2024-05-11 23:48:37 +02:00
@@ -259,4 +259,20 @@ public interface AreaEffectCloud extends Entity {
* @param source the {@link ProjectileSource} that threw the LingeringPotion
*/
public void setSource(@Nullable ProjectileSource source);
+
+ // Paper start - owner API
+ /**
+ * Get the entity UUID for the owner of this area effect cloud.
+ *
+ * @return the entity owner uuid or null
+ */
+ @Nullable java.util.UUID getOwnerUniqueId();
+
+ /**
+ * Sets the entity UUID for the owner of this area effect cloud.
+ *
+ * @param ownerUuid the entity owner uuid or null to clear
+ */
+ void setOwnerUniqueId(@Nullable java.util.UUID ownerUuid);
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Bat.java b/src/main/java/org/bukkit/entity/Bat.java
index bd73f22ef7e79e1ade69e860e7ae1d3dcd6fc858..b9f8b14d90a758672642222675d2f5664d4f67b4 100644
--- a/src/main/java/org/bukkit/entity/Bat.java
+++ b/src/main/java/org/bukkit/entity/Bat.java
@@ -24,4 +24,23 @@ public interface Bat extends Ambient {
* @param state the new state
*/
void setAwake(boolean state);
+
+ // Paper start
+ /**
+ * Gets the location that this bat is currently trying to move towards.
+ *
+ * @return target location, or null if it's going to find a new location
+ */
+ @org.jetbrains.annotations.Nullable
+ org.bukkit.Location getTargetLocation();
+
+ /**
+ * Sets the location that this bat is currently trying to move towards.
+ * <p>
+ * This can be set to null to cause the bat to recalculate its target location
+ *
+ * @param location location to move towards (world is ignored, will always use the entity's world)
+ */
+ void setTargetLocation(@org.jetbrains.annotations.Nullable org.bukkit.Location location);
+ // Paper end
}
2022-03-19 15:30:16 +01:00
diff --git a/src/main/java/org/bukkit/entity/Bee.java b/src/main/java/org/bukkit/entity/Bee.java
index adb20a9abba33c32d553f620fa82b27dff64ab5f..1f6702b0de00b87dbed7f6d93e911655e8667b0b 100644
2022-03-19 15:30:16 +01:00
--- a/src/main/java/org/bukkit/entity/Bee.java
+++ b/src/main/java/org/bukkit/entity/Bee.java
@@ -93,4 +93,56 @@ public interface Bee extends Animals {
2022-03-19 15:30:16 +01:00
* @param ticks Ticks the bee cannot enter a hive for
*/
void setCannotEnterHiveTicks(int ticks);
+
+ // Paper start
+ /**
+ * Sets the override for if the bee is currently rolling.
+ *
+ * @param rolling is rolling, or unset for vanilla behavior
+ */
+ void setRollingOverride(@org.jetbrains.annotations.NotNull net.kyori.adventure.util.TriState rolling);
+
+ /**
+ * Gets the plugin set override for if the bee is currently rolling.
+ *
+ * @return plugin set rolling override
+ */
+ @org.jetbrains.annotations.NotNull
+ net.kyori.adventure.util.TriState getRollingOverride();
+
+ /**
+ * Gets if the bee is currently rolling.
+ *
+ * @return is rolling
+ */
+ boolean isRolling();
+
+ /**
+ * Sets how many crops this bee has grown since it last
+ * pollinated.
+ * @param crops number of crops
+ */
+ void setCropsGrownSincePollination(int crops);
+
+ /**
+ * Gets how many crops this bee has grown since it last
+ * pollinated.
+ * @return number of crops
+ */
+ int getCropsGrownSincePollination();
+
+ /**
+ * Sets how many ticks this bee has gone without pollinating.
+ *
+ * @param ticks number of ticks
+ */
+ void setTicksSincePollination(int ticks);
+
+ /**
+ * Gets how many ticks this bee has gone without pollinating
+ *
+ * @return number of ticks
+ */
+ int getTicksSincePollination();
2022-03-19 15:30:16 +01:00
+ // Paper end
}
2021-08-27 20:16:41 +02:00
diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java
Updated Upstream (Bukkit/CraftBukkit) (#11501) 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
2024-10-21 00:06:54 +02:00
index 104b9c8a28ddbab8f47dbf3a0ac06bec35d7c003..5101553bb71d60fee7ac234f7ef2863781dd7742 100644
2021-08-27 20:16:41 +02:00
--- a/src/main/java/org/bukkit/entity/Cat.java
+++ b/src/main/java/org/bukkit/entity/Cat.java
Updated Upstream (Bukkit/CraftBukkit) (#11501) 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
2024-10-21 00:06:54 +02:00
@@ -90,4 +90,36 @@ public interface Cat extends Tameable, Sittable {
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11102) 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: 3a3bea52 SPIGOT-7829: Increase maximum outgoing plugin message size to match Vanilla intention 5cd1c8cb SPIGOT-7831: Add CreatureSpawnEvent.SpawnReason#POTION_EFFECT a8e278f0 SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-players can now create portals 53729d12 Remove spurious ApiStatus.Internal annotation b9f57486 SPIGOT-7799, PR-1039: Expose explosion world interaction in EntityExplodeEvent and BlockExplodeEvent 7983b966 PR-1029: Trial changing a small number of inner enums to classes/interfaces to better support custom values CraftBukkit Changes: 403accd56 SPIGOT-7831: Add CreatureSpawnEvent.SpawnReason#POTION_EFFECT 812761660 Increase outdated build delay bed1e3ff6 SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-players can now create portals 2444c8b23 SPIGOT-7823: Suspicious sand and gravel material are not marked as having gravity correctly aceddcd0b SPIGOT-7820: Enum changes - duplicate method name a0d2d6a84 SPIGOT-7813: Material#isInteractable() always returns false 8fd64b091 SPIGOT-7806: Handle both loot and inventory item drop behaviour in PlayerDeathEvent a4ee40b74 SPIGOT-7799, PR-1436: Expose explosion world interaction in EntityExplodeEvent and BlockExplodeEvent 082aa51c5 PR-1424: Trial changing a small number of inner enums to classes/interfaces to better support custom values 66e78a96b SPIGOT-7815: Consider EntityDamageEvent status for Wolf armor damage Spigot Changes: 5bbef5ad SPIGOT-7834: Modify max value for generic.max_absorption
2024-07-18 10:13:20 +02:00
return Lists.newArrayList(Registry.CAT_VARIANT).toArray(new Type[0]);
}
2021-08-27 20:16:41 +02:00
}
+
+ // Paper start - More cat api
2021-08-27 20:16:41 +02:00
+ /**
+ * Sets if the cat is lying down.
+ * This is visual and does not affect the behaviour of the cat.
+ *
+ * @param lyingDown whether the cat should lie down
+ */
+ public void setLyingDown(boolean lyingDown);
+
+ /**
+ * Gets if the cat is lying down.
+ *
+ * @return whether the cat is lying down
+ */
+ public boolean isLyingDown();
+
+ /**
+ * Sets if the cat has its head up.
+ * This is visual and does not affect the behaviour of the cat.
+ *
+ * @param headUp head is up
+ */
+ public void setHeadUp(boolean headUp);
+
+ /**
+ * Gets if the cat has its head up.
+ *
+ * @return head is up
+ */
+ public boolean isHeadUp();
+ // Paper end - More cat api
2021-08-27 20:16:41 +02:00
}
diff --git a/src/main/java/org/bukkit/entity/Chicken.java b/src/main/java/org/bukkit/entity/Chicken.java
index cb3ec6ef6c38c2071cb6ad91da094fca2de8d5c6..b4c1a262602d4ca5ffc9fcc21d6aa79af8c040a7 100644
--- a/src/main/java/org/bukkit/entity/Chicken.java
+++ b/src/main/java/org/bukkit/entity/Chicken.java
@@ -3,4 +3,35 @@ package org.bukkit.entity;
/**
* Represents a Chicken.
*/
-public interface Chicken extends Animals {}
+// Paper start
+public interface Chicken extends Animals {
+
+ /**
+ * Gets if this chicken was spawned as a chicken jockey.
+ *
+ * @return is chicken jockey
+ */
+ boolean isChickenJockey();
+
+ /**
+ * Sets if this chicken was spawned as a chicken jockey.
+ *
+ * @param isChickenJockey is chicken jockey
+ */
+ void setIsChickenJockey(boolean isChickenJockey);
+
+ /**
+ * Gets the number of ticks till this chicken lays an egg.
+ *
+ * @return ticks till the chicken lays an egg
+ */
+ int getEggLayTime();
+
+ /**
+ * Sets the number of ticks till this chicken lays an egg.
+ *
+ * @param eggLayTime ticks till the chicken lays an egg
+ */
+ void setEggLayTime(int eggLayTime);
+}
+// Paper end
2022-11-26 03:21:40 +01:00
diff --git a/src/main/java/org/bukkit/entity/Cod.java b/src/main/java/org/bukkit/entity/Cod.java
index 191ce6c0e32ab3d05b1376e0fa56d1292c2d442c..8de09075e14a08a6c68f9c24e8960cc04a018036 100644
--- a/src/main/java/org/bukkit/entity/Cod.java
+++ b/src/main/java/org/bukkit/entity/Cod.java
@@ -4,4 +4,4 @@ package org.bukkit.entity;
/**
* Represents a cod fish.
*/
-public interface Cod extends Fish { }
+public interface Cod extends io.papermc.paper.entity.SchoolableFish { } // Paper - Schooling Fish API
2024-05-30 22:31:45 +02:00
diff --git a/src/main/java/org/bukkit/entity/Damageable.java b/src/main/java/org/bukkit/entity/Damageable.java
index c4537080ee1875e984356eee42337a1342f4c9a3..f89edd9c129802f70eac022ff6bf80bef378f5e8 100644
--- a/src/main/java/org/bukkit/entity/Damageable.java
+++ b/src/main/java/org/bukkit/entity/Damageable.java
@@ -53,6 +53,25 @@ public interface Damageable extends Entity {
*/
void setHealth(double health);
+ // Paper start - entity heal API
+ /**
+ * Heal this entity by the given amount. This will call {@link org.bukkit.event.entity.EntityRegainHealthEvent}.
+ *
+ * @param amount heal amount
+ */
+ default void heal(final double amount) {
+ this.heal(amount, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.CUSTOM);
+ }
+
+ /**
+ * Heal this entity by the given amount. This will call {@link org.bukkit.event.entity.EntityRegainHealthEvent}.
+ *
+ * @param amount heal amount
+ * @param reason heal reason
+ */
+ void heal(double amount, @NotNull org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason reason);
+ // Paper end - entity heal API
+
/**
* Gets the entity's absorption amount.
*
2022-03-11 15:24:45 +01:00
diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java
index 875817b807c9f515eb07b03cc85d368955388dc3..db01cc952f0a0efd799454d6c86ee4c250e852d8 100644
2022-03-11 15:24:45 +01:00
--- a/src/main/java/org/bukkit/entity/Enderman.java
+++ b/src/main/java/org/bukkit/entity/Enderman.java
Updated Upstream (Bukkit/CraftBukkit) (#10242) * Updated Upstream (Bukkit/CraftBukkit) 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: a6a9d2a4 Remove some old ApiStatus.Experimental annotations be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration 08f86d1c PR-971: Add Player methods for client-side potion effects 2e3024a9 PR-963: Add API for in-world structures a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality 1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent CraftBukkit Changes: 38fd4bd50 Fix accidentally renamed internal damage method 80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage 7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects 4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration 22a541a29 Improve support for per-world game rules cb7dccce2 PR-1348: Add Player methods for client-side potion effects b8d6109f0 PR-1335: Add API for in-world structures 4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity e74107678 Fix Crafter maximum stack size 0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality 4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason 20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette 3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook 333701839 SPIGOT-7572: Bee nests generated without bees f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
@@ -86,4 +86,36 @@ public interface Enderman extends Monster {
* @return true if the teleport succeeded.
2022-03-11 15:24:45 +01:00
*/
public boolean teleportTowards(@NotNull Entity entity);
2022-03-11 15:24:45 +01:00
+
+ // Paper start
+ /**
+ * Returns whether the enderman is screaming/angry.
+ *
+ * @return whether the enderman is screaming
+ */
+ boolean isScreaming();
+
+ /**
+ * Sets whether the enderman is screaming/angry.
+ *
+ * @param screaming whether the enderman is screaming
+ */
+ void setScreaming(boolean screaming);
+
+ /**
+ * Returns whether the enderman has been stared at.
+ * If set to true, players will hear an ambient sound.
+ *
+ * @return whether the enderman has been stared at
+ */
+ boolean hasBeenStaredAt();
+
+ /**
+ * Sets whether the enderman has been stared at.
+ * If set to true, players will hear an ambient sound.
+ *
+ * @param hasBeenStaredAt whether the enderman has been stared at
+ */
+ void setHasBeenStaredAt(boolean hasBeenStaredAt);
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Endermite.java b/src/main/java/org/bukkit/entity/Endermite.java
index 9e7f42caab1204036f4203354c115fd40c6def92..138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2 100644
--- a/src/main/java/org/bukkit/entity/Endermite.java
+++ b/src/main/java/org/bukkit/entity/Endermite.java
@@ -23,4 +23,22 @@ public interface Endermite extends Monster {
*/
@Deprecated
void setPlayerSpawned(boolean playerSpawned);
+ // Paper start
+ /**
+ * Sets how many ticks this endermite has been living for.
+ * If this value is greater than 2400, this endermite will despawn.
+ *
+ * @param ticks lifetime ticks
+ */
+ void setLifetimeTicks(int ticks);
+
+ /**
+ * Gets how long this endermite has been living for.
+ * This value will tick up while {@link LivingEntity#getRemoveWhenFarAway()} is false.
+ * If this value is greater than 2400, this endermite will despawn.
+ *
+ * @return lifetime ticks
+ */
+ int getLifetimeTicks();
2022-03-11 15:24:45 +01:00
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index c7364a6c266aba9568f491fe0794fa593ada224d..827574b3eff9b912500b092ca081e7163677695e 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -293,6 +293,40 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
boolean isFrozen();
+ // Paper start - missing entity api
+ /**
+ * Sets whether the entity is invisible or not.
+ * <p>
+ * This setting is undefined for non-living entities like boats or paintings.
+ * Non-living entities that are marked as invisible through this method may e.g. only hide their shadow.
+ * To hide such entities from players completely, see {@link Player#hideEntity(org.bukkit.plugin.Plugin, Entity)}.
+ *
+ * @param invisible If the entity is invisible
+ */
+ void setInvisible(boolean invisible); // Paper - moved up from LivingEntity
+
+ /**
+ * Gets whether the entity is invisible or not.
+ *
+ * @return Whether the entity is invisible
+ */
+ boolean isInvisible(); // Paper - moved up from LivingEntity
+
+ /**
+ * Sets this entities no physics status.
+ *
+ * @param noPhysics boolean indicating if the entity should not have physics.
+ */
+ void setNoPhysics(boolean noPhysics);
+
+ /**
+ * Gets if this entity has no physics.
+ *
+ * @return true if the entity does not have physics.
+ */
+ boolean hasNoPhysics();
+ // Paper end - missing entity api
+
/**
* Mark the entity's removal.
*
2024-03-20 22:33:34 +01:00
diff --git a/src/main/java/org/bukkit/entity/Fireball.java b/src/main/java/org/bukkit/entity/Fireball.java
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875) 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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
index d7ebb33e946d7c5c5ee682f2dc9cf8e4e9f7049f..252e3d35c0478ff4132d33c5caf65aa27911b675 100644
2024-03-20 22:33:34 +01:00
--- a/src/main/java/org/bukkit/entity/Fireball.java
+++ b/src/main/java/org/bukkit/entity/Fireball.java
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875) 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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
@@ -62,4 +62,25 @@ public interface Fireball extends Projectile, Explosive {
*/
2024-03-20 22:33:34 +01:00
@NotNull
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875) 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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
Vector getAcceleration();
2024-03-20 22:33:34 +01:00
+
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875) 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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
+ // Paper start - Expose power on fireball projectiles
2024-03-20 22:33:34 +01:00
+ /**
+ * Sets the power of a fireball. The power determines the direction and magnitude of its acceleration.
+ *
+ * @param power the power
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875) 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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
+ * @deprecated use #setAcceleration(Vector) instead.
2024-03-20 22:33:34 +01:00
+ */
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875) 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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
+ @Deprecated
2024-03-20 22:33:34 +01:00
+ public void setPower(@NotNull Vector power);
+
+ /**
+ * Gets the power of a fireball. The power determines the direction and magnitude of its acceleration.
+ *
+ * @return the power
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875) 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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
+ * @deprecated Use #getAcceleration instead.
2024-03-20 22:33:34 +01:00
+ */
Update upstream (Bukkit/CraftBukkit/Spigot) (#10875) 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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
2024-06-13 16:45:27 +02:00
+ @Deprecated
2024-03-20 22:33:34 +01:00
+ @NotNull
+ public Vector getPower();
+ // Paper end - Expose power on fireball projectiles
}
2021-06-22 09:44:02 +02:00
diff --git a/src/main/java/org/bukkit/entity/Fox.java b/src/main/java/org/bukkit/entity/Fox.java
index c61a473453f33f9d10c330fc46cfa9d52251fe49..473a7e36ad64f866d1d2e09e2ecb2e9881668faf 100644
2021-06-22 09:44:02 +02:00
--- a/src/main/java/org/bukkit/entity/Fox.java
+++ b/src/main/java/org/bukkit/entity/Fox.java
@@ -92,4 +92,55 @@ public interface Fox extends Animals, Sittable {
2021-06-22 09:44:02 +02:00
RED,
SNOW;
}
+
+ // Paper start - Add more fox behavior API
+ /**
+ * Sets if the fox is interested.
+ *
+ * @param interested is interested
+ */
+ public void setInterested(boolean interested);
+
+ /**
+ * Gets if the fox is interested.
+ *
+ * @return fox is interested
+ */
+ public boolean isInterested();
+
+ /**
+ * Sets if the fox is leaping.
+ *
+ * @param leaping is leaping
+ */
+ public void setLeaping(boolean leaping);
+
+ /**
+ * Gets if the fox is leaping.
+ *
+ * @return fox is leaping
+ */
+ public boolean isLeaping();
+
+ /**
+ * Sets if the fox is defending.
+ *
+ * @param defending is defending
+ */
+ public void setDefending(boolean defending);
+
+ /**
+ * Gets if the fox is defending.
+ *
+ * @return fox is defending
+ */
+ public boolean isDefending();
+
+ /**
+ * Sets if the fox face planted.
+ *
+ * @param faceplanted face planted
+ */
+ public void setFaceplanted(boolean faceplanted);
+ // Paper end - Add more fox behavior API
}
2022-03-06 22:20:38 +01:00
diff --git a/src/main/java/org/bukkit/entity/Ghast.java b/src/main/java/org/bukkit/entity/Ghast.java
index 6b3c9bef9a8a34ddc6ff42cf358541a2665bf5e3..9c618a27d590f186f29c5d9094fc565efd40ca49 100644
2022-03-06 22:20:38 +01:00
--- a/src/main/java/org/bukkit/entity/Ghast.java
+++ b/src/main/java/org/bukkit/entity/Ghast.java
@@ -18,4 +18,21 @@ public interface Ghast extends Flying, Enemy {
* @param flag Whether the Ghast is charging
*/
void setCharging(boolean flag);
2022-03-06 22:20:38 +01:00
+
+ // Paper start
2022-03-06 22:20:38 +01:00
+ /**
+ * Returns the explosion power of shot fireballs.
+ *
+ * @return explosion power of shot fireballs
+ */
+ int getExplosionPower();
+
+ /**
+ * Sets the explosion power of shot fireballs.
+ *
+ * @param explosionPower explosion power of shot fireballs
+ * @throws IllegalArgumentException if the explosion power is less than 0 or greater than 127
+ */
+ void setExplosionPower(int explosionPower);
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11405) 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: 1fc1020a PR-1049: Add MenuType API 8ae2e3be PR-1055: Expand riptiding API cac68bfb SPIGOT-7890: AttributeModifier#getUniqueId() doesn't match the UUID passed to its constructor 7004fcf2 SPIGOT-7886: Fix mistake in AttributeModifier UUID shim 1ac7f950 PR-1054: Add FireworkMeta#hasPower 4cfb565f SPIGOT-7873: Add powered state for skulls CraftBukkit Changes: bbb30e7a8 SPIGOT-7894: NPE when sending tile entity update ba21e9472 SPIGOT-7895: PlayerItemBreakEvent not firing 0fb24bbe0 SPIGOT-7875: Fix PlayerItemConsumeEvent cancellation causing client-side desync 815066449 SPIGOT-7891: Can't remove second ingredient of MerchantRecipe 45c206f2c PR-1458: Add MenuType API 19c8ef9ae SPIGOT-7867: Merchant instanceof AbstractVillager always returns false 4e006d28f PR-1468: Expand riptiding API bd8aded7d Ignore checks in CraftPlayerProfile for ResolvableProfile used in profile components 8679620b5 SPIGOT-7889: Fix tool component deserialisation without speed and/or correct-for-drops 8d5222691 SPIGOT-7882, PR-1467: Fix conversion of name in Profile Component to empty if it is missing 63f91669a SPIGOT-7887: Remove duplicate ProjectileHitEvent for fireballs 7070de8c8 SPIGOT-7878: Server#getLootTable does not return null on invalid loot table 060ee6cae SPIGOT-7876: Can't kick player or disconnect player in PlayerLoginEvent when checking for cookies 7ccb86cc0 PR-1465: Add FireworkMeta#hasPower 804ad6491 SPIGOT-7873: Add powered state for skulls f9610cdcb Improve minecart movement Spigot Changes: a759b629 Rebuild patches Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2024-09-15 21:39:53 +02:00
index 2eb6f650610ca1a9b9fca49e453f79e08944be75..c0772f72768846cffd065c53de7326f9fe6386a2 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11405) 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: 1fc1020a PR-1049: Add MenuType API 8ae2e3be PR-1055: Expand riptiding API cac68bfb SPIGOT-7890: AttributeModifier#getUniqueId() doesn't match the UUID passed to its constructor 7004fcf2 SPIGOT-7886: Fix mistake in AttributeModifier UUID shim 1ac7f950 PR-1054: Add FireworkMeta#hasPower 4cfb565f SPIGOT-7873: Add powered state for skulls CraftBukkit Changes: bbb30e7a8 SPIGOT-7894: NPE when sending tile entity update ba21e9472 SPIGOT-7895: PlayerItemBreakEvent not firing 0fb24bbe0 SPIGOT-7875: Fix PlayerItemConsumeEvent cancellation causing client-side desync 815066449 SPIGOT-7891: Can't remove second ingredient of MerchantRecipe 45c206f2c PR-1458: Add MenuType API 19c8ef9ae SPIGOT-7867: Merchant instanceof AbstractVillager always returns false 4e006d28f PR-1468: Expand riptiding API bd8aded7d Ignore checks in CraftPlayerProfile for ResolvableProfile used in profile components 8679620b5 SPIGOT-7889: Fix tool component deserialisation without speed and/or correct-for-drops 8d5222691 SPIGOT-7882, PR-1467: Fix conversion of name in Profile Component to empty if it is missing 63f91669a SPIGOT-7887: Remove duplicate ProjectileHitEvent for fireballs 7070de8c8 SPIGOT-7878: Server#getLootTable does not return null on invalid loot table 060ee6cae SPIGOT-7876: Can't kick player or disconnect player in PlayerLoginEvent when checking for cookies 7ccb86cc0 PR-1465: Add FireworkMeta#hasPower 804ad6491 SPIGOT-7873: Add powered state for skulls f9610cdcb Improve minecart movement Spigot Changes: a759b629 Rebuild patches Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2024-09-15 21:39:53 +02:00
@@ -1004,6 +1004,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*
* @param invisible If the entity is invisible
*/
+ @Override // Paper - move invisibility up to Entity
public void setInvisible(boolean invisible);
/**
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11405) 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: 1fc1020a PR-1049: Add MenuType API 8ae2e3be PR-1055: Expand riptiding API cac68bfb SPIGOT-7890: AttributeModifier#getUniqueId() doesn't match the UUID passed to its constructor 7004fcf2 SPIGOT-7886: Fix mistake in AttributeModifier UUID shim 1ac7f950 PR-1054: Add FireworkMeta#hasPower 4cfb565f SPIGOT-7873: Add powered state for skulls CraftBukkit Changes: bbb30e7a8 SPIGOT-7894: NPE when sending tile entity update ba21e9472 SPIGOT-7895: PlayerItemBreakEvent not firing 0fb24bbe0 SPIGOT-7875: Fix PlayerItemConsumeEvent cancellation causing client-side desync 815066449 SPIGOT-7891: Can't remove second ingredient of MerchantRecipe 45c206f2c PR-1458: Add MenuType API 19c8ef9ae SPIGOT-7867: Merchant instanceof AbstractVillager always returns false 4e006d28f PR-1468: Expand riptiding API bd8aded7d Ignore checks in CraftPlayerProfile for ResolvableProfile used in profile components 8679620b5 SPIGOT-7889: Fix tool component deserialisation without speed and/or correct-for-drops 8d5222691 SPIGOT-7882, PR-1467: Fix conversion of name in Profile Component to empty if it is missing 63f91669a SPIGOT-7887: Remove duplicate ProjectileHitEvent for fireballs 7070de8c8 SPIGOT-7878: Server#getLootTable does not return null on invalid loot table 060ee6cae SPIGOT-7876: Can't kick player or disconnect player in PlayerLoginEvent when checking for cookies 7ccb86cc0 PR-1465: Add FireworkMeta#hasPower 804ad6491 SPIGOT-7873: Add powered state for skulls f9610cdcb Improve minecart movement Spigot Changes: a759b629 Rebuild patches Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2024-09-15 21:39:53 +02:00
@@ -1011,6 +1012,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*
* @return Whether the entity is invisible
*/
+ @Override // Paper - move invisibility up to Entity
public boolean isInvisible();
// Paper start
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11405) 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: 1fc1020a PR-1049: Add MenuType API 8ae2e3be PR-1055: Expand riptiding API cac68bfb SPIGOT-7890: AttributeModifier#getUniqueId() doesn't match the UUID passed to its constructor 7004fcf2 SPIGOT-7886: Fix mistake in AttributeModifier UUID shim 1ac7f950 PR-1054: Add FireworkMeta#hasPower 4cfb565f SPIGOT-7873: Add powered state for skulls CraftBukkit Changes: bbb30e7a8 SPIGOT-7894: NPE when sending tile entity update ba21e9472 SPIGOT-7895: PlayerItemBreakEvent not firing 0fb24bbe0 SPIGOT-7875: Fix PlayerItemConsumeEvent cancellation causing client-side desync 815066449 SPIGOT-7891: Can't remove second ingredient of MerchantRecipe 45c206f2c PR-1458: Add MenuType API 19c8ef9ae SPIGOT-7867: Merchant instanceof AbstractVillager always returns false 4e006d28f PR-1468: Expand riptiding API bd8aded7d Ignore checks in CraftPlayerProfile for ResolvableProfile used in profile components 8679620b5 SPIGOT-7889: Fix tool component deserialisation without speed and/or correct-for-drops 8d5222691 SPIGOT-7882, PR-1467: Fix conversion of name in Profile Component to empty if it is missing 63f91669a SPIGOT-7887: Remove duplicate ProjectileHitEvent for fireballs 7070de8c8 SPIGOT-7878: Server#getLootTable does not return null on invalid loot table 060ee6cae SPIGOT-7876: Can't kick player or disconnect player in PlayerLoginEvent when checking for cookies 7ccb86cc0 PR-1465: Add FireworkMeta#hasPower 804ad6491 SPIGOT-7873: Add powered state for skulls f9610cdcb Improve minecart movement Spigot Changes: a759b629 Rebuild patches Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2024-09-15 21:39:53 +02:00
@@ -1047,6 +1049,57 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
Updated Upstream (Bukkit/CraftBukkit) (#10379) Updated Upstream (Bukkit/CraftBukkit) 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: f02baa38 PR-988: Add World#getIntersectingChunks(BoundingBox) 9321d665 Move getItemInUse up to LivingEntity 819eef73 PR-959: Add access to current item's remaining ticks c4fdadb0 SPIGOT-7601: Add AbstractArrow#getItem be8261ca Add support for Java 22 26119676 PR-979: Add more translation keys 66753362 PR-985: Correct book maximum pages and characters per page documentation c8be92fa PR-980: Improve getArmorContents() documentation f1120ee2 PR-983: Expose riptide velocity to PlayerRiptideEvent CraftBukkit Changes: dfaa89bbe PR-1369: Add World#getIntersectingChunks(BoundingBox) 51bbab2b9 Move getItemInUse up to LivingEntity 668e09602 PR-1331: Add access to current item's remaining ticks a639406d1 SPIGOT-7601: Add AbstractArrow#getItem 0398930fc SPIGOT-7602: Allow opening in-world horse and related inventories ffd15611c SPIGOT-7608: Allow empty lists to morph to any PDT list 2188dcfa9 Add support for Java 22 45d6a609f SPIGOT-7604: Revert "SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime" 06d915943 SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime ca3bc3707 PR-1361: Add more translation keys 366c3ca80 SPIGOT-7600: EntityChangeBlockEvent is not fired for frog eggs 06d0f9ba8 SPIGOT-7593: Fix sapling growth physics / client-side updates 45c2608e4 PR-1366: Expose riptide velocity to PlayerRiptideEvent 29b6bb79b SPIGOT-7587: Remove fixes for now-resolved MC-142590 and MC-109346
2024-04-06 21:53:39 +02:00
void setShieldBlockingDelay(int delay);
// Paper end
Updated Upstream (Bukkit/CraftBukkit) (#10379) Updated Upstream (Bukkit/CraftBukkit) 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: f02baa38 PR-988: Add World#getIntersectingChunks(BoundingBox) 9321d665 Move getItemInUse up to LivingEntity 819eef73 PR-959: Add access to current item's remaining ticks c4fdadb0 SPIGOT-7601: Add AbstractArrow#getItem be8261ca Add support for Java 22 26119676 PR-979: Add more translation keys 66753362 PR-985: Correct book maximum pages and characters per page documentation c8be92fa PR-980: Improve getArmorContents() documentation f1120ee2 PR-983: Expose riptide velocity to PlayerRiptideEvent CraftBukkit Changes: dfaa89bbe PR-1369: Add World#getIntersectingChunks(BoundingBox) 51bbab2b9 Move getItemInUse up to LivingEntity 668e09602 PR-1331: Add access to current item's remaining ticks a639406d1 SPIGOT-7601: Add AbstractArrow#getItem 0398930fc SPIGOT-7602: Allow opening in-world horse and related inventories ffd15611c SPIGOT-7608: Allow empty lists to morph to any PDT list 2188dcfa9 Add support for Java 22 45d6a609f SPIGOT-7604: Revert "SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime" 06d915943 SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime ca3bc3707 PR-1361: Add more translation keys 366c3ca80 SPIGOT-7600: EntityChangeBlockEvent is not fired for frog eggs 06d0f9ba8 SPIGOT-7593: Fix sapling growth physics / client-side updates 45c2608e4 PR-1366: Expose riptide velocity to PlayerRiptideEvent 29b6bb79b SPIGOT-7587: Remove fixes for now-resolved MC-142590 and MC-109346
2024-04-06 21:53:39 +02:00
+ // Paper start - missing entity API
+ /**
+ * Retrieves the sideways movement direction of the entity.
+ * <p>
+ * The returned value ranges from -1 to 1, where:
+ * - Positive 1 represents movement to the left.
+ * - Negative 1 represents movement to the right.
+ * <p>
+ * Please note that for entities of type {@link Player}, this value is updated only when riding another entity.
+ * <p>
+ * This method specifically provides information about the entity's sideways movement, whereas {@link #getVelocity()} returns
+ * a vector representing the entity's overall current momentum.
+ *
+ * @return Sideways movement direction, ranging from -1 (right) to 1 (left).
+ */
+ float getSidewaysMovement();
+
+ /**
+ * Retrieves the upwards movement direction of the entity.
+ * <p>
+ * The returned value ranges from -1 to 1, where:
+ * - Positive 1 represents upward movement.
+ * - Negative 1 represents downward movement.
+ * <p>
+ * Please note that for entities of type {@link Player}, this value is never updated.
+ * <p>
+ * This method specifically provides information about the entity's vertical movement,
+ * whereas {@link #getVelocity()} returns a vector representing the entity's overall
+ * current momentum.
+ *
+ * @return Upwards movement direction, ranging from -1 (downward) to 1 (upward).
+ */
+ float getUpwardsMovement();
+
+ /**
+ * Retrieves the forwards movement direction of the entity.
+ * <p>
+ * The returned value ranges from -1 to 1, where:
+ * - Positive 1 represents movement forwards.
+ * - Negative 1 represents movement backwards.
+ * <p>
+ * Please note that for entities of type {@link Player}, this value is updated only when riding another entity.
+ * <p>
+ * This method specifically provides information about the entity's forward and backward movement,
+ * whereas {@link #getVelocity()} returns a vector representing the entity's overall current momentum.
+ *
+ * @return Forwards movement direction, ranging from -1 (backward) to 1 (forward).
+ */
+ float getForwardsMovement();
Updated Upstream (Bukkit/CraftBukkit) (#10379) Updated Upstream (Bukkit/CraftBukkit) 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: f02baa38 PR-988: Add World#getIntersectingChunks(BoundingBox) 9321d665 Move getItemInUse up to LivingEntity 819eef73 PR-959: Add access to current item's remaining ticks c4fdadb0 SPIGOT-7601: Add AbstractArrow#getItem be8261ca Add support for Java 22 26119676 PR-979: Add more translation keys 66753362 PR-985: Correct book maximum pages and characters per page documentation c8be92fa PR-980: Improve getArmorContents() documentation f1120ee2 PR-983: Expose riptide velocity to PlayerRiptideEvent CraftBukkit Changes: dfaa89bbe PR-1369: Add World#getIntersectingChunks(BoundingBox) 51bbab2b9 Move getItemInUse up to LivingEntity 668e09602 PR-1331: Add access to current item's remaining ticks a639406d1 SPIGOT-7601: Add AbstractArrow#getItem 0398930fc SPIGOT-7602: Allow opening in-world horse and related inventories ffd15611c SPIGOT-7608: Allow empty lists to morph to any PDT list 2188dcfa9 Add support for Java 22 45d6a609f SPIGOT-7604: Revert "SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime" 06d915943 SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime ca3bc3707 PR-1361: Add more translation keys 366c3ca80 SPIGOT-7600: EntityChangeBlockEvent is not fired for frog eggs 06d0f9ba8 SPIGOT-7593: Fix sapling growth physics / client-side updates 45c2608e4 PR-1366: Expose riptide velocity to PlayerRiptideEvent 29b6bb79b SPIGOT-7587: Remove fixes for now-resolved MC-142590 and MC-109346
2024-04-06 21:53:39 +02:00
+ // Paper end - missing entity API
+
Updated Upstream (Bukkit/CraftBukkit) (#10379) Updated Upstream (Bukkit/CraftBukkit) 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: f02baa38 PR-988: Add World#getIntersectingChunks(BoundingBox) 9321d665 Move getItemInUse up to LivingEntity 819eef73 PR-959: Add access to current item's remaining ticks c4fdadb0 SPIGOT-7601: Add AbstractArrow#getItem be8261ca Add support for Java 22 26119676 PR-979: Add more translation keys 66753362 PR-985: Correct book maximum pages and characters per page documentation c8be92fa PR-980: Improve getArmorContents() documentation f1120ee2 PR-983: Expose riptide velocity to PlayerRiptideEvent CraftBukkit Changes: dfaa89bbe PR-1369: Add World#getIntersectingChunks(BoundingBox) 51bbab2b9 Move getItemInUse up to LivingEntity 668e09602 PR-1331: Add access to current item's remaining ticks a639406d1 SPIGOT-7601: Add AbstractArrow#getItem 0398930fc SPIGOT-7602: Allow opening in-world horse and related inventories ffd15611c SPIGOT-7608: Allow empty lists to morph to any PDT list 2188dcfa9 Add support for Java 22 45d6a609f SPIGOT-7604: Revert "SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime" 06d915943 SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime ca3bc3707 PR-1361: Add more translation keys 366c3ca80 SPIGOT-7600: EntityChangeBlockEvent is not fired for frog eggs 06d0f9ba8 SPIGOT-7593: Fix sapling growth physics / client-side updates 45c2608e4 PR-1366: Expose riptide velocity to PlayerRiptideEvent 29b6bb79b SPIGOT-7587: Remove fixes for now-resolved MC-142590 and MC-109346
2024-04-06 21:53:39 +02:00
// Paper start - active item API
/**
2024-04-06 23:44:27 +02:00
* Starts using the item in the specified hand, making it the
diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java
index d23226ccb0f6c25028f000ce31346cd0a8898e6a..bc84b892cae5fe7019a3ad481e9da79956efa1fe 100644
--- a/src/main/java/org/bukkit/entity/Llama.java
+++ b/src/main/java/org/bukkit/entity/Llama.java
@@ -67,4 +67,56 @@ public interface Llama extends ChestedHorse, RangedEntity { // Paper
@NotNull
@Override
LlamaInventory getInventory();
+
+ // Paper start
+ /**
+ * Checks if this llama is in a caravan.
+ * This means that this llama is currently following
+ * another llama.
+ *
+ * @return is in caravan
+ */
+ boolean inCaravan();
+
+ /**
+ * Joins a caravan, with the provided llama being the leader
+ * of the caravan.
+ * This llama will then follow the provided llama.
+ *
+ * @param llama head of caravan to join
+ */
+ void joinCaravan(@NotNull Llama llama);
+
+ /**
+ * Leaves the current caravan that they are in.
+ */
+ void leaveCaravan();
+
+ /**
+ * Get the llama that this llama is following.
+ * <p>
+ * Does not necessarily mean the leader of the entire caravan.
+ *
+ * @return the llama currently being followed
+ */
+ @org.jetbrains.annotations.Nullable
+ Llama getCaravanHead();
+
+ /**
+ * Checks if another llama is currently following behind
+ * this llama.
+ *
+ * @return true if being followed in the caravan
+ */
+ boolean hasCaravanTail();
+
+ /**
+ * Gets the llama that is currently following behind
+ * this llama.
+ *
+ * @return the llama following this llama, or null if none is following them
+ */
+ @org.jetbrains.annotations.Nullable
+ Llama getCaravanTail();
2023-11-11 22:17:36 +01:00
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
index 5fd723c9fdda81595db8b150d967ff3bd5cea608..91d31e5418a5ab7cefd7c02a41bbec8464fe7ab1 100644
2023-11-11 22:17:36 +01:00
--- a/src/main/java/org/bukkit/entity/Mob.java
+++ b/src/main/java/org/bukkit/entity/Mob.java
@@ -170,4 +170,38 @@ public interface Mob extends LivingEntity, Lootable {
this.setSeed(seed);
}
// Paper end - LootTable API
2023-11-11 22:17:36 +01:00
+
+ // Paper start - Missing Entity API
2023-11-11 22:17:36 +01:00
+ /**
+ * Some mobs will raise their arm(s) when aggressive:
+ * <ul>
+ * <li>{@link Drowned}</li>
+ * <li>{@link Piglin}</li>
+ * <li>{@link Skeleton}</li>
+ * <li>{@link Zombie}</li>
+ * <li>{@link ZombieVillager}</li>
+ * <li>{@link Illusioner}</li>
+ * <li>{@link Vindicator}</li>
+ * <li>{@link Panda}</li>
+ * <li>{@link Pillager}</li>
+ * <li>{@link PiglinBrute}</li>
+ * </ul>
+ * <p>
+ * Note: This doesn't always show the actual aggressive state as
+ * set by {@link #setAggressive(boolean)}. {@link Panda}'s are always
+ * aggressive if their combined {@link Panda.Gene} is {@link Panda.Gene#AGGRESSIVE}.
+ *
+ * @return wether the mob is aggressive or not
+ */
+ boolean isAggressive();
+
+ /**
+ * Some mobs will raise their arm(s) when aggressive,
+ * see {@link #isAggressive()} for full list.
+ *
+ * @param aggressive wether the mob should be aggressive or not
+ * @see #isAggressive()
+ */
+ void setAggressive(boolean aggressive);
+ // Paper end - Missing Entity API
}
2022-01-18 00:23:44 +01:00
diff --git a/src/main/java/org/bukkit/entity/Panda.java b/src/main/java/org/bukkit/entity/Panda.java
index 1f027927a1194f4f8e86c1375a2772e6e261c151..4f06870cc8d8aab93aa83b1b8165e6714884372c 100644
2022-01-18 00:23:44 +01:00
--- a/src/main/java/org/bukkit/entity/Panda.java
+++ b/src/main/java/org/bukkit/entity/Panda.java
@@ -107,6 +107,98 @@ public interface Panda extends Animals, Sittable {
*/
int getUnhappyTicks();
2022-02-12 14:36:41 +01:00
2022-01-18 00:23:44 +01:00
+ // Paper start - Panda API
+ /**
+ * Sets the sneeze progress in this animation.
+ * This value counts up only if {@link Panda#isSneezing()} is true
+ *
+ * @param ticks sneeze progress
+ */
+ void setSneezeTicks(int ticks);
+
+ /**
+ * Gets the current sneeze progress, or how many ticks this panda will sneeze for.
+ *
+ * @return sneeze progress
+ */
+ int getSneezeTicks();
+
+ /**
+ * Sets the eating ticks for this panda.
+ * <p>
+ *
+ * This starts counting up as long as it is greater than 0.
+ *
+ * @param ticks eating ticks
+ */
+ void setEatingTicks(int ticks);
+
+ /**
+ * Gets the current eating progress, or how many ticks this panda has been eating for.
+ *
+ * @return eating progress
+ */
+ int getEatingTicks();
+
+ /**
+ * Sets the number of ticks this panda will be unhappy for.
+ * <p>
+ * This value counts down.
+ *
+ * @param ticks unhappy ticks
+ */
+ void setUnhappyTicks(int ticks);
+
+ /**
+ * Sets if this panda is currently on its back.
+ *
+ * @param onBack is on its back
+ * @deprecated use {@link #setOnBack(boolean)}
2022-01-18 00:23:44 +01:00
+ */
+ @Deprecated(forRemoval = true, since = "1.19")
+ default void setIsOnBack(boolean onBack) {
+ this.setOnBack(onBack);
+ }
2022-01-18 00:23:44 +01:00
+
+ /**
+ * Sets if this panda is currently sitting.
+ *
+ * @param sitting is currently sitting
2022-02-12 14:36:41 +01:00
+ * @deprecated use {@link #setSitting(boolean)}
2022-01-18 00:23:44 +01:00
+ */
+ @Deprecated(forRemoval = true, since = "1.19")
2022-02-12 14:36:41 +01:00
+ default void setIsSitting(boolean sitting) {
+ this.setSitting(sitting);
+ }
+
+ /**
+ * Sets if this panda is currently sitting.
+ *
+ * @param sitting is currently sitting
+ */
+ @Override
+ void setSitting(boolean sitting);
2022-01-18 00:23:44 +01:00
+
+ /**
+ * Gets if this panda is sitting.
+ *
+ * @return is sitting
+ */
2022-02-12 14:36:41 +01:00
+ @Override
2022-01-18 00:23:44 +01:00
+ boolean isSitting();
+
+ /**
+ * Gets this Panda's combined gene.
+ * <p>
+ * The combined gene can be modified using
+ * {@link #setMainGene(Gene)} or {@link #setHiddenGene(Gene)}.
+ *
+ * @return combined gene
+ */
+ @NotNull
+ Gene getCombinedGene();
2022-01-18 00:23:44 +01:00
+ // Paper end - Panda API
+
public enum Gene {
NORMAL(false),
diff --git a/src/main/java/org/bukkit/entity/Phantom.java b/src/main/java/org/bukkit/entity/Phantom.java
index 3dafdf14ced991ae1179ef1ca455da62f8c3243e..2fe8e8868f12bd9e846baf8858cd2c333c00a0d8 100644
--- a/src/main/java/org/bukkit/entity/Phantom.java
+++ b/src/main/java/org/bukkit/entity/Phantom.java
@@ -40,5 +40,21 @@ public interface Phantom extends Flying, Enemy {
* @param shouldBurnInDay True to burn in sunlight
*/
public void setShouldBurnInDay(boolean shouldBurnInDay);
+
+ /**
+ * Gets the location that this phantom circles around when not attacking a player
+ * This will be changed after attacking a player.
+ *
+ * @return circling location
+ */
+ @org.jetbrains.annotations.NotNull
+ org.bukkit.Location getAnchorLocation();
+
+ /**
+ * Sets the location that this phantom circles around when not attacking a player
+ *
+ * @param location circling location (world is ignored, will always use the entity's world)
+ */
+ void setAnchorLocation(@org.jetbrains.annotations.NotNull org.bukkit.Location location);
// Paper end
}
2022-03-19 15:30:16 +01:00
diff --git a/src/main/java/org/bukkit/entity/Piglin.java b/src/main/java/org/bukkit/entity/Piglin.java
2023-09-14 12:54:43 +02:00
index 6fdc0e0bb62189dbf3cf9ce7a87b7fbb995956a3..eb0b7c18c1266748ff1e8e18e49b6c4f6e078b83 100644
2022-03-19 15:30:16 +01:00
--- a/src/main/java/org/bukkit/entity/Piglin.java
+++ b/src/main/java/org/bukkit/entity/Piglin.java
2023-09-14 12:54:43 +02:00
@@ -90,4 +90,47 @@ public interface Piglin extends PiglinAbstract, InventoryHolder, com.destroystok
2022-03-19 15:30:16 +01:00
*/
@NotNull
public Set<Material> getBarterList();
+
+ // Paper start
+ /**
+ * Causes the piglin to appear as if they are charging
+ * a crossbow.
+ * <p>
+ * This works with any item currently held in the piglin's hand.
+ *
+ * @param chargingCrossbow is charging
+ */
+ void setChargingCrossbow(boolean chargingCrossbow);
+
+ /**
+ * Gets if the piglin is currently charging the
+ * item in their hand.
+ *
+ * @return is charging
+ */
+ boolean isChargingCrossbow();
2023-09-14 12:54:43 +02:00
+
+ /**
+ * Sets whether the Piglin is dancing or not
+ *
+ * @param dancing is dancing
+ */
+ void setDancing(boolean dancing);
+
+ /**
+ * Causes the piglin to dance for a
+ * specified amount of time
+ *
+ * @param duration duration of the dance in ticks
+ */
+ void setDancing(long duration);
+
+ /**
+ * Gets if the piglin is currently dancing
+ *
+ * @return is dancing
+ */
+ boolean isDancing();
2022-03-19 15:30:16 +01:00
+ // Paper end
+
}
2022-03-11 15:24:45 +01:00
diff --git a/src/main/java/org/bukkit/entity/PolarBear.java b/src/main/java/org/bukkit/entity/PolarBear.java
index 479f7a7c54c85cb685f56e60906650d1989c03ff..4e526ba6aa462a484984fb9f0512b8db113086fe 100644
2022-03-11 15:24:45 +01:00
--- a/src/main/java/org/bukkit/entity/PolarBear.java
+++ b/src/main/java/org/bukkit/entity/PolarBear.java
@@ -3,4 +3,22 @@ package org.bukkit.entity;
2022-03-11 15:24:45 +01:00
/**
* Represents a polar bear.
*/
-public interface PolarBear extends Animals {}
+// Paper start
+public interface PolarBear extends Animals {
+
+ /**
+ * Returns whether the polar bear is standing.
+ *
+ * @return whether the polar bear is standing
+ */
+ boolean isStanding();
+
+ /**
+ * Sets whether the polar bear is standing.
+ *
+ * @param standing whether the polar bear should be standing
+ */
+ void setStanding(boolean standing);
+
2022-03-11 15:24:45 +01:00
+}
+// Paper end
2022-12-10 01:56:13 +01:00
diff --git a/src/main/java/org/bukkit/entity/Rabbit.java b/src/main/java/org/bukkit/entity/Rabbit.java
index e88154283a8ef594e160d25005870053de15568a..979062aa476e3bd75166458d8831894fba8778cd 100644
--- a/src/main/java/org/bukkit/entity/Rabbit.java
+++ b/src/main/java/org/bukkit/entity/Rabbit.java
@@ -14,6 +14,23 @@ public interface Rabbit extends Animals {
* @param type Sets the type of rabbit for this entity.
*/
public void setRabbitType(@NotNull Type type);
+ // Paper start
+ /**
+ * Sets how many ticks this rabbit will wait
+ * until trying to find more carrots.
+ *
+ * @param ticks ticks
+ */
+ void setMoreCarrotTicks(int ticks);
+
+ /**
+ * Returns how many ticks this rabbit
+ * will wait until trying to find more carrots.
+ *
+ * @return ticks
+ */
+ int getMoreCarrotTicks();
+ // Paper end
/**
* Represents the various types a Rabbit might be.
diff --git a/src/main/java/org/bukkit/entity/Ravager.java b/src/main/java/org/bukkit/entity/Ravager.java
index 4374d5206d4d15a4d8d228c137ed9a96821a1f02..0eb7214472f3a43641a3526000af6beeefb7b36f 100644
--- a/src/main/java/org/bukkit/entity/Ravager.java
+++ b/src/main/java/org/bukkit/entity/Ravager.java
@@ -3,4 +3,61 @@ package org.bukkit.entity;
/**
* Illager beast.
*/
-public interface Ravager extends Raider { }
+// Paper start - Missing Entity Behavior
+public interface Ravager extends Raider {
+
+ /**
+ * Gets how many ticks this ravager is attacking for.
+ * When attacking, the ravager cannot move.
+ *
+ * @return ticks attacking or -1 if they are currently not attacking
+ */
+ int getAttackTicks();
+
+ /**
+ * Sets how many ticks this ravager is attacking for.
+ * When attacking, the ravager cannot move.
+ * This will tick down till it gets to -1, where this ravager will no longer be attacking.
+ *
+ * @param ticks ticks attacking or -1 if they should no longer be attacking
+ */
+ void setAttackTicks(int ticks);
+
+ /**
+ * Gets how many ticks the ravager is stunned for.
+ * The ravager cannot move or attack while stunned.
+ * At 0, this will cause the ravager to roar.
+ *
+ * @return ticks stunned or -1 if they are currently not stunned
+ */
+ int getStunnedTicks();
+
+ /**
+ * Sets how many ticks the ravager is stunned for.
+ * The ravager cannot move or attack while stunned.
+ * At 0, this will cause the ravager to roar.
+ *
+ * @param ticks ticks stunned or -1 if they should no longer be stunned
+ */
+ void setStunnedTicks(int ticks);
+
+ /**
+ * Gets how many ticks the ravager is roaring for.
+ * While roaring, the ravager cannot move
+ *
+ * @return ticks roaring or -1 if they are currently not roaring
+ */
+ int getRoarTicks();
+
+ /**
+ * Sets how many ticks the ravager is roaring for.
+ * While roaring, the ravager cannot move
+ * This will tick down till it gets to -1, where it is no longer active.
+ * If set to 11, this will play a sound and hurt nearby players.
+ *
+ * @param ticks ticks roaring or -1 if they should no longer be roaring
+ */
+ void setRoarTicks(int ticks);
+
+}
+// Paper end
2022-11-26 03:21:40 +01:00
diff --git a/src/main/java/org/bukkit/entity/Salmon.java b/src/main/java/org/bukkit/entity/Salmon.java
2024-10-22 18:23:19 +02:00
index 407aa5de170a3f0160c197a2b228f2e3b3269387..d8a2d44fe50a9ab24d8916aad270dfba0bd84e5e 100644
2022-11-26 03:21:40 +01:00
--- a/src/main/java/org/bukkit/entity/Salmon.java
+++ b/src/main/java/org/bukkit/entity/Salmon.java
2024-10-22 18:23:19 +02:00
@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull;
2022-11-26 03:21:40 +01:00
/**
* Represents a salmon fish.
*/
2024-10-22 18:23:19 +02:00
-public interface Salmon extends Fish {
+public interface Salmon extends io.papermc.paper.entity.SchoolableFish { // Paper - Schooling Fish API
/**
* Get the variant of this salmon.
diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java
index 0813bd913c8fdb2001963ce3e82c07c2af105418..87e717c9ea61b0cbf536bc62fa829ddcfae5ad8c 100644
--- a/src/main/java/org/bukkit/entity/TNTPrimed.java
+++ b/src/main/java/org/bukkit/entity/TNTPrimed.java
@@ -64,4 +64,26 @@ public interface TNTPrimed extends Explosive {
default org.bukkit.Location getSourceLoc() {
return this.getOrigin();
}
+
+ // Paper start
+ /**
+ * Sets the visual block data of this
+ * primed tnt.
+ * <br>
+ * The explosion of the tnt stays the
+ * same and is not affected by this change.
+ *
+ * @param data the visual block data
+ */
+ void setBlockData(@org.jetbrains.annotations.NotNull org.bukkit.block.data.BlockData data);
+
+ /**
+ * Gets the visual block data of this
+ * primed tnt.
+ *
+ * @return the visual block data
+ */
+ @org.jetbrains.annotations.NotNull
+ org.bukkit.block.data.BlockData getBlockData();
+ // Paper end
}
2022-12-23 21:50:32 +01:00
diff --git a/src/main/java/org/bukkit/entity/Tadpole.java b/src/main/java/org/bukkit/entity/Tadpole.java
index d64979ebdd018f0f63b6115809b48374ba454249..8e097ad55d208a6980c320e2a849efdcc504cff1 100644
--- a/src/main/java/org/bukkit/entity/Tadpole.java
+++ b/src/main/java/org/bukkit/entity/Tadpole.java
@@ -18,4 +18,21 @@ public interface Tadpole extends Fish {
* @param age New age
*/
public void setAge(int age);
+
+ // Paper start - Tadpole age lock api
+ /**
+ * Lock the age of the animal, setting this will prevent the animal from
+ * maturing.
+ *
+ * @param lock new lock
+ */
+ void setAgeLock(boolean lock);
+
+ /**
+ * Gets the current agelock.
+ *
+ * @return the current agelock
+ */
+ boolean getAgeLock();
+ // Paper end
}
2022-03-11 15:24:45 +01:00
diff --git a/src/main/java/org/bukkit/entity/Trident.java b/src/main/java/org/bukkit/entity/Trident.java
index 28cdb3b544572ba7aeb9061e3163e3895ac7d4e6..c8015ff610e3c1222cb368ea1d8a0c2f3785d9c7 100644
--- a/src/main/java/org/bukkit/entity/Trident.java
+++ b/src/main/java/org/bukkit/entity/Trident.java
@@ -3,4 +3,40 @@ package org.bukkit.entity;
/**
* Represents a thrown trident.
*/
-public interface Trident extends AbstractArrow, ThrowableProjectile { }
+// Paper start
+public interface Trident extends AbstractArrow, ThrowableProjectile {
+
+ /**
+ * Returns whether the trident has an enchanted glow.
+ * This can be separate from the underlying item having any enchantments.
+ *
+ * @return whether the trident has an enchanted glow
+ */
+ boolean hasGlint();
+
+ /**
+ * Sets whether the trident has an enchanted glow.
+ * This is separate from the underlying item having any enchantments.
+ *
+ * @param glint whether the trident should have an enchanted glow
+ */
+ void setGlint(boolean glint);
+
+ /**
+ * Returns the loyalty level of the trident.
+ * This can be separate from the underlying item's enchantments.
+ *
+ * @return loyalty level of the trident
+ */
+ int getLoyaltyLevel();
+
+ /**
+ * Sets the loyalty level of the trident.
+ * This is separate from the underlying item's enchantments.
+ *
+ * @param loyaltyLevel loyalty level
+ * @throws IllegalArgumentException if the loyalty level is lower than 0 or greater than 127
+ */
+ void setLoyaltyLevel(int loyaltyLevel);
+}
+// Paper end
2022-11-26 03:21:40 +01:00
diff --git a/src/main/java/org/bukkit/entity/TropicalFish.java b/src/main/java/org/bukkit/entity/TropicalFish.java
index ab31289bb0f9c8e581537a88e1db22bcdbd3d484..84bba32e80d755f094975b667f1bf2a132087f4f 100644
2022-11-26 03:21:40 +01:00
--- a/src/main/java/org/bukkit/entity/TropicalFish.java
+++ b/src/main/java/org/bukkit/entity/TropicalFish.java
@@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull;
/**
* Tropical fish.
*/
-public interface TropicalFish extends Fish {
+public interface TropicalFish extends io.papermc.paper.entity.SchoolableFish { // Paper - Schooling Fish API
/**
* Gets the color of the fish's pattern.
2022-03-19 15:30:16 +01:00
diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java
index 627e3c1a96ae3331f5aa2dd7803dd2a31c7204be..3c447d2300c866ae605eeca97bd869f400d6be6f 100644
2022-03-19 15:30:16 +01:00
--- a/src/main/java/org/bukkit/entity/Vex.java
+++ b/src/main/java/org/bukkit/entity/Vex.java
@@ -57,21 +57,30 @@ public interface Vex extends Monster {
* Gets the remaining lifespan of this entity.
*
* @return life in ticks
+ * @deprecated This API duplicates existing API which uses the more
+ * preferable name due to mirroring internals better
*/
+ @Deprecated
int getLifeTicks();
/**
* Sets the remaining lifespan of this entity.
*
* @param lifeTicks life in ticks, or negative for unlimited lifepan
+ * @deprecated This API duplicates existing API which uses the more
+ * preferable name due to mirroring internals better
*/
+ @Deprecated
void setLifeTicks(int lifeTicks);
/**
* Gets if the entity has a limited life.
*
* @return true if the entity has limited life
+ * @deprecated This API duplicates existing API which uses the more
+ * preferable name due to mirroring internals better
*/
+ @Deprecated
boolean hasLimitedLife();
// Paper start
@@ -89,5 +98,37 @@ public interface Vex extends Monster {
2022-03-19 15:30:16 +01:00
* @param summoner New summoner
*/
void setSummoner(@Nullable Mob summoner);
+
+ /**
+ * Gets if this vex should start to take damage
+ * once {@link Vex#getLimitedLifetimeTicks()} is less than or equal to 0.
+ *
+ * @return will take damage
+ */
+ boolean hasLimitedLifetime();
+
+ /**
+ * Sets if this vex should start to take damage
+ * once {@link Vex#getLimitedLifetimeTicks()} is less than or equal to 0.
+ *
+ * @param hasLimitedLifetime should take damage
+ */
+ void setLimitedLifetime(boolean hasLimitedLifetime);
+
+ /**
+ * Gets the number of ticks remaining until the vex will start
+ * to take damage.
+ *
+ * @return ticks until the vex will start to take damage
+ */
+ int getLimitedLifetimeTicks();
+
+ /**
+ * Sets the number of ticks remaining until the vex takes damage.
+ * This number is ticked down only if {@link Vex#hasLimitedLifetime()} is true.
+ *
+ * @param ticks ticks remaining
+ */
+ void setLimitedLifetimeTicks(int ticks);
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/WanderingTrader.java b/src/main/java/org/bukkit/entity/WanderingTrader.java
index da76e1ed5406322073dd8c7a89ca55aa68620ac4..9f25774659b29d8fcca3eb9d9487edff42dbad13 100644
--- a/src/main/java/org/bukkit/entity/WanderingTrader.java
+++ b/src/main/java/org/bukkit/entity/WanderingTrader.java
@@ -53,5 +53,26 @@ public interface WanderingTrader extends AbstractVillager {
* @return whether the mob will drink
*/
public boolean canDrinkMilk();
+
+ /**
+ * Gets the location that this wandering trader is currently
+ * wandering towards.
+ * <p>
+ * This will return null if the wandering trader has finished
+ * wandering towards the given location.
+ *
+ * @return the location currently wandering towards, or null if not wandering
+ */
+ @org.jetbrains.annotations.Nullable
+ org.bukkit.Location getWanderingTowards();
+
+ /**
+ * Sets the location that this wandering trader is currently wandering towards.
+ * <p>
+ * This can be set to null to prevent the wandering trader from wandering further.
+ *
+ * @param location location to wander towards (world is ignored, will always use the entity's world)
+ */
+ void setWanderingTowards(@org.jetbrains.annotations.Nullable org.bukkit.Location location);
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Warden.java b/src/main/java/org/bukkit/entity/Warden.java
index 3794db8867b53f3b3735ad82fdd8765a26df2bfb..efaa45f41bc1dc8df6665c55b4e5ade343d60d4c 100644
--- a/src/main/java/org/bukkit/entity/Warden.java
+++ b/src/main/java/org/bukkit/entity/Warden.java
@@ -30,6 +30,18 @@ public interface Warden extends Monster {
*/
int getAnger(@NotNull Entity entity);
+ // Paper start
+ /**
+ * Gets the highest anger level of this warden.
+ * <p>
+ * Anger is an integer from 0 to 150. Once a Warden reaches 80 anger at a
+ * target it will actively pursue it.
+ *
+ * @return highest anger level
+ */
+ int getHighestAnger();
+ // Paper end
+
/**
* Increases the anger level of this warden.
*
2022-03-11 15:24:45 +01:00
diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java
index 87a814f63c3f35be35bfa210c9248ad211c0dd8f..14543c2238b45c526dd9aebea2aa5c22f5df54dc 100644
2022-03-11 15:24:45 +01:00
--- a/src/main/java/org/bukkit/entity/Wither.java
+++ b/src/main/java/org/bukkit/entity/Wither.java
@@ -43,7 +43,9 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
* Returns the wither's current invulnerability ticks.
*
* @return amount of invulnerability ticks
+ * @deprecated Duplicate api, use {@link #getInvulnerableTicks()}
*/
+ @Deprecated(forRemoval = true) // Paper
int getInvulnerabilityTicks();
/**
@@ -52,7 +54,9 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
* When invulnerability ticks reach 0, the wither will trigger an explosion.
*
* @param ticks amount of invulnerability ticks
+ * @deprecated Duplicate api, use {@link #setInvulnerableTicks(int)}
*/
+ @Deprecated(forRemoval = true) // Paper
void setInvulnerabilityTicks(int ticks);
/**
@@ -64,4 +68,43 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
LEFT,
RIGHT
}
+
2022-03-11 15:24:45 +01:00
+ // Paper start
+ /**
+ * @return whether the wither is charged
+ */
+ boolean isCharged();
+
+ /**
+ * @return ticks the wither is invulnerable for
+ */
+ int getInvulnerableTicks();
+
+ /**
+ * Sets for how long in the future, the wither should be invulnerable.
+ *
+ * @param ticks ticks the wither is invulnerable for
+ */
+ void setInvulnerableTicks(int ticks);
+
+ /**
+ * @return whether the wither can travel through portals
+ */
+ boolean canTravelThroughPortals();
+
+ /**
+ * Sets whether the wither can travel through portals.
+ *
+ * @param value whether the wither can travel through portals
+ */
+ void setCanTravelThroughPortals(boolean value);
+
+ /**
+ * Makes the wither invulnerable for 11 seconds and
+ * sets the health to one third of the max health.
+ * <br>
+ * This is called in vanilla directly after spawning the wither.
+ */
+ void enterInvulnerabilityPhase();
2022-03-19 15:30:16 +01:00
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/ZombieVillager.java b/src/main/java/org/bukkit/entity/ZombieVillager.java
index e38f38ebfc6e85f29b09c4bb3e2ea79639078ad0..e647c6b933be8234c6ef8726724a7e1198f24f31 100644
--- a/src/main/java/org/bukkit/entity/ZombieVillager.java
+++ b/src/main/java/org/bukkit/entity/ZombieVillager.java
@@ -90,4 +90,22 @@ public interface ZombieVillager extends Zombie {
* @param conversionPlayer the player
*/
void setConversionPlayer(@Nullable OfflinePlayer conversionPlayer);
+
+ // Paper start - missing entity behaviour api - converting without entity event
+ /**
+ * Sets the amount of ticks until this entity will be converted to a
+ * Villager as a result of being cured.
+ * <p>
+ * When this reaches 0, the entity will be converted. A value of less than 0
+ * will stop the current conversion process without converting the current
+ * entity.
+ *
+ * @param time new conversion time
+ * @param broadcastEntityEvent whether this conversion time mutation should broadcast the
+ * org.bukkit.{@link org.bukkit.EntityEffect#ZOMBIE_TRANSFORM} entity event to the
+ * world. If false, no entity event is published, preventing for example the
+ * org.bukkit.{@link org.bukkit.Sound#ENTITY_ZOMBIE_VILLAGER_CURE} from playing.
+ */
+ void setConversionTime(int time, boolean broadcastEntityEvent);
+ // Paper end - missing entity behaviour api - converting without entity event
}
diff --git a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java
index db69687a7ad4b18d17ab1677cae5d8dd4dcd3678..261bacee2a48580f781876683efea68c32ed7282 100644
--- a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java
+++ b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java
2023-03-15 00:10:18 +01:00
@@ -24,4 +24,23 @@ public interface HopperMinecart extends Minecart, InventoryHolder, LootableEntit
* @param enabled new enabled state
*/
void setEnabled(boolean enabled);
+ // Paper start
+ /**
+ * Gets the number of ticks that this hopper minecart cannot pickup items up for.
+ *
+ * @return ticks left on cooldown
2023-03-15 00:10:18 +01:00
+ * @deprecated Hopper minecarts don't have cooldowns anymore
+ */
+ @Deprecated(forRemoval = true, since = "1.19.4")
+ int getPickupCooldown();
+
+ /**
+ * Sets the number of ticks that this hopper minecart cannot pickup items for.
+ *
+ * @param cooldown cooldown length in ticks
2023-03-15 00:10:18 +01:00
+ * @deprecated Hopper minecarts don't have cooldowns anymore
+ */
+ @Deprecated(forRemoval = true, since = "1.19.4")
+ void setPickupCooldown(int cooldown);
+ // Paper end
}