intelligence pvp thing done
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user