Added shims for old EditSession constructors.

This commit is contained in:
sk89q
2014-04-03 20:48:42 -07:00
parent fb4eb61763
commit 144302a487
4 changed files with 66 additions and 75 deletions

View File

@ -121,6 +121,23 @@ public class EditSession implements Extent {
@SuppressWarnings("deprecation")
private Mask oldMask;
/**
* @deprecated use {@link WorldEdit#getEditSessionFactory()} to create {@link EditSession}s
*/
@SuppressWarnings("deprecation")
@Deprecated
public EditSession(LocalWorld world, int maxBlocks) {
this(world, maxBlocks, null);
}
/**
* @deprecated use {@link WorldEdit#getEditSessionFactory()} to create {@link EditSession}s
*/
@Deprecated
public EditSession(LocalWorld world, int maxBlocks, @Nullable BlockBag blockBag) {
this(WorldEdit.getInstance().getEventBus(), world, maxBlocks, blockBag, new EditSessionEvent(world, null, maxBlocks, null));
}
/**
* Construct the object with a maximum number of blocks and a block bag.
*
@ -130,7 +147,7 @@ public class EditSession implements Extent {
* @param blockBag an optional {@link BlockBag} to use, otherwise null
* @param event the event to call with the extent
*/
public EditSession(EventBus eventBus, LocalWorld world, int maxBlocks, @Nullable BlockBag blockBag, EditSessionEvent event) {
EditSession(EventBus eventBus, LocalWorld world, int maxBlocks, @Nullable BlockBag blockBag, EditSessionEvent event) {
checkNotNull(eventBus);
checkNotNull(world);
checkArgument(maxBlocks >= -1, "maxBlocks >= -1 required");