From c8650f11f92553d0bb5fd2bad8b9002494fb80d7 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 22 Jul 2019 16:57:02 +1000 Subject: [PATCH] Update ImmutableVirtualWorld.java --- .../visualization/ImmutableVirtualWorld.java | 182 +----------------- 1 file changed, 1 insertion(+), 181 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/ImmutableVirtualWorld.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/ImmutableVirtualWorld.java index ebae701e4..456f29586 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/ImmutableVirtualWorld.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/visualization/ImmutableVirtualWorld.java @@ -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 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 getProgressTask() { - return null; - } - - @Override - public void setProgressTask(RunnableVal2 progressTask) { - - } - - @Override - public void setChangeTask(RunnableVal2 changeTask) { - - } - - @Override - public RunnableVal2 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();