1.8.8 FAWE and WorldEdit

Discussion in 'Spigot Plugin Development' started by CodingCyClone, Jul 15, 2021.

  1. I am trying to create a plugin that uses FAWE (I made sure to have the correct version) and I ran into multiple errors while trying to paste a schematic from inside one of my plugins (same error when pasting with wooden axe). Does this mean I cant use spigots anti-xray?
    Code (Text):
    [14:55:30 ERROR]: stopTiming called async for anti-xray - obfuscate
    [14:55:30 WARN]: java.lang.Throwable
    [14:55:30 WARN]:        at co.aikar.timings.TimingHandler.stopTiming(TimingHandler.java:114)
    [14:55:30 WARN]:        at org.spigotmc.AntiXray.obfuscateSync(AntiXray.java:108)
    [14:55:30 WARN]:        at net.minecraft.server.v1_8_R3.PacketPlayOutMapChunk.<init>(PacketPlayOutMapChunk.java:22)
    [14:55:30 WARN]:        at com.boydti.fawe.bukkit.v1_8.BukkitQueue18R3.sendChunk(BukkitQueue18R3.java:510)
    [14:55:30 WARN]:        at com.boydti.fawe.bukkit.v1_8.BukkitQueue18R3.sendChunk(BukkitQueue18R3.java:463)
    [14:55:30 WARN]:        at com.boydti.fawe.example.NMSRelighter$1.run(NMSRelighter.java:325)
    [14:55:30 WARN]:        at com.boydti.fawe.object.RunnableVal.run(RunnableVal.java:18)
    [14:55:30 WARN]:        at com.boydti.fawe.example.NMSRelighter.sendChunks(NMSRelighter.java:331)
    [14:55:30 WARN]:        at com.boydti.fawe.example.NMSRelighter.fixLightingSafe(NMSRelighter.java:297)
    [14:55:30 WARN]:        at com.boydti.fawe.example.NMSMappedFaweQueue$1.run(NMSMappedFaweQueue.java:47)
    [14:55:30 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59)
    [14:55:30 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
    [14:55:30 WARN]:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    [14:55:30 WARN]:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    [14:55:30 WARN]:        at java.lang.Thread.run(Thread.java:748)

    Also how do I rotate a schematic I know how to paste and save here is my paste method.
    Code (Text):
    public boolean pasteSchematic(String schematicName, Location loc, boolean noAir, boolean allowUndo){
            World world = new BukkitWorld(loc.getWorld());

            File schematic = new File(Bukkit.getPluginManager().getPlugin("WorldEdit").getDataFolder() + File.separator + "schematics" + File.separator + schematicName + ".schematic");
            if (!schematic.exists()) {
                System.out.println(schematic.getPath());
                return false;
            }
            Vector vec = new Vector(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
            try {
                EditSession editSession = Objects.requireNonNull(ClipboardFormats.findByFile(file))
                        .load(schematic)
                        .paste(world, vec, allowUndo, !noAir, null);
            } catch (IOException e) {
                e.printStackTrace();
                return false;
            }
            return true;
        }
     
    #1 CodingCyClone, Jul 15, 2021
    Last edited: Jul 15, 2021
  2. Try set false anti-ray in spigot.yml
    Code (YAML):
    anti-xray:
          enabled
    : true
     
  3. Yes that removes the error but it also removed anti-xray is that the only way?
     
    #3 CodingCyClone, Jul 15, 2021
    Last edited: Jul 15, 2021
  4. Can't you use another plugin to block the x-ray while keeping that option to false?
     
  5. Also does anyone know why this does not save the correct schematic? I made the
    I could look into it and see if I find one. Also do you know how the method to rotate schematics?
     
  6. I am unsure of the specific way, but inside your plugin you can override spigots anti-xray for that specific thing with the @Override

    EDIT: As for Rotating Schematics, you should look into WorldEdit's API as that will have everything listed
     
  7. Do have a link for the method (not the new ones since I am using an older version thats compatible with 1.8)
     
  8. After reading into it, it may be worth disabling Spigot's anti-xray and using another AC plugin (Example, NoCheatPlus) to deliver Anti-Xray capabilities.

    WorldEdit and FAWE are not the most friendly things to incorporate into plugins lol
     
  9. Ok that should not be too much of an issue I have made most of the other plugins so I can always work around it. Do you happen to know how to rotate a schematic?
     
  10. Bump any idea on how to rotate a schematic?
     
  11. You don't have access to the clipboard object in the 1.8.8 API ?
     
  12. I do you can see my paste method above but I don’t see the rotate method. The clipboard used in that link was a different one from the one I used.