More more more more more more more more more more more work
This commit is contained in:
parent
0358549f7b
commit
8f67d293a2
48 changed files with 238 additions and 240 deletions
|
@ -1,88 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: nossr50 <nossr50@gmail.com>
|
||||
Date: Thu, 26 Mar 2020 19:30:58 -0700
|
||||
Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerAttackEntityCooldownResetEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerAttackEntityCooldownResetEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ebdebe7b6ec6ed5aadc7ee925ba0147e61e6bc84
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerAttackEntityCooldownResetEvent.java
|
||||
@@ -0,0 +1,76 @@
|
||||
+package com.destroystokyo.paper.event.player;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when processing a player's attack on an entity when the player's attack strength cooldown is reset
|
||||
+ */
|
||||
+public class PlayerAttackEntityCooldownResetEvent extends PlayerEvent implements Cancellable {
|
||||
+
|
||||
+ private final float cooledAttackStrength;
|
||||
+ private boolean cancel = false;
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ @NotNull private final Entity attackedEntity;
|
||||
+
|
||||
+ public PlayerAttackEntityCooldownResetEvent(@NotNull Player who, @NotNull Entity attackedEntity, float cooledAttackStrength) {
|
||||
+ super(who);
|
||||
+ this.attackedEntity = attackedEntity;
|
||||
+ this.cooledAttackStrength = cooledAttackStrength;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ public static @NotNull HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the cancellation state of this event. A cancelled event will not
|
||||
+ * be executed in the server, but will still pass to other plugins
|
||||
+ * <p>
|
||||
+ * If an attack cooldown event is cancelled, the players attack strength will remain at the same value instead of being reset.
|
||||
+ *
|
||||
+ * @return true if this event is cancelled
|
||||
+ */
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancel;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Cancelling this event will prevent the target player from having their cooldown reset from attacking this entity
|
||||
+ *
|
||||
+ * @param cancel true if you wish to cancel this event
|
||||
+ */
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancel = cancel;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the value of the players cooldown attack strength when they initiated the attack
|
||||
+ *
|
||||
+ * @return returns the original player cooldown value
|
||||
+ */
|
||||
+ public float getCooledAttackStrength() {
|
||||
+ return cooledAttackStrength;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the entity attacked by the player
|
||||
+ *
|
||||
+ * @return the entity attacked by the player
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Entity getAttackedEntity() {
|
||||
+ return attackedEntity;
|
||||
+ }
|
||||
+}
|
|
@ -1,21 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Wesley Smith <me@wesjd.net>
|
||||
Date: Fri, 24 Apr 2020 18:30:26 -0400
|
||||
Subject: [PATCH] Fix Potion#toItemStack swapping the extended and upgraded
|
||||
constructor values.
|
||||
|
||||
While the Potion class is deprecated, it is still used in some plugins for cross-version potion handling. This issue has existed for a long time, and has caused many heaches along the way.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java
|
||||
index 2184c8620ca89e3cd769b16061dea1755ce8e03a..c0da4d307426684c1db112f41a729bcf5233452e 100644
|
||||
--- a/src/main/java/org/bukkit/potion/Potion.java
|
||||
+++ b/src/main/java/org/bukkit/potion/Potion.java
|
||||
@@ -267,7 +267,7 @@ public class Potion {
|
||||
}
|
||||
ItemStack itemStack = new ItemStack(material, amount);
|
||||
PotionMeta meta = (PotionMeta) itemStack.getItemMeta();
|
||||
- meta.setBasePotionData(new PotionData(type, level == 2, extended));
|
||||
+ meta.setBasePotionData(new PotionData(type, extended, level == 2)); // Paper - fix swapped values
|
||||
itemStack.setItemMeta(meta);
|
||||
return itemStack;
|
||||
}
|
|
@ -1,283 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: kennytv <jahnke.nassim@gmail.com>
|
||||
Date: Sat, 25 Apr 2020 23:31:28 +0200
|
||||
Subject: [PATCH] Add item slot convenience methods
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/AnvilInventory.java b/src/main/java/org/bukkit/inventory/AnvilInventory.java
|
||||
index 4af562426aa38faeb6822abb0c878a3ac346b383..b95e563b5454306a9188ae3295309ee86a756477 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/AnvilInventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/AnvilInventory.java
|
||||
@@ -49,4 +49,64 @@ public interface AnvilInventory extends Inventory {
|
||||
* @param levels the maximum experience cost
|
||||
*/
|
||||
void setMaximumRepairCost(int levels);
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the item in the left input slot.
|
||||
+ *
|
||||
+ * @return item in the first slot
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getFirstItem() {
|
||||
+ return getItem(0);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the item in the left input slot.
|
||||
+ *
|
||||
+ * @param firstItem item to set
|
||||
+ */
|
||||
+ default void setFirstItem(@Nullable ItemStack firstItem) {
|
||||
+ setItem(0, firstItem);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the item in the right input slot.
|
||||
+ *
|
||||
+ * @return item in the second slot
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getSecondItem() {
|
||||
+ return getItem(1);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the item in the right input slot.
|
||||
+ *
|
||||
+ * @param secondItem item to set
|
||||
+ */
|
||||
+ default void setSecondItem(@Nullable ItemStack secondItem) {
|
||||
+ setItem(1, secondItem);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the item in the result slot.
|
||||
+ *
|
||||
+ * @return item in the result slot
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getResult() {
|
||||
+ return getItem(2);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the item in the result slot.
|
||||
+ * Note that the client might not be able to take out the item if it does not match the input items.
|
||||
+ *
|
||||
+ * @param result item to set
|
||||
+ */
|
||||
+ default void setResult(@Nullable ItemStack result) {
|
||||
+ setItem(2, result);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/GrindstoneInventory.java b/src/main/java/org/bukkit/inventory/GrindstoneInventory.java
|
||||
index 9048892c8768c6b4d6cea03da73339f13bfbe82e..1c750108f55a0a31ad23433b333e0ea486a63ff2 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/GrindstoneInventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/GrindstoneInventory.java
|
||||
@@ -1,6 +1,68 @@
|
||||
package org.bukkit.inventory;
|
||||
|
||||
+import org.jetbrains.annotations.Nullable; // Paper
|
||||
+
|
||||
/**
|
||||
* Interface to the inventory of a Grindstone.
|
||||
*/
|
||||
-public interface GrindstoneInventory extends Inventory { }
|
||||
+public interface GrindstoneInventory extends Inventory {
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the upper input item.
|
||||
+ *
|
||||
+ * @return upper input item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getUpperItem() {
|
||||
+ return getItem(0);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the upper input item.
|
||||
+ *
|
||||
+ * @param upperItem item to set
|
||||
+ */
|
||||
+ default void setUpperItem(@Nullable ItemStack upperItem) {
|
||||
+ setItem(0, upperItem);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the lower input item.
|
||||
+ *
|
||||
+ * @return lower input item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getLowerItem() {
|
||||
+ return getItem(1);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the lower input item.
|
||||
+ *
|
||||
+ * @param lowerItem item to set
|
||||
+ */
|
||||
+ default void setLowerItem(@Nullable ItemStack lowerItem) {
|
||||
+ setItem(1, lowerItem);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the result.
|
||||
+ *
|
||||
+ * @return result
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getResult() {
|
||||
+ return getItem(2);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the result.
|
||||
+ *
|
||||
+ * @param result item to set
|
||||
+ */
|
||||
+ default void setResult(@Nullable ItemStack result) {
|
||||
+ setItem(2, result);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/LecternInventory.java b/src/main/java/org/bukkit/inventory/LecternInventory.java
|
||||
index 4a0c43acc2714e095973eb78536041bb1a179ddc..acf2244f77133df53eb5f862c8e713c85192f13d 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/LecternInventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/LecternInventory.java
|
||||
@@ -11,4 +11,25 @@ public interface LecternInventory extends Inventory {
|
||||
@Nullable
|
||||
@Override
|
||||
public Lectern getHolder();
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the lectern's held book.
|
||||
+ *
|
||||
+ * @return book set in the lectern
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getBook() {
|
||||
+ return getItem(0);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the lectern's held book.
|
||||
+ *
|
||||
+ * @param book the new book
|
||||
+ */
|
||||
+ default void setBook(@Nullable ItemStack book) {
|
||||
+ setItem(0, book);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/SmithingInventory.java b/src/main/java/org/bukkit/inventory/SmithingInventory.java
|
||||
index 96d526b7b153e56c9a97de42ce3270b6638510e4..a41ca6bd2672db2810dd70c4925b84a4f081af05 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/SmithingInventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/SmithingInventory.java
|
||||
@@ -30,4 +30,44 @@ public interface SmithingInventory extends Inventory {
|
||||
*/
|
||||
@Nullable
|
||||
Recipe getRecipe();
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the input equipment (first slot).
|
||||
+ *
|
||||
+ * @return input equipment item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getInputEquipment() {
|
||||
+ return getItem(0);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the input equipment (first slot).
|
||||
+ *
|
||||
+ * @param itemStack item to set
|
||||
+ */
|
||||
+ default void setInputEquipment(@Nullable ItemStack itemStack) {
|
||||
+ setItem(0, itemStack);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the input mineral (second slot).
|
||||
+ *
|
||||
+ * @return input mineral item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getInputMineral() {
|
||||
+ return getItem(1);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the input mineral (second slot).
|
||||
+ *
|
||||
+ * @param itemStack item to set
|
||||
+ */
|
||||
+ default void setInputMineral(@Nullable ItemStack itemStack) {
|
||||
+ setItem(1, itemStack);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/StonecutterInventory.java b/src/main/java/org/bukkit/inventory/StonecutterInventory.java
|
||||
index dbb034fae3b8bfaf40e6341460e274c21e321a3b..e7a8e7188bf8b9840de56dc80c2b79d64a9389cb 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/StonecutterInventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/StonecutterInventory.java
|
||||
@@ -1,6 +1,49 @@
|
||||
package org.bukkit.inventory;
|
||||
|
||||
+import org.jetbrains.annotations.Nullable; // Paper
|
||||
+
|
||||
/**
|
||||
* Interface to the inventory of a Stonecutter.
|
||||
*/
|
||||
-public interface StonecutterInventory extends Inventory { }
|
||||
+public interface StonecutterInventory extends Inventory {
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the input item.
|
||||
+ *
|
||||
+ * @return input item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getInputItem() {
|
||||
+ return getItem(0);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the input item.
|
||||
+ *
|
||||
+ * @param itemStack item to set
|
||||
+ */
|
||||
+ default void setInputItem(@Nullable ItemStack itemStack) {
|
||||
+ setItem(0, itemStack);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the result item.
|
||||
+ *
|
||||
+ * @return result
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getResult() {
|
||||
+ return getItem(1);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the result item.
|
||||
+ *
|
||||
+ * @param itemStack item to set
|
||||
+ */
|
||||
+ default void setResult(@Nullable ItemStack itemStack) {
|
||||
+ setItem(1, itemStack);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+}
|
|
@ -1,31 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: zbk <zbk@projectsolaris.net>
|
||||
Date: Sun, 26 Apr 2020 23:49:03 -0400
|
||||
Subject: [PATCH] Villager Restocks API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
||||
index 6545e568b74bd096e184b85e8da6f0d40acd3b36..ef8a81c4857bd06be19264580bf3a7e087118f5c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -77,6 +77,20 @@ public interface Villager extends AbstractVillager {
|
||||
*/
|
||||
public void setVillagerExperience(int experience);
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the amount of times a villager has restocked their trades today
|
||||
+ * @return The amount of trade restocks.
|
||||
+ */
|
||||
+ public int getRestocksToday();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the amount of times a villager has restocked their trades today
|
||||
+ * @param restocksToday new restock count
|
||||
+ */
|
||||
+ public void setRestocksToday(int restocksToday);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Attempts to make this villager sleep at the given location.
|
||||
* <br>
|
|
@ -1,560 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MiniDigger <admin@minidigger.me>
|
||||
Date: Fri, 3 Jan 2020 16:24:46 +0100
|
||||
Subject: [PATCH] Add Mob Goal API
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/Goal.java b/src/main/java/com/destroystokyo/paper/entity/ai/Goal.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c57c5416c88e2070a082403ab0dda9d7f08d2a57
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/Goal.java
|
||||
@@ -0,0 +1,66 @@
|
||||
+package com.destroystokyo.paper.entity.ai;
|
||||
+
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.EnumSet;
|
||||
+
|
||||
+import org.bukkit.entity.Mob;
|
||||
+
|
||||
+/**
|
||||
+ * Represents an AI goal of an entity
|
||||
+ */
|
||||
+public interface Goal<T extends Mob> {
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if this goal should be activated
|
||||
+ *
|
||||
+ * @return if this goal should be activated
|
||||
+ */
|
||||
+ boolean shouldActivate();
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if this goal should stay active, defaults to {@link Goal#shouldActivate()}
|
||||
+ *
|
||||
+ * @return if this goal should stay active
|
||||
+ */
|
||||
+ default boolean shouldStayActive() {
|
||||
+ return shouldActivate();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called when this goal gets activated
|
||||
+ */
|
||||
+ default void start() {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called when this goal gets stopped
|
||||
+ */
|
||||
+ default void stop() {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called each tick the goal is activated
|
||||
+ */
|
||||
+ default void tick() {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * A unique key that identifies this type of goal. Plugins should use their own namespace, not the minecraft
|
||||
+ * namespace. Additionally, this key also specifies to what mobs this goal can be applied to
|
||||
+ *
|
||||
+ * @return the goal key
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ GoalKey<T> getKey();
|
||||
+
|
||||
+ /**
|
||||
+ * Returns a list of all applicable flags for this goal.<br>
|
||||
+ *
|
||||
+ * This method is only called on construction.
|
||||
+ *
|
||||
+ * @return the subtypes.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ EnumSet<GoalType> getTypes();
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/GoalKey.java b/src/main/java/com/destroystokyo/paper/entity/ai/GoalKey.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9cd98c6fcfa3eb439d9013ef76ef4661175a0e5a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/GoalKey.java
|
||||
@@ -0,0 +1,64 @@
|
||||
+package com.destroystokyo.paper.entity.ai;
|
||||
+
|
||||
+import com.google.common.base.Objects;
|
||||
+
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.StringJoiner;
|
||||
+
|
||||
+import org.bukkit.NamespacedKey;
|
||||
+import org.bukkit.entity.Mob;
|
||||
+
|
||||
+/**
|
||||
+ *
|
||||
+ * Used to identify a Goal. Consists of a {@link NamespacedKey} and the type of mob the goal can be applied to
|
||||
+ *
|
||||
+ * @param <T> the type of mob the goal can be applied to
|
||||
+ */
|
||||
+public class GoalKey<T extends Mob> {
|
||||
+
|
||||
+ private final Class<T> entityClass;
|
||||
+ private final NamespacedKey namespacedKey;
|
||||
+
|
||||
+ private GoalKey(@NotNull Class<T> entityClass, @NotNull NamespacedKey namespacedKey) {
|
||||
+ this.entityClass = entityClass;
|
||||
+ this.namespacedKey = namespacedKey;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public Class<T> getEntityClass() {
|
||||
+ return entityClass;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public NamespacedKey getNamespacedKey() {
|
||||
+ return namespacedKey;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean equals(Object o) {
|
||||
+ if (this == o) return true;
|
||||
+ if (o == null || getClass() != o.getClass()) return false;
|
||||
+ GoalKey<?> goalKey = (GoalKey<?>) o;
|
||||
+ return Objects.equal(entityClass, goalKey.entityClass) &&
|
||||
+ Objects.equal(namespacedKey, goalKey.namespacedKey);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int hashCode() {
|
||||
+ return Objects.hashCode(entityClass, namespacedKey);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String toString() {
|
||||
+ return new StringJoiner(", ", GoalKey.class.getSimpleName() + "[", "]")
|
||||
+ .add("entityClass=" + entityClass)
|
||||
+ .add("namespacedKey=" + namespacedKey)
|
||||
+ .toString();
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static <A extends Mob> GoalKey<A> of(@NotNull Class<A> entityClass, @NotNull NamespacedKey namespacedKey) {
|
||||
+ return new GoalKey<>(entityClass, namespacedKey);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/GoalType.java b/src/main/java/com/destroystokyo/paper/entity/ai/GoalType.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7024c8f484d2460abf3abfe65a29771d814105ec
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/GoalType.java
|
||||
@@ -0,0 +1,17 @@
|
||||
+package com.destroystokyo.paper.entity.ai;
|
||||
+
|
||||
+/**
|
||||
+ * Represents the subtype of a goal. Used by minecraft to disable certain types of goals if needed.
|
||||
+ */
|
||||
+public enum GoalType {
|
||||
+
|
||||
+ MOVE,
|
||||
+ LOOK,
|
||||
+ JUMP,
|
||||
+ TARGET,
|
||||
+ /**
|
||||
+ * Used to map vanilla goals, that are a behavior goal but don't have a type set...
|
||||
+ */
|
||||
+ UNKNOWN_BEHAVIOR,
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoals.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoals.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e21f7574763dd4f13794f91bbef192ef66a8f5e9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoals.java
|
||||
@@ -0,0 +1,50 @@
|
||||
+package com.destroystokyo.paper.entity.ai;
|
||||
+
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+import java.util.Collection;
|
||||
+
|
||||
+import org.bukkit.entity.Mob;
|
||||
+
|
||||
+/**
|
||||
+ * Represents a part of the "brain" of a mob. It tracks all tasks (running or not), allows adding and removing goals
|
||||
+ */
|
||||
+public interface MobGoals {
|
||||
+
|
||||
+ <T extends Mob> void addGoal(@NotNull T mob, int priority, @NotNull Goal<T> goal);
|
||||
+
|
||||
+ <T extends Mob> void removeGoal(@NotNull T mob, @NotNull Goal<T> goal);
|
||||
+
|
||||
+ <T extends Mob> void removeAllGoals(@NotNull T mob);
|
||||
+
|
||||
+ <T extends Mob> void removeAllGoals(@NotNull T mob, @NotNull GoalType type);
|
||||
+
|
||||
+ <T extends Mob> void removeGoal(@NotNull T mob, @NotNull GoalKey<T> key);
|
||||
+
|
||||
+ <T extends Mob> boolean hasGoal(@NotNull T mob, @NotNull GoalKey<T> key);
|
||||
+
|
||||
+ @Nullable
|
||||
+ <T extends Mob> Goal<T> getGoal(@NotNull T mob, @NotNull GoalKey<T> key);
|
||||
+
|
||||
+ @NotNull
|
||||
+ <T extends Mob> Collection<Goal<T>> getGoals(@NotNull T mob, @NotNull GoalKey<T> key);
|
||||
+
|
||||
+ @NotNull
|
||||
+ <T extends Mob> Collection<Goal<T>> getAllGoals(@NotNull T mob);
|
||||
+
|
||||
+ @NotNull
|
||||
+ <T extends Mob> Collection<Goal<T>> getAllGoals(@NotNull T mob, @NotNull GoalType type);
|
||||
+
|
||||
+ @NotNull
|
||||
+ <T extends Mob> Collection<Goal<T>> getAllGoalsWithout(@NotNull T mob, @NotNull GoalType type);
|
||||
+
|
||||
+ @NotNull
|
||||
+ <T extends Mob> Collection<Goal<T>> getRunningGoals(@NotNull T mob);
|
||||
+
|
||||
+ @NotNull
|
||||
+ <T extends Mob> Collection<Goal<T>> getRunningGoals(@NotNull T mob, @NotNull GoalType type);
|
||||
+
|
||||
+ @NotNull
|
||||
+ <T extends Mob> Collection<Goal<T>> getRunningGoalsWithout(@NotNull T mob, @NotNull GoalType type);
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..fb0c77c66ca117eaff9487a41f1e280afe6253c6
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -0,0 +1,288 @@
|
||||
+package com.destroystokyo.paper.entity.ai;
|
||||
+
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
+
|
||||
+import org.bukkit.NamespacedKey;
|
||||
+import org.bukkit.entity.*;
|
||||
+
|
||||
+/**
|
||||
+ * Represents a vanilla goal. Plugins should never implement this.<br>
|
||||
+ * Generated by VanillaPathfinderTest in paper-server
|
||||
+ */
|
||||
+public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
+
|
||||
+ GoalKey<Creature> AVOID_ENTITY = GoalKey.of(Creature.class, NamespacedKey.minecraft("avoid_entity"));
|
||||
+ GoalKey<Wolf> BEG = GoalKey.of(Wolf.class, NamespacedKey.minecraft("beg"));
|
||||
+ GoalKey<Mob> BREAK_DOOR = GoalKey.of(Mob.class, NamespacedKey.minecraft("break_door"));
|
||||
+ GoalKey<Creature> BREATH_AIR = GoalKey.of(Creature.class, NamespacedKey.minecraft("breath_air"));
|
||||
+ GoalKey<Animals> BREED = GoalKey.of(Animals.class, NamespacedKey.minecraft("breed"));
|
||||
+ GoalKey<Cat> CAT_LIE_ON_BED = GoalKey.of(Cat.class, NamespacedKey.minecraft("cat_lie_on_bed"));
|
||||
+ GoalKey<Cat> CAT_SIT_ON_BLOCK = GoalKey.of(Cat.class, NamespacedKey.minecraft("cat_sit_on_block"));
|
||||
+ GoalKey<Dolphin> DOLPHIN_JUMP = GoalKey.of(Dolphin.class, NamespacedKey.minecraft("dolphin_jump"));
|
||||
+ GoalKey<Mob> EAT_BLOCK = GoalKey.of(Mob.class, NamespacedKey.minecraft("eat_block"));
|
||||
+ GoalKey<Creature> FLEE_SUN = GoalKey.of(Creature.class, NamespacedKey.minecraft("flee_sun"));
|
||||
+ GoalKey<Mob> FLOAT = GoalKey.of(Mob.class, NamespacedKey.minecraft("float"));
|
||||
+ GoalKey<Creature> FOLLOW_BOAT = GoalKey.of(Creature.class, NamespacedKey.minecraft("follow_boat"));
|
||||
+ GoalKey<Fish> FOLLOW_FLOCK_LEADER = GoalKey.of(Fish.class, NamespacedKey.minecraft("follow_flock_leader"));
|
||||
+ GoalKey<Mob> FOLLOW_MOB = GoalKey.of(Mob.class, NamespacedKey.minecraft("follow_mob"));
|
||||
+ GoalKey<Tameable> FOLLOW_OWNER = GoalKey.of(Tameable.class, NamespacedKey.minecraft("follow_owner"));
|
||||
+ GoalKey<Animals> FOLLOW_PARENT = GoalKey.of(Animals.class, NamespacedKey.minecraft("follow_parent"));
|
||||
+ GoalKey<Creature> GOLEM_RANDOM_STROLL_IN_VILLAGE = GoalKey.of(Creature.class, NamespacedKey.minecraft("golem_random_stroll_in_village"));
|
||||
+ GoalKey<Mob> INTERACT = GoalKey.of(Mob.class, NamespacedKey.minecraft("interact"));
|
||||
+ GoalKey<Parrot> LAND_ON_OWNERS_SHOULDER = GoalKey.of(Parrot.class, NamespacedKey.minecraft("land_on_owners_shoulder"));
|
||||
+ GoalKey<Mob> LEAP_AT = GoalKey.of(Mob.class, NamespacedKey.minecraft("leap_at"));
|
||||
+ GoalKey<Llama> LLAMA_FOLLOW_CARAVAN = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_follow_caravan"));
|
||||
+ GoalKey<Mob> LOOK_AT_PLAYER = GoalKey.of(Mob.class, NamespacedKey.minecraft("look_at_player"));
|
||||
+ GoalKey<AbstractVillager> LOOK_AT_TRADING_PLAYER = GoalKey.of(AbstractVillager.class, NamespacedKey.minecraft("look_at_trading_player"));
|
||||
+ GoalKey<Creature> MELEE_ATTACK = GoalKey.of(Creature.class, NamespacedKey.minecraft("melee_attack"));
|
||||
+ GoalKey<Creature> MOVE_BACK_TO_VILLAGE = GoalKey.of(Creature.class, NamespacedKey.minecraft("move_back_to_village"));
|
||||
+ GoalKey<Creature> MOVE_THROUGH_VILLAGE = GoalKey.of(Creature.class, NamespacedKey.minecraft("move_through_village"));
|
||||
+ GoalKey<Creature> MOVE_TOWARDS_RESTRICTION = GoalKey.of(Creature.class, NamespacedKey.minecraft("move_towards_restriction"));
|
||||
+ GoalKey<Creature> MOVE_TOWARDS = GoalKey.of(Creature.class, NamespacedKey.minecraft("move_towards"));
|
||||
+ GoalKey<Mob> OCELOT_ATTACK = GoalKey.of(Mob.class, NamespacedKey.minecraft("ocelot_attack"));
|
||||
+ GoalKey<IronGolem> OFFER_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("offer_flower"));
|
||||
+ GoalKey<Mob> OPEN_DOOR = GoalKey.of(Mob.class, NamespacedKey.minecraft("open_door"));
|
||||
+ GoalKey<Creature> PANIC = GoalKey.of(Creature.class, NamespacedKey.minecraft("panic"));
|
||||
+ GoalKey<Raider> PATHFIND_TO_RAID = GoalKey.of(Raider.class, NamespacedKey.minecraft("pathfind_to_raid"));
|
||||
+ GoalKey<Mob> RANDOM_LOOK_AROUND = GoalKey.of(Mob.class, NamespacedKey.minecraft("random_look_around"));
|
||||
+ GoalKey<Creature> RANDOM_STROLL = GoalKey.of(Creature.class, NamespacedKey.minecraft("random_stroll"));
|
||||
+ GoalKey<Creature> RANDOM_SWIMMING = GoalKey.of(Creature.class, NamespacedKey.minecraft("random_swimming"));
|
||||
+ GoalKey<RangedEntity> RANGED_ATTACK = GoalKey.of(RangedEntity.class, NamespacedKey.minecraft("ranged_attack"));
|
||||
+ GoalKey<Monster> RANGED_BOW_ATTACK = GoalKey.of(Monster.class, NamespacedKey.minecraft("ranged_bow_attack"));
|
||||
+ GoalKey<Monster> RANGED_CROSSBOW_ATTACK = GoalKey.of(Monster.class, NamespacedKey.minecraft("ranged_crossbow_attack"));
|
||||
+ GoalKey<Creature> REMOVE_BLOCK = GoalKey.of(Creature.class, NamespacedKey.minecraft("remove_block"));
|
||||
+ GoalKey<Creature> RESTRICT_SUN = GoalKey.of(Creature.class, NamespacedKey.minecraft("restrict_sun"));
|
||||
+ GoalKey<AbstractHorse> RUN_AROUND_LIKE_CRAZY = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("run_around_like_crazy"));
|
||||
+ GoalKey<Tameable> SIT_WHEN_ORDERED_TO = GoalKey.of(Tameable.class, NamespacedKey.minecraft("sit_when_ordered_to"));
|
||||
+ GoalKey<Creature> STROLL_THROUGH_VILLAGE = GoalKey.of(Creature.class, NamespacedKey.minecraft("stroll_through_village"));
|
||||
+ GoalKey<Creeper> SWELL = GoalKey.of(Creeper.class, NamespacedKey.minecraft("swell"));
|
||||
+ GoalKey<Creature> TEMPT = GoalKey.of(Creature.class, NamespacedKey.minecraft("tempt"));
|
||||
+ GoalKey<AbstractVillager> TRADE_WITH_PLAYER = GoalKey.of(AbstractVillager.class, NamespacedKey.minecraft("trade_with_player"));
|
||||
+ GoalKey<Creature> TRY_FIND_WATER = GoalKey.of(Creature.class, NamespacedKey.minecraft("try_find_water"));
|
||||
+ GoalKey<Mob> USE_ITEM = GoalKey.of(Mob.class, NamespacedKey.minecraft("use_item"));
|
||||
+ GoalKey<Creature> WATER_AVOIDING_RANDOM_FLYING = GoalKey.of(Creature.class, NamespacedKey.minecraft("water_avoiding_random_flying"));
|
||||
+ GoalKey<Creature> WATER_AVOIDING_RANDOM_STROLL = GoalKey.of(Creature.class, NamespacedKey.minecraft("water_avoiding_random_stroll"));
|
||||
+ GoalKey<Zombie> ZOMBIE_ATTACK = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack"));
|
||||
+ GoalKey<IronGolem> DEFEND_VILLAGE = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("defend_village"));
|
||||
+ GoalKey<Creature> HURT_BY = GoalKey.of(Creature.class, NamespacedKey.minecraft("hurt_by"));
|
||||
+ GoalKey<Mob> NEAREST_ATTACKABLE = GoalKey.of(Mob.class, NamespacedKey.minecraft("nearest_attackable"));
|
||||
+ GoalKey<Raider> NEAREST_ATTACKABLE_WITCH = GoalKey.of(Raider.class, NamespacedKey.minecraft("nearest_attackable_witch"));
|
||||
+ GoalKey<Raider> NEAREST_HEALABLE_RAIDER = GoalKey.of(Raider.class, NamespacedKey.minecraft("nearest_healable_raider"));
|
||||
+ GoalKey<Tameable> NON_TAME_RANDOM = GoalKey.of(Tameable.class, NamespacedKey.minecraft("non_tame_random"));
|
||||
+ GoalKey<Tameable> OWNER_HURT_BY = GoalKey.of(Tameable.class, NamespacedKey.minecraft("owner_hurt_by"));
|
||||
+ GoalKey<Tameable> OWNER_HURT = GoalKey.of(Tameable.class, NamespacedKey.minecraft("owner_hurt"));
|
||||
+ GoalKey<Mob> RESET_UNIVERSAL_ANGER = GoalKey.of(Mob.class, NamespacedKey.minecraft("reset_universal_anger"));
|
||||
+ GoalKey<Fish> FISH_SWIM = GoalKey.of(Fish.class, NamespacedKey.minecraft("fish_swim"));
|
||||
+ GoalKey<Bee> BEE_ATTACK = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_attack"));
|
||||
+ GoalKey<Bee> BEE_BECOME_ANGRY = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_become_angry"));
|
||||
+ GoalKey<Bee> BEE_ENTER_HIVE = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_enter_hive"));
|
||||
+ GoalKey<Bee> BEE_GO_TO_HIVE = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_go_to_hive"));
|
||||
+ GoalKey<Bee> BEE_GO_TO_KNOWN_FLOWER = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_go_to_known_flower"));
|
||||
+ GoalKey<Bee> BEE_GROW_CROP = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_grow_crop"));
|
||||
+ GoalKey<Bee> BEE_HURT_BY_OTHER = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_hurt_by_other"));
|
||||
+ GoalKey<Bee> BEE_LOCATE_HIVE = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_locate_hive"));
|
||||
+ GoalKey<Bee> BEE_POLLINATE = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_pollinate"));
|
||||
+ GoalKey<Bee> BEE_WANDER = GoalKey.of(Bee.class, NamespacedKey.minecraft("bee_wander"));
|
||||
+ GoalKey<Cat> CAT_AVOID_ENTITY = GoalKey.of(Cat.class, NamespacedKey.minecraft("cat_avoid_entity"));
|
||||
+ GoalKey<Cat> CAT_RELAX_ON_OWNER = GoalKey.of(Cat.class, NamespacedKey.minecraft("cat_relax_on_owner"));
|
||||
+ GoalKey<Cat> CAT_TEMPT = GoalKey.of(Cat.class, NamespacedKey.minecraft("cat_tempt"));
|
||||
+ GoalKey<Dolphin> DOLPHIN_SWIM_TO_TREASURE = GoalKey.of(Dolphin.class, NamespacedKey.minecraft("dolphin_swim_to_treasure"));
|
||||
+ GoalKey<Dolphin> DOLPHIN_SWIM_WITH_PLAYER = GoalKey.of(Dolphin.class, NamespacedKey.minecraft("dolphin_swim_with_player"));
|
||||
+ GoalKey<Dolphin> PLAY_WITH_ITEMS = GoalKey.of(Dolphin.class, NamespacedKey.minecraft("play_with_items"));
|
||||
+ GoalKey<Fox> DEFEND_TRUSTED = GoalKey.of(Fox.class, NamespacedKey.minecraft("defend_trusted"));
|
||||
+ GoalKey<Fox> FACEPLANT = GoalKey.of(Fox.class, NamespacedKey.minecraft("faceplant"));
|
||||
+ GoalKey<Fox> FOX_BREED = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_breed"));
|
||||
+ GoalKey<Fox> FOX_EAT_BERRIES = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_eat_berries"));
|
||||
+ GoalKey<Fox> FOX_FLOAT = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_float"));
|
||||
+ GoalKey<Fox> FOX_FOLLOW_PARENT = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_follow_parent"));
|
||||
+ GoalKey<Fox> FOX_LOOK_AT_PLAYER = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_look_at_player"));
|
||||
+ GoalKey<Fox> FOX_MELEE_ATTACK = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_melee_attack"));
|
||||
+ GoalKey<Fox> FOX_PANIC = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_panic"));
|
||||
+ GoalKey<Fox> FOX_POUNCE = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_pounce"));
|
||||
+ GoalKey<Fox> FOX_SEARCH_FOR_ITEMS = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_search_for_items"));
|
||||
+ GoalKey<Fox> FOX_STROLL_THROUGH_VILLAGE = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_stroll_through_village"));
|
||||
+ GoalKey<Fox> PERCH_AND_SEARCH = GoalKey.of(Fox.class, NamespacedKey.minecraft("perch_and_search"));
|
||||
+ GoalKey<Fox> SEEK_SHELTER = GoalKey.of(Fox.class, NamespacedKey.minecraft("seek_shelter"));
|
||||
+ GoalKey<Fox> SLEEP = GoalKey.of(Fox.class, NamespacedKey.minecraft("sleep"));
|
||||
+ GoalKey<Fox> STALK_PREY = GoalKey.of(Fox.class, NamespacedKey.minecraft("stalk_prey"));
|
||||
+ GoalKey<Ocelot> OCELOT_AVOID_ENTITY = GoalKey.of(Ocelot.class, NamespacedKey.minecraft("ocelot_avoid_entity"));
|
||||
+ GoalKey<Ocelot> OCELOT_TEMPT = GoalKey.of(Ocelot.class, NamespacedKey.minecraft("ocelot_tempt"));
|
||||
+ GoalKey<Panda> PANDA_ATTACK = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_attack"));
|
||||
+ GoalKey<Panda> PANDA_AVOID = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_avoid"));
|
||||
+ GoalKey<Panda> PANDA_BREED = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_breed"));
|
||||
+ GoalKey<Panda> PANDA_HURT_BY = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_hurt_by"));
|
||||
+ GoalKey<Panda> PANDA_LIE_ON_BACK = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_lie_on_back"));
|
||||
+ GoalKey<Panda> PANDA_LOOK_AT_PLAYER = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_look_at_player"));
|
||||
+ GoalKey<Panda> PANDA_PANIC = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_panic"));
|
||||
+ GoalKey<Panda> PANDA_ROLL = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_roll"));
|
||||
+ GoalKey<Panda> PANDA_SIT = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_sit"));
|
||||
+ GoalKey<Panda> PANDA_SNEEZE = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_sneeze"));
|
||||
+ GoalKey<PolarBear> POLAR_BEAR_ATTACK_PLAYERS = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polar_bear_attack_players"));
|
||||
+ GoalKey<PolarBear> POLAR_BEAR_HURT_BY = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polar_bear_hurt_by"));
|
||||
+ GoalKey<PolarBear> POLAR_BEAR_MELEE_ATTACK = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polar_bear_melee_attack"));
|
||||
+ GoalKey<PolarBear> POLAR_BEAR_PANIC = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polar_bear_panic"));
|
||||
+ GoalKey<PufferFish> PUFFERFISH_PUFF = GoalKey.of(PufferFish.class, NamespacedKey.minecraft("pufferfish_puff"));
|
||||
+ GoalKey<Rabbit> EVIL_RABBIT_ATTACK = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("evil_rabbit_attack"));
|
||||
+ GoalKey<Rabbit> RABBIT_AVOID_ENTITY = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("rabbit_avoid_entity"));
|
||||
+ GoalKey<Rabbit> RABBIT_PANIC = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("rabbit_panic"));
|
||||
+ GoalKey<Rabbit> RAID_GARDEN = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("raid_garden"));
|
||||
+ GoalKey<Squid> SQUID_FLEE = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid_flee"));
|
||||
+ GoalKey<Squid> SQUID_RANDOM_MOVEMENT = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid_random_movement"));
|
||||
+ GoalKey<Turtle> TURTLE_BREED = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_breed"));
|
||||
+ GoalKey<Turtle> TURTLE_GO_HOME = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_go_home"));
|
||||
+ GoalKey<Turtle> TURTLE_GO_TO_WATER = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_go_to_water"));
|
||||
+ GoalKey<Turtle> TURTLE_LAY_EGG = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_lay_egg"));
|
||||
+ GoalKey<Turtle> TURTLE_PANIC = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_panic"));
|
||||
+ GoalKey<Turtle> TURTLE_RANDOM_STROLL = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_random_stroll"));
|
||||
+ GoalKey<Turtle> TURTLE_TRAVEL = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_travel"));
|
||||
+ GoalKey<Wolf> WOLF_AVOID_ENTITY = GoalKey.of(Wolf.class, NamespacedKey.minecraft("wolf_avoid_entity"));
|
||||
+ GoalKey<Llama> LLAMA_ATTACK_WOLF = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_attack_wolf"));
|
||||
+ GoalKey<Llama> LLAMA_HURT_BY = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_hurt_by"));
|
||||
+ GoalKey<SkeletonHorse> SKELETON_TRAP = GoalKey.of(SkeletonHorse.class, NamespacedKey.minecraft("skeleton_trap"));
|
||||
+ GoalKey<Llama> TRADER_LLAMA_DEFEND_WANDERING_TRADER = GoalKey.of(Llama.class, NamespacedKey.minecraft("trader_llama_defend_wandering_trader"));
|
||||
+ GoalKey<Wither> WITHER_DO_NOTHING = GoalKey.of(Wither.class, NamespacedKey.minecraft("wither_do_nothing"));
|
||||
+ GoalKey<Illager> RAIDER_OPEN_DOOR = GoalKey.of(Illager.class, NamespacedKey.minecraft("raider_open_door"));
|
||||
+ GoalKey<AbstractSkeleton> SKELETON_MELEE = GoalKey.of(AbstractSkeleton.class, NamespacedKey.minecraft("abstract_skeleton_melee"));
|
||||
+ GoalKey<Blaze> BLAZE_ATTACK = GoalKey.of(Blaze.class, NamespacedKey.minecraft("blaze_attack"));
|
||||
+ GoalKey<Drowned> DROWNED_ATTACK = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack"));
|
||||
+ GoalKey<Drowned> DROWNED_GO_TO_BEACH = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_go_to_beach"));
|
||||
+ GoalKey<Creature> DROWNED_GO_TO_WATER = GoalKey.of(Creature.class, NamespacedKey.minecraft("drowned_go_to_water"));
|
||||
+ GoalKey<Drowned> DROWNED_SWIM_UP = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_swim_up"));
|
||||
+ GoalKey<RangedEntity> DROWNED_TRIDENT_ATTACK = GoalKey.of(RangedEntity.class, NamespacedKey.minecraft("drowned_trident_attack"));
|
||||
+ GoalKey<Enderman> ENDERMAN_FREEZE_WHEN_LOOKED_AT = GoalKey.of(Enderman.class, NamespacedKey.minecraft("enderman_freeze_when_looked_at"));
|
||||
+ GoalKey<Enderman> ENDERMAN_LEAVE_BLOCK = GoalKey.of(Enderman.class, NamespacedKey.minecraft("enderman_leave_block"));
|
||||
+ GoalKey<Enderman> ENDERMAN_LOOK_FOR_PLAYER = GoalKey.of(Enderman.class, NamespacedKey.minecraft("enderman_look_for_player"));
|
||||
+ GoalKey<Enderman> ENDERMAN_TAKE_BLOCK = GoalKey.of(Enderman.class, NamespacedKey.minecraft("enderman_take_block"));
|
||||
+ GoalKey<Evoker> EVOKER_ATTACK_SPELL = GoalKey.of(Evoker.class, NamespacedKey.minecraft("evoker_attack_spell"));
|
||||
+ GoalKey<Evoker> EVOKER_CASTING_SPELL = GoalKey.of(Evoker.class, NamespacedKey.minecraft("evoker_casting_spell"));
|
||||
+ GoalKey<Evoker> EVOKER_SUMMON_SPELL = GoalKey.of(Evoker.class, NamespacedKey.minecraft("evoker_summon_spell"));
|
||||
+ GoalKey<Evoker> EVOKER_WOLOLO_SPELL = GoalKey.of(Evoker.class, NamespacedKey.minecraft("evoker_wololo_spell"));
|
||||
+ GoalKey<Ghast> GHAST_LOOK = GoalKey.of(Ghast.class, NamespacedKey.minecraft("ghast_look"));
|
||||
+ GoalKey<Ghast> GHAST_SHOOT_FIREBALL = GoalKey.of(Ghast.class, NamespacedKey.minecraft("ghast_shoot_fireball"));
|
||||
+ GoalKey<Ghast> RANDOM_FLOAT_AROUND = GoalKey.of(Ghast.class, NamespacedKey.minecraft("random_float_around"));
|
||||
+ GoalKey<Guardian> GUARDIAN_ATTACK = GoalKey.of(Guardian.class, NamespacedKey.minecraft("guardian_attack"));
|
||||
+ GoalKey<Illusioner> ILLUSIONER_BLINDNESS_SPELL = GoalKey.of(Illusioner.class, NamespacedKey.minecraft("illusioner_blindness_spell"));
|
||||
+ GoalKey<Illusioner> ILLUSIONER_MIRROR_SPELL = GoalKey.of(Illusioner.class, NamespacedKey.minecraft("illusioner_mirror_spell"));
|
||||
+ GoalKey<Raider> LONG_DISTANCE_PATROL = GoalKey.of(Raider.class, NamespacedKey.minecraft("long_distance_patrol"));
|
||||
+ GoalKey<Phantom> PHANTOM_ATTACK_PLAYER = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_attack_player"));
|
||||
+ GoalKey<Phantom> PHANTOM_ATTACK_STRATEGY = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_attack_strategy"));
|
||||
+ GoalKey<Phantom> PHANTOM_CIRCLE_AROUND_ANCHOR = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_circle_around_anchor"));
|
||||
+ GoalKey<Phantom> PHANTOM_SWEEP_ATTACK = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_sweep_attack"));
|
||||
+ GoalKey<Ravager> RAVAGER_MELEE_ATTACK = GoalKey.of(Ravager.class, NamespacedKey.minecraft("ravager_melee_attack"));
|
||||
+ GoalKey<Shulker> SHULKER_ATTACK = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_attack"));
|
||||
+ GoalKey<Shulker> SHULKER_DEFENSE_ATTACK = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_defense_attack"));
|
||||
+ GoalKey<Shulker> SHULKER_NEAREST_ATTACK = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_nearest_attack"));
|
||||
+ GoalKey<Shulker> SHULKER_PEEK = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_peek"));
|
||||
+ GoalKey<Silverfish> SILVERFISH_MERGE_WITH_STONE = GoalKey.of(Silverfish.class, NamespacedKey.minecraft("silverfish_merge_with_stone"));
|
||||
+ GoalKey<Silverfish> SILVERFISH_WAKE_UP_FRIENDS = GoalKey.of(Silverfish.class, NamespacedKey.minecraft("silverfish_wake_up_friends"));
|
||||
+ GoalKey<Slime> SLIME_ATTACK = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_attack"));
|
||||
+ GoalKey<Slime> SLIME_FLOAT = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_float"));
|
||||
+ GoalKey<Slime> SLIME_KEEP_ON_JUMPING = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_keep_on_jumping"));
|
||||
+ GoalKey<Slime> SLIME_RANDOM_DIRECTION = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_random_direction"));
|
||||
+ GoalKey<Spellcaster> SPELLCASTER_CASTING_SPELL = GoalKey.of(Spellcaster.class, NamespacedKey.minecraft("spellcaster_casting_spell"));
|
||||
+ GoalKey<Spider> SPIDER_ATTACK = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_attack"));
|
||||
+ GoalKey<Spider> SPIDER = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider"));
|
||||
+ GoalKey<Strider> STRIDER_GO_TO_LAVA = GoalKey.of(Strider.class, NamespacedKey.minecraft("strider_go_to_lava"));
|
||||
+ GoalKey<Vex> VEX_CHARGE_ATTACK = GoalKey.of(Vex.class, NamespacedKey.minecraft("vex_charge_attack"));
|
||||
+ GoalKey<Vex> VEX_COPY_OWNER = GoalKey.of(Vex.class, NamespacedKey.minecraft("vex_copy_owner"));
|
||||
+ GoalKey<Vex> VEX_RANDOM_MOVE = GoalKey.of(Vex.class, NamespacedKey.minecraft("vex_random_move"));
|
||||
+ GoalKey<Mob> VINDICATOR_BREAK_DOOR = GoalKey.of(Mob.class, NamespacedKey.minecraft("vindicator_break_door"));
|
||||
+ GoalKey<Vindicator> VINDICATOR_JOHNNY_ATTACK = GoalKey.of(Vindicator.class, NamespacedKey.minecraft("vindicator_johnny_attack"));
|
||||
+ GoalKey<Vindicator> VINDICATOR_MELEE_ATTACK = GoalKey.of(Vindicator.class, NamespacedKey.minecraft("vindicator_melee_attack"));
|
||||
+ GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_turtle_egg"));
|
||||
+ GoalKey<WanderingTrader> WANDER_TO_POSITION = GoalKey.of(WanderingTrader.class, NamespacedKey.minecraft("wander_to_position"));
|
||||
+ GoalKey<Raider> HOLD_GROUND_ATTACK = GoalKey.of(Raider.class, NamespacedKey.minecraft("hold_ground_attack"));
|
||||
+ GoalKey<Raider> OBTAIN_RAID_LEADER_BANNER = GoalKey.of(Raider.class, NamespacedKey.minecraft("obtain_raid_leader_banner"));
|
||||
+ GoalKey<Raider> RAIDER_CELEBRATION = GoalKey.of(Raider.class, NamespacedKey.minecraft("raider_celebration"));
|
||||
+ GoalKey<Raider> RAIDER_MOVE_THROUGH_VILLAGE = GoalKey.of(Raider.class, NamespacedKey.minecraft("raider_move_through_village"));
|
||||
+
|
||||
+ /**
|
||||
+ * @deprecated removed in 1.16
|
||||
+ */
|
||||
+ @Deprecated GoalKey<PigZombie> ANGER = GoalKey.of(PigZombie.class, NamespacedKey.minecraft("anger"));
|
||||
+ /**
|
||||
+ * @deprecated removed in 1.16
|
||||
+ */
|
||||
+ @Deprecated GoalKey<PigZombie> ANGER_OTHER = GoalKey.of(PigZombie.class, NamespacedKey.minecraft("anger_other"));
|
||||
+
|
||||
+ // the constants below use spigot names, they no longer work
|
||||
+ @Deprecated GoalKey<Blaze> BLAZE_FIREBALL = GoalKey.of(Blaze.class, NamespacedKey.minecraft("blaze_fireball"));
|
||||
+ @Deprecated GoalKey<Cat> TEMPT_CHANCE = GoalKey.of(Cat.class, NamespacedKey.minecraft("tempt_chance"));
|
||||
+ @Deprecated GoalKey<Dolphin> DOLPHIN_PLAY_WITH_ITEMS = GoalKey.of(Dolphin.class, NamespacedKey.minecraft("dolphin_play_with_items"));
|
||||
+ @Deprecated GoalKey<Drowned> DROWNED_GOTO_BEACH = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_goto_beach"));
|
||||
+ @Deprecated GoalKey<Creature> DROWNED_GOTO_WATER = GoalKey.of(Creature.class, NamespacedKey.minecraft("drowned_goto_water"));
|
||||
+ @Deprecated GoalKey<Enderman> ENDERMAN_PICKUP_BLOCK = GoalKey.of(Enderman.class, NamespacedKey.minecraft("enderman_pickup_block"));
|
||||
+ @Deprecated GoalKey<Enderman> ENDERMAN_PLACE_BLOCK = GoalKey.of(Enderman.class, NamespacedKey.minecraft("enderman_place_block"));
|
||||
+ @Deprecated GoalKey<Enderman> PLAYER_WHO_LOOKED_AT_TARGET = GoalKey.of(Enderman.class, NamespacedKey.minecraft("player_who_looked_at_target"));
|
||||
+ @Deprecated GoalKey<Evoker> EVOKER_CAST_SPELL = GoalKey.of(Evoker.class, NamespacedKey.minecraft("evoker_cast_spell"));
|
||||
+ @Deprecated GoalKey<Fox> FOX_DEFEND_TRUSTED = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_defend_trusted"));
|
||||
+ @Deprecated GoalKey<Fox> FOX_FACEPLANT = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_faceplant"));
|
||||
+ @Deprecated GoalKey<Fox> FOX_PERCH_AND_SEARCH = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_perch_and_search"));
|
||||
+ @Deprecated GoalKey<Fox> FOX_SLEEP = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_sleep"));
|
||||
+ @Deprecated GoalKey<Fox> FOX_SEEK_SHELTER = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_seek_shelter"));
|
||||
+ @Deprecated GoalKey<Fox> FOX_STALK_PREY = GoalKey.of(Fox.class, NamespacedKey.minecraft("fox_stalk_prey"));
|
||||
+ @Deprecated GoalKey<Ghast> GHAST_ATTACK_TARGET = GoalKey.of(Ghast.class, NamespacedKey.minecraft("ghast_attack_target"));
|
||||
+ @Deprecated GoalKey<Ghast> GHAST_IDLE_MOVE = GoalKey.of(Ghast.class, NamespacedKey.minecraft("ghast_idle_move"));
|
||||
+ @Deprecated GoalKey<Ghast> GHAST_MOVE_TOWARDS_TARGET = GoalKey.of(Ghast.class, NamespacedKey.minecraft("ghast_move_towards_target"));
|
||||
+ @Deprecated GoalKey<Spellcaster> SPELLCASTER_CAST_SPELL = GoalKey.of(Spellcaster.class, NamespacedKey.minecraft("spellcaster_cast_spell"));
|
||||
+ @Deprecated GoalKey<TraderLlama> LLAMATRADER_DEFENDED_WANDERING_TRADER = GoalKey.of(TraderLlama.class, NamespacedKey.minecraft("llamatrader_defended_wandering_trader"));
|
||||
+ @Deprecated GoalKey<Panda> PANDA_HURT_BY_TARGET = GoalKey.of(Panda.class, NamespacedKey.minecraft("panda_hurt_by_target"));
|
||||
+ @Deprecated GoalKey<PolarBear> POLARBEAR_ATTACK_PLAYERS = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polarbear_attack_players"));
|
||||
+ @Deprecated GoalKey<PolarBear> POLARBEAR_HURT_BY = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polarbear_hurt_by"));
|
||||
+ @Deprecated GoalKey<PolarBear> POLARBEAR_MELEE = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polarbear_melee"));
|
||||
+ @Deprecated GoalKey<PolarBear> POLARBEAR_PANIC = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polarbear_panic"));
|
||||
+ @Deprecated GoalKey<Rabbit> EAT_CARROTS = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("eat_carrots"));
|
||||
+ @Deprecated GoalKey<Rabbit> KILLER_RABBIT_MELEE_ATTACK = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("killer_rabbit_melee_attack"));
|
||||
+ @Deprecated GoalKey<Rabbit> RABBIT_AVOID_TARGET = GoalKey.of(Rabbit.class, NamespacedKey.minecraft("rabbit_avoid_target"));
|
||||
+ @Deprecated GoalKey<Raider> RAIDER_HOLD_GROUND = GoalKey.of(Raider.class, NamespacedKey.minecraft("raider_hold_ground"));
|
||||
+ @Deprecated GoalKey<Raider> RAIDER_OBTAIN_BANNER = GoalKey.of(Raider.class, NamespacedKey.minecraft("raider_obtain_banner"));
|
||||
+ @Deprecated GoalKey<Shulker> SHULKER_DEFENSE = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_defense"));
|
||||
+ @Deprecated GoalKey<Shulker> SHULKER_NEAREST = GoalKey.of(Shulker.class, NamespacedKey.minecraft("shulker_nearest"));
|
||||
+ @Deprecated GoalKey<Silverfish> SILVERFISH_HIDE_IN_BLOCK = GoalKey.of(Silverfish.class, NamespacedKey.minecraft("silverfish_hide_in_block"));
|
||||
+ @Deprecated GoalKey<Silverfish> SILVERFISH_WAKE_OTHERS = GoalKey.of(Silverfish.class, NamespacedKey.minecraft("silverfish_wake_others"));
|
||||
+ @Deprecated GoalKey<Slime> SLIME_IDLE = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_idle"));
|
||||
+ @Deprecated GoalKey<Slime> SLIME_NEAREST_PLAYER = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_nearest_player"));
|
||||
+ @Deprecated GoalKey<Slime> SLIME_RANDOM_JUMP = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_random_jump"));
|
||||
+ @Deprecated GoalKey<Spider> SPIDER_MELEE_ATTACK = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_melee_attack"));
|
||||
+ @Deprecated GoalKey<Spider> SPIDER_NEAREST_ATTACKABLE_TARGET = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_nearest_attackable_target"));
|
||||
+ @Deprecated GoalKey<Squid> SQUID = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid"));
|
||||
+ @Deprecated GoalKey<Turtle> TURTLE_GOTO_WATER = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_goto_water"));
|
||||
+ @Deprecated GoalKey<Turtle> TURTLE_TEMPT = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_tempt"));
|
||||
+ @Deprecated GoalKey<Vex> VEX_COPY_TARGET_OF_OWNER = GoalKey.of(Vex.class, NamespacedKey.minecraft("vex_copy_target_of_owner"));
|
||||
+ @Deprecated GoalKey<WanderingTrader> VILLAGERTRADER_WANDER_TO_POSITION = GoalKey.of(WanderingTrader.class, NamespacedKey.minecraft("villagertrader_wander_to_position"));
|
||||
+ @Deprecated GoalKey<RangedEntity> ARROW_ATTACK = GoalKey.of(RangedEntity.class, NamespacedKey.minecraft("arrow_attack"));
|
||||
+ @Deprecated GoalKey<Creature> AVOID_TARGET = GoalKey.of(Creature.class, NamespacedKey.minecraft("avoid_target"));
|
||||
+ @Deprecated GoalKey<Monster> BOW_SHOOT = GoalKey.of(Monster.class, NamespacedKey.minecraft("bow_shoot"));
|
||||
+ @Deprecated GoalKey<Creature> BREATH = GoalKey.of(Creature.class, NamespacedKey.minecraft("breath"));
|
||||
+ @Deprecated GoalKey<Cat> CAT_SIT_ON_BED = GoalKey.of(Cat.class, NamespacedKey.minecraft("cat_sit_on_bed"));
|
||||
+ @Deprecated GoalKey<Monster> CROSSBOW_ATTACK = GoalKey.of(Monster.class, NamespacedKey.minecraft("crossbow_attack"));
|
||||
+ @Deprecated GoalKey<Mob> DOOR_OPEN = GoalKey.of(Mob.class, NamespacedKey.minecraft("door_open"));
|
||||
+ @Deprecated GoalKey<Mob> EAT_TILE = GoalKey.of(Mob.class, NamespacedKey.minecraft("eat_tile"));
|
||||
+ @Deprecated GoalKey<Fish> FISH_SCHOOL = GoalKey.of(Fish.class, NamespacedKey.minecraft("fish_school"));
|
||||
+ @Deprecated GoalKey<Mob> FOLLOW_ENTITY = GoalKey.of(Mob.class, NamespacedKey.minecraft("follow_entity"));
|
||||
+ @Deprecated GoalKey<SkeletonHorse> HORSE_TRAP = GoalKey.of(SkeletonHorse.class, NamespacedKey.minecraft("horse_trap"));
|
||||
+ @Deprecated GoalKey<Creature> HURT_BY_TARGET = GoalKey.of(Creature.class, NamespacedKey.minecraft("hurt_by_target"));
|
||||
+ @Deprecated GoalKey<Cat> JUMP_ON_BLOCK = GoalKey.of(Cat.class, NamespacedKey.minecraft("jump_on_block"));
|
||||
+ @Deprecated GoalKey<Mob> LEAP_AT_TARGET = GoalKey.of(Mob.class, NamespacedKey.minecraft("leap_at_target"));
|
||||
+ @Deprecated GoalKey<Llama> LLAMA_FOLLOW = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_follow"));
|
||||
+ @Deprecated GoalKey<Creature> MOVE_TOWARDS_TARGET = GoalKey.of(Creature.class, NamespacedKey.minecraft("move_towards_target"));
|
||||
+ @Deprecated GoalKey<Mob> NEAREST_ATTACKABLE_TARGET = GoalKey.of(Mob.class, NamespacedKey.minecraft("nearest_attackable_target"));
|
||||
+ @Deprecated GoalKey<Raider> NEAREST_ATTACKABLE_TARGET_WITCH = GoalKey.of(Raider.class, NamespacedKey.minecraft("nearest_attackable_target_witch"));
|
||||
+ @Deprecated GoalKey<Creature> NEAREST_VILLAGE = GoalKey.of(Creature.class, NamespacedKey.minecraft("nearest_village"));
|
||||
+ @Deprecated GoalKey<Tameable> OWNER_HURT_BY_TARGET = GoalKey.of(Tameable.class, NamespacedKey.minecraft("owner_hurt_by_target"));
|
||||
+ @Deprecated GoalKey<Tameable> OWNER_HURT_TARGET = GoalKey.of(Tameable.class, NamespacedKey.minecraft("owner_hurt_target"));
|
||||
+ @Deprecated GoalKey<Parrot> PERCH = GoalKey.of(Parrot.class, NamespacedKey.minecraft("perch"));
|
||||
+ @Deprecated GoalKey<Raider> RAID = GoalKey.of(Raider.class, NamespacedKey.minecraft("raid"));
|
||||
+ @Deprecated GoalKey<Creature> RANDOM_FLY = GoalKey.of(Creature.class, NamespacedKey.minecraft("random_fly"));
|
||||
+ @Deprecated GoalKey<Mob> RANDOM_LOOKAROUND = GoalKey.of(Mob.class, NamespacedKey.minecraft("random_lookaround"));
|
||||
+ @Deprecated GoalKey<Creature> RANDOM_STROLL_LAND = GoalKey.of(Creature.class, NamespacedKey.minecraft("random_stroll_land"));
|
||||
+ @Deprecated GoalKey<Creature> RANDOM_SWIM = GoalKey.of(Creature.class, NamespacedKey.minecraft("random_swim"));
|
||||
+ @Deprecated GoalKey<Tameable> RANDOM_TARGET_NON_TAMED = GoalKey.of(Tameable.class, NamespacedKey.minecraft("random_target_non_tamed"));
|
||||
+ @Deprecated GoalKey<Tameable> SIT = GoalKey.of(Tameable.class, NamespacedKey.minecraft("sit"));
|
||||
+ @Deprecated GoalKey<Creature> STROLL_VILLAGE = GoalKey.of(Creature.class, NamespacedKey.minecraft("stroll_village"));
|
||||
+ @Deprecated GoalKey<AbstractHorse> TAME = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("tame"));
|
||||
+ @Deprecated GoalKey<Creature> WATER = GoalKey.of(Creature.class, NamespacedKey.minecraft("water"));
|
||||
+ @Deprecated GoalKey<Dolphin> WATER_JUMP = GoalKey.of(Dolphin.class, NamespacedKey.minecraft("water_jump"));
|
||||
+ @Deprecated GoalKey<Creature> STROLL_VILLAGE_GOLEM = GoalKey.of(Creature.class, NamespacedKey.minecraft("stroll_village_golem"));
|
||||
+ @Deprecated GoalKey<Mob> UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset"));
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 796f72b1026371fff09e8ce60536d30609987449..84dc57bc02d1496afc3fe3df0b94417079c2ee6b 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2007,6 +2007,16 @@ public final class Bukkit {
|
||||
public static boolean isStopping() {
|
||||
return server.isStopping();
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the {@link com.destroystokyo.paper.entity.ai.MobGoals} manager
|
||||
+ *
|
||||
+ * @return the mob goals manager
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public static com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
|
||||
+ return server.getMobGoals();
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
@NotNull
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 552b56995ffb0898ffd459e0175af57341f39f46..3633fcb9155e35479005bfa0c13661b1c9fa726a 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1761,5 +1761,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
* @return true if server is in the process of being shutdown
|
||||
*/
|
||||
boolean isStopping();
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the {@link com.destroystokyo.paper.entity.ai.MobGoals} manager
|
||||
+ *
|
||||
+ * @return the mob goals manager
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ com.destroystokyo.paper.entity.ai.MobGoals getMobGoals();
|
||||
// Paper end
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
||||
Date: Fri, 1 May 2020 17:39:02 +0300
|
||||
Subject: [PATCH] Expose game version
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index ea67d9e95f0c9ca0b0ae3afba67563e43743abec..396e3e32e71a310702cb5d8138e1ee378656d10e 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -119,6 +119,18 @@ public final class Bukkit {
|
||||
return server.getBukkitVersion();
|
||||
}
|
||||
|
||||
+ // Paper start - expose game version
|
||||
+ /**
|
||||
+ * Gets the version of game this server implements
|
||||
+ *
|
||||
+ * @return version of game
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public static String getMinecraftVersion() {
|
||||
+ return server.getMinecraftVersion();
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Gets a view of all currently logged in players. This {@linkplain
|
||||
* Collections#unmodifiableCollection(Collection) view} is a reused
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 451a75c2716b23ca61ff53927d594034493da359..f9fe3c20b749acf89c7ea78e73a11a96448940d7 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -98,6 +98,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@NotNull
|
||||
public String getBukkitVersion();
|
||||
|
||||
+ // Paper start - expose game version
|
||||
+ /**
|
||||
+ * Gets the version of game this server implements
|
||||
+ *
|
||||
+ * @return version of game
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ String getMinecraftVersion();
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Gets a view of all currently logged in players. This {@linkplain
|
||||
* Collections#unmodifiableCollection(Collection) view} is a reused
|
|
@ -1,177 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
Date: Wed, 22 Apr 2020 23:13:49 +0200
|
||||
Subject: [PATCH] Add villager reputation API
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/villager/Reputation.java b/src/main/java/com/destroystokyo/paper/entity/villager/Reputation.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..1cc9ef255df888cb7dd7f7f2c5014e818d1be613
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/villager/Reputation.java
|
||||
@@ -0,0 +1,54 @@
|
||||
+package com.destroystokyo.paper.entity.villager;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import java.util.Map;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * A reputation score for a player on a villager.
|
||||
+ */
|
||||
+public final class Reputation {
|
||||
+ private static final ReputationType[] REPUTATION_TYPES = ReputationType.values(); // Avoid allocation
|
||||
+ @NotNull
|
||||
+ private final int[] reputation;
|
||||
+
|
||||
+ public Reputation() {
|
||||
+ this(new int[REPUTATION_TYPES.length]);
|
||||
+ }
|
||||
+
|
||||
+ // Package level to avoid plugins creating reputations with "magic values".
|
||||
+ Reputation(@NotNull int[] reputation) {
|
||||
+ this.reputation = reputation;
|
||||
+ }
|
||||
+
|
||||
+ public Reputation(@NotNull final Map<ReputationType, Integer> reputation) {
|
||||
+ this();
|
||||
+ Preconditions.checkNotNull(reputation, "reputation cannot be null");
|
||||
+
|
||||
+ for (Map.Entry<ReputationType, Integer> entry : reputation.entrySet()) {
|
||||
+ setReputation(entry.getKey(), entry.getValue());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the reputation value for a specific {@link ReputationType}.
|
||||
+ *
|
||||
+ * @param type The {@link ReputationType type} of reputation to get.
|
||||
+ * @return The value of the {@link ReputationType type}.
|
||||
+ */
|
||||
+ public int getReputation(@NotNull ReputationType type) {
|
||||
+ Preconditions.checkNotNull(type, "the reputation type cannot be null");
|
||||
+ return reputation[type.ordinal()];
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the reputation value for a specific {@link ReputationType}.
|
||||
+ *
|
||||
+ * @param type The {@link ReputationType type} of reputation to set.
|
||||
+ * @param value The value of the {@link ReputationType type}.
|
||||
+ */
|
||||
+ public void setReputation(@NotNull ReputationType type, int value) {
|
||||
+ Preconditions.checkNotNull(type, "the reputation type cannot be null");
|
||||
+ reputation[type.ordinal()] = value;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/villager/ReputationType.java b/src/main/java/com/destroystokyo/paper/entity/villager/ReputationType.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5600fcdc9795a9f49091db48d73bbd4964b8b737
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/villager/ReputationType.java
|
||||
@@ -0,0 +1,36 @@
|
||||
+package com.destroystokyo.paper.entity.villager;
|
||||
+
|
||||
+/**
|
||||
+ * A type of reputation gained with a {@link org.bukkit.entity.Villager Villager}.
|
||||
+ * <p>
|
||||
+ * All types but {@link #MAJOR_POSITIVE} are shared to other villagers.
|
||||
+ */
|
||||
+public enum ReputationType {
|
||||
+ /**
|
||||
+ * A gossip with a majorly negative effect. This is only gained through killing a nearby
|
||||
+ * villager.
|
||||
+ */
|
||||
+ MAJOR_NEGATIVE,
|
||||
+
|
||||
+ /**
|
||||
+ * A gossip with a minor negative effect. This is only gained through damaging a villager.
|
||||
+ */
|
||||
+ MINOR_NEGATIVE,
|
||||
+
|
||||
+ /**
|
||||
+ * A gossip with a minor positive effect. This is only gained through curing a zombie
|
||||
+ * villager.
|
||||
+ */
|
||||
+ MINOR_POSITIVE,
|
||||
+
|
||||
+ /**
|
||||
+ * A gossip with a major positive effect. This is only gained through curing a zombie
|
||||
+ * villager.
|
||||
+ */
|
||||
+ MAJOR_POSITIVE,
|
||||
+
|
||||
+ /**
|
||||
+ * A gossip with a minor positive effect. This is only gained through trading with a villager.
|
||||
+ */
|
||||
+ TRADING,
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
||||
index ef8a81c4857bd06be19264580bf3a7e087118f5c..511b96841f7342d0a6b38d7cff56252ea8ef9bfe 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -1,10 +1,13 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import java.util.Locale;
|
||||
+import java.util.Map; // Paper
|
||||
+import java.util.UUID; // Paper
|
||||
import org.bukkit.Keyed;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable; // Paper
|
||||
|
||||
/**
|
||||
* Represents a villager NPC
|
||||
@@ -229,4 +232,50 @@ public interface Villager extends AbstractVillager {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Paper start - Add villager reputation API
|
||||
+ /**
|
||||
+ * Get the {@link com.destroystokyo.paper.entity.villager.Reputation reputation}
|
||||
+ * for a specific player by {@link UUID}.
|
||||
+ *
|
||||
+ * @param uniqueId The {@link UUID} of the player to get the reputation of.
|
||||
+ * @return The player's copied reputation with this villager.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public com.destroystokyo.paper.entity.villager.Reputation getReputation(@NotNull UUID uniqueId);
|
||||
+
|
||||
+ /**
|
||||
+ * Get all {@link com.destroystokyo.paper.entity.villager.Reputation reputations}
|
||||
+ * for all players mapped by their {@link UUID unique IDs}.
|
||||
+ *
|
||||
+ * @return All {@link com.destroystokyo.paper.entity.villager.Reputation reputations} for all players
|
||||
+ * in a copied map.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Map<UUID, com.destroystokyo.paper.entity.villager.Reputation> getReputations();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the {@link com.destroystokyo.paper.entity.villager.Reputation reputation}
|
||||
+ * for a specific player by {@link UUID}.
|
||||
+ *
|
||||
+ * @param uniqueId The {@link UUID} of the player to set the reputation of.
|
||||
+ * @param reputation The {@link com.destroystokyo.paper.entity.villager.Reputation reputation} to set.
|
||||
+ */
|
||||
+ public void setReputation(@NotNull UUID uniqueId, @NotNull com.destroystokyo.paper.entity.villager.Reputation reputation);
|
||||
+
|
||||
+ /**
|
||||
+ * Set all {@link com.destroystokyo.paper.entity.villager.Reputation reputations}
|
||||
+ * for all players mapped by their {@link UUID unique IDs}.
|
||||
+ *
|
||||
+ * @param reputations All {@link com.destroystokyo.paper.entity.villager.Reputation reputations}
|
||||
+ * for all players mapped by their {@link UUID unique IDs}.
|
||||
+ */
|
||||
+ public void setReputations(@NotNull Map<UUID, com.destroystokyo.paper.entity.villager.Reputation> reputations);
|
||||
+
|
||||
+ /**
|
||||
+ * Clear all reputations from this villager. This removes every single
|
||||
+ * reputation regardless of its impact and the player associated.
|
||||
+ */
|
||||
+ public void clearReputations();
|
||||
+ // Paper end
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 10 Apr 2014 23:18:28 -0400
|
||||
Subject: [PATCH] Spawn Reason API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index e285d54450471ed22e12e77c7b829fde6b564ede..35e407ec7bd8d5cd38069fe7f2cf3d9d3bc94cbe 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.util.Consumer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -288,7 +289,34 @@ public interface RegionAccessor {
|
||||
* {@link Entity} requested cannot be spawned
|
||||
*/
|
||||
@NotNull
|
||||
- <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function) throws IllegalArgumentException;
|
||||
+ // Paper start
|
||||
+ public default <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function) throws IllegalArgumentException {
|
||||
+ return spawn(location, clazz, CreatureSpawnEvent.SpawnReason.CUSTOM, function);
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @NotNull CreatureSpawnEvent.SpawnReason reason) throws IllegalArgumentException {
|
||||
+ return spawn(location, clazz, reason, null);
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public default <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @NotNull CreatureSpawnEvent.SpawnReason reason, @Nullable Consumer<T> function) throws IllegalArgumentException {
|
||||
+ return spawn(location, clazz, function, reason);
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public default Entity spawnEntity(@NotNull Location loc, @NotNull org.bukkit.entity.EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason) {
|
||||
+ return spawn(loc, (Class<Entity>) type.getEntityClass(), reason, null);
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public default Entity spawnEntity(@NotNull Location loc, @NotNull org.bukkit.entity.EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason, @Nullable Consumer<Entity> function) {
|
||||
+ return spawn(loc, (Class<Entity>) type.getEntityClass(), reason, function);
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function, @NotNull CreatureSpawnEvent.SpawnReason reason) throws IllegalArgumentException;
|
||||
+ // Paper end
|
||||
|
||||
/**
|
||||
* Creates a new entity at the given {@link Location} with the supplied
|
|
@ -1,33 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Sun, 10 May 2020 23:06:41 -0400
|
||||
Subject: [PATCH] Potential bed API
|
||||
|
||||
Adds a new method to fetch the location of a player's bed without generating any sync loads.
|
||||
|
||||
getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
index 1d573d33304e9c15a9949af68dab0626ae04dce4..9cb7a9b1e1d7c20760a54bdf6aea346828ad8fc7 100644
|
||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
@@ -245,6 +245,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
*/
|
||||
public int getSleepTicks();
|
||||
|
||||
+
|
||||
+ // Paper start - Potential bed api
|
||||
+ /**
|
||||
+ * Gets the Location of the player's bed, null if they have not slept
|
||||
+ * in one. This method will not attempt to validate if the current bed
|
||||
+ * is still valid.
|
||||
+ *
|
||||
+ * @return Bed Location if has slept in one, otherwise null.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getPotentialBedLocation();
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Attempts to make the entity sleep at the given location.
|
||||
* <br>
|
Loading…
Add table
Add a link
Reference in a new issue