Open gui through npc
This commit is contained in:
parent
b33b0ac935
commit
bcd4f4f9e2
@ -19,9 +19,14 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.hub.bonuses.commands.GuiCommand;
|
||||
import mineplex.hub.bonuses.gui.BonusGui;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class BonusManager extends MiniDbClientPlugin<BonusClientData> {
|
||||
@ -323,6 +328,16 @@ public class BonusManager extends MiniDbClientPlugin<BonusClientData> {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void openGui(PlayerInteractEntityEvent event)
|
||||
{
|
||||
Entity entity = event.getRightClicked();
|
||||
if (entity instanceof LivingEntity && entity.getType().equals(EntityType.CREEPER) && ((LivingEntity) entity).getCustomName().startsWith("Carl"))
|
||||
{
|
||||
new BonusGui(_plugin, event.getPlayer(), this).openInventory();
|
||||
}
|
||||
}
|
||||
|
||||
public static long getNextVoteTime(long time) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user