mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-23 08:59:28 +00:00
Update MaxCropsPerChunk.java
This commit is contained in:
@@ -8,6 +8,7 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||||||
public class MaxCropsPerChunk {
|
public class MaxCropsPerChunk {
|
||||||
|
|
||||||
public static boolean maxCropsPerChunk(Location location){
|
public static boolean maxCropsPerChunk(Location location){
|
||||||
|
|
||||||
FileConfiguration config = CustomCrops.instance.getConfig();
|
FileConfiguration config = CustomCrops.instance.getConfig();
|
||||||
if(!config.getBoolean("config.enable-limit")){
|
if(!config.getBoolean("config.enable-limit")){
|
||||||
return false;
|
return false;
|
||||||
@@ -26,8 +27,9 @@ public class MaxCropsPerChunk {
|
|||||||
final Location square = chunkLocation.clone().add((double)i, 0.0, (double)j);
|
final Location square = chunkLocation.clone().add((double)i, 0.0, (double)j);
|
||||||
for (int k = minY; k <= maxY; ++k) {
|
for (int k = minY; k <= maxY; ++k) {
|
||||||
square.add(0.0, 1.0, 0.0);
|
square.add(0.0, 1.0, 0.0);
|
||||||
if(CustomBlock.byAlreadyPlaced(location.getWorld().getBlockAt(square))!= null){
|
Blcok b = location.getWorld().getBlcokAt(square);
|
||||||
if (CustomBlock.byAlreadyPlaced(location.getWorld().getBlockAt(square)).getNamespacedID().contains("stage")) {
|
if(CustomBlock.byAlreadyPlaced(b)!= null){
|
||||||
|
if (CustomBlock.byAlreadyPlaced(b).getNamespacedID().contains("stage")) {
|
||||||
if (n++ > maxAmount) {
|
if (n++ > maxAmount) {
|
||||||
break Label_out;
|
break Label_out;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user