mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-23 11:15:24 +01:00
Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop
This commit is contained in:
commit
0f63353e2b
@ -79,9 +79,7 @@ public class IslandBanCommand extends CompositeCommand {
|
||||
}
|
||||
target = User.getInstance(targetUUID);
|
||||
// Cannot ban ops
|
||||
if (target.isOp() || (target.isOnline() && target.hasPermission(
|
||||
getAddon()
|
||||
.getPermissionPrefix() + "admin.noban"))) {
|
||||
if (target.isOp() || (target.isOnline() && target.hasPermission(this.getPermissionPrefix() + "admin.noban"))) {
|
||||
user.sendMessage("commands.island.ban.cannot-ban");
|
||||
return false;
|
||||
}
|
||||
|
@ -84,7 +84,9 @@ public class IslandExpelCommand extends CompositeCommand {
|
||||
return false;
|
||||
}
|
||||
// Cannot ban ops
|
||||
if (target.isOp() || target.hasPermission("admin.noexpel") || target.hasPermission("mod.bypassexpel")) {
|
||||
if (target.isOp() ||
|
||||
target.hasPermission(this.getPermissionPrefix() + "admin.noexpel") ||
|
||||
target.hasPermission(this.getPermissionPrefix() + "mod.bypassexpel")) {
|
||||
user.sendMessage(CANNOT_EXPEL);
|
||||
return false;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import java.util.List;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
import world.bentobox.bentobox.api.panels.PanelItem;
|
||||
@ -22,13 +23,19 @@ public class PanelItemBuilder {
|
||||
private boolean playerHead;
|
||||
private boolean invisible;
|
||||
|
||||
public PanelItemBuilder icon(Material icon) {
|
||||
this.icon = new ItemStack(icon);
|
||||
/**
|
||||
* Default icon if someone gives invalid material or item stack.
|
||||
*/
|
||||
private final static ItemStack DEFAULT_ICON = new ItemStack(Material.PAPER);
|
||||
|
||||
|
||||
public PanelItemBuilder icon(@NonNull Material icon) {
|
||||
this.icon = icon == null ? DEFAULT_ICON : new ItemStack(icon);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PanelItemBuilder icon(ItemStack icon) {
|
||||
this.icon = icon;
|
||||
public PanelItemBuilder icon(@NonNull ItemStack icon) {
|
||||
this.icon = icon == null ? DEFAULT_ICON : icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ public class PlayersManager {
|
||||
*/
|
||||
public int getDeaths(World world, UUID playerUUID) {
|
||||
addPlayer(playerUUID);
|
||||
return playerCache.get(playerUUID).getDeaths(world);
|
||||
return playerCache.get(playerUUID) == null ? 0 : playerCache.get(playerUUID).getDeaths(world);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user