Skip to content

Commit

Permalink
Deprecate ObjectTag.getObjectType()
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 21, 2022
1 parent f8528d9 commit d811d9a
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 66 deletions.
Expand Up @@ -16,7 +16,7 @@ default void safeAdjust(Mechanism mechanism) {
mechanism.adjusting = this;
mechanism.isProperty = false;
if (mechanism.shouldDebug()) {
Debug.echoDebug(mechanism.context, "Adjust mechanism '" + mechanism.getName() + "' on object of type '" + getObjectType() + "'...");
Debug.echoDebug(mechanism.context, "Adjust mechanism '" + mechanism.getName() + "' on object of type '" + getDenizenObjectType() + "'...");
}
adjust(mechanism);
mechanism.autoReport();
Expand All @@ -38,7 +38,7 @@ default void safeApplyProperty(Mechanism mechanism) {
mechanism.adjusting = this;
mechanism.isProperty = true;
if (mechanism.shouldDebug()) {
Debug.echoDebug(mechanism.context, "Applying property '" + mechanism.getName() + "' on object of type '" + getObjectType() + "'...");
Debug.echoDebug(mechanism.context, "Applying property '" + mechanism.getName() + "' on object of type '" + getDenizenObjectType() + "'...");
if (CoreConfiguration.debugVerbose) {
try {
throw new Exception("Stack trace of property");
Expand Down
Expand Up @@ -114,13 +114,10 @@ default String debuggable() {
*/
boolean isUnique();

/**
* Returns the string type of the object. This is fairly verbose and crude, but used with
* a basic dScriptArg attribute.
*
* @return a straight-up string description of the type of dScriptArg. ie. ListTag, LocationTag
*/
String getObjectType();
@Deprecated
default String getObjectType() {
return "";
}

/**
* Gets an ugly, but exact, string representation of this ObjectTag.
Expand Down
Expand Up @@ -129,11 +129,6 @@ public boolean isUnique() {
return false;
}

@Override
public String getObjectType() {
return "binary";
}

@Override
public String identify() {
return "binary@" + hexEncode(data, false);
Expand Down
Expand Up @@ -77,11 +77,6 @@ public CustomObjectTag(CustomScriptContainer type, Map<String, ObjectTag> values

private String prefix = "Custom";

@Override
public String getObjectType() {
return "Custom";
}

@Override
public String identify() {
StringBuilder outp = new StringBuilder();
Expand Down
Expand Up @@ -269,11 +269,6 @@ public boolean isUnique() {
return false;
}

@Override
public String getObjectType() {
return "duration";
}

@Override
public String identify() {
if (seconds == (int)seconds) {
Expand Down
Expand Up @@ -357,11 +357,6 @@ public <T extends Enum> T asEnum(Class<T> clazz) {
return (T) EnumHelper.get(clazz).valuesMapLower.get(EnumHelper.cleanKey(element));
}

@Override
public String getObjectType() {
return "Element";
}

@Override
public String getPrefix() {
return prefix;
Expand Down
Expand Up @@ -124,11 +124,6 @@ public boolean isUnique() {
return true;
}

@Override
public String getObjectType() {
return "reflected";
}

@Override
public String debuggable() {
return "<LG>reflected@<GR>" + id + " <LG>(<GR>" + object + "<LG>)";
Expand Down
Expand Up @@ -657,11 +657,6 @@ public boolean isUnique() {
return false;
}

@Override
public String getObjectType() {
return "List";
}

@Override
public String identify() {
return identifyList();
Expand Down
Expand Up @@ -165,11 +165,6 @@ public boolean isUnique() {
return true;
}

@Override
public String getObjectType() {
return "Map";
}

@Override
public boolean isTruthy() {
return !map.isEmpty();
Expand Down
Expand Up @@ -92,11 +92,6 @@ public boolean isUnique() {
return true;
}

@Override
public String getObjectType() {
return "queue";
}

@Override
public String identify() {
return "q@" + queue.id;
Expand Down
Expand Up @@ -180,11 +180,6 @@ public ScriptContainer getContainer() {
// ObjectTag Methods
////////////

@Override
public String getObjectType() {
return "Script";
}

@Override
public String identify() {
return "s@" + name;
Expand Down
Expand Up @@ -115,11 +115,6 @@ public String getValue() {
return secretsFile.getString(key);
}

@Override
public String getObjectType() {
return "Secret";
}

@Override
public String identify() {
return "secret@" + key;
Expand Down
Expand Up @@ -149,11 +149,6 @@ public boolean isUnique() {
return true;
}

@Override
public String getObjectType() {
return "time";
}

public static String pad0(int value, int len) {
String outputStr = String.valueOf(value);
while (outputStr.length() < len) {
Expand Down
Expand Up @@ -251,7 +251,7 @@ public void execute(ScriptEntry scriptEntry) {
else if (object instanceof FlaggableObject) {
tracker = ((FlaggableObject) object).getFlagTracker();
if (tracker == null) {
Debug.echoError("The object type '" + object.getObjectType() + "' is flaggable, however the instance '" + object + "' is not: " + ((FlaggableObject) object).getReasonNotFlaggable());
Debug.echoError("The object type '" + object.getDenizenObjectType() + "' is flaggable, however the instance '" + object + "' is not: " + ((FlaggableObject) object).getReasonNotFlaggable());
continue;
}
}
Expand Down
Expand Up @@ -106,7 +106,7 @@ public void execute(ScriptEntry scriptEntry) {
}
}
if (!(object instanceof Notable)) {
Debug.echoError("Object '" + object + "' has type '" + object.getObjectType() + "' which is not a notable object type.");
Debug.echoError("Object '" + object + "' has type '" + object.getDenizenObjectType() + "' which is not a notable object type.");
return;
}
try {
Expand Down

0 comments on commit d811d9a

Please sign in to comment.