Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
patch for FTT input
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 21, 2018
1 parent 309a16d commit 01f9c8e
Showing 1 changed file with 15 additions and 2 deletions.
Expand Up @@ -17,6 +17,7 @@
import com.denizenscript.denizen2core.utilities.yaml.StringHolder;
import com.denizenscript.denizen2core.utilities.yaml.YAMLConfiguration;
import com.denizenscript.denizen2sponge.Denizen2Sponge;
import com.denizenscript.denizen2sponge.tags.objects.FormattedTextTag;
import com.denizenscript.denizen2sponge.tags.objects.ItemTag;
import com.denizenscript.denizen2sponge.utilities.DataKeys;
import com.denizenscript.denizen2sponge.utilities.flags.FlagMap;
Expand Down Expand Up @@ -171,12 +172,24 @@ public ItemStack generateItem(CommandQueue queue) {
};
ItemStack.Builder its = ItemStack.builder().from(ItemTag.getFor(error, parseVal(queue, material), queue).getInternal()).quantity(1);
if (displayName != null) {
its = its.add(Keys.DISPLAY_NAME, Denizen2Sponge.parseColor(parseVal(queue, displayName).toString()));
AbstractTagObject ato = parseVal(queue, displayName);
if (ato instanceof FormattedTextTag) {
its = its.add(Keys.DISPLAY_NAME, ((FormattedTextTag) ato).getInternal());
}
else {
its = its.add(Keys.DISPLAY_NAME, Denizen2Sponge.parseColor(ato.toString()));
}
}
if (lore != null) {
List<Text> loreVal = new ArrayList<>();
for (Argument arg : lore) {
loreVal.add(Denizen2Sponge.parseColor(parseVal(queue, arg).toString()));
AbstractTagObject ato = parseVal(queue, arg);
if (ato instanceof FormattedTextTag) {
loreVal.add(((FormattedTextTag) ato).getInternal());
}
else {
loreVal.add(Denizen2Sponge.parseColor(ato.toString()));
}
}
its.add(Keys.ITEM_LORE, loreVal);
}
Expand Down

0 comments on commit 01f9c8e

Please sign in to comment.