mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
It's probably better to put it here actually.
This commit is contained in:
parent
6c614d1eec
commit
9ba5e3f91b
@ -219,9 +219,7 @@ public class Plot implements Cloneable {
|
|||||||
* @param uuid
|
* @param uuid
|
||||||
*/
|
*/
|
||||||
public void addDenied(UUID uuid) {
|
public void addDenied(UUID uuid) {
|
||||||
if (!denied.contains(uuid)) {
|
this.denied.add(uuid);
|
||||||
this.denied.add(uuid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -230,9 +228,7 @@ public class Plot implements Cloneable {
|
|||||||
* @param uuid
|
* @param uuid
|
||||||
*/
|
*/
|
||||||
public void addHelper(UUID uuid) {
|
public void addHelper(UUID uuid) {
|
||||||
if (!helpers.contains(uuid)) {
|
this.helpers.add(uuid);
|
||||||
this.helpers.add(uuid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -241,9 +237,7 @@ public class Plot implements Cloneable {
|
|||||||
* @param uuid
|
* @param uuid
|
||||||
*/
|
*/
|
||||||
public void addTrusted(UUID uuid) {
|
public void addTrusted(UUID uuid) {
|
||||||
if (!trusted.contains(uuid)) {
|
this.trusted.add(uuid);
|
||||||
this.trusted.add(uuid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,8 +48,12 @@ public class Denied extends SubCommand {
|
|||||||
if (args[0].equalsIgnoreCase("add")) {
|
if (args[0].equalsIgnoreCase("add")) {
|
||||||
if (args[1].equalsIgnoreCase("*")) {
|
if (args[1].equalsIgnoreCase("*")) {
|
||||||
UUID uuid = DBFunc.everyone;
|
UUID uuid = DBFunc.everyone;
|
||||||
plot.addDenied(uuid);
|
if (!plot.denied.contains(uuid)) {
|
||||||
DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
plot.addDenied(uuid);
|
||||||
|
DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
|
PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
PlayerFunctions.sendMessage(plr, C.DENIED_ADDED);
|
PlayerFunctions.sendMessage(plr, C.DENIED_ADDED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -63,10 +67,12 @@ public class Denied extends SubCommand {
|
|||||||
* C.PLAYER_HAS_NOT_BEEN_ON); return true; }
|
* C.PLAYER_HAS_NOT_BEEN_ON); return true; }
|
||||||
*/
|
*/
|
||||||
UUID uuid = UUIDHandler.getUUID(args[1]);
|
UUID uuid = UUIDHandler.getUUID(args[1]);
|
||||||
plot.addDenied(uuid);
|
if (!plot.denied.contains(uuid)) {
|
||||||
DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
plot.addDenied(uuid);
|
||||||
PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true);
|
DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
PlayerFunctions.sendMessage(plr, C.DENIED_ADDED);
|
PlayerFunctions.sendMessage(plr, C.DENIED_ADDED);
|
||||||
if ((Bukkit.getPlayer(uuid) != null) && Bukkit.getPlayer(uuid).isOnline()) {
|
if ((Bukkit.getPlayer(uuid) != null) && Bukkit.getPlayer(uuid).isOnline()) {
|
||||||
Plot pl = PlayerFunctions.getCurrentPlot(Bukkit.getPlayer((uuid)));
|
Plot pl = PlayerFunctions.getCurrentPlot(Bukkit.getPlayer((uuid)));
|
||||||
|
@ -45,8 +45,12 @@ public class Helpers extends SubCommand {
|
|||||||
if (args[0].equalsIgnoreCase("add")) {
|
if (args[0].equalsIgnoreCase("add")) {
|
||||||
if (args[1].equalsIgnoreCase("*")) {
|
if (args[1].equalsIgnoreCase("*")) {
|
||||||
UUID uuid = DBFunc.everyone;
|
UUID uuid = DBFunc.everyone;
|
||||||
plot.addHelper(uuid);
|
if (!plot.helpers.contains(uuid)) {
|
||||||
DBFunc.setHelper(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
plot.addHelper(uuid);
|
||||||
|
DBFunc.setHelper(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
|
PlayerPlotHelperEvent event = new PlayerPlotHelperEvent(plr, plot, uuid, true);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
PlayerFunctions.sendMessage(plr, C.HELPER_ADDED);
|
PlayerFunctions.sendMessage(plr, C.HELPER_ADDED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -60,10 +64,12 @@ public class Helpers extends SubCommand {
|
|||||||
* C.PLAYER_HAS_NOT_BEEN_ON); return true; }
|
* C.PLAYER_HAS_NOT_BEEN_ON); return true; }
|
||||||
*/
|
*/
|
||||||
UUID uuid = UUIDHandler.getUUID(args[1]);
|
UUID uuid = UUIDHandler.getUUID(args[1]);
|
||||||
plot.addHelper(uuid);
|
if (!plot.helpers.contains(uuid)) {
|
||||||
DBFunc.setHelper(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
plot.addHelper(uuid);
|
||||||
PlayerPlotHelperEvent event = new PlayerPlotHelperEvent(plr, plot, uuid, true);
|
DBFunc.setHelper(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
PlayerPlotHelperEvent event = new PlayerPlotHelperEvent(plr, plot, uuid, true);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
PlayerFunctions.sendMessage(plr, C.HELPER_ADDED);
|
PlayerFunctions.sendMessage(plr, C.HELPER_ADDED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -45,8 +45,12 @@ public class Trusted extends SubCommand {
|
|||||||
if (args[0].equalsIgnoreCase("add")) {
|
if (args[0].equalsIgnoreCase("add")) {
|
||||||
if (args[1].equalsIgnoreCase("*")) {
|
if (args[1].equalsIgnoreCase("*")) {
|
||||||
UUID uuid = DBFunc.everyone;
|
UUID uuid = DBFunc.everyone;
|
||||||
plot.addTrusted(uuid);
|
if (!plot.trusted.contains(uuid)) {
|
||||||
DBFunc.setTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
plot.addTrusted(uuid);
|
||||||
|
DBFunc.setTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
|
PlayerPlotTrustedEvent event = new PlayerPlotTrustedEvent(plr, plot, uuid, true);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
PlayerFunctions.sendMessage(plr, C.TRUSTED_ADDED);
|
PlayerFunctions.sendMessage(plr, C.TRUSTED_ADDED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -60,10 +64,12 @@ public class Trusted extends SubCommand {
|
|||||||
* C.PLAYER_HAS_NOT_BEEN_ON); return true; }
|
* C.PLAYER_HAS_NOT_BEEN_ON); return true; }
|
||||||
*/
|
*/
|
||||||
UUID uuid = UUIDHandler.getUUID(args[1]);
|
UUID uuid = UUIDHandler.getUUID(args[1]);
|
||||||
plot.addTrusted(uuid);
|
if (!plot.trusted.contains(uuid)) {
|
||||||
DBFunc.setTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
plot.addTrusted(uuid);
|
||||||
PlayerPlotTrustedEvent event = new PlayerPlotTrustedEvent(plr, plot, uuid, true);
|
DBFunc.setTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1]));
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
PlayerPlotTrustedEvent event = new PlayerPlotTrustedEvent(plr, plot, uuid, true);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
PlayerFunctions.sendMessage(plr, C.TRUSTED_ADDED);
|
PlayerFunctions.sendMessage(plr, C.TRUSTED_ADDED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user