Add Punishments #100
@ -181,12 +181,21 @@ public class SchematicCommand extends SWCommand {
|
|||||||
@Register("addmember")
|
@Register("addmember")
|
||||||
public void addMember(Player player, SchematicNode node, SteamwarUser... targets) {
|
public void addMember(Player player, SchematicNode node, SteamwarUser... targets) {
|
||||||
SteamwarUser user = getUser(player);
|
SteamwarUser user = getUser(player);
|
||||||
|
if(Punishment.isPunished(user, Punishment.PunishmentType.NoSchemSharing, punishment -> player.sendMessage(SchematicSystem.PREFIX + "§cDu darfst niemanden auf deine Schematics hinzufügen: §f§l" + punishment.getReason()))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (node.getOwner() != user.getId()) {
|
if (node.getOwner() != user.getId()) {
|
||||||
player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst nur auf deine eigenen Sachen jemanden hinzufügen.");
|
player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst nur auf deine eigenen Sachen jemanden hinzufügen.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<SteamwarUser> added = new ArrayList<>();
|
List<SteamwarUser> added = new ArrayList<>();
|
||||||
for (SteamwarUser target: targets) {
|
for (SteamwarUser target: targets) {
|
||||||
|
if(Punishment.isPunished(target,
|
||||||
|
Punishment.PunishmentType.NoSchemReceiving,
|
||||||
|
punishment -> player.sendMessage(SchematicSystem.PREFIX + "§c" + target.getUserName() + " darf nicht auf Schematics hinzugefügt werden."))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (user.getId() == target.getId()) {
|
if (user.getId() == target.getId()) {
|
||||||
player.sendMessage(SchematicSystem.PREFIX + "§cAlso bitte: Das ist deine eigene Schematic!");
|
player.sendMessage(SchematicSystem.PREFIX + "§cAlso bitte: Das ist deine eigene Schematic!");
|
||||||
continue;
|
continue;
|
||||||
|
@ -322,6 +322,11 @@ public class SchematicCommandUtils {
|
|||||||
|
|
||||||
public static void changeType(Player player, SchematicNode node, SchematicType type, SchematicCommand.Extend extend) {
|
public static void changeType(Player player, SchematicNode node, SchematicType type, SchematicCommand.Extend extend) {
|
||||||
SteamwarUser user = getUser(player);
|
SteamwarUser user = getUser(player);
|
||||||
|
if(Punishment.isPunished(user,
|
||||||
|
Punishment.PunishmentType.NoSchemSubmitting,
|
||||||
|
punishment -> player.sendMessage(SchematicSystem.PREFIX + "§cDu darf keine Schematics einsenden: §f§l: " + punishment.getReason()))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (node.getOwner() != user.getId()) {
|
if (node.getOwner() != user.getId()) {
|
||||||
player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst nur deine eigenen Schematics einsenden.");
|
player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst nur deine eigenen Schematics einsenden.");
|
||||||
return;
|
return;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren