Fixing AutoCheck for new Schematic in dbs
Dieser Commit ist enthalten in:
Ursprung
35a227864a
Commit
ea312f88a2
@ -1,17 +1,15 @@
|
|||||||
package de.steamwar.schematicsystem;
|
package de.steamwar.schematicsystem;
|
||||||
|
|
||||||
import com.boydti.fawe.FaweAPI;
|
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.Vector;
|
import com.sk89q.worldedit.Vector;
|
||||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
|
import de.steamwar.sql.NoClipboardException;
|
||||||
import de.steamwar.sql.Schematic;
|
import de.steamwar.sql.Schematic;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -68,12 +66,12 @@ class CheckSchemType_12 {
|
|||||||
|
|
||||||
static void autoCheck(Schematic schematic, List<String> errors, List<String> warnings, ICheckSchemType type) {
|
static void autoCheck(Schematic schematic, List<String> errors, List<String> warnings, ICheckSchemType type) {
|
||||||
Clipboard clipboard;
|
Clipboard clipboard;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
clipboard = FaweAPI.load(new File(Constants.SCHEM_DIR + SteamwarUser.get(schematic.getSchemOwner()).getUUID(), schematic.getSchemName() + ".schematic")).getClipboard();
|
clipboard = schematic.load();
|
||||||
if(clipboard == null)
|
} catch (Schematic.WrongVersionException e) {
|
||||||
throw new IOException();
|
errors.add("Der Schematictyp dieser Schematic kann nicht in dieser Version geändert werden.");
|
||||||
} catch (IOException e) {
|
return;
|
||||||
|
} catch (IOException | NoClipboardException e) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, "Schematic could not be loaded", e);
|
Bukkit.getLogger().log(Level.SEVERE, "Schematic could not be loaded", e);
|
||||||
errors.add("Die Schematic konnte nicht geladen werden");
|
errors.add("Die Schematic konnte nicht geladen werden");
|
||||||
return;
|
return;
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
package de.steamwar.schematicsystem;
|
package de.steamwar.schematicsystem;
|
||||||
|
|
||||||
import com.boydti.fawe.FaweAPI;
|
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
|
import de.steamwar.sql.NoClipboardException;
|
||||||
import de.steamwar.sql.Schematic;
|
import de.steamwar.sql.Schematic;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -54,12 +52,12 @@ class CheckSchemType_14 {
|
|||||||
|
|
||||||
static void autoCheck(Schematic schematic, List<String> errors, List<String> warnings, ICheckSchemType type) {
|
static void autoCheck(Schematic schematic, List<String> errors, List<String> warnings, ICheckSchemType type) {
|
||||||
Clipboard clipboard;
|
Clipboard clipboard;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
clipboard = FaweAPI.load(new File(Constants.SCHEM_DIR + SteamwarUser.get(schematic.getSchemOwner()).getUUID(), schematic.getSchemName() + ".schematic")).getClipboard();
|
clipboard = schematic.load();
|
||||||
if(clipboard == null)
|
} catch (Schematic.WrongVersionException e) {
|
||||||
throw new IOException();
|
errors.add("Der Schematictyp dieser Schematic kann nicht in dieser Version geändert werden.");
|
||||||
} catch (IOException e) {
|
return;
|
||||||
|
} catch (IOException | NoClipboardException e) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, "Schematic could not be loaded", e);
|
Bukkit.getLogger().log(Level.SEVERE, "Schematic could not be loaded", e);
|
||||||
errors.add("Die Schematic konnte nicht geladen werden");
|
errors.add("Die Schematic konnte nicht geladen werden");
|
||||||
return;
|
return;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren