DenizenScript/Denizen

Inputless command fields should optionally take boolean inputs

baite1 opened this issue · 1 comments

- playsound's (custom) field (and any other command's inputless fields ) should optionally take a boolean as an input
- push, for example, requires 16 if statements to check for its (force_along), (no_rotate), (no_damage) and (ignore_collision) inputs, and 16 similar lines to execute the command itself

why?
other command fields can take booleans, but these could just require the name alone for backwards compatibility

else if (!scriptEntry.hasObject("custom")
        && arg.matches("custom")) {
    scriptEntry.addObject("custom", new ElementTag(true));
}

would become

else if (!scriptEntry.hasObject("custom") {
    if (arg.matches("custom")) {
        scriptEntry.addObject("custom", new ElementTag(true));
    }
    else if (arg.matchesPrefix("custom")
            %% arg.matchesBoolean()) {
        scriptEntry.addObject("custom", arg.asElement());
    }
}

this would have to be changed in the following commands:

  • cooldown (global)
  • adjustblock (no_physics)
  • webget (hide_failure)
  • age (lock)
  • attach (relative) (sync_server) (no_rotate)
  • cast (remove) (no_ambient) (hide_particles) (no_icon)
  • fly (cancel)
  • follow (allow_wander) (no_teleport)
  • health (heal)
  • leash (cancel)
  • mount (cancel)
  • push (force_along) (no_rotate) (no_damage) (ignore_collision)
  • rename (per_player) (list_name_only)
  • rotate (cancel)
  • shoot (no_rotate)
  • spawn (persistent)
  • walk (auto_range)
  • fakeitem (player_only)
  • give (unlimit_stack_size)
  • lookclose (realistic)
  • actionbar (per_player)
  • blockcrack (stack)
  • experience (level)
  • narrate (per_player)
  • sidebar (per_player)
  • title (per_player)
  • execute (silent)
  • copyblock (remove_original)
  • explode (fire) (breakblocks)
  • firework (flicker) (trail)
  • modifyblock (delayed)
  • playsound (custom)
  • schematic (delayed) (entities) (flags)
  • strike (no_damage)
  • switch (no_physics)
  • time (freeze)
  • worldborder (reset)
  • filecopy (overwrite)
  • determine (passively)
  • inject (instantly)
  • wait (system)
  • worldedit (undoable) (noair)
  • discordmessage (no_mention)

Support is on Discord @ https://discord.gg/Q6pZGSR