intelligence pvp thing done

This commit is contained in:
batchprogrammer314
2021-07-24 23:34:07 -05:00
parent 8dc4dcf8c9
commit d86a42eab6
22 changed files with 1045 additions and 117 deletions

View File

@@ -2,6 +2,7 @@ package net.nuggetmc.ai.utils;
import net.nuggetmc.ai.TerminatorPlus;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
@@ -49,4 +50,21 @@ public class PlayerUtils {
Debugger.log("Failed to fetch from the usercache.");
}
}
public static Location findAbove(Location loc, int amount) {
boolean check = false;
for (int i = 0; i <= amount; i++) {
if (loc.clone().add(0, i, 0).getBlock().getType().isSolid()) {
check = true;
break;
}
}
if (check) {
return loc;
} else {
return loc.clone().add(0, amount, 0);
}
}
}