Dropping items as a spectator outside of the region forces the player to leave. Thanks to ACStache.
This commit is contained in:
Binary file not shown.
@@ -620,8 +620,7 @@ public class ArenaListener
|
||||
public void onPlayerDropItem(PlayerDropItemEvent event) {
|
||||
Player p = event.getPlayer();
|
||||
|
||||
// If the player is active in the arena, only cancel if sharing is not
|
||||
// allowed
|
||||
// If the player is active in the arena, only cancel if sharing is not allowed
|
||||
if (arena.inArena(p)) {
|
||||
if (!canShare) {
|
||||
Messenger.tellPlayer(p, Msg.LOBBY_DROP_ITEM);
|
||||
@@ -629,12 +628,24 @@ public class ArenaListener
|
||||
}
|
||||
}
|
||||
|
||||
// Else, if the player is in the lobby or a spectator, just cancel
|
||||
else if (arena.inLobby(p) || arena.inSpec(p)) {
|
||||
// If the player is in the lobby, just cancel
|
||||
else if (arena.inLobby(p)) {
|
||||
Messenger.tellPlayer(p, Msg.LOBBY_DROP_ITEM);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
// Same if it's a spectator, but...
|
||||
else if (arena.inSpec(p)) {
|
||||
Messenger.tellPlayer(p, Msg.LOBBY_DROP_ITEM);
|
||||
event.setCancelled(true);
|
||||
|
||||
// If the spectator isn't in the region, force them to leave
|
||||
if (!region.contains(p.getLocation())) {
|
||||
Messenger.tellPlayer(p, Msg.MISC_MA_LEAVE_REMINDER);
|
||||
arena.playerLeave(p);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If the player is not in the arena in any way (as arena player, lobby
|
||||
* player or a spectator), but they -are- in the region, it must mean
|
||||
|
||||
@@ -67,6 +67,7 @@ public enum Msg
|
||||
MISC_HELP("For a list of commands, type /ma help"),
|
||||
MISC_MULTIPLE_MATCHES("Did you mean one of these commands?"),
|
||||
MISC_NO_MATCHES("Command not found. Type /ma help"),
|
||||
MISC_MA_LEAVE_REMINDER("Remember to use /ma leave when you are done."),
|
||||
MISC_NONE("<none>");
|
||||
|
||||
private String msg, spoutMsg;
|
||||
|
||||
Reference in New Issue
Block a user