Development Assistance Help can't get barApi work with my plugin

Discussion in 'Plugin Help/Development/Requests' started by Danielh90, Dec 18, 2014.

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

    Danielh90

    So i am new to using apis so i downloaded BarApi looked like a good start to learning how to use api with my plugin so i whated to have a command that turns it on so i did this and i thought it would work i have put the command in to my plugin.yml :/ what am i a doing wrong please tell me if you see this on Dec 18 2014 its 10:54Pm for me so i am going to bed i will check this in the morning at 5:00 am and try and respond to replys
    if (label.equalsIgnoreCase("bar")){
    BarAPI.setMessage((Player)sender,ChatColor.RED + "bar", 100f);
    }
     
  2. Offline

    Webbeh

    If that's all of the code, no wonder it doesn't work.

    Also baAPI is broken in the up-to-date versions.
     
  3. Offline

    MaTaMoR_

    Post more code & the error, which version you're using ?
     
  4. Offline

    Danielh90

    The Barapi latest one just downloaded it yesterday
     
  5. Offline

    Skionz

  6. Offline

    Danielh90

    oh k should downgrade ?
     
  7. Offline

    Skionz

    @Danielh90 Yes to 1.7.10. Or you can make use of 1.8 titles
     
  8. Offline

    Danielh90

    can you give me the link to 1.7.10. and my server i s spigot 1.7.10
     
  9. Offline

    Skionz

    @Danielh90 I don't have the link. I am sure you can find it with a quick google.
     
  10. Offline

    Danielh90

    i Downgrade still not working its not giving me a error
     
  11. Offline

    Skionz

    @Danielh90 Is both your plugin, and BarAPI in your plugins folder?
     
  12. Offline

    Funergy

    @Danielh90 @Skionz The PacketPlayOutEntityTeleport Has changed in 1.8 Thats why.
    I have fixed that bug but I cant give the class to you now because I dont have time right now.
    But just do a research how to fix the packet in barAPI
     
  13. Offline

    Skionz

    @Funergy Ah yea Spigot changed a few of the constructors.
     
  14. Offline

    mrCookieSlime Retired Staff

    Moved to Alternatives Section.
     
  15. Offline

    Danielh90

    my plugin is in the plugin folder but the barapi is not should i put the barapi in the plugin folder

    Oh and is my code right ? for it to work when we get it fixed

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  16. Offline

    Skionz

    @Danielh90 Yes. You should be getting an exception if it is not.
     
  17. Offline

    Danielh90

    so i should put the barapi jar in the file plugin and is my code right if not can you show me what i am doing wrong ?
     
  18. Offline

    Skionz

    @Danielh90 Put BarAPI in your plugins folder.
     
  19. Offline

    Danielh90

    did nothing
     
  20. Offline

    Skionz

    @Danielh90 Post your entire startup log and all relevant classes.
     
  21. Offline

    Danielh90

    Here is the link to the log http://pastebin.com/RUDDQShT
    My Main Class
    Code:
    package com.danielh90.dan;
    
    import java.util.logging.Logger;
    
    import me.confuser.barapi.BarAPI;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.enchantments.Enchantment;
    import org.bukkit.entity.Player;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.PlayerInventory;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;
    
    
    
    public class Main extends JavaPlugin {
        //Strin/Public/private
        public static Main plugin;
        public final Logger lgoger = Logger.getLogger("Minecraft");
    
      public void onEnable()
      {
          PluginDescriptionFile pdfFile = this.getDescription();
          this.getLogger().info( ChatColor.GOLD +  pdfFile.getName() + "version" + pdfFile.getVersion() + "is Enabled");
          Bukkit.getPluginManager().registerEvents(new WelcomeListeners(), this);
      }
    
    
    
    
      public void onDisble()
      {
          PluginDescriptionFile pdfFile = this.getDescription();
          this.getLogger().info( ChatColor.GOLD +  pdfFile.getName() + "version" + pdfFile.getVersion() + "is Enabled");
          Bukkit.getPluginManager().registerEvents(new WelcomeListeners(), this);
      }
    
      public void someMethod() {
          PluginDescriptionFile pdfFile = this.getDescription();
          this.getLogger().info( ChatColor.RED +  pdfFile.getName() + "version" + pdfFile.getVersion() + "Somthing happen ");
          Bukkit.getPluginManager().registerEvents(new WelcomeListeners(), this);
        }
    
      public boolean onCommand(CommandSender sender, Command cmd,String label, String[] args) {
            Player p = (Player) sender;
            PlayerInventory pi = p.getInventory();
            if(cmd.getName().equalsIgnoreCase("danielkit")){
                //Message
                sender.sendMessage(ChatColor.GOLD + "Here is Your Kit");
    
                //ItemStack
                ItemStack Daniel_sword = new ItemStack(Material.DIAMOND_SWORD,1);
                ItemStack Daniel_bow = new ItemStack(Material.BOW, 1);
                ItemStack Daniel_arrow = new ItemStack(Material.ARROW, 1);
                ItemStack Daniel_pickaxe = new ItemStack(Material.DIAMOND_PICKAXE, 1);
                ItemStack Daniel_shovel = new ItemStack(Material.DIAMOND_SPADE, 1);
                ItemStack Daniel_helmet = new ItemStack(Material.DIAMOND_HELMET, 1);
                ItemStack Daniel_chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE,1);
                ItemStack Daniel_legs = new ItemStack(Material.DIAMOND_LEGGINGS, 1);
                ItemStack Daniel_boots = new ItemStack(Material.DIAMOND_BOOTS, 1);
                ItemStack Daniel_potato = new ItemStack(Material.BAKED_POTATO, 64);
                //Enchantments
                //Daniel_sword
                Daniel_sword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 150);
                Daniel_sword.addUnsafeEnchantment(Enchantment.DIG_SPEED, 7814548);
                Daniel_sword.addUnsafeEnchantment(Enchantment.KNOCKBACK, 7848);
                Daniel_sword.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 1);
                //Daniel_bow
                Daniel_bow.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 7848);
                Daniel_bow.addUnsafeEnchantment(Enchantment.DURABILITY, 8484);
                Daniel_bow.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 158454);
                Daniel_bow.addUnsafeEnchantment(Enchantment.DURABILITY, 88948);
                Daniel_bow.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 1);
                Daniel_bow.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 7848);
              //Daniel_arrow
              Daniel_arrow.addUnsafeEnchantment(Enchantment.DURABILITY, 87745);
              Daniel_arrow.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 8845);
              Daniel_arrow.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 85978);
              Daniel_arrow.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 95489);
              //Daniel_pickaxe
              Daniel_pickaxe.addUnsafeEnchantment(Enchantment.DURABILITY, 78457);
              Daniel_pickaxe.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 78894);
              Daniel_pickaxe.addUnsafeEnchantment(Enchantment.DIG_SPEED, 10510564);
              Daniel_pickaxe.addUnsafeEnchantment(Enchantment.LUCK, 8548);
              //Daniel_shovel
              Daniel_shovel.addUnsafeEnchantment(Enchantment.DURABILITY, 87545);
              Daniel_shovel.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 8845);
              Daniel_shovel.addUnsafeEnchantment(Enchantment.DIG_SPEED, 8454);
              Daniel_shovel.addUnsafeEnchantment(Enchantment.LUCK, 8454);
              //Daniel_helmet
              Daniel_helmet.addUnsafeEnchantment(Enchantment.DURABILITY, 8745);
              Daniel_helmet.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1541);
              Daniel_helmet.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, 800000);
              Daniel_helmet.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 89454);
              //Daniel_chestplate
              Daniel_chestplate.addUnsafeEnchantment(Enchantment.DURABILITY, 84844458);
              Daniel_chestplate.addUnsafeEnchantment(Enchantment.KNOCKBACK, 845454);
              Daniel_chestplate.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 854894);
              //daniel_legs
              Daniel_legs.addUnsafeEnchantment(Enchantment.DURABILITY, 6000);
              Daniel_legs.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 54555);
              Daniel_legs.addUnsafeEnchantment(Enchantment.KNOCKBACK, 545568);
              Daniel_legs.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 8585858);
              //pi
                pi.addItem(new ItemStack[] { Daniel_sword });
                pi.addItem(Daniel_bow);
                pi.addItem(Daniel_arrow);
                pi.addItem(Daniel_pickaxe);
                pi.addItem(Daniel_shovel);
                pi.addItem(Daniel_helmet);
                pi.addItem(Daniel_chestplate);
                pi.addItem(Daniel_legs);
                pi.addItem(Daniel_boots);
                pi.addItem(Daniel_potato);
                //Bar
          
                if (label.equalsIgnoreCase("bar")){
                    BarAPI.setMessage((Player) sender,ChatColor.RED + "The bar is now visible", 100f);
                }
              
            }
            return false;
      }
    }
    
     
  22. Offline

    Skionz

    @Danielh90 Your problem is that you are watching TheBCBroz. The solution is to stop, read up on basic Java tutorials, read through the Bukkit Javadocs and the wiki.
     
  23. Offline

    Danielh90

    i learn by watching someone else do it and i i read the javadocs to :) just tell me the probelm :/ kinda need to move on to other thing like adding new features the to the plguin please :)
     
  24. Offline

    Skionz

    @Danielh90 The static, the logger, the enable messages, the ItemStack arrays. Is your command registered?
    You can't learn Java from watching someone who doesn't know Java.
     
  25. Offline

    Danielh90

    k sorry man did not now that was a crime just tell me how i can fix the barapi and i watch the only thing i watch on TheBCBroz was bar api because he was english and when i try and look up barpi how to put it in your plugin its different lang from mine so yea not to be rude everyone codes different
     
  26. Offline

    Skionz

    @Danielh90 Sure everyone codes differently, but he codes terribly. Following what he does is an awful idea especially copying him line for line. You should only watch his videos when you understand when not to copy him (90% of the time). Now back to the issue.
     
  27. Offline

    Danielh90

    in the plugin.yml yes :)
     
  28. Offline

    Skionz

    @Danielh90 Add a few debug lines to see if the command is actually working.
     
  29. Offline

    Danielh90

    and for the feature who do you recommand me to watch ?

    how do i do that ?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  30. Offline

    Skionz

Thread Status:
Not open for further replies.

Share This Page