mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
parent
3a29022d19
commit
afef79ea66
@ -1835,8 +1835,6 @@ public class PS {
|
||||
options.put("cache.permissions", Settings.PERMISSION_CACHING);
|
||||
options.put("cache.ratings", Settings.CACHE_RATINGS);
|
||||
|
||||
options.put("cache.ratings", Settings.CACHE_RATINGS);
|
||||
|
||||
// Titles
|
||||
options.put("titles", Settings.TITLES);
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class CreateRoadSchematic extends SubCommand {
|
||||
return sendMessage(player, C.NOT_IN_PLOT_WORLD);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ public class DebugRoadRegen extends SubCommand {
|
||||
}
|
||||
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, "&cTo regenerate all roads: /plot regenallroads");
|
||||
}
|
||||
else {
|
||||
HybridPlotManager manager = (HybridPlotManager) PS.get().getPlotManager(world);
|
||||
@ -76,6 +77,7 @@ public class DebugRoadRegen extends SubCommand {
|
||||
manager.createRoadSouth(plotworld, plot);
|
||||
manager.createRoadSouthEast(plotworld, plot);
|
||||
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;
|
||||
}
|
||||
|
@ -125,8 +125,8 @@ public class FlagCmd extends SubCommand {
|
||||
return false;
|
||||
}
|
||||
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())) {
|
||||
MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].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() + "." + value.toLowerCase());
|
||||
return false;
|
||||
}
|
||||
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())) {
|
||||
for (String entry : args[2].split(",")) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -201,7 +201,7 @@ public class FlagCmd extends SubCommand {
|
||||
if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
|
||||
for (String entry : args[2].split(",")) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -542,6 +542,31 @@ public class Plot {
|
||||
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
|
||||
* @see PS#removePlot(String, PlotId, boolean)
|
||||
|
@ -18,7 +18,15 @@ public class Rating {
|
||||
private int initial;
|
||||
|
||||
public Rating(int value) {
|
||||
this.initial = value;
|
||||
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) {
|
||||
for (int i = 0 ; i < Settings.RATING_CATEGORIES.size(); i++) {
|
||||
ratingMap.put(Settings.RATING_CATEGORIES.get(i), (value % 10) - 1);
|
||||
@ -28,7 +36,6 @@ public class Rating {
|
||||
else {
|
||||
ratingMap.put(null, value);
|
||||
}
|
||||
this.initial = value;
|
||||
}
|
||||
|
||||
public List<String> getCategories() {
|
||||
|
@ -122,7 +122,7 @@ public class ExpireManager {
|
||||
public void run() {
|
||||
PlotAnalysis changed = this.value;
|
||||
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);
|
||||
expiredPlots.get(world).remove(plot);
|
||||
FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("analysis"), changed.asList()));
|
||||
|
@ -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);
|
||||
if (BlockManager.manager.getBlock(loc).id != 0) {
|
||||
// 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;
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.intellectualcrafters.plot.util;
|
||||
|
||||
import org.bukkit.permissions.Permission;
|
||||
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.plotsquared.general.commands.CommandCaller;
|
||||
@ -13,13 +15,24 @@ public class Permissions {
|
||||
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())) {
|
||||
return true;
|
||||
}
|
||||
if (player.hasPermission(perm)) {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -40,6 +53,7 @@ public class Permissions {
|
||||
if (player.hasPermission(stub + ".*")) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
System.out.print(range);
|
||||
for (int i = range; i > 0; i--) {
|
||||
if (player.hasPermission(stub + "." + i)) {
|
||||
return i;
|
||||
|
@ -190,8 +190,16 @@ public class LikePlotMeConverter {
|
||||
pathwidth = 7;
|
||||
}
|
||||
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"); //
|
||||
if (plotsize == null) {
|
||||
if (plotsize == null || plotsize == 0) {
|
||||
plotsize = 32;
|
||||
}
|
||||
PS.get().config.set("worlds." + world + ".plot.size", plotsize);
|
||||
|
@ -68,6 +68,9 @@ public class ChunkListener implements Listener {
|
||||
PlotPlayer pp = entry.getValue();
|
||||
Location loc = pp.getLocation();
|
||||
String world = loc.getWorld();
|
||||
if (!PS.get().isPlotWorld(world)) {
|
||||
continue;
|
||||
}
|
||||
HashMap<ChunkLoc, Integer> map = players.get(world);
|
||||
if (map == null) {
|
||||
map = new HashMap<>();
|
||||
@ -107,8 +110,10 @@ public class ChunkListener implements Listener {
|
||||
for (World world : Bukkit.getWorlds()) {
|
||||
String name = world.getName();
|
||||
boolean autosave = world.isAutoSave();
|
||||
boolean plotworld = PS.get().isPlotWorld(name);
|
||||
if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave && plotworld) {
|
||||
if (!PS.get().isPlotWorld(name)) {
|
||||
continue;
|
||||
}
|
||||
if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave) {
|
||||
world.setAutoSave(false);
|
||||
}
|
||||
HashMap<ChunkLoc, Integer> map = players.get(name);
|
||||
@ -119,12 +124,12 @@ public class ChunkListener implements Listener {
|
||||
int x = chunk.getX();
|
||||
int z = chunk.getZ();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave && plotworld) {
|
||||
if (!Settings.CHUNK_PROCESSOR_TRIM_ON_SAVE && autosave) {
|
||||
world.setAutoSave(true);
|
||||
}
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
String msg = event.getMessage().toLowerCase().replaceFirst("/", "");
|
||||
|
@ -61,7 +61,6 @@ public class WESubscriber {
|
||||
if (pp != null && pp.getAttribute("worldedit")) {
|
||||
return;
|
||||
}
|
||||
|
||||
PlotPlayer player = UUIDHandler.getPlayer(actor.getName());
|
||||
HashSet<RegionWrapper> mask = WEManager.getMask(player);
|
||||
PlotWorld plotworld = PS.get().getPlotWorld(world);
|
||||
|
@ -1,17 +1,16 @@
|
||||
package com.plotsquared.bukkit.object;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.WeatherType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
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.util.EconHandler;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.MathMan;
|
||||
import com.intellectualcrafters.plot.util.PlotGamemode;
|
||||
import com.intellectualcrafters.plot.util.PlotWeather;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
@ -83,22 +81,7 @@ public class BukkitPlayer extends PlotPlayer {
|
||||
return EconHandler.manager.hasPermission(getName(), node);
|
||||
}
|
||||
boolean value = this.player.hasPermission(node);
|
||||
if (!value) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
System.out.print(value + " | " + node);
|
||||
if (Settings.PERMISSION_CACHING) {
|
||||
if (value) {
|
||||
this.hasPerm.add(node);
|
||||
@ -110,6 +93,29 @@ public class BukkitPlayer extends PlotPlayer {
|
||||
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
|
||||
public void sendMessage(final String message) {
|
||||
this.player.sendMessage(message);
|
||||
|
@ -197,7 +197,6 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
|
||||
case 47:
|
||||
case 48:
|
||||
case 49:
|
||||
case 50:
|
||||
case 51:
|
||||
case 52:
|
||||
case 54:
|
||||
@ -215,8 +214,6 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
|
||||
case 11:
|
||||
case 73:
|
||||
case 74:
|
||||
case 75:
|
||||
case 76:
|
||||
case 78:
|
||||
case 79:
|
||||
case 80:
|
||||
|
@ -20,11 +20,8 @@ import org.spongepowered.api.Server;
|
||||
import org.spongepowered.api.block.BlockState;
|
||||
import org.spongepowered.api.block.BlockType;
|
||||
import org.spongepowered.api.block.BlockTypes;
|
||||
import org.spongepowered.api.entity.player.Player;
|
||||
import org.spongepowered.api.event.Subscribe;
|
||||
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.entity.living.player.Player;
|
||||
import org.spongepowered.api.event.entity.living.player.PlayerChatEvent;
|
||||
import org.spongepowered.api.plugin.Plugin;
|
||||
import org.spongepowered.api.plugin.PluginContainer;
|
||||
import org.spongepowered.api.service.profile.GameProfileResolver;
|
||||
@ -37,6 +34,7 @@ import org.spongepowered.api.world.GeneratorTypes;
|
||||
import org.spongepowered.api.world.World;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Inject;
|
||||
import com.intellectualcrafters.configuration.ConfigurationSection;
|
||||
import com.intellectualcrafters.plot.IPlotMain;
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 com.intellectualcrafters.plot.object.Plot;
|
||||
|
@ -1,6 +1,6 @@
|
||||
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;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
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;
|
||||
|
||||
public abstract class PlayerEvent extends AbstractEvent {
|
||||
|
@ -1,6 +1,6 @@
|
||||
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;
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.plotsquared.sponge.events;
|
||||
|
||||
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;
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.plotsquared.sponge.events;
|
||||
|
||||
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;
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.plotsquared.sponge.events;
|
||||
|
||||
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;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
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 com.intellectualcrafters.plot.object.Location;
|
||||
|
@ -12,29 +12,13 @@ import org.spongepowered.api.entity.living.Ambient;
|
||||
import org.spongepowered.api.entity.living.Living;
|
||||
import org.spongepowered.api.entity.living.animal.Animal;
|
||||
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.minecart.Minecart;
|
||||
import org.spongepowered.api.event.Subscribe;
|
||||
import org.spongepowered.api.event.block.BlockMoveEvent;
|
||||
import org.spongepowered.api.event.block.BlockRedstoneUpdateEvent;
|
||||
import org.spongepowered.api.event.block.FloraGrowEvent;
|
||||
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.event.entity.living.player.PlayerChatEvent;
|
||||
import org.spongepowered.api.event.entity.living.player.PlayerConnectionEvent;
|
||||
import org.spongepowered.api.event.entity.living.player.PlayerJoinEvent;
|
||||
import org.spongepowered.api.event.entity.living.player.PlayerQuitEvent;
|
||||
import org.spongepowered.api.network.PlayerConnection;
|
||||
import org.spongepowered.api.text.Text;
|
||||
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.Vector3i;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
@ -726,10 +711,10 @@ public class MainListener {
|
||||
if (!PlotListener.plotExit(pp, lastPlot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED);
|
||||
if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
event.setTo(from);
|
||||
}
|
||||
else {
|
||||
event.setNewLocation(world.getSpawnLocation());
|
||||
event.setTo(world.getSpawnLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -742,10 +727,10 @@ public class MainListener {
|
||||
if (!PlotListener.plotEntry(pp, plot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
|
||||
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
event.setTo(from);
|
||||
}
|
||||
else {
|
||||
event.setNewLocation(world.getSpawnLocation());
|
||||
event.setTo(world.getSpawnLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -755,13 +740,13 @@ public class MainListener {
|
||||
if (x2 > border) {
|
||||
Vector3d pos = to.getPosition();
|
||||
to = to.setPosition(new Vector3d(border - 4, pos.getY(), pos.getZ()));
|
||||
event.setNewLocation(to);
|
||||
event.setTo(to);
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
}
|
||||
else if (x2 < -border) {
|
||||
Vector3d pos = to.getPosition();
|
||||
to = to.setPosition(new Vector3d(-border + 4, pos.getY(), pos.getZ()));
|
||||
event.setNewLocation(to);
|
||||
event.setTo(to);
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
}
|
||||
}
|
||||
@ -793,10 +778,10 @@ public class MainListener {
|
||||
if (!PlotListener.plotExit(pp, lastPlot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED);
|
||||
if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
event.setTo(from);
|
||||
}
|
||||
else {
|
||||
event.setNewLocation(world.getSpawnLocation());
|
||||
event.setTo(world.getSpawnLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -809,10 +794,10 @@ public class MainListener {
|
||||
if (!PlotListener.plotEntry(pp, plot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
|
||||
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
event.setTo(from);
|
||||
}
|
||||
else {
|
||||
event.setNewLocation(world.getSpawnLocation());
|
||||
event.setTo(world.getSpawnLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -822,13 +807,13 @@ public class MainListener {
|
||||
if (z2 > border) {
|
||||
Vector3d pos = to.getPosition();
|
||||
to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), border - 4));
|
||||
event.setNewLocation(to);
|
||||
event.setTo(to);
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
}
|
||||
else if (z2 < -border) {
|
||||
Vector3d pos = to.getPosition();
|
||||
to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), -border + 4));
|
||||
event.setNewLocation(to);
|
||||
event.setTo(to);
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
}
|
||||
}
|
||||
@ -867,10 +852,10 @@ public class MainListener {
|
||||
if (!PlotListener.plotExit(pp, lastPlot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED);
|
||||
if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
event.setTo(from);
|
||||
}
|
||||
else {
|
||||
event.setNewLocation(world.getSpawnLocation());
|
||||
event.setTo(world.getSpawnLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -883,10 +868,10 @@ public class MainListener {
|
||||
if (!PlotListener.plotEntry(pp, plot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
|
||||
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
event.setTo(from);
|
||||
}
|
||||
else {
|
||||
event.setNewLocation(world.getSpawnLocation());
|
||||
event.setTo(world.getSpawnLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -896,13 +881,13 @@ public class MainListener {
|
||||
if (x2 > border) {
|
||||
Vector3d pos = to.getPosition();
|
||||
to = to.setPosition(new Vector3d(border - 4, pos.getY(), pos.getZ()));
|
||||
event.setNewLocation(to);
|
||||
event.setTo(to);
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
}
|
||||
else if (x2 < -border) {
|
||||
Vector3d pos = to.getPosition();
|
||||
to = to.setPosition(new Vector3d(-border + 4, pos.getY(), pos.getZ()));
|
||||
event.setNewLocation(to);
|
||||
event.setTo(to);
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
}
|
||||
}
|
||||
@ -934,10 +919,10 @@ public class MainListener {
|
||||
if (!PlotListener.plotExit(pp, lastPlot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED);
|
||||
if (lastPlot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
event.setTo(from);
|
||||
}
|
||||
else {
|
||||
event.setNewLocation(player.getWorld().getSpawnLocation());
|
||||
event.setTo(player.getWorld().getSpawnLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -950,10 +935,10 @@ public class MainListener {
|
||||
if (!PlotListener.plotEntry(pp, plot)) {
|
||||
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED);
|
||||
if (!plot.equals(MainUtil.getPlot(SpongeUtil.getLocation(worldname, from)))) {
|
||||
event.setNewLocation(from);
|
||||
event.setTo(from);
|
||||
}
|
||||
else {
|
||||
event.setNewLocation(player.getWorld().getSpawnLocation());
|
||||
event.setTo(player.getWorld().getSpawnLocation());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -963,13 +948,13 @@ public class MainListener {
|
||||
if (z2 > border) {
|
||||
Vector3d pos = to.getPosition();
|
||||
to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), border - 4));
|
||||
event.setNewLocation(to);
|
||||
event.setTo(to);
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
}
|
||||
else if (z2 < -border) {
|
||||
Vector3d pos = to.getPosition();
|
||||
to = to.setPosition(new Vector3d(pos.getX(), pos.getY(), -border + 4));
|
||||
event.setNewLocation(to);
|
||||
event.setTo(to);
|
||||
MainUtil.sendMessage(pp, C.BORDER);
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ import java.util.UUID;
|
||||
import org.spongepowered.api.data.key.Keys;
|
||||
import org.spongepowered.api.data.manipulator.mutable.TargetedLocationData;
|
||||
import org.spongepowered.api.data.value.mutable.Value;
|
||||
import org.spongepowered.api.entity.player.Player;
|
||||
import org.spongepowered.api.entity.player.gamemode.GameMode;
|
||||
import org.spongepowered.api.entity.player.gamemode.GameModes;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.entity.living.player.gamemode.GameMode;
|
||||
import org.spongepowered.api.entity.living.player.gamemode.GameModes;
|
||||
import org.spongepowered.api.text.TextBuilder;
|
||||
import org.spongepowered.api.text.Texts;
|
||||
import org.spongepowered.api.text.action.HoverAction;
|
||||
|
@ -5,7 +5,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
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.Texts;
|
||||
import org.spongepowered.api.util.command.CommandCallable;
|
||||
|
@ -3,7 +3,7 @@ package com.plotsquared.sponge.util;
|
||||
import java.util.ArrayList;
|
||||
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.ItemTypes;
|
||||
import org.spongepowered.api.item.inventory.Carrier;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.plotsquared.sponge.util;
|
||||
|
||||
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.extent.Extent;
|
||||
|
||||
|
@ -3,7 +3,7 @@ package com.plotsquared.sponge.uuid;
|
||||
import java.util.UUID;
|
||||
|
||||
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.intellectualcrafters.plot.object.OfflinePlotPlayer;
|
||||
|
@ -15,10 +15,6 @@ commands:
|
||||
permission: plots.use
|
||||
permission-message: "You are lacking the permission node 'plots.use'"
|
||||
permissions:
|
||||
plots.admin:
|
||||
children:
|
||||
plots.*: true
|
||||
default: op
|
||||
plots.use:
|
||||
default: true
|
||||
plots.permpack.basicflags:
|
||||
@ -26,43 +22,48 @@ permissions:
|
||||
children:
|
||||
plots.set.flag: true
|
||||
plots.flag: true
|
||||
plots.set.flag.titles: true
|
||||
plots.set.flag.greeting: true
|
||||
plots.set.flag.farewell: true
|
||||
plots.set.flag.notify-enter: true
|
||||
plots.set.flag.notify-leave: true
|
||||
plots.set.flag.feed: true
|
||||
plots.set.flag.heal: true
|
||||
plots.set.flag.invincible: true
|
||||
plots.set.flag.instabreak: true
|
||||
plots.set.flag.fly: true
|
||||
plots.set.flag.gamemode: true
|
||||
plots.set.flag.time: true
|
||||
plots.set.flag.weather: true
|
||||
plots.set.flag.music: true
|
||||
plots.set.flag.disable-physics: true
|
||||
plots.set.flag.pve: true
|
||||
plots.set.flag.pvp: true
|
||||
plots.set.flag.explosion: true
|
||||
plots.set.flag.hostile-interact: true
|
||||
plots.set.flag.hostile-attack: true
|
||||
plots.set.flag.animal-interact: true
|
||||
plots.set.flag.animal-attack: true
|
||||
plots.set.flag.tamed-interact: true
|
||||
plots.set.flag.tamed-attack: true
|
||||
plots.set.flag.misc-interact: true
|
||||
plots.set.flag.hanging-place: true
|
||||
plots.set.flag.hanging-break: true
|
||||
plots.set.flag.vehicle-use: true
|
||||
plots.set.flag.vehicle-place: true
|
||||
plots.set.flag.vehicle-break: true
|
||||
plots.set.flag.player-interact: 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.flag.add: true
|
||||
plots.flag.remove: true
|
||||
plots.flag.list: true
|
||||
plots.flag.info: true
|
||||
plots.set.flag.titles.*: true
|
||||
plots.set.flag.greeting.*: true
|
||||
plots.set.flag.farewell.*: true
|
||||
plots.set.flag.notify-enter.*: true
|
||||
plots.set.flag.notify-leave.*: true
|
||||
plots.set.flag.feed.*: true
|
||||
plots.set.flag.heal.*: true
|
||||
plots.set.flag.invincible.*: true
|
||||
plots.set.flag.instabreak.*: true
|
||||
plots.set.flag.fly.*: true
|
||||
plots.set.flag.gamemode.*: true
|
||||
plots.set.flag.time.*: true
|
||||
plots.set.flag.weather.*: true
|
||||
plots.set.flag.music.*: true
|
||||
plots.set.flag.disable-physics.*: true
|
||||
plots.set.flag.pve.*: true
|
||||
plots.set.flag.pvp.*: true
|
||||
plots.set.flag.explosion.*: true
|
||||
plots.set.flag.hostile-interact.*: true
|
||||
plots.set.flag.hostile-attack.*: true
|
||||
plots.set.flag.player-interact.*: true
|
||||
plots.set.flag.animal-interact.*: true
|
||||
plots.set.flag.animal-attack.*: true
|
||||
plots.set.flag.tamed-interact.*: true
|
||||
plots.set.flag.tamed-attack.*: true
|
||||
plots.set.flag.misc-interact.*: true
|
||||
plots.set.flag.hanging-place.*: true
|
||||
plots.set.flag.hanging-break.*: true
|
||||
plots.set.flag.vehicle-use.*: true
|
||||
plots.set.flag.vehicle-place.*: true
|
||||
plots.set.flag.vehicle-break.*: true
|
||||
plots.set.flag.player-interact.*: 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:
|
||||
default: op
|
||||
children:
|
||||
@ -104,6 +105,10 @@ permissions:
|
||||
plots.visit.owned: true
|
||||
plots.visit.shared: 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.buy: true
|
||||
plots.chat: true
|
||||
|
Loading…
Reference in New Issue
Block a user