Commits
md_5 authored b93194d14a2
1 1 | package org.bukkit.attribute; |
2 2 | |
3 + | import com.google.common.base.Preconditions; |
3 4 | import java.util.HashMap; |
4 5 | import java.util.Map; |
5 6 | import java.util.Objects; |
6 7 | import java.util.UUID; |
7 - | import org.apache.commons.lang.Validate; |
8 8 | import org.bukkit.configuration.serialization.ConfigurationSerializable; |
9 9 | import org.bukkit.inventory.EquipmentSlot; |
10 10 | import org.bukkit.util.NumberConversions; |
11 11 | import org.jetbrains.annotations.NotNull; |
12 12 | import org.jetbrains.annotations.Nullable; |
13 13 | |
14 14 | /** |
15 15 | * Concrete implementation of an attribute modifier. |
16 16 | */ |
17 17 | public class AttributeModifier implements ConfigurationSerializable { |
24 24 | |
25 25 | public AttributeModifier( String name, double amount, Operation operation) { |
26 26 | this(UUID.randomUUID(), name, amount, operation); |
27 27 | } |
28 28 | |
29 29 | public AttributeModifier( UUID uuid, String name, double amount, Operation operation) { |
30 30 | this(uuid, name, amount, operation, null); |
31 31 | } |
32 32 | |
33 33 | public AttributeModifier( UUID uuid, String name, double amount, Operation operation, EquipmentSlot slot) { |
34 - | Validate.notNull(uuid, "UUID cannot be null"); |
35 - | Validate.notNull(name, "Name cannot be null"); |
36 - | Validate.notNull(operation, "Operation cannot be null"); |
34 + | Preconditions.checkArgument(uuid != null, "UUID cannot be null"); |
35 + | Preconditions.checkArgument(name != null, "Name cannot be null"); |
36 + | Preconditions.checkArgument(operation != null, "Operation cannot be null"); |
37 37 | this.uuid = uuid; |
38 38 | this.name = name; |
39 39 | this.amount = amount; |
40 40 | this.operation = operation; |
41 41 | this.slot = slot; |
42 42 | } |
43 43 | |
44 44 | /** |
45 45 | * Get the unique ID for this modifier. |
46 46 | * |