mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-02-17 21:02:12 +01:00
Fix portal checks ignoring worlds; resolves #919
This commit is contained in:
parent
b28423fa58
commit
1482bb5902
@ -403,9 +403,12 @@ public class DPortal extends GlobalProtection {
|
||||
* @return the portal that the block belongs to, null if it belongs to none
|
||||
*/
|
||||
public static DPortal getByBlock(DungeonsXL plugin, Block block) {
|
||||
if (plugin.isInstance(block.getWorld())) {
|
||||
return null;
|
||||
}
|
||||
for (GlobalProtection protection : plugin.getGlobalProtectionCache().getProtections(DPortal.class)) {
|
||||
DPortal portal = (DPortal) protection;
|
||||
if (portal.getBlock1() == null || portal.getBlock2() == null) {
|
||||
if (!portal.getWorld().equals(block.getWorld()) || portal.getBlock1() == null || portal.getBlock2() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ public class GlobalProtectionListener implements Listener {
|
||||
@EventHandler
|
||||
public void onPlayerMove(PlayerMoveEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (DPlayerListener.isCitizensNPC(player)) {
|
||||
if (DPlayerListener.isCitizensNPC(player) || plugin.isInstance(event.getTo().getWorld())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user