Some changes

Fixes #605
Possibly #604
Other minor tweaks
This commit is contained in:
boy0001 2015-09-03 15:45:25 +10:00
parent 3a29022d19
commit afef79ea66
31 changed files with 195 additions and 146 deletions

View File

@ -1835,8 +1835,6 @@ public class PS {
options.put("cache.permissions", Settings.PERMISSION_CACHING); options.put("cache.permissions", Settings.PERMISSION_CACHING);
options.put("cache.ratings", Settings.CACHE_RATINGS); options.put("cache.ratings", Settings.CACHE_RATINGS);
options.put("cache.ratings", Settings.CACHE_RATINGS);
// Titles // Titles
options.put("titles", Settings.TITLES); options.put("titles", Settings.TITLES);

View File

@ -52,7 +52,7 @@ public class CreateRoadSchematic extends SubCommand {
return sendMessage(player, C.NOT_IN_PLOT_WORLD); return sendMessage(player, C.NOT_IN_PLOT_WORLD);
} }
HybridUtils.manager.setupRoadSchematic(plot); HybridUtils.manager.setupRoadSchematic(plot);
MainUtil.sendMessage(player, "&6Saved new road schematic (see console for more information)"); MainUtil.sendMessage(player, "&6Saved new road schematic. To test the road, fly to a few other plots and use /plot debugroadregen");
return true; return true;
} }
} }

View File

@ -69,6 +69,7 @@ public class DebugRoadRegen extends SubCommand {
} }
boolean result = HybridUtils.manager.regenerateRoad(world, chunk, extend); boolean result = HybridUtils.manager.regenerateRoad(world, chunk, extend);
MainUtil.sendMessage(player, "&6Regenerating chunk: " + chunk.x + "," + chunk.z + "\n&6 - Result: " + (result == true ? "&aSuccess" : "&cFailed")); MainUtil.sendMessage(player, "&6Regenerating chunk: " + chunk.x + "," + chunk.z + "\n&6 - Result: " + (result == true ? "&aSuccess" : "&cFailed"));
MainUtil.sendMessage(player, "&cTo regenerate all roads: /plot regenallroads");
} }
else { else {
HybridPlotManager manager = (HybridPlotManager) PS.get().getPlotManager(world); HybridPlotManager manager = (HybridPlotManager) PS.get().getPlotManager(world);
@ -76,6 +77,7 @@ public class DebugRoadRegen extends SubCommand {
manager.createRoadSouth(plotworld, plot); manager.createRoadSouth(plotworld, plot);
manager.createRoadSouthEast(plotworld, plot); manager.createRoadSouthEast(plotworld, plot);
MainUtil.sendMessage(player, "&6Regenerating plot south/east roads: " + plot.id + "\n&6 - Result: &aSuccess"); MainUtil.sendMessage(player, "&6Regenerating plot south/east roads: " + plot.id + "\n&6 - Result: &aSuccess");
MainUtil.sendMessage(player, "&cTo regenerate all roads: /plot regenallroads");
} }
return true; return true;
} }

View File

@ -125,8 +125,8 @@ public class FlagCmd extends SubCommand {
return false; return false;
} }
final String value = StringMan.join(Arrays.copyOfRange(args, 2, args.length), " "); final String value = StringMan.join(Arrays.copyOfRange(args, 2, args.length), " ");
if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase()) && !Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase() + "." + value.toLowerCase())) { if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase() + "." + value.toLowerCase())) {
MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase()); MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase() + "." + value.toLowerCase());
return false; return false;
} }
final Object parsed = af.parseValueRaw(value); final Object parsed = af.parseValueRaw(value);
@ -161,7 +161,7 @@ public class FlagCmd extends SubCommand {
if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) { if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
for (String entry : args[2].split(",")) { for (String entry : args[2].split(",")) {
if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase() + "." + entry)) { if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase() + "." + entry)) {
MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase()); MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase() + "." + entry);
return false; return false;
} }
} }
@ -201,7 +201,7 @@ public class FlagCmd extends SubCommand {
if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) { if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
for (String entry : args[2].split(",")) { for (String entry : args[2].split(",")) {
if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase() + "." + entry)) { if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase() + "." + entry)) {
MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase()); MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase() + "." + entry);
return false; return false;
} }
} }

View File

