mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 18:37:35 +01:00
Add AttributeModifier constructor without EquipmentSlotGroup (#11079)
This commit is contained in:
parent
99ae7bbc97
commit
9fd5b3cfbd
patches/api
0053-Fix-upstream-javadocs.patch0396-Add-method-to-remove-all-active-potion-effects.patch0396-Add-transient-modifier-API.patch0397-Folia-scheduler-and-owned-region-API.patch0398-Add-event-for-player-editing-sign.patch0399-Add-Sign-getInteractableSideFor.patch0400-Fix-BanList-API.patch0401-Add-whitelist-events.patch0402-API-for-updating-recipes-on-clients.patch0403-Add-PlayerFailMoveEvent.patch0404-Fix-custom-statistic-criteria-creation.patch0405-SculkCatalyst-bloom-API.patch0406-API-for-an-entity-s-scoreboard-name.patch0407-Deprecate-and-replace-methods-with-old-StructureType.patch0408-Add-Listing-API-for-Player.patch0409-Expose-clicked-BlockFace-during-BlockDamageEvent.patch0410-Fix-NPE-on-Boat-getStatus.patch0411-Expand-Pose-API.patch0412-MerchantRecipe-add-copy-constructor.patch0413-More-DragonBattle-API.patch0414-Add-PlayerPickItemEvent.patch0415-Allow-trident-custom-damage.patch0416-Expose-hand-during-BlockCanBuildEvent.patch0417-Limit-setBurnTime-to-valid-short-values.patch0418-Add-OfflinePlayer-isConnected.patch0419-Add-titleOverride-to-InventoryOpenEvent.patch0420-Allow-proper-checking-of-empty-item-stacks.patch0421-Fix-PlayerSwapHandItemsEvent-throwing-exception-when.patch0422-Add-player-idle-duration-API.patch0423-Add-API-to-get-the-collision-shape-of-a-block-before.patch0424-Add-predicate-for-blocks-when-raytracing.patch0425-Add-hand-to-fish-event-for-all-player-interactions.patch0426-Attribute-Modifier-API-improvements.patch0427-Expand-LingeringPotion-API.patch0428-Remove-unnecessary-durability-check-in-ItemStack-isS.patch0429-Add-Structure-check-API.patch0430-Experimental-annotations-change.patch0431-Add-more-scoreboard-API.patch0432-Improve-Registry.patch0433-Add-experience-points-API.patch0434-Add-missing-InventoryType.patch0435-Add-drops-to-shear-events.patch0436-Add-HiddenPotionEffect-API.patch0437-Add-PlayerShieldDisableEvent.patch0438-Return-null-for-empty-String-in-NamespacedKey.fromSt.patch0439-Add-BlockStateMeta-clearBlockState.patch0440-Expose-LootTable-of-DecoratedPot.patch0441-Add-ShulkerDuplicateEvent.patch0442-Add-api-for-spawn-egg-texture-colors.patch0443-Add-Lifecycle-Event-system.patch0444-ItemStack-Tooltip-API.patch0445-Add-getChunkSnapshot-includeLightData-parameter.patch0446-Add-FluidState-API.patch0447-add-number-format-api.patch0448-improve-BanList-types.patch0449-Suspicious-Effect-Entry-API.patch0450-Fix-DamageSource-API.patch0451-Expanded-Hopper-API.patch0452-Clone-mutables-to-prevent-unexpected-issues.patch0453-Add-BlockBreakProgressUpdateEvent.patch0454-Deprecate-ItemStack-setType.patch0455-Item-Mutation-Fixes.patch0456-API-for-checking-sent-chunks.patch0457-Add-CartographyItemEvent.patch0458-More-Raid-API.patch0459-Fix-SpawnerEntry-Equipment-API.patch0460-Fix-ItemFlags.patch0461-Allow-modifying-library-loader-jars-bytecode.patch0462-Add-hook-to-remap-library-jars.patch0463-Add-GameMode-isInvulnerable.patch0464-Expose-hasColor-to-leather-armor.patch0465-Add-missing-wind-charge-damage-type.patch0466-Added-API-to-get-player-ha-proxy-address.patch0467-More-Chest-Block-API.patch0468-Brigadier-based-command-API.patch0469-Fix-issues-with-recipe-API.patch0470-Fix-equipment-slot-and-group-API.patch0471-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch0472-General-ItemMeta-fixes.patch0473-Add-missing-fishing-event-state.patch0474-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch0475-Registry-Modification-API.patch0476-Introduce-registry-entry-and-builders.patch0477-Proxy-ItemStack-to-CraftItemStack.patch0478-Make-a-PDC-view-accessible-directly-from-ItemStack.patch
@ -185,6 +185,20 @@ index 9885fd1adc1f93a80d650e6d42dfa3a0b084db9f..c4f2f03ec31998d486dad1d45ef83df3
|
||||
* temporarily freezing while locating an unexplored structure.
|
||||
* <p>
|
||||
* The {@code radius} is not a rigid square radius. Each structure may alter
|
||||
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
index d66502c9df2592cd18694481e7e90a71a5c3a359..ee39c0b83e558681e8b006172d34c98e2c83cda2 100644
|
||||
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
@@ -117,8 +117,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||
}
|
||||
|
||||
/**
|
||||
- * Get the {@link EquipmentSlot} this AttributeModifier is active on,
|
||||
- * or null if this modifier is applicable for any slot.
|
||||
+ * Get the {@link EquipmentSlotGroup} this AttributeModifier is active on.
|
||||
*
|
||||
* @return the slot
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/block/Bed.java b/src/main/java/org/bukkit/block/Bed.java
|
||||
index f9bd74f9ce6bd6650726e5a993f9b6e292cdc74d..f4c37ce1fe7aac3dde8485ee51fc8888ed56e79e 100644
|
||||
--- a/src/main/java/org/bukkit/block/Bed.java
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Malfrador <malfrador@gmail.com>
|
||||
Date: Wed, 31 May 2023 21:25:01 +0200
|
||||
Subject: [PATCH] Add transient modifier API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/attribute/AttributeInstance.java b/src/main/java/org/bukkit/attribute/AttributeInstance.java
|
||||
index f08ee26cc4d479e1bfc5264b8cbe721315de91f2..5513174ea545bb5b4fdc028cbaa4c1bb763e2c6d 100644
|
||||
--- a/src/main/java/org/bukkit/attribute/AttributeInstance.java
|
||||
+++ b/src/main/java/org/bukkit/attribute/AttributeInstance.java
|
||||
@@ -46,6 +46,16 @@ public interface AttributeInstance {
|
||||
*/
|
||||
void addModifier(@NotNull AttributeModifier modifier);
|
||||
|
||||
+ // Paper start - Transient modifier API
|
||||
+ /**
|
||||
+ * Add a transient modifier to this instance.
|
||||
+ * Transient modifiers are not persisted (saved with the NBT data)
|
||||
+ *
|
||||
+ * @param modifier to add
|
||||
+ */
|
||||
+ void addTransientModifier(@NotNull AttributeModifier modifier);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Remove a modifier from this instance.
|
||||
*
|
@ -1,11 +1,12 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: TonytheMacaroni <tonythemacaroni123@gmail.com>
|
||||
Date: Thu, 9 Nov 2023 20:35:35 -0500
|
||||
Subject: [PATCH] Add UUID attribute modifier API
|
||||
Subject: [PATCH] Attribute Modifier API improvements
|
||||
|
||||
Co-authored-by: Malfrador <malfrador@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/attribute/AttributeInstance.java b/src/main/java/org/bukkit/attribute/AttributeInstance.java
|
||||
index 5513174ea545bb5b4fdc028cbaa4c1bb763e2c6d..f1fa86ddf1f50a357c9e94cc61261d8c96a2da6f 100644
|
||||
index f08ee26cc4d479e1bfc5264b8cbe721315de91f2..f1fa86ddf1f50a357c9e94cc61261d8c96a2da6f 100644
|
||||
--- a/src/main/java/org/bukkit/attribute/AttributeInstance.java
|
||||
+++ b/src/main/java/org/bukkit/attribute/AttributeInstance.java
|
||||
@@ -39,6 +39,42 @@ public interface AttributeInstance {
|
||||
@ -51,11 +52,28 @@ index 5513174ea545bb5b4fdc028cbaa4c1bb763e2c6d..f1fa86ddf1f50a357c9e94cc61261d8c
|
||||
/**
|
||||
* Add a modifier to this instance.
|
||||
*
|
||||
@@ -46,6 +82,16 @@ public interface AttributeInstance {
|
||||
*/
|
||||
void addModifier(@NotNull AttributeModifier modifier);
|
||||
|
||||
+ // Paper start - Transient modifier API
|
||||
+ /**
|
||||
+ * Add a transient modifier to this instance.
|
||||
+ * Transient modifiers are not persisted (saved with the NBT data)
|
||||
+ *
|
||||
+ * @param modifier to add
|
||||
+ */
|
||||
+ void addTransientModifier(@NotNull AttributeModifier modifier);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Remove a modifier from this instance.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
index d66502c9df2592cd18694481e7e90a71a5c3a359..90f18f355a6a236a7e4273cc1258e7c8034b8276 100644
|
||||
index c6b8700d258b859d246118868167497397010292..3808f76d49e24c20156c013f68e00efa9351f1a3 100644
|
||||
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
@@ -25,22 +25,22 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||
@@ -25,26 +25,32 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||
private final Operation operation;
|
||||
private final EquipmentSlotGroup slot;
|
||||
|
||||
@ -82,7 +100,17 @@ index d66502c9df2592cd18694481e7e90a71a5c3a359..90f18f355a6a236a7e4273cc1258e7c8
|
||||
public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull Operation operation, @NotNull EquipmentSlotGroup slot) {
|
||||
this(NamespacedKey.fromString(uuid.toString()), amount, operation, slot);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||
|
||||
+ // Paper start - Add constructor without EquipmentSlotGroup
|
||||
+ public AttributeModifier(@NotNull NamespacedKey key, double amount, @NotNull Operation operation) {
|
||||
+ this(key, amount, operation, EquipmentSlotGroup.ANY);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public AttributeModifier(@NotNull NamespacedKey key, double amount, @NotNull Operation operation, @NotNull EquipmentSlotGroup slot) {
|
||||
Preconditions.checkArgument(key != null, "Key cannot be null");
|
||||
Preconditions.checkArgument(operation != null, "Operation cannot be null");
|
||||
@@ -63,7 +69,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||
* @deprecated attributes are now identified by keys
|
||||
*/
|
||||
@NotNull
|
@ -10,10 +10,10 @@ Adds the following:
|
||||
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
index 90f18f355a6a236a7e4273cc1258e7c8034b8276..a0750d457a9cd7cf3ab9c45bb28ce5a2aef35298 100644
|
||||
index 3808f76d49e24c20156c013f68e00efa9351f1a3..e14b64d3b178791dacc7849e97f2ed95f1919c55 100644
|
||||
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
|
||||
@@ -112,6 +112,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||
@@ -118,6 +118,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
|
||||
*/
|
||||
@Nullable
|
||||
@Deprecated
|
Loading…
Reference in New Issue
Block a user