Skip to content

Commit

Permalink
feat: rewrite the logic of full-random mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jlxnb committed Jan 21, 2025
1 parent 2151bd0 commit c4e25be
Showing 1 changed file with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,18 @@ protected Pair<Double> getDoubleInterval(Map<String, Object> section, String key
}
@Override
protected void load(FireworkScheduler scheduler, Map<String, Object> section) {
this.full = (boolean) section.getOrDefault("full", false); // enable full random mode
if (!this.full) {
// presets
List<String> pr = (List<String>) section.get("presets");
if (pr != null) {
for (String s : pr) {
ItemStack p = scheduler.getPreset(s);
if (p == null)
throw new IllegalArgumentException("preset " + s);
presets.add(p);
// presets
List<String> pr = (List<String>) section.get("presets");
if (pr != null) {
for (String s : pr) {
ItemStack p = scheduler.getPreset(s);
if (p == null)
throw new IllegalArgumentException("preset " + s);
presets.add(p);
}
}
single = this.presets.size() != 1;
}

single = this.presets.size() == 1;
this.full = this.presets.isEmpty();
this.count = (int) section.getOrDefault("count", 1);
this.X = getDoubleInterval(section,"X");
this.Y = getDoubleInterval(section,"Y");
Expand Down

0 comments on commit c4e25be

Please sign in to comment.