aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0437-Add-UUID-attribute-modifier-API.patch
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2024-05-09 14:51:33 +0100
committerShane Freeder <[email protected]>2024-05-09 14:51:33 +0100
commit3693bbdc6b65e68db10375d3eeab70f06708b729 (patch)
tree4a71a5e6e5f50b3e2937053a5d4b4196ef67665b /patches/api/0437-Add-UUID-attribute-modifier-API.patch
parentf2512b12385961f8ca1f69efebe5ed0e00c0caa8 (diff)
downloadPaper-3693bbdc6b65e68db10375d3eeab70f06708b729.tar.gz
Paper-3693bbdc6b65e68db10375d3eeab70f06708b729.zip
Use internals for getting block/entity countstimings/use-internals
For a long time I've been meaning to move some of this logic internally as this would allow us to avoid hitting systems like block state snapshots which can create issues as many of the spigot implementations of this stuff are increasingly broken, leading to unexpected crashes during ticking, even if the API cannot properly interact with these such states/items, it's generally more preferable to not crash the server in the course, and just let those interactions fail more gracefully.
Diffstat (limited to 'patches/api/0437-Add-UUID-attribute-modifier-API.patch')
-rw-r--r--patches/api/0437-Add-UUID-attribute-modifier-API.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/patches/api/0437-Add-UUID-attribute-modifier-API.patch b/patches/api/0437-Add-UUID-attribute-modifier-API.patch
new file mode 100644
index 0000000000..251ae6e425
--- /dev/null
+++ b/patches/api/0437-Add-UUID-attribute-modifier-API.patch
@@ -0,0 +1,34 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: TonytheMacaroni <[email protected]>
+Date: Thu, 9 Nov 2023 20:35:35 -0500
+Subject: [PATCH] Add UUID attribute modifier API
+
+
+diff --git a/src/main/java/org/bukkit/attribute/AttributeInstance.java b/src/main/java/org/bukkit/attribute/AttributeInstance.java
+index 5513174ea545bb5b4fdc028cbaa4c1bb763e2c6d..3cffffe8106387847b10ac39f96687bb075ef686 100644
+--- a/src/main/java/org/bukkit/attribute/AttributeInstance.java
++++ b/src/main/java/org/bukkit/attribute/AttributeInstance.java
+@@ -39,6 +39,23 @@ public interface AttributeInstance {
+ @NotNull
+ Collection<AttributeModifier> getModifiers();
+
++ // Paper start
++ /**
++ * Gets the modifier with the corresponding UUID.
++ *
++ * @param uuid the UUID of the modifier
++ * @return the modifier, if it exists
++ */
++ @org.jetbrains.annotations.Nullable AttributeModifier getModifier(@NotNull java.util.UUID uuid);
++
++ /**
++ * Remove a modifier with the corresponding UUID from this instance.
++ *
++ * @param uuid the UUID of the modifier
++ */
++ void removeModifier(@NotNull java.util.UUID uuid);
++ // Paper end
++
+ /**
+ * Add a modifier to this instance.
+ *