SteamWar/SpigotCore
Archiviert
13
0

Change Schematic Reader and Writer to FaWe #242

Zusammengeführt
Lixfel hat 2 Commits von fawe_reader nach master 2023-08-30 12:40:53 +02:00 zusammengeführt
3 geänderte Dateien mit 7 neuen und 12 gelöschten Zeilen
Nur Änderungen aus Commit d1478cf148 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -13,10 +13,7 @@ import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
import com.sk89q.worldedit.extent.clipboard.io.NBTSchematicReader;
import com.sk89q.worldedit.extent.clipboard.io.*;
import com.sk89q.worldedit.extent.clipboard.io.legacycompat.*;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
@ -38,8 +35,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
public class WorldEditWrapper14 implements WorldEditWrapper.IWorldEditWrapper {
private static final ClipboardFormat SCHEMATIC = BuiltInClipboardFormat.MCEDIT_SCHEMATIC;
private static final ClipboardFormat SCHEM = BuiltInClipboardFormat.SPONGE_SCHEMATIC;
private static final ClipboardFormat SCHEMATIC = ClipboardFormats.findByAlias("schematic");
private static final ClipboardFormat SCHEM = ClipboardFormats.findByAlias("schem");
@Override
public InputStream getPlayerClipboard(Player player, boolean schemFormat) {

Datei anzeigen

@ -47,7 +47,7 @@ dependencies {
compileOnly project(":SpigotCore_14")
compileOnly project(':CommonCore')
compileOnly swdep("WorldEdit-1.15")
compileOnly swdep("FastAsyncWorldEdit-1.18")
compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'
compileOnly 'com.mojang:datafixerupper:4.0.26'

Datei anzeigen

@ -19,10 +19,8 @@
package de.steamwar.core;
import com.sk89q.jnbt.NBTInputStream;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader;
import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicReader;
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
import de.steamwar.sql.NoClipboardException;
import java.io.IOException;
@ -35,9 +33,9 @@ public class WorldEditWrapper18 extends WorldEditWrapper14 {
//Use FAWE reader due to FAWE capability of reading corrupt FAWE schems
try {
if(schemFormat){
return new SpongeSchematicReader(new NBTInputStream(is)).read();
return BuiltInClipboardFormat.FAST.load(is);
}else{
return new MCEditSchematicReader(new NBTInputStream(is)).read();
return BuiltInClipboardFormat.MCEDIT_SCHEMATIC.load(is);
}
} catch (NullPointerException e) {
throw new NoClipboardException();