Agent migration from 2.0 (legacy), basic velocities and maneuvering.

This commit is contained in:
batchprogrammer314
2021-07-12 18:20:17 -05:00
parent 7c2de37bd8
commit 94da2ac11b
16 changed files with 1407 additions and 64 deletions

View File

@@ -0,0 +1,29 @@
package net.nuggetmc.ai.bot;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.util.BoundingBox;
import org.bukkit.util.Vector;
public class BotUtils {
public static boolean solidAt(Location loc) { // not perfect, still cuts corners of fences
Block block = loc.getBlock();
BoundingBox box = block.getBoundingBox();
Vector position = loc.toVector();
double x = position.getX();
double y = position.getY();
double z = position.getZ();
double minX = box.getMinX();
double minY = box.getMinY();
double minZ = box.getMinZ();
double maxX = box.getMaxX();
double maxY = box.getMaxY();
double maxZ = box.getMaxZ();
return x > minX && x < maxX && y > minY && y < maxY && z > minZ && z < maxZ;
}
}