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

Commit

Permalink
Fix item script static dupgen from recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 25, 2018
1 parent 04e62a6 commit f34a902
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -82,6 +82,8 @@ public ItemScript(String name, YAMLConfiguration section) {

public final String itemScriptName;

private static final CommandQueue FORCE_TO_STATIC = new CommandQueue(); // Special case recursive static generation helper

@Override
public boolean init() {
if (super.init()) {
Expand All @@ -91,7 +93,7 @@ public boolean init() {
throw new ErrorInducedException(es);
};
if (contents.contains("static") && BooleanTag.getFor(error, contents.getString("static")).getInternal()) {
staticItem = generateItem(null);
staticItem = getItemCopy(FORCE_TO_STATIC);
}
}
catch (ErrorInducedException ex) {
Expand Down Expand Up @@ -222,6 +224,9 @@ public ItemStack generateItem(CommandQueue queue) {
if (!flagsMap.getInternal().isEmpty()) {
toRet.offer(new FlagMapDataImpl(new FlagMap(flagsMap)));
}
if (queue == FORCE_TO_STATIC) {
staticItem = toRet;
}
return toRet;
}

Expand Down

0 comments on commit f34a902

Please sign in to comment.