SteamWar/SpigotCore
Archiviert
13
0

Fix CuboidClipboard-Chaos

Dieser Commit ist enthalten in:
Lixfel 2019-12-09 11:15:27 +01:00
Ursprung de2e880e0e
Commit 0fe01c40e5
3 geänderte Dateien mit 3 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -49,7 +49,6 @@
<groupId>steamwar</groupId> <groupId>steamwar</groupId>
<artifactId>SpigotCore_API</artifactId> <artifactId>SpigotCore_API</artifactId>
<version>2.0</version> <version>2.0</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>steamwar</groupId> <groupId>steamwar</groupId>

Datei anzeigen

@ -43,7 +43,6 @@
<groupId>steamwar</groupId> <groupId>steamwar</groupId>
<artifactId>SpigotCore_API</artifactId> <artifactId>SpigotCore_API</artifactId>
<version>2.0</version> <version>2.0</version>
<scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

Datei anzeigen

@ -1,14 +1,12 @@
package de.steamwar.sql; package de.steamwar.sql;
import com.sk89q.worldedit.EmptyClipboardException; import com.sk89q.worldedit.EmptyClipboardException;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitWorld; import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.data.DataException;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
import com.sk89q.worldedit.schematic.MCEditSchematicFormat;
import com.sk89q.worldedit.schematic.SchematicFormat;
import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.world.registry.WorldData; import com.sk89q.worldedit.world.registry.WorldData;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -46,12 +44,8 @@ class Schematic_8 {
getWorldEditPlugin().getWorldEdit().getSessionManager().get(actor).setClipboard(new ClipboardHolder(clipboard, world)); getWorldEditPlugin().getWorldEdit().getSessionManager().get(actor).setClipboard(new ClipboardHolder(clipboard, world));
} }
static Clipboard getClipboard(InputStream is) throws IOException, NoClipboardException { static Clipboard getClipboard(InputStream is) throws IOException {
try { return ClipboardFormat.findByAlias("mcedit").getReader(is).read(WorldEdit.getInstance().getServer().getWorlds().get(0).getWorldData());
return (Clipboard) ((MCEditSchematicFormat)SchematicFormat.getFormat("mcedit")).load(is);
} catch (DataException e) {
throw new NoClipboardException();
}
} }
private static WorldEditPlugin getWorldEditPlugin() { private static WorldEditPlugin getWorldEditPlugin() {