mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26: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 UUID uuid = pp.getUUID();
|
||||
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 Plot plot = MainUtil.getPlot(loc);
|
||||
if (plot == null) {
|
||||
@ -458,7 +463,12 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
||||
public void onWorldChanged(final PlayerChangedWorldEvent event) {
|
||||
final PlotPlayer player = BukkitUtil.getPlayer(event.getPlayer());
|
||||
if (PlotSquared.worldEdit != null) {
|
||||
WEManager.bypass.remove(player.getName());
|
||||
if (!Permissions.hasPermission(player, "plots.worldedit.bypass")) {
|
||||
WEManager.bypass.remove(player.getName());
|
||||
}
|
||||
else {
|
||||
WEManager.bypass.add(player.getName());
|
||||
}
|
||||
}
|
||||
((BukkitPlayer) player).hasPerm = new HashSet<>();
|
||||
((BukkitPlayer) player).noPerm = new HashSet<>();
|
||||
|
Loading…
Reference in New Issue
Block a user