mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 03:03:43 +01:00 
			
		
		
		
	Merge branch 'master' of https://github.com/IntellectualSites/PlotSquared
Conflicts: src/main/java/com/intellectualcrafters/plot/IPlotMain.java src/main/java/com/intellectualcrafters/plot/commands/Trim.java src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java src/main/java/com/plotsquared/bukkit/BukkitMain.java src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java src/main/java/com/plotsquared/sponge/SpongeMain.java src/main/java/com/plotsquared/sponge/util/SpongeChunkManager.java
This commit is contained in:
		@@ -32,6 +32,12 @@ public interface IPlotMain
 | 
			
		||||
     */
 | 
			
		||||
    File getDirectory();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Get the directory containing all the worlds
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    File getWorldContainer();
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Wrap a player into a PlotPlayer object
 | 
			
		||||
     * @param obj
 | 
			
		||||
 
 | 
			
		||||
@@ -237,6 +237,33 @@ public class PS
 | 
			
		||||
                                    }
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            
 | 
			
		||||
                            // Auto clearing
 | 
			
		||||
                            if (Settings.AUTO_CLEAR)
 | 
			
		||||
                            {
 | 
			
		||||
                                ExpireManager.runTask();
 | 
			
		||||
                            }
 | 
			
		||||
                            
 | 
			
		||||
                            // PlotMe
 | 
			
		||||
                            if (Settings.CONVERT_PLOTME || Settings.CACHE_PLOTME)
 | 
			
		||||
                            {
 | 
			
		||||
                                TaskManager.runTaskLater(new Runnable()
 | 
			
		||||
                                {
 | 
			
		||||
 | 
			
		||||
                                    @Override
 | 
			
		||||
                                    public void run()
 | 
			
		||||
                                    {
 | 
			
		||||
                                        if (IMP.initPlotMeConverter())
 | 
			
		||||
                                        {
 | 
			
		||||
                                            log("&c=== IMPORTANT ===");
 | 
			
		||||
                                            log("&cTHIS MESSAGE MAY BE EXTREMELY HELPFUL IF YOU HAVE TROUBLE CONVERTING PLOTME!");
 | 
			
		||||
                                            log("&c - Make sure 'UUID.read-from-disk' is disabled (false)!");
 | 
			
		||||
                                            log("&c - Sometimes the database can be locked, deleting PlotMe.jar beforehand will fix the issue!");
 | 
			
		||||
                                            log("&c - After the conversion is finished, please set 'plotme-convert.enabled' to false in the 'settings.yml'");
 | 
			
		||||
                                        }
 | 
			
		||||
                                    }
 | 
			
		||||
                                }, 20);
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    });
 | 
			
		||||
                }
 | 
			
		||||
@@ -278,33 +305,6 @@ public class PS
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            // PlotMe
 | 
			
		||||
            if (Settings.CONVERT_PLOTME || Settings.CACHE_PLOTME)
 | 
			
		||||
            {
 | 
			
		||||
                TaskManager.runTaskLater(new Runnable()
 | 
			
		||||
                {
 | 
			
		||||
 | 
			
		||||
                    @Override
 | 
			
		||||
                    public void run()
 | 
			
		||||
                    {
 | 
			
		||||
                        if (IMP.initPlotMeConverter())
 | 
			
		||||
                        {
 | 
			
		||||
                            log("&c=== IMPORTANT ===");
 | 
			
		||||
                            log("&cTHIS MESSAGE MAY BE EXTREMELY HELPFUL IF YOU HAVE TROUBLE CONVERTING PLOTME!");
 | 
			
		||||
                            log("&c - Make sure 'UUID.read-from-disk' is disabled (false)!");
 | 
			
		||||
                            log("&c - Sometimes the database can be locked, deleting PlotMe.jar beforehand will fix the issue!");
 | 
			
		||||
                            log("&c - After the conversion is finished, please set 'plotme-convert.enabled' to false in the 'settings.yml'");
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }, 200);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Auto clearing
 | 
			
		||||
            if (Settings.AUTO_CLEAR)
 | 
			
		||||
            {
 | 
			
		||||
                ExpireManager.runTask();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // World generators:
 | 
			
		||||
            final ConfigurationSection section = config.getConfigurationSection("worlds");
 | 
			
		||||
            if (section != null)
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,7 @@ public class Trim extends SubCommand
 | 
			
		||||
            public void run()
 | 
			
		||||
            {
 | 
			
		||||
                final String directory = world + File.separator + "region";
 | 
			
		||||
                final File folder = new File(directory);
 | 
			
		||||
                final File folder = new File(PS.get().IMP.getWorldContainer(), directory);
 | 
			
		||||
                final File[] regionFiles = folder.listFiles();
 | 
			
		||||
                for (final File file : regionFiles)
 | 
			
		||||
                {
 | 
			
		||||
@@ -175,14 +175,12 @@ public class Trim extends SubCommand
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void deleteChunks(final String world, final ArrayList<ChunkLoc> chunks)
 | 
			
		||||
    {
 | 
			
		||||
        ChunkManager.manager.deleteRegionFiles(world, chunks);
 | 
			
		||||
    public static void deleteChunks(final String world, final ArrayList<ChunkLoc> chunks, final Runnable whenDone) {
 | 
			
		||||
        ChunkManager.manager.deleteRegionFiles(world, chunks, whenDone);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void sendMessage(final String message)
 | 
			
		||||
    {
 | 
			
		||||
        PS.debug("&3PlotSquared -> World trim&8: &7" + message);
 | 
			
		||||
    public static void sendMessage(final String message) {
 | 
			
		||||
        PS.log("&3PlotSquared -> World trim&8: &7" + message);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public PlotId getId(final String id)
 | 
			
		||||
@@ -244,11 +242,13 @@ public class Trim extends SubCommand
 | 
			
		||||
        final ArrayList<ChunkLoc> empty = new ArrayList<>();
 | 
			
		||||
        getTrimRegions(empty, world, new Runnable()
 | 
			
		||||
        {
 | 
			
		||||
            @Override
 | 
			
		||||
            public void run()
 | 
			
		||||
            {
 | 
			
		||||
                deleteChunks(world, empty);
 | 
			
		||||
                PS.log("$1Trim task complete!");
 | 
			
		||||
            public void run() {
 | 
			
		||||
                deleteChunks(world, empty, new Runnable() {
 | 
			
		||||
                    @Override
 | 
			
		||||
                    public void run() {
 | 
			
		||||
                        PS.log("$1Trim task complete!");
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
        return true;
 | 
			
		||||
 
 | 
			
		||||
@@ -125,7 +125,9 @@ public abstract class ChunkManager
 | 
			
		||||
 | 
			
		||||
    public abstract void deleteRegionFiles(final String world, final List<ChunkLoc> chunks);
 | 
			
		||||
 | 
			
		||||
    public abstract Plot hasPlot(final String world, final ChunkLoc chunk);
 | 
			
		||||
    public abstract void deleteRegionFiles(final String world, final List<ChunkLoc> chunks, final Runnable whenDone);
 | 
			
		||||
 | 
			
		||||
    public abstract Plot hasPlot(String world, ChunkLoc chunk);
 | 
			
		||||
 | 
			
		||||
    public abstract boolean copyRegion(final Location pos1, final Location pos2, final Location newPos, final Runnable whenDone);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user