mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-25 18:48:15 +01:00
Send message to player to tell he cannot change the island settings as he's not owner
#638
This commit is contained in:
parent
a3a50c1961
commit
4f84f37461
@ -2,7 +2,6 @@ package world.bentobox.bentobox.api.flags.clicklisteners;
|
|||||||
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||||
@ -109,6 +108,8 @@ public class CycleClick implements PanelItem.ClickHandler {
|
|||||||
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user, invisible).getItem());
|
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user, invisible).getItem());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// Player is not the owner of the island.
|
||||||
|
user.getPlayer().sendMessage("general.errors.not-owner");
|
||||||
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
|
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package world.bentobox.bentobox.api.flags.clicklisteners;
|
package world.bentobox.bentobox.api.flags.clicklisteners;
|
||||||
|
|
||||||
import world.bentobox.bentobox.api.events.island.IslandEvent;
|
import world.bentobox.bentobox.api.events.island.IslandEvent;
|
||||||
|
@ -2,7 +2,6 @@ package world.bentobox.bentobox.api.flags.clicklisteners;
|
|||||||
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||||
@ -69,9 +68,10 @@ public class IslandToggleClick implements ClickHandler {
|
|||||||
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user, invisible).getItem());
|
panel.getInventory().setItem(slot, flag.toPanelItem(plugin, user, invisible).getItem());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// Player is not the owner of the island.
|
||||||
|
user.getPlayer().sendMessage("general.errors.not-owner");
|
||||||
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
|
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user