Skip to content

Commit

Permalink
Fix is expel + is ban
Browse files Browse the repository at this point in the history
  • Loading branch information
Euphillya committed Dec 23, 2024
1 parent 1ebe58f commit 80ad5ed
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@ public static void expelPlayer(Main plugin, Island island, Player bPlayerToExpel
return;
}

int chunkLocX = bPlayerExpelLocation.getChunk().getX();
int chunkLocZ = bPlayerExpelLocation.getChunk().getZ();
org.bukkit.Bukkit.getRegionScheduler().execute(plugin, bPlayerExpelLocation, () -> {
int chunkLocX = bPlayerExpelLocation.getChunk().getX();
int chunkLocZ = bPlayerExpelLocation.getChunk().getZ();

Position islandPosition = island.getPosition();
Position playerRegionPosition = RegionHelper.getRegionInChunk(chunkLocX, chunkLocZ);
Position islandPosition = island.getPosition();
Position playerRegionPosition = RegionHelper.getRegionInChunk(chunkLocX, chunkLocZ);

if (islandPosition.x() != playerRegionPosition.x() || islandPosition.z() != playerRegionPosition.z()) {
if (!silent) LanguageToml.sendMessage(executor, LanguageToml.messageExpelPlayerFailedNotInIsland);
return;
}
if (islandPosition.x() != playerRegionPosition.x() || islandPosition.z() != playerRegionPosition.z()) {
if (!silent) LanguageToml.sendMessage(executor, LanguageToml.messageExpelPlayerFailedNotInIsland);
return;
}

PlayerUtils.teleportPlayerSpawn(bPlayerToExpel);
PlayerUtils.teleportPlayerSpawn(bPlayerToExpel);
});
}

@Override
Expand Down

0 comments on commit 80ad5ed

Please sign in to comment.