mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-22 16:39:36 +00:00
Update MaxCropsPerChunk.java
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user