mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Merge pull request #1301 from MisterErwin/master
Calling events when players are removed from plots & correct calling of Member & Trusted events
This commit is contained in:
commit
a801127036
@ -110,12 +110,12 @@ public class BukkitEventUtil extends EventUtil {
|
||||
|
||||
@Override
|
||||
public void callTrusted(PlotPlayer initiator, Plot plot, UUID player, boolean added) {
|
||||
callEvent(new PlayerPlotHelperEvent(getPlayer(initiator), plot, player, added));
|
||||
callEvent(new PlayerPlotTrustedEvent(getPlayer(initiator), plot, player, added));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void callMember(PlotPlayer initiator, Plot plot, UUID player, boolean added) {
|
||||
callEvent(new PlayerPlotTrustedEvent(getPlayer(initiator), plot, player, added));
|
||||
callEvent(new PlayerPlotHelperEvent(getPlayer(initiator), plot, player, added));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,6 +5,7 @@ import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.util.EventUtil;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
@ -71,20 +72,30 @@ public class Remove extends SubCommand {
|
||||
if (!uuids.isEmpty()) {
|
||||
for (UUID uuid : uuids) {
|
||||
if (uuid == DBFunc.everyone) {
|
||||
if (plot.removeTrusted(uuid) | plot.removeMember(uuid) | plot.removeDenied(uuid)) {
|
||||
if (plot.removeTrusted(uuid)){
|
||||
EventUtil.manager.callTrusted(player, plot, uuid, false);
|
||||
count++;
|
||||
}else if (plot.removeMember(uuid)) {
|
||||
EventUtil.manager.callMember(player, plot, uuid, false);
|
||||
count++;
|
||||
}else if (plot.removeDenied(uuid)) {
|
||||
EventUtil.manager.callDenied(player, plot, uuid, false);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
else if (plot.getTrusted().contains(uuid)) {
|
||||
if (plot.removeTrusted(uuid)) {
|
||||
EventUtil.manager.callTrusted(player, plot, uuid, false);
|
||||
count++;
|
||||
}
|
||||
} else if (plot.getMembers().contains(uuid)) {
|
||||
if (plot.removeMember(uuid)) {
|
||||
EventUtil.manager.callMember(player, plot, uuid, false);
|
||||
count++;
|
||||
}
|
||||
} else if (plot.getDenied().contains(uuid)) {
|
||||
if (plot.removeDenied(uuid)) {
|
||||
EventUtil.manager.callDenied(player, plot, uuid, false);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@ -106,12 +106,12 @@ public class SpongeEventUtil extends EventUtil {
|
||||
|
||||
@Override
|
||||
public void callTrusted(PlotPlayer initiator, Plot plot, UUID player, boolean added) {
|
||||
callEvent(new PlayerPlotHelperEvent(SpongeUtil.getPlayer(initiator), plot, player, added));
|
||||
callEvent(new PlayerPlotTrustedEvent(SpongeUtil.getPlayer(initiator), plot, player, added));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void callMember(PlotPlayer initiator, Plot plot, UUID player, boolean added) {
|
||||
callEvent(new PlayerPlotTrustedEvent(SpongeUtil.getPlayer(initiator), plot, player, added));
|
||||
callEvent(new PlayerPlotHelperEvent(SpongeUtil.getPlayer(initiator), plot, player, added));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user