daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest Dec 9th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package lanthyrhorseinv.lanthyrhorseinv.commands;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.Material;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandExecutor;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.*;
  10. import org.bukkit.inventory.Inventory;
  11. import org.bukkit.inventory.ItemStack;
  12.  
  13. import static lanthyrhorseinv.lanthyrhorseinv.LanthyrHorseINV.returnHorse;
  14.  
  15. public class configreload implements CommandExecutor {
  16.  
  17.  
  18.     @Override
  19.     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  20.         if (command.getName().equalsIgnoreCase("configreload")) {
  21.             Player player = (Player) sender;
  22.             Inventory inventory = Bukkit.createInventory(null, 9, player.getName() + "'s inventory");
  23.  
  24.             if (args.length < 1) {
  25.                 if (player.getNearbyEntities(5, 5, 5).iterator().next().getType().equals(EntityType.HORSE)) {
  26.                     if (returnHorse().getHM().getHorse(player.getUniqueId(), 1).equals(returnHorse().getHM().getFavoriteHorse(player.getUniqueId()))) {
  27.                         player.sendMessage(ChatColor.GREEN + "This is your horse!");
  28.  
  29.                         inventory.setItem(1, new ItemStack(Material.STAINED_CLAY));
  30.                         player.openInventory(inventory);
  31.                     }
  32.                 }
  33.             } else {
  34.                 player.sendMessage(ChatColor.DARK_RED + "Wrong usage.");
  35.             }
  36.  
  37.             return true;
  38.  
  39.         }
  40.  
  41.         return false;
  42.     }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top