@ -542,6 +542,31 @@ public class Plot {
PlotAnalysis.analyzePlot(this, whenDone); PlotAnalysis.analyzePlot(this, whenDone);
} }
/**
* Set a flag for this plot
* @param flag
* @param value
*/
public void setFlag(String flag, Object value) {
FlagManager.addPlotFlag(this, new Flag(FlagManager.getFlag(flag), value));
}
/**
* Remove a flag from this plot
* @param flag
*/
public void removeFlag(String flag) {
FlagManager.removePlotFlag(this, flag);
}
/**
* Get the flag for a given key
* @param flag
*/
public Flag getFlag(String key) {
return FlagManager.getPlotFlag(this, key);
}
/** /**
* Delete a plot * Delete a plot
* @see PS#removePlot(String, PlotId, boolean) * @see PS#removePlot(String, PlotId, boolean)

View File

@ -18,7 +18,15 @@ public class Rating {
private int initial; private int initial;
public Rating(int value) { public Rating(int value) {
this.initial = value;
ratingMap = new HashMap<>(); ratingMap = new HashMap<>();
if (value < 10) {
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
ratingMap.put(Settings.RATING_CATEGORIES.get(i), value);
}
changed = true;
return;
}
if (Settings.RATING_CATEGORIES != null && Settings.RATING_CATEGORIES.size() > 1) { if (Settings.RATING_CATEGORIES != null && Settings.RATING_CATEGORIES.size() > 1) {
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) { for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
ratingMap.put(Settings.RATING_CATEGORIES.get(i), (value % 10) - 1); ratingMap.put(Settings.RATING_CATEGORIES.get(i), (value % 10) - 1);
@ -28,7 +36,6 @@ public class Rating {
else { else {
ratingMap.put(null, value); ratingMap.put(null, value);
} }
this.initial = value;
} }
public List<String> getCategories() { public List<String> getCategories() {

View File

@ -122,7 +122,7 @@ public class ExpireManager {
public void run() { public void run() {
PlotAnalysis changed = this.value; PlotAnalysis changed = this.value;
if (Settings.CLEAR_THRESHOLD != -1 && plotworld.TYPE == 0 && changed != null) { if (Settings.CLEAR_THRESHOLD != -1 && plotworld.TYPE == 0 && changed != null) {
if (changed.getComplexity() > Settings.CLEAR_THRESHOLD) { if (changed.changes != 0 && changed.getComplexity() > Settings.CLEAR_THRESHOLD) {
PS.debug("$2[&5Expire&dManager$2] &bIgnoring modified plot: " + plot + " : " + changed.getComplexity() + " - " + changed.changes); PS.debug("$2[&5Expire&dManager$2] &bIgnoring modified plot: " + plot + " : " + changed.getComplexity() + " - " + changed.changes);
expiredPlots.get(world).remove(plot); expiredPlots.get(world).remove(plot);
FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("analysis"), changed.asList())); FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("analysis"), changed.asList()));

View File

@ -1261,7 +1261,7 @@ public class MainUtil {
Location loc = new Location(bot.getWorld(), bot.getX() + home.x, bot.getY() + home.y, bot.getZ() + home.z); Location loc = new Location(bot.getWorld(), bot.getX() + home.x, bot.getY() + home.y, bot.getZ() + home.z);
if (BlockManager.manager.getBlock(loc).id != 0) { if (BlockManager.manager.getBlock(loc).id != 0) {
// sendConsoleMessage("ID was " + BukkitUtil.getBlock(loc).id); // sendConsoleMessage("ID was " + BukkitUtil.getBlock(loc).id);
loc.setY(Math.max(getHeighestBlock(w, bot.getX(), bot.getZ()), bot.getY())); loc.setY(Math.max(getHeighestBlock(w, loc.getX(), loc.getZ()), bot.getY()));
} }
return loc; return loc;
} }

View File

@ -1,5 +1,7 @@
package com.intellectualcrafters.plot.util; package com.intellectualcrafters.plot.util;
import org.bukkit.permissions.Permission;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.plotsquared.general.commands.CommandCaller; import com.plotsquared.general.commands.CommandCaller;
@ -13,13 +15,24 @@ public class Permissions {
return hasPermission((CommandCaller) player, perm); return hasPermission((CommandCaller) player, perm);
} }
public static boolean hasPermission(final CommandCaller player, final String perm) { public static boolean hasPermission(final CommandCaller player, String perm) {
if ((player == null) || player.hasPermission(C.PERMISSION_ADMIN.s()) || player.hasPermission(C.PERMISSION_STAR.s())) { if ((player == null) || player.hasPermission(C.PERMISSION_ADMIN.s()) || player.hasPermission(C.PERMISSION_STAR.s())) {
return true; return true;
} }
if (player.hasPermission(perm)) { if (player.hasPermission(perm)) {
return true; return true;
} }
perm = perm.toLowerCase().replaceAll("^[^a-z|0-9|\\.|_|-]", "");
String[] nodes = perm.split("\\.");
final StringBuilder n = new StringBuilder();
for (int i = 0; i < (nodes.length - 1); i++) {
n.append(nodes[i] + ("."));
if (!perm.equals(n + C.PERMISSION_STAR.s())) {
if (player.hasPermission(n + C.PERMISSION_STAR.s())) {
return true;
}
}
}
return false; return false;
} }
@ -40,6 +53,7 @@ public class Permissions {
if (player.hasPermission(stub + ".*")) { if (player.hasPermission(stub + ".*")) {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} }
System.out.print(range);
for (int i = range; i > 0; i--) { for (int i = range; i > 0; i--) {
if (player.hasPermission(stub + "." + i)) { if (player.hasPermission(stub + "." + i)) {
return i; return i;

View File

@ -190,8 +190,16 @@ public class LikePlotMeConverter {
pathwidth = 7; pathwidth = 7;
} }
PS.get().config.set("worlds." + world + ".road.width", pathwidth); PS.get().config.set("worlds." + world + ".road.width", pathwidth);
Integer pathheight = PLOTME_DG_YML.getInt("worlds." + plotMeWorldName + ".RoadHeight"); //
if (pathheight == null || pathheight == 0) {
pathheight = 64;
}
PS.get().config.set("worlds." + world + ".road.height", pathheight);
PS.get().config.set("worlds." + world + ".wall.height", pathheight);
PS.get().config.set("worlds." + world + ".plot.height", pathheight);
Integer plotsize = PLOTME_DG_YML.getInt("worlds." + plotMeWorldName + ".PlotSize"); // Integer plotsize = PLOTME_DG_YML.getInt("worlds." + plotMeWorldName + ".PlotSize"); //
if (plotsize == null) { if (plotsize == null || plotsize == 0) {
plotsize = 32; plotsize = 32;
} }
PS.get().config.set("worlds." + world + ".plot.size", plotsize); PS.get().config.set("worlds." + world + ".plot.size", plotsize);

View File

@ -68,6 +68,9 @@ public class ChunkListener implements Listener {
PlotPlayer pp = entry.getValue(); PlotPlayer pp = entry.getValue();
Location loc = pp.getLocation(); Location loc = pp.getLocation();
String world = loc.getWorld(); String world = loc.getWorld();
if (!PS.get().isPlotWorld(world)) {
continue;
}
HashMap<ChunkLoc, Integer> map = players.get(world); HashMap<ChunkLoc, Integer> map = players.get(world);
if (map == null) { if (map == null) {
map = new HashMap<>(); map = new HashMap<>();
@ -107,8 +110,10 @@ public class ChunkListener implements Listener {
for (World world : Bukkit.getWorlds()) { for (World world : Bukkit.getWorlds()) {
String name = world.getName(); String name = world.getName();
boolean autosave = world.isAutoSave(); boolean autosave = world.isAutoSave();
boolean plotworld = PS.get().isPlotWorld(name); if (!PS.get().isPlotWorld(name)) {
if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave && plotworld) { continue;
}
if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave) {
world.setAutoSave(false); world.setAutoSave(false);
} }
HashMap<ChunkLoc, Integer> map = players.get(name); HashMap<ChunkLoc, Integer> map = players.get(name);
@ -119,12 +124,12 @@ public class ChunkListener implements Listener {
int x = chunk.getX(); int x = chunk.getX();
int z = chunk.getZ(); int z = chunk.getZ();
if (!map.containsKey(new ChunkLoc(x, z))) { if (!map.containsKey(new ChunkLoc(x, z))) {
if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE || !plotworld || !unloadChunk(name, chunk)) { if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE || !unloadChunk(name, chunk)) {
chunk.unload(true, false); chunk.unload(true, false);
} }
} }
} }
if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave && plotworld) { if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave) {
world.setAutoSave(true); world.setAutoSave(true);
} }
} }

View File

@ -346,7 +346,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
} }
Flag flag; Flag flag;
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS) && (flag = FlagManager.getPlotFlag(plot, "blocked-cmds")) != null) { if ((flag = FlagManager.getPlotFlag(plot, "blocked-cmds")) != null && !Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
List<String> v = (List<String>) flag.getValue(); List<String> v = (List<String>) flag.getValue();
String msg = event.getMessage().toLowerCase().replaceFirst("/", ""); String msg = event.getMessage().toLowerCase().replaceFirst("/", "");

View File

@ -61,7 +61,6 @@ public class WESubscriber {
if (pp != null && pp.getAttribute("worldedit")) { if (pp != null && pp.getAttribute("worldedit")) {
return; return;
} }
PlotPlayer player = UUIDHandler.getPlayer(actor.getName()); PlotPlayer player = UUIDHandler.getPlayer(actor.getName());
HashSet<RegionWrapper> mask = WEManager.getMask(player); HashSet<RegionWrapper> mask = WEManager.getMask(player);
PlotWorld plotworld = PS.get().getPlotWorld(world); PlotWorld plotworld = PS.get().getPlotWorld(world);

View File

@ -1,17 +1,16 @@
package com.plotsquared.bukkit.object; package com.plotsquared.bukkit.object;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.WeatherType; import org.bukkit.WeatherType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission; import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.PluginManager;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
@ -19,7 +18,6 @@ import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.EconHandler; import com.intellectualcrafters.plot.util.EconHandler;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.PlotGamemode; import com.intellectualcrafters.plot.util.PlotGamemode;
import com.intellectualcrafters.plot.util.PlotWeather; import com.intellectualcrafters.plot.util.PlotWeather;
import com.intellectualcrafters.plot.util.UUIDHandler; import com.intellectualcrafters.plot.util.UUIDHandler;
@ -83,22 +81,7 @@ public class BukkitPlayer extends PlotPlayer {
return EconHandler.manager.hasPermission(getName(), node); return EconHandler.manager.hasPermission(getName(), node);
} }
boolean value = this.player.hasPermission(node); boolean value = this.player.hasPermission(node);
if (!value) { System.out.print(value + " | " + node);
final String[] nodes = node.split("\\.");
if (!MathMan.isInteger(nodes[nodes.length - 1])) {
final StringBuilder n = new StringBuilder();
for (int i = 0; i < (nodes.length - 1); i++) {
n.append(nodes[i] + ("."));
if (!node.equals(n + C.PERMISSION_STAR.s())) {
value = player.hasPermission(n + C.PERMISSION_STAR.s());
if (value) {
break;
}
}
}
value = this.player.hasPermission(node);
}
}
if (Settings.PERMISSION_CACHING) { if (Settings.PERMISSION_CACHING) {
if (value) { if (value) {
this.hasPerm.add(node); this.hasPerm.add(node);
@ -110,6 +93,29 @@ public class BukkitPlayer extends PlotPlayer {
return value; return value;
} }
public Permission getPermission(String node) {
PluginManager manager = Bukkit.getPluginManager();
Permission perm = manager.getPermission(node);
if (perm == null) {
String[] nodes = node.split("\\.");
perm = new Permission(node);
final StringBuilder n = new StringBuilder();
for (int i = 0; i < (nodes.length - 1); i++) {
n.append(nodes[i] + ("."));
if (!node.equals(n + C.PERMISSION_STAR.s())) {
Permission parent = getPermission(n + C.PERMISSION_STAR.s());
if (parent != null) {
perm.addParent(parent, true);
}
}
}
manager.addPermission(perm);
}
manager.recalculatePermissionDefaults(perm);
perm.recalculatePermissibles();
return perm;
}
@Override @Override
public void sendMessage(final String message) { public void sendMessage(final String message) {
this.player.sendMessage(message); this.player.sendMessage(message);

View File

@ -197,7 +197,6 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
case 47: case 47:
case 48: case 48:
case 49: case 49:
case 50:
case 51: case 51:
case 52: case 52:
case 54: case 54:
@ -215,8 +214,6 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
case 11: case 11:
case 73: case 73:
case 74: case 74:
case 75:
case 76:
case 78: case 78:
case 79: case 79:
case 80: case 80:

View File

@ -20,11 +20,8 @@ import org.spongepowered.api.Server;
import org.spongepowered.api.block.BlockState; import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockType; import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.block.BlockTypes; import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Subscribe; import org.spongepowered.api.event.entity.living.player.PlayerChatEvent;
import org.spongepowered.api.event.entity.player.PlayerChatEvent;
import org.spongepowered.api.event.state.PreInitializationEvent;
import org.spongepowered.api.event.state.ServerAboutToStartEvent;
import org.spongepowered.api.plugin.Plugin; import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.plugin.PluginContainer; import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.service.profile.GameProfileResolver; import org.spongepowered.api.service.profile.GameProfileResolver;
@ -37,6 +34,7 @@ import org.spongepowered.api.world.GeneratorTypes;
import org.spongepowered.api.world.World; import org.spongepowered.api.world.World;
import com.google.common.base.Optional; import com.google.common.base.Optional;
import com.google.common.eventbus.Subscribe;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.intellectualcrafters.configuration.ConfigurationSection; import com.intellectualcrafters.configuration.ConfigurationSection;
import com.intellectualcrafters.plot.IPlotMain; import com.intellectualcrafters.plot.IPlotMain;

View File

@ -1,6 +1,6 @@
package com.plotsquared.sponge.events; package com.plotsquared.sponge.events;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Cancellable; import org.spongepowered.api.event.Cancellable;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;

View File

@ -1,6 +1,6 @@
package com.plotsquared.sponge.events; package com.plotsquared.sponge.events;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;

View File

@ -1,6 +1,6 @@
package com.plotsquared.sponge.events; package com.plotsquared.sponge.events;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.AbstractEvent; import org.spongepowered.api.event.AbstractEvent;
public abstract class PlayerEvent extends AbstractEvent { public abstract class PlayerEvent extends AbstractEvent {

View File

@ -1,6 +1,6 @@
package com.plotsquared.sponge.events; package com.plotsquared.sponge.events;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;

View File

@ -2,7 +2,7 @@ package com.plotsquared.sponge.events;
import java.util.UUID; import java.util.UUID;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;

View File

@ -2,7 +2,7 @@ package com.plotsquared.sponge.events;
import java.util.UUID; import java.util.UUID;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;

View File

@ -2,7 +2,7 @@ package com.plotsquared.sponge.events;
import java.util.UUID; import java.util.UUID;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;

View File

@ -1,6 +1,6 @@
package com.plotsquared.sponge.events; package com.plotsquared.sponge.events;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Cancellable; import org.spongepowered.api.event.Cancellable;
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;

View File

@ -12,29 +12,13 @@ import org.spongepowered.api.entity.living.Ambient;
import org.spongepowered.api.entity.living.Living; import org.spongepowered.api.entity.living.Living;
import org.spongepowered.api.entity.living.animal.Animal; import org.spongepowered.api.entity.living.animal.Animal;
import org.spongepowered.api.entity.living.monster.Monster; import org.spongepowered.api.entity.living.monster.Monster;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.entity.vehicle.Boat; import org.spongepowered.api.entity.vehicle.Boat;
import org.spongepowered.api.entity.vehicle.minecart.Minecart; import org.spongepowered.api.entity.vehicle.minecart.Minecart;
import org.spongepowered.api.event.Subscribe; import org.spongepowered.api.event.entity.living.player.PlayerChatEvent;
import org.spongepowered.api.event.block.BlockMoveEvent; import org.spongepowered.api.event.entity.living.player.PlayerConnectionEvent;
import org.spongepowered.api.event.block.BlockRedstoneUpdateEvent; import org.spongepowered.api.event.entity.living.player.PlayerJoinEvent;
import org.spongepowered.api.event.block.FloraGrowEvent; import org.spongepowered.api.event.entity.living.player.PlayerQuitEvent;
import org.spongepowered.api.event.block.FluidSpreadEvent;
import org.spongepowered.api.event.entity.EntityChangeBlockEvent;
import org.spongepowered.api.event.entity.EntitySpawnEvent;
import org.spongepowered.api.event.entity.EntityTeleportEvent;
import org.spongepowered.api.event.entity.player.PlayerBreakBlockEvent;
import org.spongepowered.api.event.entity.player.PlayerChangeWorldEvent;
import org.spongepowered.api.event.entity.player.PlayerChatEvent;
import org.spongepowered.api.event.entity.player.PlayerInteractBlockEvent;
import org.spongepowered.api.event.entity.player.PlayerJoinEvent;
import org.spongepowered.api.event.entity.player.PlayerMoveEvent;
import org.spongepowered.api.event.entity.player.PlayerPlaceBlockEvent;
import org.spongepowered.api.event.entity.player.PlayerQuitEvent;
import org.spongepowered.api.event.message.CommandEvent;
import org.spongepowered.api.event.network.PlayerConnectionEvent;
import org.spongepowered.api.event.world.ChunkPreGenerateEvent;
import org.spongepowered.api.event.world.WorldOnExplosionEvent;
import org.spongepowered.api.network.PlayerConnection; import org.spongepowered.api.network.PlayerConnection;
import org.spongepowered.api.text.Text; import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.Texts; import org.spongepowered.api.text.Texts;
@ -46,6 +30,7 @@ import org.spongepowered.api.world.extent.Extent;
import com.flowpowered.math.vector.Vector3d; import com.flowpowered.math.vector.Vector3d;
import com.flowpowered.math.vector.Vector3i; import com.flowpowered.math.vector.Vector3i;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.eventbus.Subscribe;
import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
@ -726,10 +711,10 @@ public class MainListener {
if (!PlotListener.plotExit(pp, lastPlot)) { if (!PlotListener.plotExit(pp, lastPlot)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED);
if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) { if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
event.setNewLocation(from); event.setTo(from);
} }
else { else {
event.setNewLocation(world.getSpawnLocation()); event.setTo(world.getSpawnLocation());
} }
return; return;
} }
@ -742,10 +727,10 @@ public class MainListener {
if (!PlotListener.plotEntry(pp, plot)) { if (!PlotListener.plotEntry(pp, plot)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED); MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) { if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
event.setNewLocation(from); event.setTo(from);
} }
else { else {
event.setNewLocation(world.getSpawnLocation()); event.setTo(world.getSpawnLocation());
} }
return; return;
} }
@ -755,13 +740,13 @@ public class MainListener {
if (x2 > border) { if (x2 > border) {
Vector3d pos = to.getPosition(); Vector3d pos = to.getPosition();
to = to.setPosition(new Vector3d(border - 4, pos.getY(), pos.getZ())); to = to.setPosition(new Vector3d(border - 4, pos.getY(), pos.getZ()));
event.setNewLocation(to); event.setTo(to);
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} }
else if (x2 < -border) { else if (x2 < -border) {
Vector3d pos = to.getPosition(); Vector3d pos = to.getPosition();
to = to.setPosition(new Vector3d(-border + 4, pos.getY(), pos.getZ())); to = to.setPosition(new Vector3d(-border + 4, pos.getY(), pos.getZ()));
event.setNewLocation(to); event.setTo(to);
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} }
} }
@ -793,10 +778,10 @@ public class MainListener {
if (!PlotListener.plotExit(pp, lastPlot)) { if (!PlotListener.plotExit(pp, lastPlot)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED);
if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) { if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
event.setNewLocation(from); event.setTo(from);
} }
else { else {
event.setNewLocation(world.getSpawnLocation()); event.setTo(world.getSpawnLocation());
} }
return; return;
} }
@ -809,10 +794,10 @@ public class MainListener {
if (!PlotListener.plotEntry(pp, plot)) { if (!PlotListener.plotEntry(pp, plot)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED); MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) { if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
event.setNewLocation(from); event.setTo(from);
} }
else { else {
event.setNewLocation(world.getSpawnLocation()); event.setTo(world.getSpawnLocation());
} }
return; return;
} }
@ -822,13 +807,13 @@ public class MainListener {
if (z2 > border) { if (z2 > border) {
Vector3d pos = to.getPosition(); Vector3d pos = to.getPosition();
to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), border - 4)); to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), border - 4));
event.setNewLocation(to); event.setTo(to);
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} }
else if (z2 < -border) { else if (z2 < -border) {
Vector3d pos = to.getPosition(); Vector3d pos = to.getPosition();
to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), -border + 4)); to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), -border + 4));
event.setNewLocation(to); event.setTo(to);
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} }
} }
@ -867,10 +852,10 @@ public class MainListener {
if (!PlotListener.plotExit(pp, lastPlot)) { if (!PlotListener.plotExit(pp, lastPlot)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED);
if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) { if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
event.setNewLocation(from); event.setTo(from);
} }
else { else {
event.setNewLocation(world.getSpawnLocation()); event.setTo(world.getSpawnLocation());
} }
return; return;
} }
@ -883,10 +868,10 @@ public class MainListener {
if (!PlotListener.plotEntry(pp, plot)) { if (!PlotListener.plotEntry(pp, plot)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED); MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) { if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
event.setNewLocation(from); event.setTo(from);
} }
else { else {
event.setNewLocation(world.getSpawnLocation()); event.setTo(world.getSpawnLocation());
} }
return; return;
} }
@ -896,13 +881,13 @@ public class MainListener {
if (x2 > border) { if (x2 > border) {
Vector3d pos = to.getPosition(); Vector3d pos = to.getPosition();
to = to.setPosition(new Vector3d(border - 4, pos.getY(), pos.getZ())); to = to.setPosition(new Vector3d(border - 4, pos.getY(), pos.getZ()));
event.setNewLocation(to); event.setTo(to);
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} }
else if (x2 < -border) { else if (x2 < -border) {
Vector3d pos = to.getPosition(); Vector3d pos = to.getPosition();
to = to.setPosition(new Vector3d(-border + 4, pos.getY(), pos.getZ())); to = to.setPosition(new Vector3d(-border + 4, pos.getY(), pos.getZ()));
event.setNewLocation(to); event.setTo(to);
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} }
} }
@ -934,10 +919,10 @@ public class MainListener {
if (!PlotListener.plotExit(pp, lastPlot)) { if (!PlotListener.plotExit(pp, lastPlot)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED);
if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) { if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
event.setNewLocation(from); event.setTo(from);
} }
else { else {
event.setNewLocation(player.getWorld().getSpawnLocation()); event.setTo(player.getWorld().getSpawnLocation());
} }
return; return;
} }
@ -950,10 +935,10 @@ public class MainListener {
if (!PlotListener.plotEntry(pp, plot)) { if (!PlotListener.plotEntry(pp, plot)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED); MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) { if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
event.setNewLocation(from); event.setTo(from);
} }
else { else {
event.setNewLocation(player.getWorld().getSpawnLocation()); event.setTo(player.getWorld().getSpawnLocation());
} }
return; return;
} }
@ -963,13 +948,13 @@ public class MainListener {
if (z2 > border) { if (z2 > border) {
Vector3d pos = to.getPosition(); Vector3d pos = to.getPosition();
to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), border - 4)); to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), border - 4));
event.setNewLocation(to); event.setTo(to);
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} }
else if (z2 < -border) { else if (z2 < -border) {
Vector3d pos = to.getPosition(); Vector3d pos = to.getPosition();
to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), -border + 4)); to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), -border + 4));
event.setNewLocation(to); event.setTo(to);
MainUtil.sendMessage(pp, C.BORDER); MainUtil.sendMessage(pp, C.BORDER);
} }
} }

View File

@ -7,9 +7,9 @@ import java.util.UUID;
import org.spongepowered.api.data.key.Keys; import org.spongepowered.api.data.key.Keys;
import org.spongepowered.api.data.manipulator.mutable.TargetedLocationData; import org.spongepowered.api.data.manipulator.mutable.TargetedLocationData;
import org.spongepowered.api.data.value.mutable.Value; import org.spongepowered.api.data.value.mutable.Value;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.entity.player.gamemode.GameMode; import org.spongepowered.api.entity.living.player.gamemode.GameMode;
import org.spongepowered.api.entity.player.gamemode.GameModes; import org.spongepowered.api.entity.living.player.gamemode.GameModes;
import org.spongepowered.api.text.TextBuilder; import org.spongepowered.api.text.TextBuilder;
import org.spongepowered.api.text.Texts; import org.spongepowered.api.text.Texts;
import org.spongepowered.api.text.action.HoverAction; import org.spongepowered.api.text.action.HoverAction;

View File

@ -5,7 +5,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.text.Text; import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.Texts; import org.spongepowered.api.text.Texts;
import org.spongepowered.api.util.command.CommandCallable; import org.spongepowered.api.util.command.CommandCallable;

View File

@ -3,7 +3,7 @@ package com.plotsquared.sponge.util;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.item.ItemType; import org.spongepowered.api.item.ItemType;
import org.spongepowered.api.item.ItemTypes; import org.spongepowered.api.item.ItemTypes;
import org.spongepowered.api.item.inventory.Carrier; import org.spongepowered.api.item.inventory.Carrier;

View File

@ -1,7 +1,7 @@
package com.plotsquared.sponge.util; package com.plotsquared.sponge.util;
import org.spongepowered.api.entity.Entity; import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.world.World; import org.spongepowered.api.world.World;
import org.spongepowered.api.world.extent.Extent; import org.spongepowered.api.world.extent.Extent;

View File

@ -3,7 +3,7 @@ package com.plotsquared.sponge.uuid;
import java.util.UUID; import java.util.UUID;
import org.spongepowered.api.GameProfile; import org.spongepowered.api.GameProfile;
import org.spongepowered.api.entity.player.Player; import org.spongepowered.api.entity.living.player.Player;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer; import com.intellectualcrafters.plot.object.OfflinePlotPlayer;

View File

@ -15,10 +15,6 @@ commands:
permission: plots.use permission: plots.use
permission-message: "You are lacking the permission node 'plots.use'" permission-message: "You are lacking the permission node 'plots.use'"
permissions: permissions:
plots.admin:
children:
plots.*: true
default: op
plots.use: plots.use:
default: true default: true
plots.permpack.basicflags: plots.permpack.basicflags:
@ -26,43 +22,48 @@ permissions:
children: children:
plots.set.flag: true plots.set.flag: true
plots.flag: true plots.flag: true
plots.set.flag.titles: true plots.flag.add: true
plots.set.flag.greeting: true plots.flag.remove: true
plots.set.flag.farewell: true plots.flag.list: true
plots.set.flag.notify-enter: true plots.flag.info: true
plots.set.flag.notify-leave: true plots.set.flag.titles.*: true
plots.set.flag.feed: true plots.set.flag.greeting.*: true
plots.set.flag.heal: true plots.set.flag.farewell.*: true
plots.set.flag.invincible: true plots.set.flag.notify-enter.*: true
plots.set.flag.instabreak: true plots.set.flag.notify-leave.*: true
plots.set.flag.fly: true plots.set.flag.feed.*: true
plots.set.flag.gamemode: true plots.set.flag.heal.*: true
plots.set.flag.time: true plots.set.flag.invincible.*: true
plots.set.flag.weather: true plots.set.flag.instabreak.*: true
plots.set.flag.music: true plots.set.flag.fly.*: true
plots.set.flag.disable-physics: true plots.set.flag.gamemode.*: true
plots.set.flag.pve: true plots.set.flag.time.*: true
plots.set.flag.pvp: true plots.set.flag.weather.*: true
plots.set.flag.explosion: true plots.set.flag.music.*: true
plots.set.flag.hostile-interact: true plots.set.flag.disable-physics.*: true
plots.set.flag.hostile-attack: true plots.set.flag.pve.*: true
plots.set.flag.animal-interact: true plots.set.flag.pvp.*: true
plots.set.flag.animal-attack: true plots.set.flag.explosion.*: true
plots.set.flag.tamed-interact: true plots.set.flag.hostile-interact.*: true
plots.set.flag.tamed-attack: true plots.set.flag.hostile-attack.*: true
plots.set.flag.misc-interact: true plots.set.flag.player-interact.*: true
plots.set.flag.hanging-place: true plots.set.flag.animal-interact.*: true
plots.set.flag.hanging-break: true plots.set.flag.animal-attack.*: true
plots.set.flag.vehicle-use: true plots.set.flag.tamed-interact.*: true
plots.set.flag.vehicle-place: true plots.set.flag.tamed-attack.*: true
plots.set.flag.vehicle-break: true plots.set.flag.misc-interact.*: true
plots.set.flag.player-interact: true plots.set.flag.hanging-place.*: true
plots.set.flag.place: true plots.set.flag.hanging-break.*: true
plots.set.flag.break: true plots.set.flag.vehicle-use.*: true
plots.set.flag.use: true plots.set.flag.vehicle-place.*: true
plots.set.flag.forcefield: true plots.set.flag.vehicle-break.*: true
plots.set.flag.price: true plots.set.flag.player-interact.*: true
plots.set.flag.no-worldedit: true plots.set.flag.place.*: true
plots.set.flag.break.*: true
plots.set.flag.use.*: true
plots.set.flag.forcefield.*: true
plots.set.flag.price.*: true
plots.set.flag.no-worldedit.*: true
plots.permpack.basicinbox: plots.permpack.basicinbox:
default: op default: op
children: children:
@ -104,6 +105,10 @@ permissions:
plots.visit.owned: true plots.visit.owned: true
plots.visit.shared: true plots.visit.shared: true
plots.set.flag: true plots.set.flag: true
plots.flag.add: true
plots.flag.remove: true
plots.flag.list: true
plots.flag.info: true
plots.flag: true plots.flag: true
plots.buy: true plots.buy: true
plots.chat: true plots.chat: true