Skip to content

Commit af01b8c

Browse files
authored
Improve ObjectProperty overriding behavior (#116)
1 parent b277871 commit af01b8c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/com/denizenscript/denizencore/objects/properties/ObjectProperty.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ public boolean isDefaultValue(TData data) {
2222
@Override
2323
public TData getPropertyValueNoDefault() {
2424
TData res = getPropertyValue();
25-
return res == null || isDefaultValue(res) ? null : getPropertyValue();
25+
return res == null || isDefaultValue(res) ? null : res;
2626
}
2727

2828
@Override
2929
public String getPropertySavableValue() {
30-
TData res = getPropertyValue();
31-
return res == null || isDefaultValue(res) ? null : getPropertyValue().savable();
30+
TData res = getPropertyValueNoDefault();
31+
return res == null ? null : res.savable();
3232
}
3333

3434
@Deprecated @Override
3535
public String getPropertyString() {
36-
TData res = getPropertyValue();
37-
return res == null || isDefaultValue(res) ? null : getPropertyValue().identify();
36+
TData res = getPropertyValueNoDefault();
37+
return res == null ? null : res.identify();
3838
}
3939

4040
public abstract void setPropertyValue(TData data, Mechanism mechanism);

0 commit comments

Comments
 (0)