Make clan create button functional
This commit is contained in:
parent
16804a860c
commit
841a44b8a6
@ -1,15 +1,15 @@
|
|||||||
package mineplex.game.clans.clans.gui.button;
|
package mineplex.game.clans.clans.gui.button;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||||
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
import mineplex.core.common.jsonchat.ClickEvent;
|
|
||||||
import mineplex.core.common.jsonchat.JsonMessage;
|
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.shop.item.IButton;
|
|
||||||
|
|
||||||
public class ClanCreateButton implements IButton
|
public class ClanCreateButton implements IButton
|
||||||
{
|
{
|
||||||
public ClanCreateButton()
|
public ClanCreateButton()
|
||||||
@ -20,6 +20,14 @@ public class ClanCreateButton implements IButton
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(Player player, ClickType clickType)
|
public void onClick(Player player, ClickType clickType)
|
||||||
{
|
{
|
||||||
UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Create));
|
if (!UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Create)).isCancelled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TextComponent message = new TextComponent("Click Here to create a Clan!");
|
||||||
|
message.setColor(ChatColor.AQUA);
|
||||||
|
message.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/c create "));
|
||||||
|
player.spigot().sendMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user