refactor: reorganize packages and replace LPSchematic with WorldEdit
Restructure core modules into subpackages (generator, schematic, config, session, etc.); add .schem/.nbt schematic pipeline, commands, adaptive stats skeleton, and bootstrap wiring.
This commit is contained in:
parent
6ba6e5137d
commit
fd0ba2cc0e
203 changed files with 5652 additions and 2367 deletions
|
|
@ -0,0 +1,29 @@
|
|||
package dev.loki.loparkour.schematic.schem;
|
||||
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public final class SchemLoader {
|
||||
|
||||
private SchemLoader() {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Clipboard load(@NotNull File file) throws IOException {
|
||||
ClipboardFormat format = ClipboardFormats.findByFile(file);
|
||||
if (format == null) {
|
||||
throw new IOException("Unsupported schematic file: " + file.getName());
|
||||
}
|
||||
try (FileInputStream in = new FileInputStream(file);
|
||||
ClipboardReader reader = format.getReader(in)) {
|
||||
return reader.read();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue