fix: check the player is in the same world

This commit is contained in:
Sekwah 2024-02-04 04:58:19 +00:00
parent f9f5a9d1f2
commit 8018d68e42
3 changed files with 2 additions and 56 deletions

View File

@ -16,6 +16,7 @@ import com.sekwah.advancedportals.core.warphandler.Tag;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* @author sekwah41
@ -153,7 +154,7 @@ public class AdvancedPortal implements TagTarget {
double playerY = loc.posY;
double playerZ = loc.posZ;
return playerX >= this.minLoc.posX - additionalArea &&
return Objects.equals(loc.worldName, this.minLoc.worldName) && playerX >= this.minLoc.posX - additionalArea &&
playerX < this.maxLoc.posX + 1 + additionalArea &&
playerY >= this.minLoc.posY - additionalArea &&
playerY < this.maxLoc.posY + 1 + additionalArea &&

View File

@ -8,19 +8,4 @@ import com.sekwah.advancedportals.core.serializeddata.PlayerData;
import java.util.UUID;
public interface IPlayerDataRepository extends IJsonRepository<PlayerData> {
void addSelectedPortal(UUID selectedPlayer, String portal);
void removeSelectedPortal(UUID uuid);
void addSelectedPosition(UUID uuid, boolean isPos1, BlockLocation portalLocation);
void removeSelectedPosition(UUID uuid, boolean isPos1);
void removeAllSelectedHand(UUID uuid);
void activateCooldown(PlayerContainer player);
void playerLeave(PlayerContainer player);
boolean inPortalRegion(PlayerLocation loc);
}

View File

@ -49,44 +49,4 @@ public class PlayerDataRepositoryImpl implements IPlayerDataRepository {
public List<PlayerData> getAll() {
return null;
}
@Override
public void addSelectedPortal(UUID selectedPlayer, String portal) {
}
@Override
public void removeSelectedPortal(UUID uuid) {
}
@Override
public void addSelectedPosition(UUID uuid, boolean isPos1, BlockLocation portalLocation) {
}
@Override
public void removeSelectedPosition(UUID uuid, boolean isPos1) {
}
@Override
public void removeAllSelectedHand(UUID uuid) {
}
@Override
public void activateCooldown(PlayerContainer player) {
}
@Override
public void playerLeave(PlayerContainer player) {
}
@Override
public boolean inPortalRegion(PlayerLocation loc) {
return false;
}
}