WE unregistration + home/visit sorting + format

- WorldEdit listener unregistration for external masking/extent/async
worldedit management. (wink)
- Use the same listing for home and visit as previous behavior was
confusing.
This commit is contained in:
boy0001
2015-09-13 01:19:39 +10:00
parent c386f33df8
commit 1c28a72f9c
28 changed files with 490 additions and 465 deletions

View File

@ -21,6 +21,8 @@
package com.intellectualcrafters.plot.commands;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
@ -51,7 +53,16 @@ public class Home extends SubCommand
@Override
public boolean onCommand(final PlotPlayer plr, String[] args)
{
final ArrayList<Plot> plots = PS.get().sortPlotsByTemp(PS.get().getPlots(plr));//PS.get().sortPlots(PS.get().getPlots(plr), SortType.CREATION_DATE, null);
final Set<Plot> all = PS.get().getPlots(plr);
final Iterator<Plot> iter = all.iterator();
while (iter.hasNext())
{
if (!iter.next().isBasePlot())
{
iter.remove();
}
}
final ArrayList<Plot> plots = PS.get().sortPlotsByTemp(all);
if (plots.size() == 1)
{
MainUtil.teleportPlayer(plr, plr.getLocation(), plots.get(0));

View File

@ -159,12 +159,12 @@ public class Info extends SubCommand
final UUID uuid = player.getUUID();
final String name = MainUtil.getName(plot.owner);
inv.setItem(1, new PlotItemStack(388, (short) 0, 1, "&cPlot Info", new String[] {
"&cID: &6" + plot.getId().toString(),
"&cOwner: &6" + name,
"&cAlias: &6" + plot.getSettings().getAlias(),
"&cBiome: &6" + plot.getBiome().toString().replaceAll("_", "").toLowerCase(),
"&cCan Build: &6" + plot.isAdded(uuid),
"&cIs Denied: &6" + plot.isDenied(uuid) }));
"&cID: &6" + plot.getId().toString(),
"&cOwner: &6" + name,
"&cAlias: &6" + plot.getSettings().getAlias(),
"&cBiome: &6" + plot.getBiome().toString().replaceAll("_", "").toLowerCase(),
"&cCan Build: &6" + plot.isAdded(uuid),
"&cIs Denied: &6" + plot.isDenied(uuid) }));
inv.setItem(1, new PlotItemStack(388, (short) 0, 1, "&cTrusted", new String[] { "&cAmount: &6" + plot.getTrusted().size(), "&8Click to view a list of the trusted users" }));
inv.setItem(1, new PlotItemStack(388, (short) 0, 1, "&cMembers", new String[] { "&cAmount: &6" + plot.getMembers().size(), "&8Click to view a list of plot members" }));
inv.setItem(1, new PlotItemStack(388, (short) 0, 1, "&cDenied", new String[] { "&cDenied", "&cAmount: &6" + plot.getDenied().size(), "&8Click to view a list of denied players" }));

View File

@ -61,7 +61,7 @@ public class MusicSubcommand extends SubCommand
{
final PlotItemStack item = getItem(index);
if (item == null) {
return true;
return true;
}
final int id = item.id == 7 ? 0 : item.id;
if (id == 0)

View File

@ -21,6 +21,7 @@
package com.intellectualcrafters.plot.commands;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
@ -114,6 +115,14 @@ public class Visit extends SubCommand
}
final Plot plot = plots.get(index);
final Iterator<Plot> iter = plots.iterator();
while (iter.hasNext())
{
if (!iter.next().isBasePlot())
{
iter.remove();
}
}
if (!plot.hasOwner())
{
if (!Permissions.hasPermission(plr, "plots.visit.unowned"))

View File

@ -248,7 +248,7 @@ public class list extends SubCommand
if (MathMan.isInteger(va))
{
if (MathMan.isInteger(vb)) {
return Integer.parseInt(vb) - Integer.parseInt(va);
return Integer.parseInt(vb) - Integer.parseInt(va);
}
return -1;
}
@ -296,7 +296,7 @@ public class list extends SubCommand
v2 += p2s;
}
if ((v2 == v1) && (v2 != 0)) {
return p2s - p1s;
return p2s - p1s;
}
return (int) Math.signum(v2 - v1);
}