Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. package me.nebuler;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.event.inventory.InventoryType;
  9. import org.bukkit.inventory.Inventory;
  10. import org.bukkit.plugin.java.JavaPlugin;
  11.  
  12. public class VirtualGUI extends JavaPlugin {
  13.  
  14. @Override
  15. public void onEnable() {
  16. getLogger().info("VirtualGUI successfully enabled! Working correctly");
  17. }
  18.  
  19. @Override
  20. public void onDisable() {
  21. getLogger().info("VirtualGUI successfully disabled!");
  22. }
  23.  
  24. @Override
  25. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  26.  
  27. if (cmd.getName().equalsIgnoreCase("anvil") && sender instanceof Player) {
  28.  
  29. Player p = (Player) sender;
  30. Inventory i = Bukkit.createInventory(p, InventoryType.ANVIL);
  31. p.openInventory(i);
  32.  
  33. } else if (!(sender instanceof Player)) {
  34.  
  35. sender.sendMessage(ChatColor.DARK_RED + "You must be a player to use this command!");
  36.  
  37. }
  38.  
  39. if (cmd.getName().equalsIgnoreCase("furnace") && sender instanceof Player || cmd.getName().equalsIgnoreCase("smelt") && sender instanceof Player) {
  40.  
  41. Player p = (Player) sender;
  42. Inventory i = Bukkit.createInventory(p, InventoryType.FURNACE);
  43. p.openInventory(i);
  44.  
  45. } else if (!(sender instanceof Player)) {
  46.  
  47. sender.sendMessage(ChatColor.DARK_RED + "You must be a player to use this command!");
  48.  
  49. }
  50.  
  51. return true;
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement