2014-03-30 04:05:09 +00:00
|
|
|
/*
|
|
|
|
* WorldEdit, a Minecraft world manipulation toolkit
|
|
|
|
* Copyright (C) sk89q <http://www.sk89q.com>
|
|
|
|
* Copyright (C) WorldEdit team and contributors
|
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or
|
2014-03-30 04:05:09 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
|
|
|
* for more details.
|
2014-03-30 04:05:09 +00:00
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
2014-03-30 04:05:09 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-03-30 19:03:12 +00:00
|
|
|
package com.sk89q.worldedit.extent;
|
2014-03-30 04:05:09 +00:00
|
|
|
|
2014-04-04 00:52:53 +00:00
|
|
|
import com.sk89q.worldedit.Vector;
|
2014-04-28 06:34:39 +00:00
|
|
|
import com.sk89q.worldedit.entity.BaseEntity;
|
|
|
|
import com.sk89q.worldedit.entity.Entity;
|
2014-07-10 21:50:40 +00:00
|
|
|
import com.sk89q.worldedit.util.Location;
|
2014-07-11 05:22:35 +00:00
|
|
|
import com.sk89q.worldedit.regions.Region;
|
2014-04-28 06:34:39 +00:00
|
|
|
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
import java.util.List;
|
2014-04-04 00:52:53 +00:00
|
|
|
|
2014-03-30 04:05:09 +00:00
|
|
|
/**
|
2014-04-03 06:42:11 +00:00
|
|
|
* A world, portion of a world, clipboard, or other object that can have blocks
|
|
|
|
* set or entities placed.
|
|
|
|
*
|
|
|
|
* @see InputExtent the get____() portion
|
|
|
|
* @see OutputExtent the set____() portion
|
2014-03-30 04:05:09 +00:00
|
|
|
*/
|
2014-04-03 06:42:11 +00:00
|
|
|
public interface Extent extends InputExtent, OutputExtent {
|
2014-04-04 00:52:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the minimum point in the extent.
|
2014-07-26 07:29:12 +00:00
|
|
|
*
|
|
|
|
* <p>If the extent is unbounded, then a large (negative) value may
|
|
|
|
* be returned.</p>
|
2014-04-04 00:52:53 +00:00
|
|
|
*
|
|
|
|
* @return the minimum point
|
|
|
|
*/
|
|
|
|
Vector getMinimumPoint();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the maximum point in the extent.
|
2014-07-26 07:29:12 +00:00
|
|
|
*
|
|
|
|
* <p>If the extent is unbounded, then a large (positive) value may
|
|
|
|
* be returned.</p>
|
2014-04-04 00:52:53 +00:00
|
|
|
*
|
|
|
|
* @return the maximum point
|
|
|
|
*/
|
|
|
|
Vector getMaximumPoint();
|
|
|
|
|
2014-07-11 05:22:35 +00:00
|
|
|
/**
|
|
|
|
* Get a list of all entities within the given region.
|
2014-07-26 07:29:12 +00:00
|
|
|
*
|
|
|
|
* <p>If the extent is not wholly loaded (i.e. a world being simulated in the
|
2014-07-11 05:22:35 +00:00
|
|
|
* game will not have every chunk loaded), then this list may not be
|
2014-07-26 07:29:12 +00:00
|
|
|
* incomplete.</p>
|
2014-07-11 05:22:35 +00:00
|
|
|
*
|
|
|
|
* @return a list of entities
|
|
|
|
*/
|
|
|
|
List<? extends Entity> getEntities(Region region);
|
|
|
|
|
2014-04-28 06:34:39 +00:00
|
|
|
/**
|
|
|
|
* Get a list of all entities.
|
2014-07-26 07:29:12 +00:00
|
|
|
*
|
|
|
|
* <p>If the extent is not wholly loaded (i.e. a world being simulated in the
|
2014-04-28 06:34:39 +00:00
|
|
|
* game will not have every chunk loaded), then this list may not be
|
2014-07-26 07:29:12 +00:00
|
|
|
* incomplete.</p>
|
2014-04-28 06:34:39 +00:00
|
|
|
*
|
|
|
|
* @return a list of entities
|
|
|
|
*/
|
2014-07-11 05:22:35 +00:00
|
|
|
List<? extends Entity> getEntities();
|
2014-04-28 06:34:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create an entity at the given location.
|
|
|
|
*
|
|
|
|
* @param entity the entity
|
2014-07-10 21:50:40 +00:00
|
|
|
* @param location the location
|
2014-04-28 06:34:39 +00:00
|
|
|
* @return a reference to the created entity, or null if the entity could not be created
|
|
|
|
*/
|
2014-07-10 21:50:40 +00:00
|
|
|
@Nullable Entity createEntity(Location location, BaseEntity entity);
|
2014-04-28 06:34:39 +00:00
|
|
|
|
2014-03-30 04:05:09 +00:00
|
|
|
}
|