diff --git a/src/main/java/net/momirealms/customcrops/DataManager/MaxCropsPerChunk.java b/src/main/java/net/momirealms/customcrops/DataManager/MaxCropsPerChunk.java index 5f9b540..a29e2ad 100644 --- a/src/main/java/net/momirealms/customcrops/DataManager/MaxCropsPerChunk.java +++ b/src/main/java/net/momirealms/customcrops/DataManager/MaxCropsPerChunk.java @@ -8,6 +8,7 @@ import org.bukkit.configuration.file.FileConfiguration; public class MaxCropsPerChunk { public static boolean maxCropsPerChunk(Location location){ + FileConfiguration config = CustomCrops.instance.getConfig(); if(!config.getBoolean("config.enable-limit")){ return false; @@ -26,8 +27,9 @@ public class MaxCropsPerChunk { final Location square = chunkLocation.clone().add((double)i, 0.0, (double)j); for (int k = minY; k <= maxY; ++k) { square.add(0.0, 1.0, 0.0); - if(CustomBlock.byAlreadyPlaced(location.getWorld().getBlockAt(square))!= null){ - if (CustomBlock.byAlreadyPlaced(location.getWorld().getBlockAt(square)).getNamespacedID().contains("stage")) { + Blcok b = location.getWorld().getBlcokAt(square); + if(CustomBlock.byAlreadyPlaced(b)!= null){ + if (CustomBlock.byAlreadyPlaced(b).getNamespacedID().contains("stage")) { if (n++ > maxAmount) { break Label_out; }