mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 03:46:42 +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:
@ -19,25 +19,19 @@
|
||||
|
||||
package com.sk89q.worldedit.world.chunk;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sk89q.jnbt.ByteArrayTag;
|
||||
import com.sk89q.jnbt.ByteTag;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.IntTag;
|
||||
import com.sk89q.jnbt.ListTag;
|
||||
import com.sk89q.jnbt.NBTUtils;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.jnbt.*;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.TileEntityBlock;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AnvilChunk implements Chunk {
|
||||
|
||||
private CompoundTag rootTag;
|
||||
@ -49,7 +43,7 @@ public class AnvilChunk implements Chunk {
|
||||
|
||||
private Map<BlockVector, Map<String,Tag>> tileEntities;
|
||||
@SuppressWarnings("unused")
|
||||
private LocalWorld world; // TODO: remove if stays unused.
|
||||
private World world; // TODO: remove if stays unused.
|
||||
|
||||
/**
|
||||
* Construct the chunk with a compound tag.
|
||||
@ -58,7 +52,7 @@ public class AnvilChunk implements Chunk {
|
||||
* @param tag the tag to read
|
||||
* @throws DataException on a data error
|
||||
*/
|
||||
public AnvilChunk(LocalWorld world, CompoundTag tag) throws DataException {
|
||||
public AnvilChunk(World world, CompoundTag tag) throws DataException {
|
||||
rootTag = tag;
|
||||
this.world = world;
|
||||
|
||||
|
@ -21,11 +21,11 @@ package com.sk89q.worldedit.world.chunk;
|
||||
|
||||
import com.sk89q.jnbt.*;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.TileEntityBlock;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.storage.InvalidFormatException;
|
||||
|
||||
import java.util.HashMap;
|
||||
@ -46,7 +46,7 @@ public class OldChunk implements Chunk {
|
||||
|
||||
private Map<BlockVector, Map<String,Tag>> tileEntities;
|
||||
@SuppressWarnings("unused")
|
||||
private LocalWorld world; // TODO: remove if stays unused.
|
||||
private World world; // TODO: remove if stays unused.
|
||||
|
||||
/**
|
||||
* Construct the chunk with a compound tag.
|
||||
@ -54,7 +54,7 @@ public class OldChunk implements Chunk {
|
||||
* @param tag
|
||||
* @throws DataException
|
||||
*/
|
||||
public OldChunk(LocalWorld world, CompoundTag tag) throws DataException {
|
||||
public OldChunk(World world, CompoundTag tag) throws DataException {
|
||||
rootTag = tag;
|
||||
this.world = world;
|
||||
|
||||
|
@ -19,16 +19,20 @@
|
||||
|
||||
package com.sk89q.worldedit.world.storage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sk89q.jnbt.*;
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.chunk.AnvilChunk;
|
||||
import com.sk89q.worldedit.world.chunk.Chunk;
|
||||
import com.sk89q.worldedit.world.chunk.OldChunk;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Represents chunk storage mechanisms.
|
||||
*
|
||||
@ -61,7 +65,7 @@ public abstract class ChunkStore {
|
||||
* @throws DataException
|
||||
* @throws IOException
|
||||
*/
|
||||
public abstract CompoundTag getChunkTag(Vector2D pos, LocalWorld world)
|
||||
public abstract CompoundTag getChunkTag(Vector2D pos, World world)
|
||||
throws DataException, IOException;
|
||||
|
||||
/**
|
||||
@ -73,8 +77,7 @@ public abstract class ChunkStore {
|
||||
* @throws IOException
|
||||
* @throws DataException
|
||||
*/
|
||||
public Chunk getChunk(Vector2D pos, LocalWorld world)
|
||||
throws DataException, IOException {
|
||||
public Chunk getChunk(Vector2D pos, World world) throws DataException, IOException {
|
||||
|
||||
CompoundTag tag = getChunkTag(pos, world);
|
||||
Map<String, Tag> tags = tag.getValue();
|
||||
|
@ -24,6 +24,7 @@ import com.sk89q.jnbt.NBTInputStream;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -78,8 +79,7 @@ public abstract class LegacyChunkStore extends ChunkStore {
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public CompoundTag getChunkTag(Vector2D pos, LocalWorld world)
|
||||
throws DataException, IOException {
|
||||
public CompoundTag getChunkTag(Vector2D pos, World world) throws DataException, IOException {
|
||||
int x = pos.getBlockX();
|
||||
int z = pos.getBlockZ();
|
||||
|
||||
|
@ -19,15 +19,16 @@
|
||||
|
||||
package com.sk89q.worldedit.world.storage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.NBTInputStream;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class McRegionChunkStore extends ChunkStore {
|
||||
protected String curFilename = null;
|
||||
@ -67,8 +68,7 @@ public abstract class McRegionChunkStore extends ChunkStore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag getChunkTag(Vector2D pos, LocalWorld world) throws DataException,
|
||||
IOException {
|
||||
public CompoundTag getChunkTag(Vector2D pos, World world) throws DataException, IOException {
|
||||
|
||||
McRegionReader reader = getReader(pos, world.getName());
|
||||
|
||||
|
Reference in New Issue
Block a user