mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-09-27 14:13:00 +02:00
Check if player is previewing an island before cleaning inventory and info commands.
This commit is contained in:
parent
0ef9296cdc
commit
83cbff38ea
@ -59,6 +59,13 @@ public class InformationCommand extends SubCommand {
|
||||
|
||||
PlayerData playerData = plugin.getPlayerDataManager().getPlayerData(player);
|
||||
|
||||
if (playerData.isPreview()) {
|
||||
messageManager.sendMessage(player,
|
||||
configLoad.getString("Command.Island.Information.Previewing.Message"));
|
||||
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F);
|
||||
return;
|
||||
}
|
||||
|
||||
if (islandOwnerUUID == null) {
|
||||
if (islandManager.getIsland(player) == null) {
|
||||
messageManager.sendMessage(player,
|
||||
|
@ -580,10 +580,10 @@ public class IslandManager {
|
||||
}
|
||||
|
||||
// TODO - Find a way to delete also offline players
|
||||
if (configLoad.getBoolean("Island.Deletion.ClearInventory", false)){
|
||||
if (configLoad.getBoolean("Island.Deletion.ClearInventory", false) && !playerData.isPreview()) {
|
||||
player.getInventory().clear();
|
||||
}
|
||||
if (configLoad.getBoolean("Island.Deletion.ClearEnderChest", false)){
|
||||
if (configLoad.getBoolean("Island.Deletion.ClearEnderChest", false) && !playerData.isPreview()) {
|
||||
player.getEnderChest().clear();
|
||||
}
|
||||
|
||||
|
@ -841,6 +841,8 @@ Command:
|
||||
Message: '&bSkyBlock &8| &cError&8: &eYou don''t have permission to view information on other players'' Islands.'
|
||||
Owner:
|
||||
Message: '&bSkyBlock &8| &cError&8: &eYou are not an Island Owner.'
|
||||
Previewing:
|
||||
Message: '&bSkyBlock &8| &cError&8: &eYou are currently previewing an island.'
|
||||
Info:
|
||||
Message: '&f&oOpens the Island Information menu.'
|
||||
Reset:
|
||||
|
Loading…
Reference in New Issue
Block a user