mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-12-01 06:53:26 +01:00
Fix groupless players being inside dungeons; resolves #414
This commit is contained in:
parent
ef17d01ab8
commit
2da4e74261
@ -756,6 +756,13 @@ public class DGroup {
|
|||||||
game.removeDGroup(this);
|
game.removeDGroup(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (UUID uuid : players.getUniqueIds()) {
|
||||||
|
DGlobalPlayer member = dPlayers.getByUniqueId(uuid);
|
||||||
|
if (member instanceof DInstancePlayer) {
|
||||||
|
((DInstancePlayer) member).leave();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (timeIsRunningTask != null) {
|
if (timeIsRunningTask != null) {
|
||||||
timeIsRunningTask.cancel();
|
timeIsRunningTask.cancel();
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ import de.erethon.dungeonsxl.world.DEditWorld;
|
|||||||
import de.erethon.dungeonsxl.world.DGameWorld;
|
import de.erethon.dungeonsxl.world.DGameWorld;
|
||||||
import de.erethon.dungeonsxl.world.block.LockedDoor;
|
import de.erethon.dungeonsxl.world.block.LockedDoor;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -520,17 +521,17 @@ public class DPlayerListener implements Listener {
|
|||||||
if (isCitizensNPC(player)) {
|
if (isCitizensNPC(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DGamePlayer dPlayer = DGamePlayer.getByPlayer(player);
|
DGlobalPlayer dPlayer = dPlayers.getByPlayer(player);
|
||||||
|
|
||||||
if (dPlayer == null) {
|
World toWorld = event.getTo().getWorld();
|
||||||
|
|
||||||
|
if (dPlayer instanceof DInstancePlayer && ((DInstancePlayer) dPlayer).getWorld() == toWorld) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dPlayer.getWorld() == event.getTo().getWorld()) {
|
if (plugin.getDWorlds().getInstanceByWorld(toWorld) != null) {
|
||||||
return;
|
dPlayer.sendMessage(DMessage.ERROR_JOIN_GROUP.getMessage());
|
||||||
}
|
dPlayer.sendMessage(ChatColor.GOLD + DMessage.HELP_CMD_ENTER.getMessage());
|
||||||
|
|
||||||
if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user