More debug, and colored debug

This commit is contained in:
Spencer 2017-11-25 16:03:43 -05:00 committed by Alexander Meech
parent 331b20ed47
commit 1973f74003

View File

@ -29,6 +29,7 @@ import com.java.sk89q.jnbt.Tag;
import mineplex.core.common.block.schematic.Schematic;
import mineplex.core.common.block.schematic.UtilSchematic;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.NautHashMap;
@ -258,27 +259,40 @@ public class BuildData
return inBuildArea(block.getLocation().toVector());
}
private String getBooleanForDebug(boolean bool) {
if (bool) {
return C.cGreen + "true";
}
return C.cRed + "false";
}
public boolean inBuildArea(Vector vec)
{
Bukkit.broadcastMessage("Checking if vector " + vec + " is inside build area for " + Player.getName());
Bukkit.broadcastMessage("Bottom left corner: " + CornerBottomLeft.toString());
Bukkit.broadcastMessage("Top right corner: " + CornerTopRight.toString());
Bukkit.broadcastMessage(C.cGray + "Checking if vector " + C.cYellow + vec + C.cGray + " is inside build area for " + C.cYellow + Player.getName());
Bukkit.broadcastMessage(C.cGray + "Bottom left corner: " + C.cYellow + CornerBottomLeft.toVector().toString());
Bukkit.broadcastMessage((C.cGray + "Top right corner: " + C.cYellow + CornerTopRight.toVector().toString());
Bukkit.broadcastMessage(C.cGray + "Checking relative to BL x: " + getBooleanForDebug(vec.getBlockX() <= CornerBottomLeft.getBlockX()));
if (vec.getBlockX() <= CornerBottomLeft.getBlockX())
return false;
Bukkit.broadcastMessage(C.cGray + "Checking relative to BL y: " + getBooleanForDebug(vec.getBlockY() < CornerBottomLeft.getBlockY()));
if (vec.getBlockY() < CornerBottomLeft.getBlockY())
return false;
Bukkit.broadcastMessage(C.cGray + "Checking relative to BL z: " + getBooleanForDebug(vec.getBlockZ() < CornerBottomLeft.getBlockZ()));
if (vec.getBlockZ() < CornerBottomLeft.getBlockZ())
return false;
Bukkit.broadcastMessage(C.cGray + "Checking relative to TR x: " + getBooleanForDebug(vec.getBlockX() > CornerTopRight.getBlockX()));
if (vec.getBlockX() > CornerTopRight.getBlockX())
return false;
Bukkit.broadcastMessage(C.cGray + "Checking relative to TR y: " + getBooleanForDebug(vec.getBlockY() > CornerTopRight.getBlockY()));
if (vec.getBlockY() > CornerTopRight.getBlockY())
return false;
Bukkit.broadcastMessage(C.cGray + "Checking relative to TR z: " + getBooleanForDebug(vec.getBlockZ() > CornerTopRight.getBlockZ()));
if (vec.getBlockZ() > CornerTopRight.getBlockZ())
return false;