com.wasteofplastic.askyblock.ASkyBlockAPI Java Examples

The following examples show how to use com.wasteofplastic.askyblock.ASkyBlockAPI. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HookASkyBlock.java    From CombatLogX with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Island getIslandFor(Player player) {
    if(player == null) return null;
    UUID uuid = player.getUniqueId();

    ASkyBlockAPI api = ASkyBlockAPI.getInstance();
    return api.getIslandOwnedBy(uuid);
}
 
Example #2
Source File: HookASkyBlock.java    From CombatLogX with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Island getIslandAt(Location location) {
    if(location == null) return null;

    ASkyBlockAPI api = ASkyBlockAPI.getInstance();
    return api.getIslandAt(location);
}
 
Example #3
Source File: ASkyBlockListener.java    From ShopChest with MIT License 5 votes vote down vote up
private boolean handleForLocation(Player player, Location loc, Cancellable e) {
    Island island = ASkyBlockAPI.getInstance().getIslandAt(loc);
    if (island == null) 
        return false;

    if (!player.getUniqueId().equals(island.getOwner()) && !island.getMembers().contains(player.getUniqueId())) {
        e.setCancelled(true);
        plugin.debug("Cancel Reason: ASkyBlock");
        return true;
    }

    return false;
}