Add Punishments #100
@ -23,7 +23,7 @@ import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.command.TypeMapper;
|
||||
import de.steamwar.inventory.SWAnvilInv;
|
||||
import de.steamwar.inventory.SchematicSelector;
|
||||
import de.steamwar.providers.BauSystemProvider;
|
||||
import de.steamwar.providers.BauServerInfo;
|
||||
import de.steamwar.schematicsystem.SchematicSystem;
|
||||
import de.steamwar.sql.*;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
@ -136,10 +136,11 @@ public class SchematicCommand extends SWCommand {
|
||||
@Register("s")
|
||||
public void saveSchem(Player player, @Mapper("dirStringMapper") String name) {
|
||||
SteamwarUser user = getUser(player);
|
||||
if((Punishment.isPunished(user, Punishment.PunishmentType.NoSchemReceiving, punishment -> player.sendMessage(SchematicSystem.PREFIX + "§cDu darfst hier keine Schematics laden")) ||
|
||||
Punishment.isPunished(SteamwarUser.get(BauSystemProvider.use(BauSystemProvider::getOwner, 0)), Punishment.PunishmentType.NoSchemSharing, punishment -> player.sendMessage(SchematicSystem.PREFIX + "§cAuf diesem Bau kannst du keine Schematics speichern"))) &&
|
||||
Boolean.TRUE.equals(BauSystemProvider.use(bauSystemProvider -> bauSystemProvider.getOwner() != user.getId(), false))) {
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cDu darfst hier keine Schematics speichern");
|
||||
if(BauServerInfo.isBauServer() && BauServerInfo.getOwnerId() != user.getId() &&
|
||||
(Punishment.isPunished(user, Punishment.PunishmentType.NoSchemReceiving, punishment ->
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst nicht auf anderen Baus Schematics machen")) ||
|
||||
Punishment.isPunished(SteamwarUser.get(BauServerInfo.getOwnerId()), Punishment.PunishmentType.NoSchemSharing, punishment ->
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cAuf diesem Bau können keine Schematics gemacht werden")))) {
|
||||
return;
|
||||
}
|
||||
if (name.endsWith("/")) {
|
||||
|
@ -22,7 +22,7 @@ package de.steamwar.schematicsystem.commands;
|
||||
import de.steamwar.comms.packets.PrepareSchemPacket;
|
||||
import de.steamwar.inventory.SWInventory;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.providers.BauSystemProvider;
|
||||
import de.steamwar.providers.BauServerInfo;
|
||||
import de.steamwar.schematicsystem.AutoCheckResult;
|
||||
import de.steamwar.schematicsystem.CheckSchemType;
|
||||
import de.steamwar.schematicsystem.SchematicSystem;
|
||||
@ -295,10 +295,11 @@ public class SchematicCommandUtils {
|
||||
|
||||
public static void loadSchem(Player player, SchematicNode node) {
|
||||
SteamwarUser user = getUser(player);
|
||||
if ((Punishment.isPunished(user, Punishment.PunishmentType.NoSchemSharing, punishment -> player.sendMessage(SchematicSystem.PREFIX + "§cDu darfst hier keine Schematics laden")) &&
|
||||
Boolean.TRUE.equals(BauSystemProvider.use(bauSystemProvider -> bauSystemProvider.getOwner() != user.getId(), false))) ||
|
||||
(Boolean.TRUE.equals(BauSystemProvider.use(bauSystemProvider -> bauSystemProvider.getOwner() != user.getId(), false)) &&
|
||||
Punishment.isPunished(BauSystemProvider.use(bauSystemProvider -> SteamwarUser.get(bauSystemProvider.getOwner()), user), Punishment.PunishmentType.NoSchemSharing, punishment -> player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst auf diesem Bau keine Schematics laden")))) {
|
||||
if(BauServerInfo.isBauServer() && BauServerInfo.getOwnerId() != user.getId() &&
|
||||
(Punishment.isPunished(user, Punishment.PunishmentType.NoSchemSharing, punishment ->
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cDu kannst hier keine Schematics laden")) ||
|
||||
Punishment.isPunished(SteamwarUser.get(BauServerInfo.getOwnerId()), Punishment.PunishmentType.NoSchemReceiving, punishment ->
|
||||
player.sendMessage(SchematicSystem.PREFIX + "§cAuf diesem Bau können keine Schematics geladen werden")))) {
|
||||
return;
|
||||
}
|
||||
if (node.isDir()) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren