@Override public void prepare(CastContext context, ConfigurationSection parameters) { super.prepare(context, parameters); targetEntityLocation = parameters.getBoolean("target_entity"); targetSelf = parameters.getBoolean("target_caster"); sourceAtTarget = parameters.getBoolean("source_at_target"); targetOffset = ConfigurationUtils.getVector(parameters, "target_offset"); sourceOffset = ConfigurationUtils.getVector(parameters, "source_offset"); randomTargetOffset = ConfigurationUtils.getVector(parameters, "random_target_offset"); randomSourceOffset = ConfigurationUtils.getVector(parameters, "random_source_offset"); sourceDirection = ConfigurationUtils.getVector(parameters, "source_direction"); targetDirection = ConfigurationUtils.getVector(parameters, "target_direction"); sourceDirectionOffset = ConfigurationUtils.getVector(parameters, "source_direction_offset"); targetDirectionOffset = ConfigurationUtils.getVector(parameters, "source_direction_offset"); persistTarget = parameters.getBoolean("persist_target", false); attachBlock = parameters.getBoolean("target_attachment", false); if (parameters.contains("target_direction_speed")) { targetDirectionSpeed = parameters.getDouble("target_direction_speed"); } else { targetDirectionSpeed = null; } if (parameters.contains("source_direction_speed")) { sourceDirectionSpeed = parameters.getDouble("source_direction_speed"); } else { sourceDirectionSpeed = null; } }
@Override public void getParameterOptions(Spell spell, String parameterKey, Collection<String> examples) { if (parameterKey.equals("cross_world")) { examples.addAll(Arrays.asList((BaseSpell.EXAMPLE_BOOLEANS))); } else { super.getParameterOptions(spell, parameterKey, examples); } }
@Override public void prepare(CastContext context, ConfigurationSection parameters) { super.prepare(context, parameters); useHitbox = parameters.getBoolean("hitbox", false); range = parameters.getDouble("range", 32); fov = parameters.getDouble("fov", 0.3); closeRange = parameters.getDouble("close_range", 1); closeFOV = parameters.getDouble("close_fov", 0.5); }
@Override public void getParameterNames(Spell spell, Collection<String> parameters) { super.getParameterNames(spell, parameters); parameters.add("fov"); parameters.add("target_count"); parameters.add("hitbox"); parameters.add("range"); parameters.add("close_range"); parameters.add("close_fov"); }
@Override public void prepare(CastContext context, ConfigurationSection parameters) { super.prepare(context, parameters); direction = BlockFace.UP; try { direction = BlockFace.valueOf(parameters.getString("direction", "up").toUpperCase()); } catch (Exception ex) { context.getLogger().info("Invalid search direction: " + parameters.getString("direction")); direction = BlockFace.DOWN; } }
@Override public void getParameterOptions(Spell spell, String parameterKey, Collection<String> examples) { if (parameterKey.equals("hitbox")) { examples.addAll(Arrays.asList((BaseSpell.EXAMPLE_BOOLEANS))); } else if (parameterKey.equals("target_count") || parameterKey.equals("range") || parameterKey.equals("fov") || parameterKey.equals("close_range") || parameterKey.equals("close_fov")) { examples.addAll(Arrays.asList((BaseSpell.EXAMPLE_SIZES))); } else { super.getParameterOptions(spell, parameterKey, examples); } }
@Override public void prepare(CastContext context, ConfigurationSection parameters) { super.prepare(context, parameters); allowCrossWorld = parameters.getBoolean("cross_world", true); }
@Override public void reset(CastContext context) { super.reset(context); players = new HashMap<>(); active = false; }
@Override public void getParameterNames(Spell spell, Collection<String> parameters) { parameters.add("cross_world"); super.getParameterNames(spell, parameters); }