Java Code Examples for com.sk89q.worldedit.util.Location#getExtent()

The following examples show how to use com.sk89q.worldedit.util.Location#getExtent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FloodFillTool.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
    World world = (World) clicked.getExtent();

    int initialType = world.getBlockType(clicked.toVector());

    if (initialType == BlockID.AIR) {
        return true;
    }

    if (initialType == BlockID.BEDROCK && !player.canDestroyBedrock()) {
        return true;
    }

    EditSession editSession = session.createEditSession(player);

    try {
        recurse(server, editSession, world, clicked.toVector().toBlockVector(),
                clicked.toVector(), range, initialType, new HashSet<BlockVector>());
    } catch (WorldEditException e) {
        throw new RuntimeException(e);
    }
    editSession.flushQueue();
    session.remember(editSession);
    return true;
}
 
Example 2
Source File: ScaleTransform.java    From FastAsyncWorldedit with GNU General Public License v3.0 4 votes vote down vote up
@Nullable
@Override
public Entity createEntity(Location location, BaseEntity entity) {
    Location newLoc = new Location(location.getExtent(), getPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()), location.getYaw(), location.getPitch());
    return super.createEntity(newLoc, entity);
}
 
Example 3
Source File: PlayerProxy.java    From FastAsyncWorldedit with GNU General Public License v3.0 4 votes vote down vote up
public Location getLocation() {
    Location loc = this.basePlayer.getLocation();
    return new Location(loc.getExtent(), loc.toVector().add(offset), loc.getDirection());
}