Advertisement
thevipershowita

guicommand.java

Jul 6th, 2019
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. package me.tylercreator.guichunk.commands;
  2.  
  3. import org.bukkit.command.Command;
  4. import org.bukkit.command.CommandExecutor;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7.  
  8. import me.tylercreator.guichunk.Main;
  9. import me.tylercreator.guichunk.ui.gui;
  10.  
  11. public class guicommand implements CommandExecutor {
  12.    
  13.     private Main plugin;
  14.    
  15.     public guicommand(Main plugin) {
  16.         this.plugin = plugin;
  17.        
  18.         plugin.getCommand("guichunk").setExecutor(this);
  19.        
  20.     }
  21.     @Override
  22.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  23.         // TODO Auto-generated method stub
  24.         if (!(sender instanceof Player)) {
  25.            
  26.            
  27.             return true;
  28.         }
  29.         Player p = (Player) sender;
  30.        
  31.         if (p.hasPermission("guichunk.user")) {
  32.             p.openInventory(gui.GUI(p));
  33.            
  34.         }
  35.        
  36.         return false;
  37.     }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement