Hey Spigot, So in my NameMyTool plugin i wanted to support both 1.8 and 1.9 so both jars are added to the build path, i wanted to grab the inventory location and if its null (which i want) to do the rest of my code. When using inv.getLocation() i get: Code (Text): Caused by: java.lang.NoSuchMethodError: org.bukkit.inventory.Inventory.getLocation()Lorg/bukkit/Location; My imports are not directly specifying a version and was confused why i am still getting this error, Cheers!
I see, after changing i see 1.8 does not have a inv.getLocation() method, any other possible way of checking its location?
Why? Just use the 1.9 version. It should implements the 1.8 methods and the newest. So you had to import one api.
My plugin is meant to support both 1.8 and 1.9, when using this method on a 1.8 server i get the error i said above thats why
Make a version string,with split etc.." After make a simple method with equals example: if (version.equals("1.8.8"))) { Your code }else if (version.equals("1.9") { code }
I still want the 1.8 API and i do understand what you mean, i cannot even change the imports for 1.9 as they are all org.bukkit etc.
But inventory no have location, inventory no is entity/livingentity, use e.getRightClicked(),getLocation()
I am using an InventoryClickEvent @Particlees , and i wish to have it so it checks if the Inventory location is null meaning i created the GUI.
Make a simple method: public static boolean Chazmondo(Inventory inv){ try{ inv.getLocation(); return true; }catch(Exception ex) { return false; } .............. False is null, true is !null ------------------------------- After, use Inventory inv = e.getInventory(); if (Chazmondo(inv) == true){ return; or your code; } else { created the GUI: }