mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 05:05:18 +01:00
Another try at fixing NoClassDefFoundError with WorldEdit hook...
This commit is contained in:
parent
67a9dfa1cc
commit
f5a3fdee82
@ -219,9 +219,11 @@ public class BlueprintPaster {
|
||||
}
|
||||
|
||||
private void pasteEntity(World world, Location location, Entry<Vector, List<BlueprintEntity>> entry) {
|
||||
System.out.println(location.toString());
|
||||
int x = location.getBlockX() + entry.getKey().getBlockX();
|
||||
int y = location.getBlockY() + entry.getKey().getBlockY();
|
||||
int z = location.getBlockZ() + entry.getKey().getBlockZ();
|
||||
System.out.println(x + " " + y + " " + z);
|
||||
setEntity(new Location(world, x, y, z), entry.getValue());
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package world.bentobox.bentobox.blueprints;
|
||||
package world.bentobox.bentobox.blueprints.worldedit;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.gson.Gson;
|
||||
@ -9,19 +8,13 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||
import world.bentobox.bentobox.api.commands.admin.blueprints.AdminBlueprintCommand;
|
||||
import world.bentobox.bentobox.blueprints.converter.BlueprintClipboardReader;
|
||||
import world.bentobox.bentobox.blueprints.converter.BlueprintClipboardWriter;
|
||||
import world.bentobox.bentobox.blueprints.Blueprint;
|
||||
import world.bentobox.bentobox.database.json.BentoboxTypeAdapterFactory;
|
||||
import world.bentobox.bentobox.managers.BlueprintClipboardManager;
|
||||
import world.bentobox.bentobox.managers.BlueprintsManager;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
@ -1,11 +1,10 @@
|
||||
package world.bentobox.bentobox.blueprints.converter;
|
||||
package world.bentobox.bentobox.blueprints.worldedit;
|
||||
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* @since 1.6.0
|
||||
|
@ -1,7 +1,6 @@
|
||||
package world.bentobox.bentobox.blueprints.converter;
|
||||
package world.bentobox.bentobox.blueprints.worldedit;
|
||||
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -11,7 +10,7 @@ import java.io.OutputStream;
|
||||
* @since 1.6.0
|
||||
* @author CustomEntity
|
||||
*/
|
||||
public class BlueprintClipboardWriter implements ClipboardWriter{
|
||||
public class BlueprintClipboardWriter implements ClipboardWriter {
|
||||
|
||||
private OutputStream outputStream;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package world.bentobox.bentobox.blueprints.converter;
|
||||
package world.bentobox.bentobox.blueprints.worldedit;
|
||||
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||
|
@ -5,7 +5,7 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||
import org.bukkit.Material;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import world.bentobox.bentobox.api.hooks.Hook;
|
||||
import world.bentobox.bentobox.blueprints.BlueprintClipboardFormat;
|
||||
import world.bentobox.bentobox.blueprints.worldedit.BlueprintClipboardFormat;
|
||||
|
||||
/**
|
||||
* @since 1.6.0
|
||||
@ -14,6 +14,7 @@ import world.bentobox.bentobox.blueprints.BlueprintClipboardFormat;
|
||||
public class WorldEditHook extends Hook {
|
||||
|
||||
private WorldEdit instance;
|
||||
private BlueprintClipboardFormat clipboardFormat;
|
||||
|
||||
public WorldEditHook() {
|
||||
super("WorldEdit", Material.WOODEN_AXE);
|
||||
@ -23,7 +24,8 @@ public class WorldEditHook extends Hook {
|
||||
public boolean hook() {
|
||||
try {
|
||||
instance = WorldEdit.getInstance();
|
||||
ClipboardFormats.registerClipboardFormat(new BlueprintClipboardFormat());
|
||||
clipboardFormat = new BlueprintClipboardFormat();
|
||||
ClipboardFormats.registerClipboardFormat(clipboardFormat);
|
||||
} catch (Exception | NoClassDefFoundError | NoSuchMethodError e) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user