Update SchematicCommand.schemSearch #110
@ -24,8 +24,8 @@ import de.steamwar.command.SWCommandUtils;
|
|||||||
import de.steamwar.command.TypeMapper;
|
import de.steamwar.command.TypeMapper;
|
||||||
import de.steamwar.inventory.SWAnvilInv;
|
import de.steamwar.inventory.SWAnvilInv;
|
||||||
import de.steamwar.inventory.SchematicSelector;
|
import de.steamwar.inventory.SchematicSelector;
|
||||||
import de.steamwar.schematicsystem.SafeSchematicNode;
|
|
||||||
import de.steamwar.providers.BauServerInfo;
|
import de.steamwar.providers.BauServerInfo;
|
||||||
|
import de.steamwar.schematicsystem.SafeSchematicNode;
|
||||||
import de.steamwar.schematicsystem.SchematicSystem;
|
import de.steamwar.schematicsystem.SchematicSystem;
|
||||||
import de.steamwar.sql.*;
|
import de.steamwar.sql.*;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
@ -57,6 +57,9 @@ public class SchematicCommand extends SWCommand {
|
|||||||
Class<?> clazz = Material.class;
|
Class<?> clazz = Material.class;
|
||||||
searchMapper.put("-item", SWCommandUtils.createEnumMapper((Class<Enum<?>>) clazz));
|
searchMapper.put("-item", SWCommandUtils.createEnumMapper((Class<Enum<?>>) clazz));
|
||||||
searchMapper.put("-public", null);
|
searchMapper.put("-public", null);
|
||||||
|
searchMapper.put("-exclude", SWCommandUtils.createMapper(Function.identity(), (commandSender, s) -> Collections.singletonList(s)));
|
||||||
|
searchMapper.put("-excludeType", SWCommandUtils.createMapper(SchematicType.values().stream().map(SchematicType::name).toArray(String[]::new)));
|
||||||
|
searchMapper.put("-excludeOwner", SWCommandUtils.createMapper(Function.identity(), (commandSender, s) -> Collections.singletonList(s)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SchematicCommand() {
|
public SchematicCommand() {
|
||||||
@ -313,6 +316,21 @@ public class SchematicCommand extends SWCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
predicates.add(node -> node.getOwner() == steamwarUser.getId());
|
predicates.add(node -> node.getOwner() == steamwarUser.getId());
|
||||||
|
break;
|
||||||
|
case "-exclude":
|
||||||
|
predicates.add(node -> !node.getName().contains(query[finalI + 1]));
|
||||||
|
break;
|
||||||
|
case "-excludeType":
|
||||||
|
predicates.add(node -> !node.getSchemtype().name().equalsIgnoreCase(query[finalI + 1]));
|
||||||
|
break;
|
||||||
|
case "-excludeOwner":
|
||||||
|
SteamwarUser steamwarUser1 = SteamwarUser.get(query[finalI + 1]);
|
||||||
|
if (steamwarUser1 == null) {
|
||||||
|
player.sendMessage(SchematicSystem.PREFIX + "§cDer Spieler §e" + query[finalI + 1] + " §cexistiert nicht");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
predicates.add(node -> node.getOwner() != steamwarUser1.getId());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren