Merge pull request #298 from TinyTank800/master

Hasperm null fix
This commit is contained in:
RockyHawk 2024-02-17 09:00:03 +11:00 committed by GitHub
commit 6138ef1e2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,7 +119,11 @@ public class HasSections {
//the current has section with all the functions implemented inside it //the current has section with all the functions implemented inside it
if(setName.startsWith("has")) { if(setName.startsWith("has")) {
if(value.endsWith(" HASPERM")) { if(value.endsWith(" HASPERM")) {
return Bukkit.getPlayer(value.substring(0, value.length()-8)).hasPermission(compare) == outputValue; String playername = value.substring(0, value.length()-8);
Player player = Bukkit.getPlayerExact(playername);
if(player != null){
return player.hasPermission(compare) == outputValue;
}
}else if(value.endsWith(" ISGREATER")) { }else if(value.endsWith(" ISGREATER")) {
return (new BigDecimal(compare).compareTo(new BigDecimal(value.substring(0, value.length()-10).replace(",",""))) <= 0 == outputValue); return (new BigDecimal(compare).compareTo(new BigDecimal(value.substring(0, value.length()-10).replace(",",""))) <= 0 == outputValue);
}else{ }else{