Skip to content

Commit

Permalink
fix: check the player is in the same world
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Nov 18, 2024
1 parent f9f5a9d commit 8018d68
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* @author sekwah41
Expand Down Expand Up @@ -153,7 +154,7 @@ public boolean isLocationInPortal(BlockLocation loc, int additionalArea) {
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 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,4 @@
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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,44 +49,4 @@ public List<String> getAllNames() {
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;
}
}

0 comments on commit 8018d68

Please sign in to comment.