mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-05 23:37:39 +01:00
Fixed checks in challenge management
This commit is contained in:
parent
8a601a605c
commit
a97d951b7f
@ -6,6 +6,8 @@ import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.skyblock.SkyBlock;
|
||||
import com.songoda.skyblock.island.Island;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -18,7 +20,6 @@ import org.bukkit.potion.PotionData;
|
||||
import org.bukkit.potion.PotionType;
|
||||
|
||||
import com.songoda.skyblock.api.SkyBlockAPI;
|
||||
import com.songoda.skyblock.api.island.Island;
|
||||
|
||||
public class Challenge {
|
||||
private ChallengeCategory category;
|
||||
@ -240,11 +241,12 @@ public class Challenge {
|
||||
public boolean has(Player p, Object obj) {
|
||||
// Check if the level of player's island is greater or equals to the required
|
||||
// level
|
||||
Island is = SkyBlockAPI.getIslandManager().getIsland(p);
|
||||
Island is = SkyBlock.getInstance().getIslandManager().getIsland(p);
|
||||
// Player doesn't have an island
|
||||
if (is == null)
|
||||
return false;
|
||||
return is.getLevel().getLevel() >= (Integer) obj;
|
||||
if (is != null && obj instanceof Number) {
|
||||
return is.getLevel().getLevel() >= (Long) obj;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user