-
-
Notifications
You must be signed in to change notification settings - Fork 103
/
InventoryUniquifier.java
35 lines (28 loc) · 1.03 KB
/
InventoryUniquifier.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.denizenscript.denizen.objects.properties.inventory;
import com.denizenscript.denizen.objects.InventoryTag;
import com.denizenscript.denizencore.objects.Mechanism;
import com.denizenscript.denizencore.objects.core.ElementTag;
import com.denizenscript.denizencore.objects.properties.ObjectProperty;
public class InventoryUniquifier extends ObjectProperty<InventoryTag, ElementTag> {
public static boolean describes(InventoryTag inventory) {
return inventory.isGeneric();
}
@Override
public ElementTag getPropertyValue() {
if (object.uniquifier == null || object.isSaving) {
return null;
}
return new ElementTag(object.uniquifier);
}
@Override
public void setPropertyValue(ElementTag val, Mechanism mechanism) {
throw new UnsupportedOperationException();
}
@Override
public String getPropertyId() {
return "uniquifier";
}
public static void register() {
// Intentionally no tags.
}
}