mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-03 02:33:43 +01:00 
			
		
		
		
	Plot info footer
This commit is contained in:
		@@ -265,6 +265,7 @@ public class Info extends SubCommand {
 | 
			
		||||
                    }
 | 
			
		||||
                    MainUtil.sendMessage(player, C.PLOT_INFO_HEADER);
 | 
			
		||||
                    MainUtil.sendMessage(player, info, false);
 | 
			
		||||
                    MainUtil.sendMessage(player, C.PLOT_INFO_FOOTER);
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
            return;
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ import com.plotsquared.general.commands.CommandDeclaration;
 | 
			
		||||
        permission = "plots.admin",
 | 
			
		||||
        description = "Update PlotSquared",
 | 
			
		||||
        usage = "/plot update",
 | 
			
		||||
        requiredType = RequiredType.CONSOLE,
 | 
			
		||||
        requiredType = RequiredType.PLAYER,
 | 
			
		||||
        aliases = {"updateplugin"},
 | 
			
		||||
        category = CommandCategory.DEBUG
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
@@ -45,12 +45,6 @@ import com.plotsquared.general.commands.CommandDeclaration;
 | 
			
		||||
)
 | 
			
		||||
public class Visit extends SubCommand {
 | 
			
		||||
 | 
			
		||||
    public Visit() {
 | 
			
		||||
        requiredArguments = new Argument[] {
 | 
			
		||||
                Argument.String
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public List<Plot> getPlots(final UUID uuid) {
 | 
			
		||||
        final List<Plot> plots = new ArrayList<>();
 | 
			
		||||
        for (final Plot p : PS.get().getPlots()) {
 | 
			
		||||
 
 | 
			
		||||
@@ -271,6 +271,12 @@ public class list extends SubCommand {
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                UUID uuid = UUIDHandler.getUUID(args[0], null);
 | 
			
		||||
                if (uuid == null) {
 | 
			
		||||
                    try {
 | 
			
		||||
                        uuid = UUID.fromString(args[0]);
 | 
			
		||||
                    }
 | 
			
		||||
                    catch (Exception e) {}
 | 
			
		||||
                }
 | 
			
		||||
                if (uuid != null) {
 | 
			
		||||
                    if (!Permissions.hasPermission(plr, "plots.list.player")) {
 | 
			
		||||
                        MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.list.player");
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,7 @@ import java.util.ArrayList;
 | 
			
		||||
 | 
			
		||||
import com.intellectualcrafters.plot.PS;
 | 
			
		||||
import com.intellectualcrafters.plot.object.PlotPlayer;
 | 
			
		||||
import com.intellectualcrafters.plot.util.MainUtil;
 | 
			
		||||
import com.intellectualcrafters.plot.util.TaskManager;
 | 
			
		||||
import com.plotsquared.general.commands.CommandDeclaration;
 | 
			
		||||
 | 
			
		||||
@@ -35,7 +36,7 @@ import com.plotsquared.general.commands.CommandDeclaration;
 | 
			
		||||
        command = "plugin",
 | 
			
		||||
        permission = "plots.use",
 | 
			
		||||
        description = "Show plugin information",
 | 
			
		||||
        aliases = {"version}"},
 | 
			
		||||
        aliases = {"version"},
 | 
			
		||||
        category = CommandCategory.INFO
 | 
			
		||||
)
 | 
			
		||||
public class plugin extends SubCommand {
 | 
			
		||||
@@ -80,7 +81,7 @@ public class plugin extends SubCommand {
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
                for (final String s : strings) {
 | 
			
		||||
                    plr.sendMessage(s);
 | 
			
		||||
                    MainUtil.sendMessage(plr, s);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 
 | 
			
		||||
@@ -386,6 +386,7 @@ public enum C {
 | 
			
		||||
    PLOT_INFO_UNCLAIMED("$2Plot $1%s$2 is not yet claimed", "Info"),
 | 
			
		||||
    PLOT_INFO_HEADER("$3&m---------&r $1INFO $3&m---------", false, "Info"),
 | 
			
		||||
    PLOT_INFO("$1ID: $2%id%$1&-" + "$1Alias: $2%alias%$1&-" + "$1Owner: $2%owner%$1&-" + "$1Biome: $2%biome%$1&-" + "$1Can Build: $2%build%$1&-" + "$1Rating: $2%rating%&-" + "$1Trusted: $2%trusted%$1&-" + "$1Members: $2%members%$1&-" + "$1Denied: $2%denied%$1&-" + "$1Flags: $2%flags%", "Info"),
 | 
			
		||||
    PLOT_INFO_FOOTER("$3&m---------&r $1INFO $3&m---------", false, "Info"),
 | 
			
		||||
    PLOT_INFO_TRUSTED("$1Trusted:$2 %trusted%", "Info"),
 | 
			
		||||
    PLOT_INFO_MEMBERS("$1Members:$2 %members%", "Info"),
 | 
			
		||||
    PLOT_INFO_DENIED("$1Denied:$2 %denied%", "Info"),
 | 
			
		||||
 
 | 
			
		||||
@@ -160,19 +160,24 @@ public abstract class PlotWorld {
 | 
			
		||||
            case "s":
 | 
			
		||||
            case "0":
 | 
			
		||||
                this.GAMEMODE = PlotGamemode.SURVIVAL;
 | 
			
		||||
                break;
 | 
			
		||||
            case "creative":
 | 
			
		||||
            case "c":
 | 
			
		||||
            case "1":
 | 
			
		||||
                this.GAMEMODE = PlotGamemode.CREATIVE;
 | 
			
		||||
                break;
 | 
			
		||||
            case "adventure":
 | 
			
		||||
            case "a":
 | 
			
		||||
            case "2":
 | 
			
		||||
                this.GAMEMODE = PlotGamemode.ADVENTURE;
 | 
			
		||||
                break;
 | 
			
		||||
            case "spectator":
 | 
			
		||||
            case "3":
 | 
			
		||||
                this.GAMEMODE = PlotGamemode.SPECTATOR;
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                PS.debug("&cInvalid gamemode set for: " + worldname);
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        this.HOME_ALLOW_NONMEMBER = config.getBoolean("home.allow-nonmembers");
 | 
			
		||||
 
 | 
			
		||||
@@ -1370,12 +1370,16 @@ public class MainUtil {
 | 
			
		||||
        final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(plot2.world, plot2.id);
 | 
			
		||||
        final Location top = MainUtil.getPlotTopLoc(plot1.world, plot1.id);
 | 
			
		||||
        if (plot1.owner == null) {
 | 
			
		||||
            PS.debug(plot2 +" is unowned (single)");
 | 
			
		||||
            TaskManager.runTask(whenDone);
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        final Plot pos1 = getBottomPlot(plot1);
 | 
			
		||||
        final Plot pos2 = getTopPlot(plot1);
 | 
			
		||||
        final PlotId size = MainUtil.getSize(plot1);
 | 
			
		||||
        if (!MainUtil.isUnowned(plot2.world, plot2.id, new PlotId((plot2.id.x + size.x) - 1, (plot2.id.y + size.y) - 1))) {
 | 
			
		||||
            PS.debug(plot2 +" is unowned (multi)");
 | 
			
		||||
            TaskManager.runTask(whenDone);
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        final int offset_x = plot2.id.x - pos1.id.x;
 | 
			
		||||
 
 | 
			
		||||
@@ -74,7 +74,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
 | 
			
		||||
                            final String s = current.replaceAll(".dat$", "");
 | 
			
		||||
                            try {
 | 
			
		||||
                                UUID uuid = UUID.fromString(s);
 | 
			
		||||
                                if (check || all.contains(uuid)) {
 | 
			
		||||
                                if (check || all.remove(uuid)) {
 | 
			
		||||
                                    File file = new File(playerdataFolder + File.separator + current);
 | 
			
		||||
                                    InputSupplier<FileInputStream> is = Files.newInputStreamSupplier(file);
 | 
			
		||||
                                    NbtFactory.NbtCompound compound = NbtFactory.fromStream(is, NbtFactory.StreamOptions.GZIP_COMPRESSION);
 | 
			
		||||
@@ -91,8 +91,13 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    add(toAdd);
 | 
			
		||||
                    if (whenDone != null) whenDone.run();
 | 
			
		||||
                    return;
 | 
			
		||||
                    if (all.size() == 0) {
 | 
			
		||||
                        if (whenDone != null) whenDone.run();
 | 
			
		||||
                        return;
 | 
			
		||||
                    }
 | 
			
		||||
                    else {
 | 
			
		||||
                        PS.debug("Failed to cache: " + all.size() + " uuids - slowly processing all files");
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                final HashSet<String> worlds = new HashSet<>();
 | 
			
		||||
                worlds.add(world);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user