Skip to content

Commit

Permalink
Added Synchronisation
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachesMLG committed Feb 23, 2024
1 parent f11c922 commit 69caa2c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,11 @@ public boolean teleport(Player player, Location location, Faction team) {
}


public CompletableFuture<Void> claimFactionLand(Faction faction, Chunk chunk, Player player) {
public synchronized CompletableFuture<Void> claimFactionLand(Faction faction, Chunk chunk, Player player) {
return claimFactionLand(faction, chunk.getWorld(), chunk.getX(), chunk.getZ(), player);
}

public CompletableFuture<Void> claimFactionLand(Faction faction, World world, int x, int z, Player player) {
public synchronized CompletableFuture<Void> claimFactionLand(Faction faction, World world, int x, int z, Player player) {
return CompletableFuture.runAsync(() -> {
User user = IridiumFactions.getInstance().getUserManager().getUser(player);
if (!getTeamPermission(faction, user, PermissionType.CLAIM)) {
Expand Down Expand Up @@ -563,11 +563,11 @@ public CompletableFuture<Void> claimFactionLand(Faction faction, Chunk centerChu
});
}

public CompletableFuture<Void> unClaimFactionLand(Chunk chunk, Player player) {
public synchronized CompletableFuture<Void> unClaimFactionLand(Chunk chunk, Player player) {
return unClaimFactionLand(chunk.getWorld(), chunk.getX(), chunk.getZ(), player);
}

public CompletableFuture<Void> unClaimFactionLand(World world, int x, int z, Player player) {
public synchronized CompletableFuture<Void> unClaimFactionLand(World world, int x, int z, Player player) {
return CompletableFuture.runAsync(() -> {
User user = IridiumFactions.getInstance().getUserManager().getUser(player);
Optional<FactionClaim> factionClaim = getFactionClaimViaChunk(world, x, z);
Expand Down

0 comments on commit 69caa2c

Please sign in to comment.