From 6d0fa6527e8692f390aced4096fc7d769c4f8003 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 8 Dec 2024 23:40:50 +0100 Subject: [PATCH 1/2] Fix Schematic Punishment Messages --- .../src/SchematicSystem.properties | 3 ++- .../src/SchematicSystem_de.properties | 3 ++- .../schematiccommand/SchematicCommandUtils.java | 17 ++++++++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/SchematicSystem/SchematicSystem_Core/src/SchematicSystem.properties b/SchematicSystem/SchematicSystem_Core/src/SchematicSystem.properties index b5e1c15f..eb7e9b1d 100644 --- a/SchematicSystem/SchematicSystem_Core/src/SchematicSystem.properties +++ b/SchematicSystem/SchematicSystem_Core/src/SchematicSystem.properties @@ -82,7 +82,8 @@ UTIL_LOAD_ERROR=§cThe schematic could not be loaded UTIL_DOWNLOAD_PUNISHED=§cYou are not allowed to download schematics: §f§l{0} UTIL_DOWNLOAD_NOT_OWN=§cYou may download only your own schematics UTIL_DOWNLOAD_LINK=Your download link: -UTIL_TYPE_PUNISHED=§cYou are not allowed to submit schematics: §f§l{0} +UTIL_TYPE_PUNISHED=§cYou are not allowed to submit schematics until §e{0}§7: §f§l{1} +UTIL_TYPE_PUNISHED_PERMA=§cYou are permanently prohibited from submitting schematics: §f§l{0} UTIL_TYPE_NOT_OWN=§cYou can only submit your own schematics UTIL_TYPE_DIR=§cYou cannot submit folders UTIL_TYPE_NOT_ASSIGNABLE=§cSchematics cannot be changed for this type diff --git a/SchematicSystem/SchematicSystem_Core/src/SchematicSystem_de.properties b/SchematicSystem/SchematicSystem_Core/src/SchematicSystem_de.properties index cf370bcb..f52763a9 100644 --- a/SchematicSystem/SchematicSystem_Core/src/SchematicSystem_de.properties +++ b/SchematicSystem/SchematicSystem_Core/src/SchematicSystem_de.properties @@ -69,7 +69,8 @@ UTIL_LOAD_ERROR=§cDie Schematic konnte nicht geladen werden UTIL_DOWNLOAD_PUNISHED=§cDu darf keine Schematics Downloaden: §f§l{0} UTIL_DOWNLOAD_NOT_OWN=§cDu darfst nur deine eigenen Schematics herunterladen UTIL_DOWNLOAD_LINK=Dein Download Link: -UTIL_TYPE_PUNISHED=§cDu darf keine Schematics einsenden: §f§l{0} +UTIL_TYPE_PUNISHED=§cDu darfst bis zum §e{0} §7keine Schematics einsenden: §f§l{1} +UTIL_TYPE_PUNISHED_PERMA=§cDu darfst keine Schematics mehr einsenden: §f§l{0} UTIL_TYPE_NOT_OWN=§cDu kannst nur deine eigenen Schematics einsenden UTIL_TYPE_DIR=§cDu kannst keine Ordner einsenden UTIL_TYPE_NOT_ASSIGNABLE=§cZu diesem Typen können keine Schematics geändert werden diff --git a/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java b/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java index 753cd3b9..ba48a78f 100644 --- a/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java +++ b/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java @@ -401,11 +401,6 @@ public class SchematicCommandUtils { public static void changeType(Player player, SchematicNode node, SchematicType type, SchematicCommand.Extend extend) { SteamwarUser user = getUser(player); - if (Punishment.isPunished(user, - Punishment.PunishmentType.NoSchemSubmitting, - punishment -> SchematicSystem.MESSAGE.send("UTIL_TYPE_PUNISHED", player, punishment.getReason()))) { - return; - } if (node.getOwner() != user.getId()) { SchematicSystem.MESSAGE.send("UTIL_TYPE_NOT_OWN", player); return; @@ -430,6 +425,18 @@ public class SchematicCommandUtils { node.setSchemtype(type); SchematicSystem.MESSAGE.send("UTIL_TYPE_DONE", player); } else if (type.fightType()) { + if (Punishment.isPunished(user, + Punishment.PunishmentType.NoSchemSubmitting, + punishment -> { + if (punishment.isPerma()) { + SchematicSystem.MESSAGE.send("UTIL_TYPE_PUNISHED_PERMA", player, punishment.getReason()); + } else { + SchematicSystem.MESSAGE.send("UTIL_TYPE_PUNISHED", player, punishment.getEndTime(), punishment.getReason()); + } + })) { + return; + } + if (node.getSchemtype().check()) { SchematicSystem.MESSAGE.send("UTIL_TYPE_FIGHT_ALREADY", player); return; From 80ab0eeda027ef4e27d4cc2de9347356fa4c4e2c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 9 Dec 2024 19:05:36 +0100 Subject: [PATCH 2/2] Fix --- .../SchematicSystem_Core/src/SchematicSystem.properties | 2 +- .../src/SchematicSystem_de.properties | 2 +- .../commands/schematiccommand/SchematicCommandUtils.java | 8 +------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/SchematicSystem/SchematicSystem_Core/src/SchematicSystem.properties b/SchematicSystem/SchematicSystem_Core/src/SchematicSystem.properties index eb7e9b1d..6250ddde 100644 --- a/SchematicSystem/SchematicSystem_Core/src/SchematicSystem.properties +++ b/SchematicSystem/SchematicSystem_Core/src/SchematicSystem.properties @@ -82,7 +82,7 @@ UTIL_LOAD_ERROR=§cThe schematic could not be loaded UTIL_DOWNLOAD_PUNISHED=§cYou are not allowed to download schematics: §f§l{0} UTIL_DOWNLOAD_NOT_OWN=§cYou may download only your own schematics UTIL_DOWNLOAD_LINK=Your download link: -UTIL_TYPE_PUNISHED=§cYou are not allowed to submit schematics until §e{0}§7: §f§l{1} +UTIL_TYPE_PUNISHED=§cYou are not allowed to submit schematics until §e{1}§7: §f§l{0} UTIL_TYPE_PUNISHED_PERMA=§cYou are permanently prohibited from submitting schematics: §f§l{0} UTIL_TYPE_NOT_OWN=§cYou can only submit your own schematics UTIL_TYPE_DIR=§cYou cannot submit folders diff --git a/SchematicSystem/SchematicSystem_Core/src/SchematicSystem_de.properties b/SchematicSystem/SchematicSystem_Core/src/SchematicSystem_de.properties index f52763a9..6660f686 100644 --- a/SchematicSystem/SchematicSystem_Core/src/SchematicSystem_de.properties +++ b/SchematicSystem/SchematicSystem_Core/src/SchematicSystem_de.properties @@ -69,7 +69,7 @@ UTIL_LOAD_ERROR=§cDie Schematic konnte nicht geladen werden UTIL_DOWNLOAD_PUNISHED=§cDu darf keine Schematics Downloaden: §f§l{0} UTIL_DOWNLOAD_NOT_OWN=§cDu darfst nur deine eigenen Schematics herunterladen UTIL_DOWNLOAD_LINK=Dein Download Link: -UTIL_TYPE_PUNISHED=§cDu darfst bis zum §e{0} §7keine Schematics einsenden: §f§l{1} +UTIL_TYPE_PUNISHED=§cDu darfst bis zum §e{1} §7keine Schematics einsenden: §f§l{0} UTIL_TYPE_PUNISHED_PERMA=§cDu darfst keine Schematics mehr einsenden: §f§l{0} UTIL_TYPE_NOT_OWN=§cDu kannst nur deine eigenen Schematics einsenden UTIL_TYPE_DIR=§cDu kannst keine Ordner einsenden diff --git a/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java b/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java index ba48a78f..60d33ad5 100644 --- a/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java +++ b/SchematicSystem/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommandUtils.java @@ -427,13 +427,7 @@ public class SchematicCommandUtils { } else if (type.fightType()) { if (Punishment.isPunished(user, Punishment.PunishmentType.NoSchemSubmitting, - punishment -> { - if (punishment.isPerma()) { - SchematicSystem.MESSAGE.send("UTIL_TYPE_PUNISHED_PERMA", player, punishment.getReason()); - } else { - SchematicSystem.MESSAGE.send("UTIL_TYPE_PUNISHED", player, punishment.getEndTime(), punishment.getReason()); - } - })) { + punishment -> SchematicSystem.MESSAGE.send(punishment.isPerma() ? "UTIL_TYPE_PUNISHED_PERMA" : "UTIL_TYPE_PUNISHED", player, punishment.getReason(), punishment.getEndTime()))) { return; }