Skip to content

Commit

Permalink
use new getter methods yay
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 7, 2020
1 parent 7e401b6 commit cebcfd6
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java
Expand Up @@ -42,7 +42,6 @@
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -790,16 +789,7 @@ else if (attribute.startsWith("list", 2)) {
return null;
}
HologramTrait hologram = object.getCitizen().getTraitNullable(HologramTrait.class);
try {
Field directionField = HologramTrait.class.getDeclaredField("direction");
directionField.setAccessible(true);
HologramTrait.HologramDirection dir = (HologramTrait.HologramDirection) directionField.get(hologram);
return new ElementTag(dir.name());
}
catch (Throwable ex) {
Debug.echoError(ex);
return null;
}
return new ElementTag(hologram.getDirection().name());
});

// <--[tag]
Expand All @@ -814,16 +804,7 @@ else if (attribute.startsWith("list", 2)) {
return null;
}
HologramTrait hologram = object.getCitizen().getTraitNullable(HologramTrait.class);
try {
Field lineHeightField = HologramTrait.class.getDeclaredField("lineHeight");
lineHeightField.setAccessible(true);
double height = lineHeightField.getDouble(hologram);
return new ElementTag(height);
}
catch (Throwable ex) {
Debug.echoError(ex);
return null;
}
return new ElementTag(hologram.getLineHeight());
});

// <--[tag]
Expand Down

0 comments on commit cebcfd6

Please sign in to comment.