mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 05:36:45 +01:00
Added WorldEdit bypass on join
This commit is contained in:
parent
ec80151cd9
commit
8ce33753f3
@ -270,6 +270,11 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
final StringWrapper name = new StringWrapper(username);
|
final StringWrapper name = new StringWrapper(username);
|
||||||
final UUID uuid = pp.getUUID();
|
final UUID uuid = pp.getUUID();
|
||||||
UUIDHandler.add(name, uuid);
|
UUIDHandler.add(name, uuid);
|
||||||
|
if (PlotSquared.worldEdit != null) {
|
||||||
|
if (Permissions.hasPermission(pp, "plots.worldedit.bypass")) {
|
||||||
|
WEManager.bypass.add(pp.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
final Location loc = BukkitUtil.getLocation(player.getLocation());
|
final Location loc = BukkitUtil.getLocation(player.getLocation());
|
||||||
final Plot plot = MainUtil.getPlot(loc);
|
final Plot plot = MainUtil.getPlot(loc);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
@ -458,8 +463,13 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
public void onWorldChanged(final PlayerChangedWorldEvent event) {
|
public void onWorldChanged(final PlayerChangedWorldEvent event) {
|
||||||
final PlotPlayer player = BukkitUtil.getPlayer(event.getPlayer());
|
final PlotPlayer player = BukkitUtil.getPlayer(event.getPlayer());
|
||||||
if (PlotSquared.worldEdit != null) {
|
if (PlotSquared.worldEdit != null) {
|
||||||
|
if (!Permissions.hasPermission(player, "plots.worldedit.bypass")) {
|
||||||
WEManager.bypass.remove(player.getName());
|
WEManager.bypass.remove(player.getName());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
WEManager.bypass.add(player.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
((BukkitPlayer) player).hasPerm = new HashSet<>();
|
((BukkitPlayer) player).hasPerm = new HashSet<>();
|
||||||
((BukkitPlayer) player).noPerm = new HashSet<>();
|
((BukkitPlayer) player).noPerm = new HashSet<>();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user