From 5c02275b4e8f3ab92a3c3b47af5c0e18765f4069 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 7 Jan 2021 17:40:14 +0100 Subject: [PATCH 1/5] Add Schemdownload --- SchematicSystem_Main/pom.xml | 27 +++++ .../schematicsystem/ExternalUpDownload.java | 107 ++++++++++++++++++ .../schematicsystem/SchematicSystem.java | 4 + .../commands/SchemTransferCommand.java | 30 +++++ SchematicSystem_Main/src/plugin.yml | 3 +- 5 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java create mode 100644 SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java diff --git a/SchematicSystem_Main/pom.xml b/SchematicSystem_Main/pom.xml index 09a6c73..3986067 100644 --- a/SchematicSystem_Main/pom.xml +++ b/SchematicSystem_Main/pom.xml @@ -43,10 +43,27 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 9 + 9 + + schematicsystem + + + + maven-restlet + Public online Restlet repository + http://maven.restlet.org + + + steamwar @@ -73,5 +90,15 @@ 1.0 compile + + org.apache.httpcomponents + httpclient + 4.5.13 + + + org.apache.httpcomponents + httpmime + 4.5.13 + \ No newline at end of file diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java new file mode 100644 index 0000000..8042007 --- /dev/null +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java @@ -0,0 +1,107 @@ +package de.steamwar.schematicsystem; + +import de.steamwar.sql.Schematic; +import de.steamwar.sql.SchematicType; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.mime.MultipartEntity; +import org.apache.http.entity.mime.content.StringBody; +import org.apache.http.impl.client.BasicCookieStore; +import org.apache.http.impl.client.HttpClients; +import org.bukkit.entity.Player; +import java.io.InputStream; +import java.net.URL; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +public class ExternalUpDownload { + + public static void downloadSchemsFromWGW(Player player, String pw) { + BasicCookieStore cookieStore = new BasicCookieStore(); + HttpClient httpclient = HttpClients.custom().setDefaultCookieStore(cookieStore).build(); + try { + //Login to WGW + HttpPost loginPost = new HttpPost("https://wargearworld.net/index.php"); + MultipartEntity loginEntity = new MultipartEntity(); + loginEntity.addPart("login-username", new StringBody(player.getName())); + loginEntity.addPart("login-password", new StringBody(pw)); + loginEntity.addPart("send-login", new StringBody("login")); + + loginPost.setEntity(loginEntity); + HttpResponse loginResponse = httpclient.execute(loginPost); + if(loginResponse.getStatusLine().getStatusCode() != 302) { + player.sendMessage(SchematicSystem.PREFIX + "§cLogin Fehlgeschlagen"); + return; + } + + //Prepare Schemdownload + HttpPost preparePost = new HttpPost("https://wargearworld.net/index.php"); + MultipartEntity prepareEntity = new MultipartEntity(); + prepareEntity.addPart("option", new StringBody("com_ajax")); + prepareEntity.addPart("module", new StringBody("account")); + prepareEntity.addPart("content", new StringBody("getDir")); + prepareEntity.addPart("data[dir]", new StringBody("/")); + prepareEntity.addPart("data[event]", new StringBody("download_all")); + prepareEntity.addPart("data[data]", new StringBody("")); + prepareEntity.addPart("format", new StringBody("raw")); + preparePost.setEntity(prepareEntity); + HttpResponse prepareResponse = httpclient.execute(preparePost); + InputStream content = prepareResponse.getEntity().getContent(); + StringBuilder builder = new StringBuilder(); + byte[] remover = new byte[67]; + content.read(remover); + while (content.available() > 0) { + int readed = content.read(); + if(readed == 46) + break; + builder.append((char) readed); + } + player.sendMessage(SchematicSystem.PREFIX + "§aDownload erstellt!"); + player.sendMessage("§ahttps://wargearworld.net/images/temp/schematics/" + builder.toString() + ".zip"); + + //Process Schems + player.sendMessage(SchematicSystem.PREFIX + "§aSchematics werden verarbeitet!"); + ZipInputStream zipInputStream = new ZipInputStream(new URL("https://wargearworld.net/images/temp/schematics/" + builder.toString() + ".zip").openStream()); + while (true) { + ZipEntry schematic = zipInputStream.getNextEntry(); + if(schematic == null) + break; + if(schematic.isDirectory()) + continue; + String[] schemName = schematic.getName().split("\\."); + StringBuilder name = new StringBuilder(); + for (int i = 0; i < schemName.length - 1; i++) { + if(!name.toString().equals("")) + name.append("."); + name.append(schemName[i].replace("/", "-")); + } + Schematic testSchem = Schematic.getSchemFromDB(name.toString(), player.getUniqueId()); + byte[] schemData = zipInputStream.readAllBytes(); + if(testSchem != null) { + int i = 1; + while (true) { + if(Schematic.getSchemFromDB(name.toString() + "-" + i, player.getUniqueId()) == null) { + name = new StringBuilder(name.toString() + "-" + i); + break; + } + i++; + } + } + Schematic.createSchem(name.toString(), player.getUniqueId(), "", SchematicType.Normal); + Schematic schem = Schematic.getSchemFromDB(name.toString(), player.getUniqueId()); + schem.saveFromBytes(schemData, schemName[schemName.length - 1].equals("schem")); + zipInputStream.closeEntry(); + player.sendMessage(SchematicSystem.PREFIX + "§6Die Schematic §e" + schematic.getName() + " §6wurde von WarGearWorld.net als §e" + name.toString() + " §6herruntergeladen!"); + } + player.sendMessage(SchematicSystem.PREFIX + "§aAlle deine Schematics wurden von §6W§7ar§6G§7ear§6W§7orld.net §aauf §eSteam§8War §aHochgeladen!"); + zipInputStream.close(); + + } catch (Exception e) { + player.sendMessage("Beidem Schemdownload ist ein Fehler passiert, Versuche es Später nochmal."); + throw new SecurityException(e); + } finally { + httpclient.getConnectionManager().shutdown(); + } + } +} diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/SchematicSystem.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/SchematicSystem.java index 2125121..12a40a2 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/SchematicSystem.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/SchematicSystem.java @@ -20,6 +20,7 @@ package de.steamwar.schematicsystem; import de.steamwar.core.CommandRemover; +import de.steamwar.schematicsystem.commands.SchemTransferCommand; import de.steamwar.schematicsystem.commands.SchematicCommand; import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; @@ -31,6 +32,7 @@ import java.io.File; public class SchematicSystem extends JavaPlugin { public static final String PREFIX = "§eSchematic§8» §7"; + public static SchematicSystem INSTANCE; @Override public void onEnable() { @@ -48,5 +50,7 @@ public class SchematicSystem extends JavaPlugin { CommandRemover.removeAll("/schematic", "/schem", "//schematic", "//schem"); getCommand("schem").setExecutor(new SchematicCommand()); + getCommand("schemtransfer").setExecutor(new SchemTransferCommand()); + INSTANCE = this; } } diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java new file mode 100644 index 0000000..2046ead --- /dev/null +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java @@ -0,0 +1,30 @@ +package de.steamwar.schematicsystem.commands; + +import de.steamwar.schematicsystem.ExternalUpDownload; +import de.steamwar.schematicsystem.SchematicSystem; +import org.bukkit.Bukkit; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class SchemTransferCommand implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) { + if(commandSender instanceof Player) { + if(args.length < 1) { + Player p = (Player) commandSender; + p.sendMessage("§6W§7ar§6G§7ear§6W§7orld §6Schematictransfer"); + p.sendMessage("§7Mit diesem Command kannst du deine Wargearworld schematics auf Steamwar Transferieren"); + p.sendMessage("§8/§eschemtransfer [Dein Wargearworld Website Passwort]"); + p.sendMessage("§4§lDISCLAIMER: §eDein Passwort wird in keinster von uns gespeichert, es wird nut für den Download der Schematics von Wargearworld.net verwendet und danach sofort wieder gelöcht!"); + p.sendMessage("§eWenn du uns das nicht glaubst, kannst du es gerne hier https://steamwar.de/devlabs/SteamWar/SchematicSystem/src/branch/master/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTranferCommand.java nachlesen oder auch einen Developer fragen."); + } else { + Bukkit.getScheduler().runTaskAsynchronously(SchematicSystem.INSTANCE, () -> ExternalUpDownload.downloadSchemsFromWGW((Player) commandSender, args[0])); + } + + } + return true; + } +} diff --git a/SchematicSystem_Main/src/plugin.yml b/SchematicSystem_Main/src/plugin.yml index 654bc59..ad046b5 100644 --- a/SchematicSystem_Main/src/plugin.yml +++ b/SchematicSystem_Main/src/plugin.yml @@ -11,4 +11,5 @@ commands: - schematic - /schematic - /schem - check: \ No newline at end of file + check: + schemtransfer: \ No newline at end of file -- 2.39.2 From 2f8a2124d5859c17e9c7fa268f66385938d4aaee Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 7 Jan 2021 17:48:34 +0100 Subject: [PATCH 2/5] Fix java 8 --- SchematicSystem_Main/pom.xml | 4 ++-- .../src/de/steamwar/schematicsystem/ExternalUpDownload.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SchematicSystem_Main/pom.xml b/SchematicSystem_Main/pom.xml index 3986067..79f54a4 100644 --- a/SchematicSystem_Main/pom.xml +++ b/SchematicSystem_Main/pom.xml @@ -47,8 +47,8 @@ org.apache.maven.plugins maven-compiler-plugin - 9 - 9 + 8 + 8 diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java index 8042007..9cf1dbc 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java @@ -77,7 +77,8 @@ public class ExternalUpDownload { name.append(schemName[i].replace("/", "-")); } Schematic testSchem = Schematic.getSchemFromDB(name.toString(), player.getUniqueId()); - byte[] schemData = zipInputStream.readAllBytes(); + byte[] schemData = new byte[zipInputStream.available()]; + zipInputStream.read(schemData); if(testSchem != null) { int i = 1; while (true) { @@ -92,7 +93,7 @@ public class ExternalUpDownload { Schematic schem = Schematic.getSchemFromDB(name.toString(), player.getUniqueId()); schem.saveFromBytes(schemData, schemName[schemName.length - 1].equals("schem")); zipInputStream.closeEntry(); - player.sendMessage(SchematicSystem.PREFIX + "§6Die Schematic §e" + schematic.getName() + " §6wurde von WarGearWorld.net als §e" + name.toString() + " §6herruntergeladen!"); + player.sendMessage(SchematicSystem.PREFIX + "§6Die Schematic §e" + schematic.getName() + " §6wurde von WarGearWorld.net als §e" + name.toString() + " §6heruntergeladen!"); } player.sendMessage(SchematicSystem.PREFIX + "§aAlle deine Schematics wurden von §6W§7ar§6G§7ear§6W§7orld.net §aauf §eSteam§8War §aHochgeladen!"); zipInputStream.close(); -- 2.39.2 From 0b0126b2b96134aa51dadc66d42386c48e051b1d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 8 Jan 2021 13:23:13 +0100 Subject: [PATCH 3/5] Nachrichtenanpassung Signed-off-by: Lixfel --- SchematicSystem_Main/pom.xml | 8 ----- .../schematicsystem/ExternalUpDownload.java | 29 +++++++++++++++---- .../commands/SchemTransferCommand.java | 10 +++---- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/SchematicSystem_Main/pom.xml b/SchematicSystem_Main/pom.xml index 79f54a4..ef5a40d 100644 --- a/SchematicSystem_Main/pom.xml +++ b/SchematicSystem_Main/pom.xml @@ -43,14 +43,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - schematicsystem diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java index 9cf1dbc..d7efd54 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java @@ -1,3 +1,21 @@ +/* + This file is a part of the SteamWar software. + + Copyright (C) 2020 SteamWar.de-Serverteam + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ package de.steamwar.schematicsystem; import de.steamwar.sql.Schematic; @@ -16,6 +34,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class ExternalUpDownload { + private ExternalUpDownload(){} public static void downloadSchemsFromWGW(Player player, String pw) { BasicCookieStore cookieStore = new BasicCookieStore(); @@ -31,7 +50,7 @@ public class ExternalUpDownload { loginPost.setEntity(loginEntity); HttpResponse loginResponse = httpclient.execute(loginPost); if(loginResponse.getStatusLine().getStatusCode() != 302) { - player.sendMessage(SchematicSystem.PREFIX + "§cLogin Fehlgeschlagen"); + player.sendMessage(SchematicSystem.PREFIX + "§cLogin mit gegebenem Passwort nicht möglich."); return; } @@ -57,11 +76,11 @@ public class ExternalUpDownload { break; builder.append((char) readed); } - player.sendMessage(SchematicSystem.PREFIX + "§aDownload erstellt!"); + player.sendMessage(SchematicSystem.PREFIX + "§aWGW-Downloadlink erstellt..."); player.sendMessage("§ahttps://wargearworld.net/images/temp/schematics/" + builder.toString() + ".zip"); //Process Schems - player.sendMessage(SchematicSystem.PREFIX + "§aSchematics werden verarbeitet!"); + player.sendMessage(SchematicSystem.PREFIX + "§aSchematics werden verarbeitet..."); ZipInputStream zipInputStream = new ZipInputStream(new URL("https://wargearworld.net/images/temp/schematics/" + builder.toString() + ".zip").openStream()); while (true) { ZipEntry schematic = zipInputStream.getNextEntry(); @@ -95,11 +114,11 @@ public class ExternalUpDownload { zipInputStream.closeEntry(); player.sendMessage(SchematicSystem.PREFIX + "§6Die Schematic §e" + schematic.getName() + " §6wurde von WarGearWorld.net als §e" + name.toString() + " §6heruntergeladen!"); } - player.sendMessage(SchematicSystem.PREFIX + "§aAlle deine Schematics wurden von §6W§7ar§6G§7ear§6W§7orld.net §aauf §eSteam§8War §aHochgeladen!"); + player.sendMessage(SchematicSystem.PREFIX + "§aAlle deine Schematics wurden von §6W§7ar§6G§7ear§6W§7orld.net §aauf §eSteam§8War §atransferiert!"); zipInputStream.close(); } catch (Exception e) { - player.sendMessage("Beidem Schemdownload ist ein Fehler passiert, Versuche es Später nochmal."); + player.sendMessage("§cUnerwarteter Fehler beim Schematictransfer. Developer wurden benachrichtigt."); throw new SecurityException(e); } finally { httpclient.getConnectionManager().shutdown(); diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java index 2046ead..f459b9e 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java @@ -15,11 +15,11 @@ public class SchemTransferCommand implements CommandExecutor { if(commandSender instanceof Player) { if(args.length < 1) { Player p = (Player) commandSender; - p.sendMessage("§6W§7ar§6G§7ear§6W§7orld §6Schematictransfer"); - p.sendMessage("§7Mit diesem Command kannst du deine Wargearworld schematics auf Steamwar Transferieren"); - p.sendMessage("§8/§eschemtransfer [Dein Wargearworld Website Passwort]"); - p.sendMessage("§4§lDISCLAIMER: §eDein Passwort wird in keinster von uns gespeichert, es wird nut für den Download der Schematics von Wargearworld.net verwendet und danach sofort wieder gelöcht!"); - p.sendMessage("§eWenn du uns das nicht glaubst, kannst du es gerne hier https://steamwar.de/devlabs/SteamWar/SchematicSystem/src/branch/master/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTranferCommand.java nachlesen oder auch einen Developer fragen."); + p.sendMessage("§6W§7ar§6G§7ear§6W§7orld Schematictransfer"); + p.sendMessage("§7Mit diesem Command kannst du deine WGW-Schematics auf SteamWar übertragen"); + p.sendMessage("§8/§eschemtransfer §8[§eDein WGW-Website Passwort§8]"); + p.sendMessage("§cDISCLAIMER§8: §eDein Passwort wird nicht von uns gespeichert, es wird nur für den Download der Schematics von WGW verwendet und danach sofort wieder gelöscht!"); + p.sendMessage("§eWenn du uns das nicht glaubst, kannst du es gerne hier https://steamwar.de/devlabs/SteamWar/SchematicSystem/src/branch/master/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTranferCommand.java nachlesen oder die Schematics manuell übertragen."); } else { Bukkit.getScheduler().runTaskAsynchronously(SchematicSystem.INSTANCE, () -> ExternalUpDownload.downloadSchemsFromWGW((Player) commandSender, args[0])); } -- 2.39.2 From 7056675fc725ee13c0447181e7eeee8af6d4e2a2 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 8 Jan 2021 13:31:44 +0100 Subject: [PATCH 4/5] Fix disclaimer Signed-off-by: Lixfel --- .../steamwar/schematicsystem/commands/SchemTransferCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java index f459b9e..8ef9b44 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTransferCommand.java @@ -18,7 +18,7 @@ public class SchemTransferCommand implements CommandExecutor { p.sendMessage("§6W§7ar§6G§7ear§6W§7orld Schematictransfer"); p.sendMessage("§7Mit diesem Command kannst du deine WGW-Schematics auf SteamWar übertragen"); p.sendMessage("§8/§eschemtransfer §8[§eDein WGW-Website Passwort§8]"); - p.sendMessage("§cDISCLAIMER§8: §eDein Passwort wird nicht von uns gespeichert, es wird nur für den Download der Schematics von WGW verwendet und danach sofort wieder gelöscht!"); + p.sendMessage("§cDISCLAIMER§8: §eWir nutzen dieses Passwort ausschließlich zum einmaligen Download der Schematics."); p.sendMessage("§eWenn du uns das nicht glaubst, kannst du es gerne hier https://steamwar.de/devlabs/SteamWar/SchematicSystem/src/branch/master/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchemTranferCommand.java nachlesen oder die Schematics manuell übertragen."); } else { Bukkit.getScheduler().runTaskAsynchronously(SchematicSystem.INSTANCE, () -> ExternalUpDownload.downloadSchemsFromWGW((Player) commandSender, args[0])); -- 2.39.2 From 8fb3f8b0662753ea96bd01d8e67b4b69f23b409a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 8 Jan 2021 14:07:17 +0100 Subject: [PATCH 5/5] Fixing of Big Schems --- .../schematicsystem/ExternalUpDownload.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java index d7efd54..b1be11f 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/ExternalUpDownload.java @@ -30,6 +30,8 @@ import org.apache.http.impl.client.HttpClients; import org.bukkit.entity.Player; import java.io.InputStream; import java.net.URL; +import java.util.ArrayList; +import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -96,8 +98,14 @@ public class ExternalUpDownload { name.append(schemName[i].replace("/", "-")); } Schematic testSchem = Schematic.getSchemFromDB(name.toString(), player.getUniqueId()); - byte[] schemData = new byte[zipInputStream.available()]; - zipInputStream.read(schemData); + List schemData = new ArrayList<>(); + while (zipInputStream.available() == 1) { + schemData.add((byte) zipInputStream.read()); + } + byte[] bytes = new byte[schemData.size()]; + for (int i = 0; i < schemData.size(); i++) { + bytes[i] = schemData.get(i); + } if(testSchem != null) { int i = 1; while (true) { @@ -110,7 +118,7 @@ public class ExternalUpDownload { } Schematic.createSchem(name.toString(), player.getUniqueId(), "", SchematicType.Normal); Schematic schem = Schematic.getSchemFromDB(name.toString(), player.getUniqueId()); - schem.saveFromBytes(schemData, schemName[schemName.length - 1].equals("schem")); + schem.saveFromBytes(bytes, schemName[schemName.length - 1].equals("schem")); zipInputStream.closeEntry(); player.sendMessage(SchematicSystem.PREFIX + "§6Die Schematic §e" + schematic.getName() + " §6wurde von WarGearWorld.net als §e" + name.toString() + " §6heruntergeladen!"); } -- 2.39.2