mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-31 01:23:44 +01:00 
			
		
		
		
	Set floor async / fixed exportall
This commit is contained in:
		| @@ -8,7 +8,7 @@ | ||||
| 	    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||||
| 	</properties> | ||||
|     <artifactId>PlotSquared</artifactId> | ||||
|     <version>2.11.5</version> | ||||
|     <version>2.11.6</version> | ||||
|     <name>PlotSquared</name> | ||||
|     <packaging>jar</packaging> | ||||
|     <build> | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import java.io.FileOutputStream; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.io.OutputStream; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collection; | ||||
| import java.util.HashSet; | ||||
| import java.util.Iterator; | ||||
| @@ -39,20 +40,22 @@ public abstract class SchematicHandler { | ||||
|      | ||||
|     private boolean exportAll = false; | ||||
|      | ||||
|     public boolean exportAll(final Collection<Plot> plots, final File outputDir, final String namingScheme, final Runnable ifSuccess) { | ||||
|     public boolean exportAll(final Collection<Plot> collection, final File outputDir, final String namingScheme, final Runnable ifSuccess) { | ||||
|     	if (exportAll) { | ||||
|     		return false; | ||||
|     	} | ||||
|     	if (plots.size() == 0) { | ||||
|     	if (collection.size() == 0) { | ||||
|     		return false; | ||||
|     	} | ||||
|     	exportAll = true; | ||||
|     	final ArrayList<Plot> plots = new ArrayList<Plot>(collection); | ||||
|     	TaskManager.index.increment(); | ||||
|     	final Integer currentIndex = TaskManager.index.toInteger(); | ||||
|         final int task = TaskManager.runTaskRepeat(new Runnable() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|             	if (plots.size() == 0) { | ||||
|             	    exportAll = false; | ||||
|             		Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex)); | ||||
|                     TaskManager.tasks.remove(currentIndex); | ||||
|                     TaskManager.runTask(ifSuccess); | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| package com.intellectualcrafters.plot.util; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
|  | ||||
| import org.bukkit.Bukkit; | ||||
|  | ||||
| import com.intellectualcrafters.plot.PlotSquared; | ||||
| @@ -12,15 +10,10 @@ import com.sk89q.worldedit.CuboidClipboard; | ||||
| import com.sk89q.worldedit.EditSession; | ||||
| import com.sk89q.worldedit.Vector; | ||||
| import com.sk89q.worldedit.bukkit.BukkitWorld; | ||||
| import com.sk89q.worldedit.data.DataException; | ||||
| import com.sk89q.worldedit.extent.clipboard.Clipboard; | ||||
| import com.sk89q.worldedit.regions.CuboidRegion; | ||||
| import com.sk89q.worldedit.schematic.MCEditSchematicFormat; | ||||
| import com.sk89q.worldedit.schematic.SchematicFormat; | ||||
|  | ||||
| public class WorldEditSchematic { | ||||
|     public void saveSchematic(String file, final String world, final PlotId id) { | ||||
|         System.out.print("SAVCING SCHSAKJHDJKAS HDKAS"); | ||||
|         Location bot = MainUtil.getPlotBottomLoc(world, id).add(1, 0, 1); | ||||
|         Location top = MainUtil.getPlotTopLoc(world, id); | ||||
|         Vector size = new Vector(top.getX() - bot.getX() + 1, top.getY() - bot.getY() - 1, top.getZ() - bot.getZ() + 1); | ||||
| @@ -28,7 +21,6 @@ public class WorldEditSchematic { | ||||
|         CuboidClipboard clipboard = new CuboidClipboard(size, origin); | ||||
|         Vector pos1 = new Vector(bot.getX(), bot.getY(), bot.getZ()); | ||||
|         Vector pos2 = new Vector(top.getX(), top.getY(), top.getZ()); | ||||
|         CuboidRegion region = new CuboidRegion(pos1, pos2); | ||||
|         EditSession session = PlotSquared.worldEdit.getWorldEdit().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorld(world)), 999999999); | ||||
|         clipboard.copy(session); | ||||
|         try { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 boy0001
					boy0001