Search in sources :

Example 6 with MatchRule

use of me.botsko.prism.actionlibs.MatchRule in project Prism-Bukkit by prism.

the class EntityParameter method process.

/**
	 * 
	 */
@Override
public void process(QueryParameters query, String alias, String input, CommandSender sender) {
    MatchRule match = MatchRule.INCLUDE;
    if (input.startsWith("!")) {
        match = MatchRule.EXCLUDE;
    }
    final String[] entityNames = input.split(",");
    if (entityNames.length > 0) {
        for (final String entityName : entityNames) {
            query.addEntity(entityName.replace("!", ""), match);
        }
    }
}
Also used : MatchRule(me.botsko.prism.actionlibs.MatchRule)

Example 7 with MatchRule

use of me.botsko.prism.actionlibs.MatchRule in project Prism-Bukkit by prism.

the class PlayerParameter method process.

/**
	 * 
	 */
@Override
public void process(QueryParameters query, String alias, String input, CommandSender sender) {
    MatchRule match = MatchRule.INCLUDE;
    if (input.startsWith("!")) {
        match = MatchRule.EXCLUDE;
        input = input.replace("!", "");
    } else if (input.startsWith("~")) {
        match = MatchRule.PARTIAL;
        input = input.replace("~", "");
    }
    final String[] playerNames = input.split(",");
    if (playerNames.length > 0) {
        for (String playerName : playerNames) {
            query.addPlayerName(playerName, match);
        }
    }
}
Also used : MatchRule(me.botsko.prism.actionlibs.MatchRule)

Aggregations

MatchRule (me.botsko.prism.actionlibs.MatchRule)7 Connection (java.sql.Connection)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 SQLException (java.sql.SQLException)2 QueryParameters (me.botsko.prism.actionlibs.QueryParameters)2 ArrayList (java.util.ArrayList)1 ActionType (me.botsko.prism.actionlibs.ActionType)1 ActionReportQueryBuilder (me.botsko.prism.database.mysql.ActionReportQueryBuilder)1 BlockReportQueryBuilder (me.botsko.prism.database.mysql.BlockReportQueryBuilder)1 PrismParameterHandler (me.botsko.prism.parameters.PrismParameterHandler)1 Player (org.bukkit.entity.Player)1