title: How do I call an itemStack from another Class?
body: <p>I'm making a Custom Horse plugin and this is the first real plugin that I'm making so please excuse my messy code.</p>
  
  <p>In one class (HorseSaddles) I have created 4 different saddles:</p>
  
  <pre><code>package io.github.bxnie.Items;
  
  import java.util.ArrayList;
  import org.bukkit.Material;
  import org.bukkit.event.Listener;
  import org.bukkit.inventory.ItemStack;
  import org.bukkit.inventory.meta.ItemMeta;
  
  import net.md_5.bungee.api.ChatColor;
  
  public class HorseSaddles implements Listener {
      public void DonkeyHorse() {
          ItemStack dhorse = new ItemStack(Material.SADDLE);
          ItemMeta dhorsemeta = dhorse.getItemMeta();
  
          dhorsemeta.setDisplayName(ChatColor.RED + "Donkey");
          ArrayList&lt;String&gt; dhorselore = new ArrayList&lt;String&gt;();
          dhorselore.add(ChatColor.DARK_GRAY + "1/4");
          dhorselore.add(ChatColor.DARK_GRAY + "Right click to spawn your Donkey!");
          dhorsemeta.setLore(dhorselore);
          dhorse.setItemMeta(dhorsemeta);
      }
  
      public void BrownHorse() {
          ItemStack brhorse = new ItemStack(Material.SADDLE);
          ItemMeta brhorsemeta = brhorse.getItemMeta();
  
          brhorsemeta.setDisplayName(ChatColor.RED + "Brown Horse");
          ArrayList&lt;String&gt; brhorselore = new ArrayList&lt;String&gt;();
          brhorselore.add(ChatColor.DARK_GRAY + "2/4");
          brhorselore.add(ChatColor.DARK_GRAY + "Right click to spawn your Horse!");
          brhorsemeta.setLore(brhorselore);
          brhorse.setItemMeta(brhorsemeta);
      }
  
      public void BlackHorse() {
          ItemStack blhorse = new ItemStack(Material.SADDLE);
          ItemMeta blhorsemeta = blhorse.getItemMeta();
  
          blhorsemeta.setDisplayName(ChatColor.BLACK + "Black" + ChatColor.RED + "Horse");
          ArrayList&lt;String&gt; blhorselore = new ArrayList&lt;String&gt;();
          blhorselore.add(ChatColor.DARK_GRAY + "3/4");
          blhorselore.add(ChatColor.DARK_GRAY + "Right click to spawn your Horse!");
          blhorsemeta.setLore(blhorselore);
          blhorse.setItemMeta(blhorsemeta);
      }
  
      public void WhiteHorse() {
          ItemStack whorse = new ItemStack(Material.SADDLE);
          ItemMeta whorsemeta = whorse.getItemMeta();
  
          whorsemeta.setDisplayName(ChatColor.WHITE + "White" + ChatColor.RED + "Horse");
          ArrayList&lt;String&gt; whorselore = new ArrayList&lt;String&gt;();
          whorselore.add(ChatColor.DARK_GRAY + "4/4");
          whorselore.add(ChatColor.DARK_GRAY + "Right click to spawn your Horse!");
          whorsemeta.setLore(whorselore);
          whorse.setItemMeta(whorsemeta);
      }
  }
  </code></pre>
  
  <p>And in another class (SaddleCommands) I am attempting to create a command which will give the user that an that item if they have the correct permissions</p>
  
  <pre><code>package io.github.bxnie.commands;
  
  import org.bukkit.Material;
  import org.bukkit.command.Command;
  import org.bukkit.command.CommandExecutor;
  import org.bukkit.command.CommandSender;
  import org.bukkit.entity.Player;
  import org.bukkit.event.Listener;
  import org.bukkit.inventory.ItemStack;
  
  import net.minecraft.server.v1_12_R1.CommandExecute;
  
  public class SaddleCommands extends CommandExecute implements Listener, CommandExecutor{
  
      public String cmd1 = "fhdonkey";
  
      @Override
      public boolean onCommand(CommandSender sender, Command cmd, String label, String[] arg3) {
          if (!(sender instanceof Player)) {
              sender.sendMessage("Only players may execute this command!");
              return true;
          }
  
          Player p = (Player) sender;
          if(cmd.getName().equalsIgnoreCase(cmd1)) {
              if (p.hasPermission("fh.donkey")) {
                  p.sendMessage("You Have Purchased a Donkey");
                  p.getInventory().addItem(...);
                  return true;
              } else {
                  p.sendMessage("§cInsufficient Permission!");
                  return false;
              }
          }
          return false;
      }
  }
  </code></pre>
  
  <p>where it says <code>p.getInventory().addItem(...);</code> i put in the 3dots as a placeholder as I don't know how to retrieve an item from another class.</p>