mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Get rid of the string equality and convert a few more ID uses over.
This commit is contained in:
@ -29,6 +29,7 @@ import com.sk89q.worldedit.blocks.BaseItem;
|
||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||
import com.sk89q.worldedit.blocks.BlockID;
|
||||
import com.sk89q.worldedit.blocks.BlockType;
|
||||
import com.sk89q.worldedit.blocks.type.BlockTypes;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.function.mask.BlockMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
@ -102,10 +103,10 @@ public abstract class AbstractWorld implements World {
|
||||
@Override
|
||||
public Mask createLiquidMask() {
|
||||
return new BlockMask(this,
|
||||
new BaseBlock(BlockID.STATIONARY_LAVA, -1),
|
||||
new BaseBlock(BlockID.LAVA, -1),
|
||||
new BaseBlock(BlockID.STATIONARY_WATER, -1),
|
||||
new BaseBlock(BlockID.WATER, -1));
|
||||
new BaseBlock(BlockTypes.LAVA, -1),
|
||||
new BaseBlock(BlockTypes.FLOWING_LAVA, -1),
|
||||
new BaseBlock(BlockTypes.WATER, -1),
|
||||
new BaseBlock(BlockTypes.FLOWING_WATER, -1));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -140,7 +141,7 @@ public abstract class AbstractWorld implements World {
|
||||
}
|
||||
|
||||
try {
|
||||
setBlock(pt, new BaseBlock(BlockID.AIR));
|
||||
setBlock(pt, new BaseBlock(BlockTypes.AIR));
|
||||
} catch (WorldEditException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ import com.sk89q.worldedit.Vector2D;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||
import com.sk89q.worldedit.blocks.BlockID;
|
||||
import com.sk89q.worldedit.blocks.type.BlockTypes;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
@ -102,12 +102,12 @@ public class NullWorld extends AbstractWorld {
|
||||
|
||||
@Override
|
||||
public BaseBlock getBlock(Vector position) {
|
||||
return new BaseBlock(BlockID.AIR);
|
||||
return new BaseBlock(BlockTypes.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock getLazyBlock(Vector position) {
|
||||
return new BaseBlock(BlockID.AIR);
|
||||
return new BaseBlock(BlockTypes.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,11 +80,9 @@ public abstract class LegacyChunkStore extends ChunkStore {
|
||||
+ "." + Integer.toString(z, 36) + ".dat";
|
||||
|
||||
InputStream stream = getInputStream(folder1, folder2, filename);
|
||||
NBTInputStream nbt = new NBTInputStream(
|
||||
new GZIPInputStream(stream));
|
||||
Tag tag;
|
||||
|
||||
try {
|
||||
try (NBTInputStream nbt = new NBTInputStream(new GZIPInputStream(stream))) {
|
||||
tag = nbt.readNamedTag().getTag();
|
||||
if (!(tag instanceof CompoundTag)) {
|
||||
throw new ChunkStoreException("CompoundTag expected for chunk; got "
|
||||
@ -112,8 +110,6 @@ public abstract class LegacyChunkStore extends ChunkStore {
|
||||
}
|
||||
|
||||
return rootTag;
|
||||
} finally {
|
||||
nbt.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,10 +71,9 @@ public abstract class McRegionChunkStore extends ChunkStore {
|
||||
McRegionReader reader = getReader(position, world.getName());
|
||||
|
||||
InputStream stream = reader.getChunkInputStream(position);
|
||||
NBTInputStream nbt = new NBTInputStream(stream);
|
||||
Tag tag;
|
||||
|
||||
try {
|
||||
try (NBTInputStream nbt = new NBTInputStream(stream)) {
|
||||
tag = nbt.readNamedTag().getTag();
|
||||
if (!(tag instanceof CompoundTag)) {
|
||||
throw new ChunkStoreException("CompoundTag expected for chunk; got " + tag.getClass().getName());
|
||||
@ -100,8 +99,6 @@ public abstract class McRegionChunkStore extends ChunkStore {
|
||||
}
|
||||
|
||||
return rootTag;
|
||||
} finally {
|
||||
nbt.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user