Difficulties in using Huskclaims API
I am developing a land sales system using the Huskclaims API, but I am struggling to make it work properly. I believe the method I am using is correct, according to API documentation, but the system is not responding as expected.
The system is designed to work as follows: I created a menu in which members can buy advertised land, paying with coins. However, when the member makes the purchase, the change of land ownership is not made correctly.
Could you take a look at the code and check if I am making a mistake or if there is anything missing?
@Override public void setOwner(String id, UUID friendId) { try{ BukkitHuskClaimsAPI huskClaimsAPI = BukkitHuskClaimsAPI.getInstance();
for (ClaimWorld claimWorld : huskClaimsAPI.getClaimWorlds()){
for (net.william278.huskclaims.claim.Claim claim : claimWorld.getClaims()){
String claimId = String.format("%s_%s_%s", claim.getRegion().getNearCorner().getLongChunkCoords(), claim.getRegion().getFarCorner().getLongChunkCoords(), claimWorld);
if (claimId.equals(id)) {
claim.setOwner(friendId);
break;
}
}
}
}catch (Throwable ignored){}
}
hello?