mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 20:16:41 +00:00
Converted API over to use new World.
This breaks backwards compatibility for all getWorld() methods, but shim methods were added for binary compatibility with method calls that use LocalWorld.
This commit is contained in:
@ -21,7 +21,7 @@ package com.sk89q.worldedit.session.request;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -37,7 +37,7 @@ public final class Request {
|
||||
}
|
||||
};
|
||||
|
||||
private @Nullable LocalWorld world;
|
||||
private @Nullable World world;
|
||||
private @Nullable LocalSession session;
|
||||
private @Nullable EditSession editSession;
|
||||
|
||||
@ -49,7 +49,7 @@ public final class Request {
|
||||
*
|
||||
* @return the world, which may be null
|
||||
*/
|
||||
public @Nullable LocalWorld getWorld() {
|
||||
public @Nullable World getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public final class Request {
|
||||
*
|
||||
* @param world the world, which may be null
|
||||
*/
|
||||
public void setWorld(@Nullable LocalWorld world) {
|
||||
public void setWorld(@Nullable World world) {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.regions.NullRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -45,7 +46,7 @@ public class RequestSelection implements Region {
|
||||
*/
|
||||
protected Region getRegion() {
|
||||
LocalSession session = Request.request().getSession();
|
||||
LocalWorld world = Request.request().getWorld();
|
||||
World world = Request.request().getWorld();
|
||||
|
||||
if (session != null && world != null) {
|
||||
try {
|
||||
@ -123,12 +124,17 @@ public class RequestSelection implements Region {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalWorld getWorld() {
|
||||
public World getWorld() {
|
||||
return getRegion().getWorld();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWorld(LocalWorld world) {
|
||||
setWorld((World) world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWorld(World world) {
|
||||
getRegion().setWorld(world);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user