Search in sources :

Example 1 with BorderData

use of com.wimbli.WorldBorder.BorderData in project WildernessTp by AcmeProject.

the class WorldConfig method weNeedToBuildaWallTrumpSaidItAndObviouslyEverybodyLikeHim.

void weNeedToBuildaWallTrumpSaidItAndObviouslyEverybodyLikeHim() {
    if (WildTP.wb) {
        WildTP.debug("worldborder plugin detected");
        BorderData b = Config.Border(world.getName());
        // We don't need no education...
        if (b != null) {
            Boolean s = b.getShape();
            int x = b.getRadiusX(), z = b.getRadiusZ();
            // (guitar riff)
            if ((s == null && Config.ShapeRound()) || (s != null && s)) {
                x = (int) (Math.sqrt(2) * x) / 2;
                z = (int) (Math.sqrt(2) * z) / 2;
            }
            // We don't need no thought control...
            sendBrick(minXY, maxXY, (int) b.getX() - x, (int) b.getX() + x, (int) b.getZ() - z, (int) b.getZ() + z);
            return;
        }
    }
    WildTP.debug("WorldBorder plugin not detected (or border not set), checking for vanilla's");
    WorldBorder b = world.getWorldBorder();
    if (b == null)
        return;
    int r = (int) b.getSize() / 2, x = b.getCenter().getBlockX(), z = b.getCenter().getBlockZ();
    sendBrick(minXY, maxXY, x - r, x + r, z - r, z + r);
}
Also used : BorderData(com.wimbli.WorldBorder.BorderData) WorldBorder(org.bukkit.WorldBorder)

Aggregations

BorderData (com.wimbli.WorldBorder.BorderData)1 WorldBorder (org.bukkit.WorldBorder)1