Shematic API failed
DevSnx opened this issue ยท 1 comments
WorldEdit Version
7.2.12
Platform Version
Spigot 1.19.2
Confirmations
- I am using the most recent Minecraft release.
- I am using a version of WorldEdit compatible with my Minecraft version.
- I am using the latest or recommended version of my platform software.
- I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
- I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)
Bug Description
[21:18:22] [Server thread/ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'island' in plugin Skyrama v0.4 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:833) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at org.bukkit.craftbukkit.v1_19_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:50) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:?] at net.minecraft.commands.CommandDispatcher.performCommand(CommandDispatcher.java:298) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:282) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:1949) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.network.PlayerConnection.lambda$18(PlayerConnection.java:1914) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.util.thread.IAsyncTaskHandler.b(SourceFile:68) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1150) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:131) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.bh(MinecraftServer.java:1129) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1122) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:140) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1106) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1017) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at java.lang.Thread.run(Thread.java:833) [?:?] Caused by: java.lang.NullPointerException: Cannot invoke "com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat.getReader(java.io.InputStream)" because "format" is null at de.skyrama.objects.schematics.SchematicManager.load(SchematicManager.java:43) ~[?:?] at de.skyrama.objects.islands.IslandManager.create(IslandManager.java:53) ~[?:?] at de.skyrama.commands.subcommands.CreateCommand.perform(CreateCommand.java:29) ~[?:?] at de.skyrama.commands.CommandManager.onCommand(CommandManager.java:39) ~[?:?] at org.bukkit.comma
Expected Behavior
my code
` public void load(String name, double x, double y, double z) {
try {
File file = new File(Skyrama.getPlugin(Skyrama.class).getDataFolder() + "/schematics/" + name + ".schematic");
Bukkit.getLogger().info(file.getPath());
ClipboardFormat format = ClipboardFormats.findByFile(file);
ClipboardReader reader = format.getReader(new FileInputStream(file));
Clipboard clipboard = reader.read();
try (EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(BukkitAdapter.adapt(Objects.requireNonNull(Bukkit.getWorld((String) Skyrama.getPlugin(Skyrama.class).getConfig().get("general.world")))), -1)) {
Operation operation = new ClipboardHolder(clipboard)
.createPaste(editSession)
.to(BlockVector3.at(x - Math.floor(clipboard.getDimensions().getX() / 2), y - Math.floor(clipboard.getDimensions().getY() / 2), z - Math.floor(clipboard.getDimensions().getZ() / 2)))
.ignoreAirBlocks(false)
.build();
Operations.complete(operation);
Bukkit.getLogger().info("complete");
} catch (WorldEditException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
}`
Reproduction Steps
With my own Plugin
Anything Else?
nothing