Solved help - fixing variables

Discussion in 'Plugin Development' started by noraver, Mar 30, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    noraver

    keep running into a problem maybe someone else can see where i went wrong
    Code:
    Multiple markers at this line
        - name cannot be resolved to a
        variable
        - lore cannot be resolved to a
        variable
        - ench cannot be resolved to a
        variable
        - color cannot be resolved to a
        variable
        - mat cannot be resolved to a
        variable
        - enchLevel cannot be resolved to a
        variable
        - durability cannot be resolved to a
        variable

    This is the main Class
    Code:java
    1.  
    Code:java
    1.  
    Code:java
    1.  
    2. import java.util.ArrayList;
    3. import java.util.List;
    4. import org.bukkit.Color;
    5. import org.bukkit.Material;
    6. import org.bukkit.enchantments.Enchantment;
    7. import org.bukkit.event.EventHandler;
    8. import org.bukkit.event.Listener;
    9. import org.bukkit.inventory.ItemStack;
    10. import org.bukkit.inventory.ShapedRecipe;
    11. import org.bukkit.inventory.meta.ItemMeta;
    12. import org.bukkit.inventory.meta.LeatherArmorMeta;
    13. import org.bukkit.plugin.java.JavaPlugin;
    14. import net.bless.armoreq.ArmorP;
    15. import org.bukkit.event.Event;
    16. public class ArmorBW extends JavaPlugin
    17. implements Listener
    18. {
    19. public void onEnable() {
    20. addRecipes();
    21.  
    22. }
    23.  
    24. private void addRecipes() {
    25. List<String> lore = new ArrayList<String>();
    26. lore.add("Blah");
    27. ArmorP whiteArmor = new ArmorP("Sugar", Material.SUGAR, Color.WHITE, (short)-2500, lore, Enchantment.PROTECTION_ENVIRONMENTAL, 1);
    28.  
    29. List<String> lore2 = new ArrayList<String>();
    30. lore2.add("Blah");
    31. ArmorP blackArmor = new ArmorP("Brick", Material.BRICK, Color.BLACK, (short)-2000, lore, Enchantment.PROTECTION_ENVIRONMENTAL, 2);
    32.  
    33. createLeatherArmourRecipes(whiteArmor);
    34. createLeatherArmourRecipes(blackArmor);
    35. }
    36.  
    37. private void createLeatherArmourRecipes(ArmorP Armor) {
    38. createLeatherPiece("Helm", new String[] {" ", "*%*", "* *"}, Material.LEATHER_HELMET, name, mat, color, durability, lore, ench, enchLevel);
    39. createLeatherPiece("Leggings", new String[] {"***", "% %", "* *"}, Material.LEATHER_LEGGINGS, name, mat, color, durability, lore, ench, enchLevel);
    40. createLeatherPiece("Boots", new String[] {" ", "* *", "% %"}, Material.LEATHER_BOOTS, name, mat, color, durability, lore, ench, enchLevel);
    41. createLeatherPiece("ChestPlate", new String[] {"* *", "*%*", "***"}, Material.LEATHER_CHESTPLATE, name, mat, color, durability, lore, ench, enchLevel);
    42. }
    43.  


    this is the ArmorP class
    Code:java
    1.  
    Code:java
    1.  
    Code:java
    1.  
    2. import java.util.List;
    3.  
    4. import org.bukkit.Color;
    5. import org.bukkit.Material;
    6. import org.bukkit.enchantments.Enchantment;
    7.  
    8. public class ArmorP {
    9. String name;
    10. Material recipeMat;
    11. Color color;
    12. Short durability;
    13. List<String> lore;
    14. Enchantment ench;
    15. int enchLevel;
    16.  
    17. public ArmorP(String name, Material recipeMat, Color color,
    18. Short durability, List<String> lore, Enchantment ench, int enchLevel) {
    19. super();
    20. this.name = name;
    21. this.recipeMat = recipeMat;
    22. this.color = color;
    23. this.durability = durability;
    24. this.lore = lore;
    25. this.ench = ench;
    26. this.enchLevel = enchLevel;
    27. }
    28.  
    29.  
    30.  
    31. }



    syntax is glitching on bukkit i didnt add those others.
     
  2. Offline

    chasechocolate

    If you want the variables from the ArmorP class, then make them public.
     
Thread Status:
Not open for further replies.

Share This Page