mirror of https://github.com/PaperMC/Paper.git
33 lines
1.4 KiB
Diff
33 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Fri, 20 Aug 2021 13:03:55 -0700
|
|
Subject: [PATCH] Get entity default attributes
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java
|
|
index a086c3472fa12667e5ca9276a201dbd731101602..9f7430282d1d7f5967ea281101d92377b3fcf5a9 100644
|
|
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
|
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
|
@@ -488,4 +488,21 @@ public abstract class EntityType<E extends Entity> extends OldEnum<EntityType<E>
|
|
public boolean isEnabledByFeature(@NotNull World world) {
|
|
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
|
}
|
|
+
|
|
+ // Paper start - default EntityType attributes API
|
|
+ /**
|
|
+ * Checks if the entity has default attributes.
|
|
+ *
|
|
+ * @return true if it has default attributes
|
|
+ */
|
|
+ public abstract boolean hasDefaultAttributes();
|
|
+
|
|
+ /**
|
|
+ * Gets the default attributes for the entity.
|
|
+ *
|
|
+ * @return an unmodifiable instance of Attributable for reading default attributes.
|
|
+ * @throws IllegalArgumentException if the entity does not exist of have default attributes (use {@link #hasDefaultAttributes()} first)
|
|
+ */
|
|
+ public abstract @NotNull org.bukkit.attribute.Attributable getDefaultAttributes();
|
|
+ // Paper end
|
|
}
|