Update ImmutableVirtualWorld.java

Dieser Commit ist enthalten in:
Jesse Boyd 2019-07-22 16:57:02 +10:00
Ursprung 90044382d4
Commit c8650f11f9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F

Datei anzeigen

@ -1,12 +1,5 @@
package com.boydti.fawe.object.brush.visualization;
import com.boydti.fawe.example.SimpleIntFaweChunk;
import com.boydti.fawe.object.FaweChunk;
import com.boydti.fawe.object.FawePlayer;
import com.boydti.fawe.object.RunnableVal2;
import com.boydti.fawe.object.exception.FaweException;
import com.boydti.fawe.util.SetQueue;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.WorldEditException;
@ -17,16 +10,12 @@ import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.TreeGenerator;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.biome.BiomeTypes;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.weather.WeatherType;
import com.sk89q.worldedit.world.weather.WeatherTypes;
import java.io.File;
import java.util.Collection;
import java.util.Collections;
import java.util.UUID;
import javax.annotation.Nullable;
public abstract class ImmutableVirtualWorld implements VirtualWorld {
@ -35,141 +24,16 @@ public abstract class ImmutableVirtualWorld implements VirtualWorld {
return 255;
}
@Override
public Collection<FaweChunk> getFaweChunks() {
return Collections.emptyList();
}
@Override
public boolean regenerateChunk(int x, int z, @Nullable BiomeType biome, @Nullable Long seed) {
return unsupported();
}
@Override
public void sendBlockUpdate(FaweChunk chunk, FawePlayer... players) {
}
@Override
public File getSaveFolder() {
return null;
}
@Override
public BiomeType getBiome(BlockVector2 position) {
return BiomeTypes.FOREST;
}
@Override
public int getCombinedId4Data(int x, int y, int z, int def) {
return getCombinedId4Data(x, y, z);
}
@Override
public int getCachedCombinedId4Data(int x, int y, int z) throws FaweException.FaweChunkLoadException {
return getCombinedId4Data(x, y, z);
}
@Override
public boolean hasSky() {
return true;
}
@Override
public int getSkyLight(int x, int y, int z) {
return 15;
}
@Override
public int getEmmittedLight(int x, int y, int z) {
return 0;
}
@Override
public CompoundTag getTileEntity(int x, int y, int z) throws FaweException.FaweChunkLoadException {
return null;
}
@Override
public int size() {
return 0;
}
@Override
public void setWorld(String world) {
}
@Override
public World getWEWorld() {
return this;
}
@Override
public String getWorldName() {
return getName();
}
@Override
public long getModified() {
return 0;
}
@Override
public void setModified(long modified) {
// Unsupported
}
@Override
public RunnableVal2<ProgressType, Integer> getProgressTask() {
return null;
}
@Override
public void setProgressTask(RunnableVal2<ProgressType, Integer> progressTask) {
}
@Override
public void setChangeTask(RunnableVal2<FaweChunk, FaweChunk> changeTask) {
}
@Override
public RunnableVal2<FaweChunk, FaweChunk> getChangeTask() {
return null;
}
@Override
public SetQueue.QueueStage getStage() {
return SetQueue.QueueStage.NONE;
}
@Override
public void setStage(SetQueue.QueueStage stage) {
// Not supported
}
@Override
public void addNotifyTask(Runnable runnable) {
runnable.run();
}
@Override
public void runTasks() {
}
@Override
public void addTask(Runnable whenFree) {
whenFree.run();
}
@Override
public boolean isEmpty() {
return true;
}
@Nullable
@Override
public Operation commit() {
@ -206,60 +70,16 @@ public abstract class ImmutableVirtualWorld implements VirtualWorld {
return unsupported();
}
@Override
public FaweChunk getFaweChunk(int chunkX, int chunkZ) {
return new SimpleIntFaweChunk(this, chunkX, chunkZ);
}
@Override
public void setEntity(int x, int y, int z, CompoundTag tag) {
unsupported();
}
@Override
public void setTile(int x, int y, int z, CompoundTag tag) {
unsupported();
}
@Override
public void removeEntity(int x, int y, int z, UUID uuid) {
unsupported();
}
@Override
public boolean setBiome(int x, int z, BiomeType biome) {
return unsupported();
}
@Override
public void setChunk(FaweChunk chunk) {
unsupported();
}
@Override
public boolean next(int amount, long time) {
return unsupported();
}
@Override
public boolean regenerate(Region region, EditSession editSession) {
return unsupported();
}
@Override
public void clear() {
// do nothing - world is immutable
}
private boolean unsupported() {
throw new UnsupportedOperationException("World is immutable");
}
@Override
public boolean setBlock(int x, int y, int z, int combinedId) {
return unsupported();
}
@Override
public boolean setBlock(BlockVector3 pt, BlockStateHolder block) throws WorldEditException {
return unsupported();