<commit_before>package com.elmakers.mine.bukkit.api.spell;

import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.block.MaterialAndData;
import com.elmakers.mine.bukkit.api.block.MaterialBrush;
import com.elmakers.mine.bukkit.api.magic.MageController;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Entity;
import org.bukkit.util.Vector;

/**
 * Represents a Spell that may be cast by a Mage.
 * 
 * Each Spell is based on a SpellTemplate, which are defined
 * by the spells configuration files.
 * 
 * Every spell uses a specific Class that must extend from
 * com.elmakers.mine.bukkit.plugins.magic.spell.Spell.
 * 
 * To create a new custom spell from scratch, you must also
 * implement the MageSpell interface.
 */
public interface Spell extends SpellTemplate {
    MageController getController();
    boolean cast();
    boolean cast(String[] parameters);
    boolean cast(String[] parameters, Location defaultLocation);
    boolean cast(ConfigurationSection parameters, Location defaultLocation);
    boolean cast(ConfigurationSection parameters);
    Location getLocation();
    Entity getEntity();
    Location getEyeLocation();
    void target();
    Location getTargetLocation();
    Entity getTargetEntity();
    Vector getDirection();
    boolean canTarget(Entity entity);
    boolean isActive();
    boolean hasBrushOverride();
    boolean canCast(Location location);
    void clearCooldown();
    void setRemainingCooldown(long ms);
    long getRemainingCooldown();
    CastingCost getRequiredCost();
    void messageTargets(String messageKey);
    void playEffects(String effectName);
    CastContext getCurrentCast();
    void playEffects(String effectName, CastContext context);
    void playEffects(String effectName, CastContext context, float scale);
    boolean requiresBuildPermission();
    boolean requiresBreakPermission();
    boolean isPvpRestricted();
    boolean isDisguiseRestricted();
    void sendMessage(String message);
    void castMessage(String message);
    MaterialAndData getEffectMaterial();
    String getEffectParticle();
    Color getEffectColor();
    MaterialBrush getBrush();
    boolean isCancellable();
    ConfigurationSection getWorkingParameters();
    void finish(CastContext context);
    double cancelOnDamage();
    boolean cancelOnCastOther();
    String getMessage(String messageKey);
    boolean hasHandlerParameters(String handlerKey);
    ConfigurationSection getHandlerParameters(String handlerKey);
    long getProgressLevel();
    boolean cancelOnNoPermission();
<commit_msg>Add ability to check if a spell is using an erase brush, important for distinction between break and build permissions.<commit_after>package com.elmakers.mine.bukkit.api.spell;

import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.block.MaterialAndData;
import com.elmakers.mine.bukkit.api.block.MaterialBrush;
import com.elmakers.mine.bukkit.api.magic.MageController;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Entity;
import org.bukkit.util.Vector;

/**
 * Represents a Spell that may be cast by a Mage.
 * 
 * Each Spell is based on a SpellTemplate, which are defined
 * by the spells configuration files.
 * 
 * Every spell uses a specific Class that must extend from
 * com.elmakers.mine.bukkit.plugins.magic.spell.Spell.
 * 
 * To create a new custom spell from scratch, you must also
 * implement the MageSpell interface.
 */
public interface Spell extends SpellTemplate {
    MageController getController();
    boolean cast();
    boolean cast(String[] parameters);
    boolean cast(String[] parameters, Location defaultLocation);
    boolean cast(ConfigurationSection parameters, Location defaultLocation);
    boolean cast(ConfigurationSection parameters);
    Location getLocation();
    Entity getEntity();
    Location getEyeLocation();
    void target();
    Location getTargetLocation();
    Entity getTargetEntity();
    Vector getDirection();
    boolean canTarget(Entity entity);
    boolean isActive();
    boolean hasBrushOverride();
    boolean canCast(Location location);
    void clearCooldown();
    void setRemainingCooldown(long ms);
    long getRemainingCooldown();
    CastingCost getRequiredCost();
    void messageTargets(String messageKey);
    void playEffects(String effectName);
    CastContext getCurrentCast();
    void playEffects(String effectName, CastContext context);
    void playEffects(String effectName, CastContext context, float scale);
    boolean requiresBuildPermission();
    boolean requiresBreakPermission();
    boolean isPvpRestricted();
    boolean isDisguiseRestricted();
    void sendMessage(String message);
    void castMessage(String message);
    MaterialAndData getEffectMaterial();
    String getEffectParticle();
    Color getEffectColor();
    MaterialBrush getBrush();
    boolean brushIsErase();
    boolean isCancellable();
    ConfigurationSection getWorkingParameters();
    void finish(CastContext context);
    double cancelOnDamage();
    boolean cancelOnCastOther();
    String getMessage(String messageKey);
    boolean hasHandlerParameters(String handlerKey);
    ConfigurationSection getHandlerParameters(String handlerKey);
    long getProgressLevel();
    boolean cancelOnNoPermission();

{'fraction_non_alphanumeric': 0.08553113553113553, 'fraction_numerical': 0.0, 'mean_word_length': 4.730325288562434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4824357', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1380, 'n_words': 411}