when passing a location to a different class it passed as null

Discussion in 'Plugin Development' started by Dizzen, May 3, 2020.

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

    Dizzen

    So I have this code that passes locations to a different class but when I try to access the locations from the other class it returns as null. Here is the code that creates the location:
    Code:
     World claimworld = plugin.getWorld(plugin.claimsConfig.getString(i + "ClaimWorld"));
                  
                    Location loc1 = new Location(claimworld, plugin.claimsConfig.getDouble(i + "Claiml1X"), 1, plugin.claimsConfig.getDouble(i + "Claiml1Z"));
                    Location loc2 = new Location(claimworld, plugin.claimsConfig.getDouble(i + "Claiml2X"), 256, plugin.claimsConfig.getDouble(i + "Claiml2Z"));
                    
    and the line i get the error (NPE) on is:
    Code:
    area.area(loc1, loc2);
    which just passes the location to the area class where all I do is location.getblockx and it returns as null.
     
  2. Online

    timtower Administrator Administrator Moderator

    @Dizzen You need to post more code than this.
    You are posting lines that seem unrelated to each other.
     
Thread Status:
Not open for further replies.

Share This Page