geforkt von Mirrors/FastAsyncWorldEdit
merge with upstream (broken)
Dieser Commit ist enthalten in:
Ursprung
f361619037
Commit
4cd8d08134
@ -21,7 +21,7 @@ import com.sk89q.jnbt.Tag;
|
|||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@ -287,7 +287,7 @@ public abstract class BukkitQueue_0<CHUNK, CHUNKSECTIONS, SECTION> extends NMSMa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean regenerateChunk(World world, int x, int z, BaseBiome biome, Long seed) {
|
public boolean regenerateChunk(World world, int x, int z, BiomeType biome, Long seed) {
|
||||||
if (!keepLoaded.isEmpty()) keepLoaded.remove(MathMan.pairInt(x, z));
|
if (!keepLoaded.isEmpty()) keepLoaded.remove(MathMan.pairInt(x, z));
|
||||||
boolean result = world.regenerateChunk(x, z);
|
boolean result = world.regenerateChunk(x, z);
|
||||||
return result;
|
return result;
|
||||||
|
@ -12,7 +12,7 @@ import com.boydti.fawe.util.TaskManager;
|
|||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
||||||
import com.sk89q.worldedit.function.operation.Operation;
|
import com.sk89q.worldedit.function.operation.Operation;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -865,7 +865,7 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue
|
|||||||
@Override
|
@Override
|
||||||
public void setBiome(int x, int z, Biome bio) {
|
public void setBiome(int x, int z, Biome bio) {
|
||||||
int id = adapter.getBiomeId(bio);
|
int id = adapter.getBiomeId(bio);
|
||||||
queue.setBiome(x, z, new BaseBiome(id));
|
queue.setBiome(x, z, new BiomeType(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.boydti.fawe;
|
package com.boydti.fawe;
|
||||||
|
|
||||||
import com.sk89q.jnbt.*;
|
import com.sk89q.jnbt.*;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -32,15 +32,15 @@ public class FaweCache {
|
|||||||
/**
|
/**
|
||||||
* Immutable biome cache
|
* Immutable biome cache
|
||||||
*/
|
*/
|
||||||
public final static BaseBiome[] CACHE_BIOME = new BaseBiome[256];
|
public final static BiomeType[] CACHE_BIOME = new BiomeType[256];
|
||||||
|
|
||||||
public static final BaseBiome getBiome(int id) {
|
public static final BiomeType getBiome(int id) {
|
||||||
return CACHE_BIOME[id];
|
return CACHE_BIOME[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for (int i = 0; i < 256; i++) {
|
for (int i = 0; i < 256; i++) {
|
||||||
CACHE_BIOME[i] = new BaseBiome(i) {
|
CACHE_BIOME[i] = new BiomeType(i) {
|
||||||
@Override
|
@Override
|
||||||
public void setId(int id) {
|
public void setId(int id) {
|
||||||
throw new IllegalStateException("Cannot set id");
|
throw new IllegalStateException("Cannot set id");
|
||||||
|
@ -32,7 +32,7 @@ import com.sk89q.worldedit.regions.Region;
|
|||||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
@ -291,7 +291,7 @@ public class AnvilCommands {
|
|||||||
desc = "Delete chunks matching a specific biome"
|
desc = "Delete chunks matching a specific biome"
|
||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.anvil.trimallair")
|
@CommandPermissions("worldedit.anvil.trimallair")
|
||||||
public void deleteBiome(Player player, String folder, BaseBiome biome, @Switch('u') boolean unsafe) {
|
public void deleteBiome(Player player, String folder, BiomeType biome, @Switch('u') boolean unsafe) {
|
||||||
DeleteBiomeFilterSimple filter = new DeleteBiomeFilterSimple(biome);
|
DeleteBiomeFilterSimple filter = new DeleteBiomeFilterSimple(biome);
|
||||||
DeleteBiomeFilterSimple result = runWithWorld(player, folder, filter, true, unsafe);
|
DeleteBiomeFilterSimple result = runWithWorld(player, folder, filter, true, unsafe);
|
||||||
if (result != null) player.print(BBC.getPrefix() + BBC.VISITOR_BLOCK.format(result.getTotal()));
|
if (result != null) player.print(BBC.getPrefix() + BBC.VISITOR_BLOCK.format(result.getTotal()));
|
||||||
|
@ -52,7 +52,7 @@ import com.sk89q.worldedit.util.command.binding.Switch;
|
|||||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||||
import com.sk89q.worldedit.util.command.parametric.ParameterException;
|
import com.sk89q.worldedit.util.command.parametric.ParameterException;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
@ -527,7 +527,7 @@ public class CFICommands extends MethodCommands {
|
|||||||
" - If a mask is used, the biome will be set anywhere the mask applies"
|
" - If a mask is used, the biome will be set anywhere the mask applies"
|
||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.anvil.cfi")
|
@CommandPermissions("worldedit.anvil.cfi")
|
||||||
public void biome(FawePlayer fp, BaseBiome biome, @Optional FawePrimitiveBinding.ImageUri image, @Optional Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
public void biome(FawePlayer fp, BiomeType biome, @Optional FawePrimitiveBinding.ImageUri image, @Optional Mask mask, @Switch('w') boolean disableWhiteOnly) throws ParameterException{
|
||||||
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
HeightMapMCAGenerator gen = assertSettings(fp).getGenerator();
|
||||||
if (image != null) gen.setBiome(load(image), (byte) biome.getId(), !disableWhiteOnly);
|
if (image != null) gen.setBiome(load(image), (byte) biome.getId(), !disableWhiteOnly);
|
||||||
else if (mask != null) gen.setBiome(mask, (byte) biome.getId());
|
else if (mask != null) gen.setBiome(mask, (byte) biome.getId());
|
||||||
|
@ -17,7 +17,7 @@ import com.boydti.fawe.util.TaskManager;
|
|||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.EditSession;
|
import com.sk89q.worldedit.EditSession;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
@ -119,7 +119,7 @@ public abstract class MappedFaweQueue<WORLD, CHUNK, CHUNKSECTIONS, SECTION> impl
|
|||||||
|
|
||||||
public abstract WORLD getImpWorld();
|
public abstract WORLD getImpWorld();
|
||||||
|
|
||||||
public abstract boolean regenerateChunk(WORLD world, int x, int z, BaseBiome biome, Long seed);
|
public abstract boolean regenerateChunk(WORLD world, int x, int z, BiomeType biome, Long seed);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public abstract FaweChunk getFaweChunk(int x, int z);
|
public abstract FaweChunk getFaweChunk(int x, int z);
|
||||||
@ -140,7 +140,7 @@ public abstract class MappedFaweQueue<WORLD, CHUNK, CHUNKSECTIONS, SECTION> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean regenerateChunk(int x, int z, BaseBiome biome, Long seed) {
|
public boolean regenerateChunk(int x, int z, BiomeType biome, Long seed) {
|
||||||
return regenerateChunk(getWorld(), x, z, biome, seed);
|
return regenerateChunk(getWorld(), x, z, biome, seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ public abstract class MappedFaweQueue<WORLD, CHUNK, CHUNKSECTIONS, SECTION> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int z, BiomeType biome) {
|
||||||
int cx = x >> 4;
|
int cx = x >> 4;
|
||||||
int cz = z >> 4;
|
int cz = z >> 4;
|
||||||
FaweChunk chunk = map.getFaweChunk(cx, cz);
|
FaweChunk chunk = map.getFaweChunk(cx, cz);
|
||||||
|
@ -3,7 +3,7 @@ package com.boydti.fawe.example;
|
|||||||
import com.boydti.fawe.object.FaweChunk;
|
import com.boydti.fawe.object.FaweChunk;
|
||||||
import com.boydti.fawe.object.FaweQueue;
|
import com.boydti.fawe.object.FaweQueue;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -97,7 +97,7 @@ public class NullFaweChunk extends FaweChunk<Void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBiome(int x, int z, BaseBiome biome) {
|
public void setBiome(int x, int z, BiomeType biome) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import com.sk89q.worldedit.regions.Region;
|
|||||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||||
import com.sk89q.worldedit.util.TreeGenerator;
|
import com.sk89q.worldedit.util.TreeGenerator;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
@ -689,7 +689,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return this.setBiome(position.getBlockX(), position.getBlockZ(), biome);
|
return this.setBiome(position.getBlockX(), position.getBlockZ(), biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -741,7 +741,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int z, BiomeType biome) {
|
||||||
int index = z * getWidth() + x;
|
int index = z * getWidth() + x;
|
||||||
if (index < 0 || index >= getArea()) return false;
|
if (index < 0 || index >= getArea()) return false;
|
||||||
biomes.setByte(index, (byte) biome.getId());
|
biomes.setByte(index, (byte) biome.getId());
|
||||||
@ -829,7 +829,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean regenerateChunk(int x, int z, @Nullable BaseBiome biome, @Nullable Long seed) {
|
public boolean regenerateChunk(int x, int z, @Nullable BiomeType biome, @Nullable Long seed) {
|
||||||
// Unsupported
|
// Unsupported
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1010,7 +1010,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return FaweCache.CACHE_BIOME[getBiomeId(position.getBlockX(), position.getBlockZ())];
|
return FaweCache.CACHE_BIOME[getBiomeId(position.getBlockX(), position.getBlockZ())];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ import com.boydti.fawe.object.collection.IterableThreadLocal;
|
|||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@ -643,7 +643,7 @@ public class MCAQueue extends NMSMappedFaweQueue<FaweQueue, FaweChunk, FaweChunk
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean regenerateChunk(FaweQueue faweQueue, int x, int z, BaseBiome biome, Long seed) {
|
public boolean regenerateChunk(FaweQueue faweQueue, int x, int z, BiomeType biome, Long seed) {
|
||||||
throw new UnsupportedOperationException("Not supported");
|
throw new UnsupportedOperationException("Not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import com.sk89q.worldedit.math.Vector3;
|
|||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.SimpleWorld;
|
import com.sk89q.worldedit.world.SimpleWorld;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -108,12 +108,12 @@ public class MCAWorld implements SimpleWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return extent.getBiome(position);
|
return extent.getBiome(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return extent.setBiome(position, biome);
|
return extent.setBiome(position, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@ package com.boydti.fawe.jnbt.anvil.filters;
|
|||||||
import com.boydti.fawe.jnbt.anvil.MCAChunk;
|
import com.boydti.fawe.jnbt.anvil.MCAChunk;
|
||||||
import com.boydti.fawe.jnbt.anvil.MCAFilterCounter;
|
import com.boydti.fawe.jnbt.anvil.MCAFilterCounter;
|
||||||
import com.boydti.fawe.object.number.MutableLong;
|
import com.boydti.fawe.object.number.MutableLong;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
|
|
||||||
public class DeleteBiomeFilterSimple extends MCAFilterCounter {
|
public class DeleteBiomeFilterSimple extends MCAFilterCounter {
|
||||||
private final int id;
|
private final int id;
|
||||||
|
|
||||||
public DeleteBiomeFilterSimple(BaseBiome biome) {
|
public DeleteBiomeFilterSimple(BiomeType biome) {
|
||||||
this.id = biome.getId();
|
this.id = biome.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import com.boydti.fawe.FaweCache;
|
|||||||
import com.boydti.fawe.object.changeset.FaweChangeSet;
|
import com.boydti.fawe.object.changeset.FaweChangeSet;
|
||||||
import com.boydti.fawe.object.queue.DelegateFaweQueue;
|
import com.boydti.fawe.object.queue.DelegateFaweQueue;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ public class ChangeSetFaweQueue extends DelegateFaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int z, BiomeType biome) {
|
||||||
if (super.setBiome(x, z, biome)) {
|
if (super.setBiome(x, z, biome)) {
|
||||||
int oldBiome = getParent().getBiomeId(x, z);
|
int oldBiome = getParent().getBiomeId(x, z);
|
||||||
if (oldBiome != biome.getId()) {
|
if (oldBiome != biome.getId()) {
|
||||||
|
@ -5,7 +5,7 @@ import com.boydti.fawe.util.MainUtil;
|
|||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
@ -289,7 +289,7 @@ public abstract class FaweChunk<T> implements Callable<FaweChunk> {
|
|||||||
*/
|
*/
|
||||||
public abstract CompoundTag getTile(int x, int y, int z);
|
public abstract CompoundTag getTile(int x, int y, int z);
|
||||||
|
|
||||||
public void setBiome(final int x, final int z, final BaseBiome biome) {
|
public void setBiome(final int x, final int z, final BiomeType biome) {
|
||||||
setBiome(x, z, (byte) biome.getId());
|
setBiome(x, z, (byte) biome.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,7 +630,6 @@ public abstract class FawePlayer<T> extends Metadatable {
|
|||||||
cancel(true);
|
cancel(true);
|
||||||
if (Settings.IMP.HISTORY.DELETE_ON_LOGOUT) {
|
if (Settings.IMP.HISTORY.DELETE_ON_LOGOUT) {
|
||||||
session = getSession();
|
session = getSession();
|
||||||
WorldEdit.getInstance().getSessionManager().remove(toWorldEditPlayer());
|
|
||||||
session.setClipboard(null);
|
session.setClipboard(null);
|
||||||
session.clearHistory();
|
session.clearHistory();
|
||||||
session.unregisterTools(getPlayer());
|
session.unregisterTools(getPlayer());
|
||||||
|
@ -21,7 +21,7 @@ import com.sk89q.worldedit.math.BlockVector3;
|
|||||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
@ -107,7 +107,7 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default BaseBiome getBiome(BlockVector2 position) {
|
default BiomeType getBiome(BlockVector2 position) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
default boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return setBiome(position.getBlockX(), position.getBlockZ(), biome);
|
return setBiome(position.getBlockX(), position.getBlockZ(), biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
|||||||
|
|
||||||
void removeEntity(int x, int y, int z, UUID uuid);
|
void removeEntity(int x, int y, int z, UUID uuid);
|
||||||
|
|
||||||
boolean setBiome(final int x, final int z, final BaseBiome biome);
|
boolean setBiome(final int x, final int z, final BiomeType biome);
|
||||||
|
|
||||||
FaweChunk getFaweChunk(int x, int z);
|
FaweChunk getFaweChunk(int x, int z);
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ public interface FaweQueue extends HasFaweQueue, Extent {
|
|||||||
return regenerateChunk(x, z, null, null);
|
return regenerateChunk(x, z, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean regenerateChunk(int x, int z, @Nullable BaseBiome biome, @Nullable Long seed);
|
boolean regenerateChunk(int x, int z, @Nullable BiomeType biome, @Nullable Long seed);
|
||||||
|
|
||||||
default void startSet(boolean parallel) {
|
default void startSet(boolean parallel) {
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ import com.sk89q.worldedit.math.BlockVector3;
|
|||||||
import com.sk89q.worldedit.math.Vector2;
|
import com.sk89q.worldedit.math.Vector2;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
@ -105,8 +105,8 @@ public class HistoryExtent extends AbstractDelegateExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome newBiome) {
|
public boolean setBiome(BlockVector2 position, BiomeType newBiome) {
|
||||||
BaseBiome oldBiome = this.getBiome(position);
|
BiomeType oldBiome = this.getBiome(position);
|
||||||
if (oldBiome.getId() != newBiome.getId()) {
|
if (oldBiome.getId() != newBiome.getId()) {
|
||||||
this.changeSet.addBiomeChange(position.getBlockX(), position.getBlockZ(), oldBiome, newBiome);
|
this.changeSet.addBiomeChange(position.getBlockX(), position.getBlockZ(), oldBiome, newBiome);
|
||||||
return getExtent().setBiome(position, newBiome);
|
return getExtent().setBiome(position, newBiome);
|
||||||
@ -116,8 +116,8 @@ public class HistoryExtent extends AbstractDelegateExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int y, int z, BaseBiome newBiome) {
|
public boolean setBiome(int x, int y, int z, BiomeType newBiome) {
|
||||||
BaseBiome oldBiome = this.getBiome(BlockVector2.at(x, z));
|
BiomeType oldBiome = this.getBiome(BlockVector2.at(x, z));
|
||||||
if (oldBiome.getId() != newBiome.getId()) {
|
if (oldBiome.getId() != newBiome.getId()) {
|
||||||
this.changeSet.addBiomeChange(x, z, oldBiome, newBiome);
|
this.changeSet.addBiomeChange(x, z, oldBiome, newBiome);
|
||||||
return getExtent().setBiome(x, y, z, newBiome);
|
return getExtent().setBiome(x, y, z, newBiome);
|
||||||
|
@ -11,7 +11,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
public class MaskedFaweQueue extends DelegateFaweQueue {
|
public class MaskedFaweQueue extends DelegateFaweQueue {
|
||||||
@ -88,7 +88,7 @@ public class MaskedFaweQueue extends DelegateFaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
if (region.contains(position.getBlockX(), position.getBlockZ())) {
|
if (region.contains(position.getBlockX(), position.getBlockZ())) {
|
||||||
return super.setBiome(position, biome);
|
return super.setBiome(position, biome);
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ public class MaskedFaweQueue extends DelegateFaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int z, BiomeType biome) {
|
||||||
if (region.contains(x, z)) {
|
if (region.contains(x, z)) {
|
||||||
return super.setBiome(x, z, biome);
|
return super.setBiome(x, z, biome);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import com.sk89q.jnbt.CompoundTag;
|
|||||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||||
import com.sk89q.worldedit.history.change.Change;
|
import com.sk89q.worldedit.history.change.Change;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ public class NullChangeSet extends FaweChangeSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addBiomeChange(int x, int z, BaseBiome from, BaseBiome to) {
|
public void addBiomeChange(int x, int z, BiomeType from, BiomeType to) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import com.sk89q.worldedit.math.Vector3;
|
|||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.TreeGenerator;
|
import com.sk89q.worldedit.util.TreeGenerator;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.weather.WeatherType;
|
import com.sk89q.worldedit.world.weather.WeatherType;
|
||||||
import com.sk89q.worldedit.world.weather.WeatherTypes;
|
import com.sk89q.worldedit.world.weather.WeatherTypes;
|
||||||
@ -41,7 +41,7 @@ public abstract class ImmutableVirtualWorld implements VirtualWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean regenerateChunk(int x, int z, @Nullable BaseBiome biome, @Nullable Long seed) {
|
public boolean regenerateChunk(int x, int z, @Nullable BiomeType biome, @Nullable Long seed) {
|
||||||
return unsupported();
|
return unsupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ public abstract class ImmutableVirtualWorld implements VirtualWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return FaweCache.getBiome(0);
|
return FaweCache.getBiome(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ public abstract class ImmutableVirtualWorld implements VirtualWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int z, BiomeType biome) {
|
||||||
return unsupported();
|
return unsupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
|||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||||
@ -61,7 +61,7 @@ public class VisualExtent extends AbstractDelegateExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,17 @@ import com.sk89q.worldedit.WorldEditException;
|
|||||||
import com.sk89q.worldedit.history.UndoContext;
|
import com.sk89q.worldedit.history.UndoContext;
|
||||||
import com.sk89q.worldedit.history.change.Change;
|
import com.sk89q.worldedit.history.change.Change;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
|
|
||||||
public class MutableBiomeChange implements Change {
|
public class MutableBiomeChange implements Change {
|
||||||
|
|
||||||
private MutableBlockVector2 mutable = new MutableBlockVector2();
|
private MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||||
private BaseBiome from;
|
private BiomeType from;
|
||||||
private BaseBiome to;
|
private BiomeType to;
|
||||||
|
|
||||||
public MutableBiomeChange() {
|
public MutableBiomeChange() {
|
||||||
this.from = new BaseBiome(0);
|
this.from = new BiomeType(0);
|
||||||
this.to = new BaseBiome(0);
|
this.to = new BiomeType(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBiome(int x, int z, int from, int to) {
|
public void setBiome(int x, int z, int from, int to) {
|
||||||
|
@ -13,7 +13,7 @@ import com.sk89q.worldedit.history.change.EntityCreate;
|
|||||||
import com.sk89q.worldedit.history.change.EntityRemove;
|
import com.sk89q.worldedit.history.change.EntityRemove;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -89,7 +89,7 @@ public class AbstractDelegateChangeSet extends FaweChangeSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addBiomeChange(int x, int z, BaseBiome from, BaseBiome to) {
|
public void addBiomeChange(int x, int z, BiomeType from, BiomeType to) {
|
||||||
parent.addBiomeChange(x, z, from, to);
|
parent.addBiomeChange(x, z, from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import com.google.common.base.Function;
|
|||||||
import com.google.common.collect.Iterators;
|
import com.google.common.collect.Iterators;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.history.change.Change;
|
import com.sk89q.worldedit.history.change.Change;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@ -79,7 +79,7 @@ public class AnvilHistory extends FaweChangeSet implements IAnvilHistory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addBiomeChange(int x, int z, BaseBiome from, BaseBiome to) {
|
public void addBiomeChange(int x, int z, BiomeType from, BiomeType to) {
|
||||||
throw new UnsupportedOperationException("Only anvil operations are supported");
|
throw new UnsupportedOperationException("Only anvil operations are supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import com.boydti.fawe.object.change.CFIChange;
|
|||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.history.change.Change;
|
import com.sk89q.worldedit.history.change.Change;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -65,7 +65,7 @@ public class CFIChangeSet extends FaweChangeSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addBiomeChange(int x, int z, BaseBiome from, BaseBiome to) {
|
public void addBiomeChange(int x, int z, BiomeType from, BiomeType to) {
|
||||||
throw new UnsupportedOperationException("Only CFI operations are supported");
|
throw new UnsupportedOperationException("Only CFI operations are supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import com.sk89q.jnbt.CompoundTag;
|
|||||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||||
import com.sk89q.worldedit.history.change.Change;
|
import com.sk89q.worldedit.history.change.Change;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ public class CPUOptimizedChangeSet extends FaweChangeSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addBiomeChange(int x, int z, BaseBiome from, BaseBiome to) {
|
public void addBiomeChange(int x, int z, BiomeType from, BiomeType to) {
|
||||||
throw new UnsupportedOperationException("Invalid mode");
|
throw new UnsupportedOperationException("Invalid mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import com.sk89q.worldedit.history.changeset.ChangeSet;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -141,7 +141,7 @@ public abstract class FaweChangeSet implements ChangeSet {
|
|||||||
|
|
||||||
public abstract void addEntityCreate(CompoundTag tag);
|
public abstract void addEntityCreate(CompoundTag tag);
|
||||||
|
|
||||||
public abstract void addBiomeChange(int x, int z, BaseBiome from, BaseBiome to);
|
public abstract void addBiomeChange(int x, int z, BiomeType from, BiomeType to);
|
||||||
|
|
||||||
public Iterator<Change> getIterator(BlockBag blockBag, int mode, boolean redo) {
|
public Iterator<Change> getIterator(BlockBag blockBag, int mode, boolean redo) {
|
||||||
return getIterator(redo);
|
return getIterator(redo);
|
||||||
|
@ -16,7 +16,7 @@ import com.sk89q.jnbt.NBTOutputStream;
|
|||||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||||
import com.sk89q.worldedit.history.change.Change;
|
import com.sk89q.worldedit.history.change.Change;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
@ -325,7 +325,7 @@ public abstract class FaweStreamChangeSet extends FaweChangeSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addBiomeChange(int x, int z, BaseBiome from, BaseBiome to) {
|
public void addBiomeChange(int x, int z, BiomeType from, BiomeType to) {
|
||||||
blockSize++;
|
blockSize++;
|
||||||
try {
|
try {
|
||||||
OutputStream os = getBiomeOS();
|
OutputStream os = getBiomeOS();
|
||||||
|
@ -8,7 +8,7 @@ import com.sk89q.worldedit.entity.BaseEntity;
|
|||||||
import com.sk89q.worldedit.entity.Entity;
|
import com.sk89q.worldedit.entity.Entity;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
@ -47,12 +47,12 @@ public class AbstractDelegateFaweClipboard extends FaweClipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int x, int z) {
|
public BiomeType getBiome(int x, int z) {
|
||||||
return parent.getBiome(x, z);
|
return parent.getBiome(x, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int index) {
|
public BiomeType getBiome(int index) {
|
||||||
return parent.getBiome(index);
|
return parent.getBiome(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import com.sk89q.worldedit.entity.BaseEntity;
|
|||||||
import com.sk89q.worldedit.entity.Entity;
|
import com.sk89q.worldedit.entity.Entity;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
@ -84,15 +84,15 @@ public class CPUOptimizedClipboard extends FaweClipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int index) {
|
public BiomeType getBiome(int index) {
|
||||||
if (!hasBiomes()) {
|
if (!hasBiomes()) {
|
||||||
return EditSession.nullBiome;
|
return null;
|
||||||
}
|
}
|
||||||
return FaweCache.CACHE_BIOME[biomes[index] & 0xFF];
|
return FaweCache.CACHE_BIOME[biomes[index] & 0xFF];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int x, int z) {
|
public BiomeType getBiome(int x, int z) {
|
||||||
return getBiome(getIndex(x, 0, z));
|
return getBiome(getIndex(x, 0, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import com.sk89q.worldedit.extent.Extent;
|
|||||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
@ -140,9 +140,9 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int index) {
|
public BiomeType getBiome(int index) {
|
||||||
if (!hasBiomes()) {
|
if (!hasBiomes()) {
|
||||||
return EditSession.nullBiome;
|
return null;
|
||||||
}
|
}
|
||||||
int biomeId = mbb.get(HEADER_SIZE + (volume << 2) + index) & 0xFF;
|
int biomeId = mbb.get(HEADER_SIZE + (volume << 2) + index) & 0xFF;
|
||||||
return FaweCache.CACHE_BIOME[biomeId];
|
return FaweCache.CACHE_BIOME[biomeId];
|
||||||
@ -162,7 +162,7 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int x, int z) {
|
public BiomeType getBiome(int x, int z) {
|
||||||
return getBiome(getIndex(x, 0, z));
|
return getBiome(getIndex(x, 0, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import com.sk89q.worldedit.math.BlockVector3;
|
|||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
@ -84,8 +84,8 @@ public class EmptyClipboard implements Clipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return EditSession.nullBiome;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -94,7 +94,7 @@ public class EmptyClipboard implements Clipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import com.sk89q.worldedit.entity.Entity;
|
|||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
@ -35,9 +35,9 @@ public abstract class FaweClipboard {
|
|||||||
|
|
||||||
public abstract boolean setBiome(int x, int z, int biome);
|
public abstract boolean setBiome(int x, int z, int biome);
|
||||||
|
|
||||||
public abstract BaseBiome getBiome(int x, int z);
|
public abstract BiomeType getBiome(int x, int z);
|
||||||
|
|
||||||
public abstract BaseBiome getBiome(int index);
|
public abstract BiomeType getBiome(int index);
|
||||||
|
|
||||||
public abstract BaseBlock getBlock(int index);
|
public abstract BaseBlock getBlock(int index);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import com.sk89q.worldedit.entity.BaseEntity;
|
|||||||
import com.sk89q.worldedit.entity.Entity;
|
import com.sk89q.worldedit.entity.Entity;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
@ -117,15 +117,15 @@ public class MemoryOptimizedClipboard extends FaweClipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int index) {
|
public BiomeType getBiome(int index) {
|
||||||
if (!hasBiomes()) {
|
if (!hasBiomes()) {
|
||||||
return EditSession.nullBiome;
|
return null;
|
||||||
}
|
}
|
||||||
return FaweCache.CACHE_BIOME[biomes[index] & 0xFF];
|
return FaweCache.CACHE_BIOME[biomes[index] & 0xFF];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int x, int z) {
|
public BiomeType getBiome(int x, int z) {
|
||||||
return getBiome(getIndex(x, 0, z));
|
return getBiome(getIndex(x, 0, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.boydti.fawe.object.clipboard;
|
package com.boydti.fawe.object.clipboard;
|
||||||
|
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
@ -36,7 +36,7 @@ public class OffsetFaweClipboard extends AbstractDelegateFaweClipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int x, int z) {
|
public BiomeType getBiome(int x, int z) {
|
||||||
return super.getBiome(ox + x, oz + z);
|
return super.getBiome(ox + x, oz + z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import com.sk89q.worldedit.entity.Entity;
|
|||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ public abstract class ReadOnlyClipboard extends FaweClipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int index) {
|
public BiomeType getBiome(int index) {
|
||||||
throw new UnsupportedOperationException("World based clipboards do not provide index access");
|
throw new UnsupportedOperationException("World based clipboards do not provide index access");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public abstract class ReadOnlyClipboard extends FaweClipboard {
|
|||||||
public abstract BaseBlock getBlock(int x, int y, int z);
|
public abstract BaseBlock getBlock(int x, int y, int z);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public abstract BaseBiome getBiome(int x, int z);
|
public abstract BiomeType getBiome(int x, int z);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public abstract List<? extends Entity> getEntities();
|
public abstract List<? extends Entity> getEntities();
|
||||||
|
@ -16,7 +16,7 @@ import com.sk89q.worldedit.math.MutableBlockVector3;
|
|||||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -55,7 +55,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(int x, int z) {
|
public BiomeType getBiome(int x, int z) {
|
||||||
return extent.getBiome(MutableBlockVector2.setComponents(mx + x, mz + z));
|
return extent.getBiome(MutableBlockVector2.setComponents(mx + x, mz + z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import com.sk89q.worldedit.extent.Extent;
|
|||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
public class BlockTranslateExtent extends AbstractDelegateExtent {
|
public class BlockTranslateExtent extends AbstractDelegateExtent {
|
||||||
@ -36,17 +36,17 @@ public class BlockTranslateExtent extends AbstractDelegateExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return super.setBiome(position.add(dx, dz), biome);
|
return super.setBiome(position.add(dx, dz), biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int y, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int y, int z, BiomeType biome) {
|
||||||
return super.setBiome(x + dx, y + dy, z + dz, biome);
|
return super.setBiome(x + dx, y + dy, z + dz, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return super.getBiome(position.add(dx, dz));
|
return super.getBiome(position.add(dx, dz));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -55,7 +55,7 @@ public class EmptyExtent implements Extent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,12 +65,12 @@ public class EmptyExtent implements Extent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int y, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int y, int z, BiomeType biome) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ import com.sk89q.worldedit.math.BlockVector3;
|
|||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
@ -106,7 +106,7 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(final BlockVector2 position) {
|
public BiomeType getBiome(final BlockVector2 position) {
|
||||||
return FaweCache.CACHE_BIOME[queue.getBiomeId(position.getBlockX(), position.getBlockZ())];
|
return FaweCache.CACHE_BIOME[queue.getBiomeId(position.getBlockX(), position.getBlockZ())];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ public class FastWorldEditExtent extends AbstractDelegateExtent implements HasFa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(final BlockVector2 position, final BaseBiome biome) {
|
public boolean setBiome(final BlockVector2 position, final BiomeType biome) {
|
||||||
queue.setBiome(position.getBlockX(), position.getBlockZ(), biome);
|
queue.setBiome(position.getBlockX(), position.getBlockZ(), biome);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -79,7 +79,7 @@ public abstract class FaweRegionExtent extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
if (!contains(position)) {
|
if (!contains(position)) {
|
||||||
if (!limit.MAX_FAILS()) {
|
if (!limit.MAX_FAILS()) {
|
||||||
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
|
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
|
||||||
@ -90,7 +90,7 @@ public abstract class FaweRegionExtent extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int y, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int y, int z, BiomeType biome) {
|
||||||
if (!contains(x, y, z)) {
|
if (!contains(x, y, z)) {
|
||||||
if (!limit.MAX_FAILS()) {
|
if (!limit.MAX_FAILS()) {
|
||||||
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
|
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
|
||||||
@ -101,12 +101,12 @@ public abstract class FaweRegionExtent extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
if (!contains(position)) {
|
if (!contains(position)) {
|
||||||
if (!limit.MAX_FAILS()) {
|
if (!limit.MAX_FAILS()) {
|
||||||
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
|
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION);
|
||||||
}
|
}
|
||||||
return EditSession.nullBiome;
|
return null;
|
||||||
}
|
}
|
||||||
return super.getBiome(position);
|
return super.getBiome(position);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
|||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -46,7 +46,7 @@ public class MultiTransform extends RandomTransform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
for (AbstractDelegateExtent extent : extents) result |= extent.setBiome(position, biome);
|
for (AbstractDelegateExtent extent : extents) result |= extent.setBiome(position, biome);
|
||||||
return result;
|
return result;
|
||||||
|
@ -14,7 +14,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -48,7 +48,7 @@ public class NullExtent extends FaweRegionExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(final BlockVector2 arg0) {
|
public BiomeType getBiome(final BlockVector2 arg0) {
|
||||||
if(reason != null) {
|
if(reason != null) {
|
||||||
throw new FaweException(reason);
|
throw new FaweException(reason);
|
||||||
}else {
|
}else {
|
||||||
@ -75,7 +75,7 @@ public class NullExtent extends FaweRegionExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(final BlockVector2 arg0, final BaseBiome arg1) {
|
public boolean setBiome(final BlockVector2 arg0, final BiomeType arg1) {
|
||||||
if(reason != null) {
|
if(reason != null) {
|
||||||
throw new FaweException(reason);
|
throw new FaweException(reason);
|
||||||
}else {
|
}else {
|
||||||
|
@ -5,7 +5,7 @@ import com.sk89q.worldedit.extent.Extent;
|
|||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
public class OffsetExtent extends ResettableExtent {
|
public class OffsetExtent extends ResettableExtent {
|
||||||
@ -20,12 +20,12 @@ public class OffsetExtent extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return getExtent().setBiome(mutable.setComponents(position.getBlockX() + dx, position.getBlockZ() + dz), biome);
|
return getExtent().setBiome(mutable.setComponents(position.getBlockX() + dx, position.getBlockZ() + dz), biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int y, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int y, int z, BiomeType biome) {
|
||||||
return getExtent().setBiome(x + dx, y + dy, z + dz, biome);
|
return getExtent().setBiome(x + dx, y + dy, z + dz, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import com.sk89q.worldedit.math.BlockVector3;
|
|||||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableVector3;
|
import com.sk89q.worldedit.math.MutableVector3;
|
||||||
import com.sk89q.worldedit.math.transform.Transform;
|
import com.sk89q.worldedit.math.transform.Transform;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
public class PositionTransformExtent extends ResettableExtent {
|
public class PositionTransformExtent extends ResettableExtent {
|
||||||
@ -67,7 +67,7 @@ public class PositionTransformExtent extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
mutable.mutX(position.getBlockX());
|
mutable.mutX(position.getBlockX());
|
||||||
mutable.mutZ(position.getBlockZ());
|
mutable.mutZ(position.getBlockZ());
|
||||||
mutable.mutY(0);
|
mutable.mutY(0);
|
||||||
@ -86,7 +86,7 @@ public class PositionTransformExtent extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
mutable.mutX(position.getBlockX());
|
mutable.mutX(position.getBlockX());
|
||||||
mutable.mutZ(position.getBlockZ());
|
mutable.mutZ(position.getBlockZ());
|
||||||
mutable.mutY(0);
|
mutable.mutY(0);
|
||||||
|
@ -16,7 +16,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -48,7 +48,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(final BlockVector2 position) {
|
public BiomeType getBiome(final BlockVector2 position) {
|
||||||
return super.getBiome(position);
|
return super.getBiome(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(final BlockVector2 position, final BaseBiome biome) {
|
public boolean setBiome(final BlockVector2 position, final BiomeType biome) {
|
||||||
if (!limit.MAX_CHANGES()) {
|
if (!limit.MAX_CHANGES()) {
|
||||||
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES);
|
WEManager.IMP.cancelEditSafe(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES);
|
||||||
return false;
|
return false;
|
||||||
|
@ -6,7 +6,7 @@ import com.sk89q.worldedit.extent.Extent;
|
|||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.SplittableRandom;
|
import java.util.SplittableRandom;
|
||||||
@ -26,7 +26,7 @@ public class RandomOffsetTransform extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 pos, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 pos, BiomeType biome) {
|
||||||
int x = pos.getBlockX() + random.nextInt(1 + (dx << 1)) - dx;
|
int x = pos.getBlockX() + random.nextInt(1 + (dx << 1)) - dx;
|
||||||
int z = pos.getBlockZ() + random.nextInt(1 + (dz << 1)) - dz;
|
int z = pos.getBlockZ() + random.nextInt(1 + (dz << 1)) - dz;
|
||||||
return getExtent().setBiome(mutable.setComponents(x, z), biome);
|
return getExtent().setBiome(mutable.setComponents(x, z), biome);
|
||||||
|
@ -9,7 +9,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -80,7 +80,7 @@ public class ScaleTransform extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
MutableBlockVector3 pos = new MutableBlockVector3(getPos(position.getBlockX(), 0, position.getBlockZ()));
|
MutableBlockVector3 pos = new MutableBlockVector3(getPos(position.getBlockX(), 0, position.getBlockZ()));
|
||||||
double sx = pos.getX();
|
double sx = pos.getX();
|
||||||
|
@ -11,7 +11,7 @@ import com.sk89q.worldedit.extent.NullExtent;
|
|||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -50,7 +50,7 @@ public abstract class SelectTransform extends ResettableExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return getExtent(position).setBiome(position, biome);
|
return getExtent(position).setBiome(position, biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
|||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import com.sk89q.worldedit.world.registry.BundledBlockData;
|
import com.sk89q.worldedit.world.registry.BundledBlockData;
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ public class TemporalExtent extends AbstractDelegateExtent {
|
|||||||
private BlockStateHolder<?> block = EditSession.nullBlock;
|
private BlockStateHolder<?> block = EditSession.nullBlock;
|
||||||
|
|
||||||
private int bx, bz = Integer.MAX_VALUE;
|
private int bx, bz = Integer.MAX_VALUE;
|
||||||
private BaseBiome biome = EditSession.nullBiome;
|
private BiomeType biome = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance.
|
* Create a new instance.
|
||||||
@ -35,7 +35,7 @@ public class TemporalExtent extends AbstractDelegateExtent {
|
|||||||
this.block = block;
|
this.block = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(int x, int z, BaseBiome biome) {
|
public void set(int x, int z, BiomeType biome) {
|
||||||
this.bx = x;
|
this.bx = x;
|
||||||
this.bz = z;
|
this.bz = z;
|
||||||
this.biome = biome;
|
this.biome = biome;
|
||||||
@ -86,7 +86,7 @@ public class TemporalExtent extends AbstractDelegateExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
if (position.getX() == bx && position.getZ() == bz) {
|
if (position.getX() == bx && position.getZ() == bz) {
|
||||||
return biome;
|
return biome;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableVector3;
|
import com.sk89q.worldedit.math.MutableVector3;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
public class TransformExtent extends BlockTransformExtent {
|
public class TransformExtent extends BlockTransformExtent {
|
||||||
@ -98,7 +98,7 @@ public class TransformExtent extends BlockTransformExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
mutable.mutX(position.getBlockX());
|
mutable.mutX(position.getBlockX());
|
||||||
mutable.mutZ(position.getBlockZ());
|
mutable.mutZ(position.getBlockZ());
|
||||||
mutable.mutY(0);
|
mutable.mutY(0);
|
||||||
@ -117,7 +117,7 @@ public class TransformExtent extends BlockTransformExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
mutable.mutX(position.getBlockX());
|
mutable.mutX(position.getBlockX());
|
||||||
mutable.mutZ(position.getBlockZ());
|
mutable.mutZ(position.getBlockZ());
|
||||||
mutable.mutY(0);
|
mutable.mutY(0);
|
||||||
|
@ -5,13 +5,13 @@ import com.sk89q.worldedit.function.mask.AbstractExtentMask;
|
|||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
|
|
||||||
public class BiomeMask extends AbstractExtentMask implements ResettableMask {
|
public class BiomeMask extends AbstractExtentMask implements ResettableMask {
|
||||||
private final BaseBiome biome;
|
private final BiomeType biome;
|
||||||
private transient MutableBlockVector2 mutable = new MutableBlockVector2();
|
private transient MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||||
|
|
||||||
public BiomeMask(Extent extent, BaseBiome biome) {
|
public BiomeMask(Extent extent, BiomeType biome) {
|
||||||
super(extent);
|
super(extent);
|
||||||
this.biome = biome;
|
this.biome = biome;
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,14 @@ import com.sk89q.worldedit.world.block.BlockState;
|
|||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class BiomePattern extends ExistingPattern {
|
public class BiomePattern extends ExistingPattern {
|
||||||
private transient MutableBlockVector2 mutable = new MutableBlockVector2();
|
private transient MutableBlockVector2 mutable = new MutableBlockVector2();
|
||||||
private final BaseBiome biome;
|
private final BiomeType biome;
|
||||||
|
|
||||||
public BiomePattern(Extent extent, BaseBiome biome) {
|
public BiomePattern(Extent extent, BiomeType biome) {
|
||||||
super(extent);
|
super(extent);
|
||||||
this.biome = biome;
|
this.biome = biome;
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ public class BiomePattern extends ExistingPattern {
|
|||||||
return BiomePattern.this;
|
return BiomePattern.this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseBiome getBiome() {
|
public BiomeType getBiome() {
|
||||||
return biome;
|
return biome;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -102,8 +102,8 @@ public class PatternExtent extends AbstractPattern implements Extent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return new BaseBiome(0);
|
return new BiomeType(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -112,7 +112,7 @@ public class PatternExtent extends AbstractPattern implements Extent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import com.sk89q.worldedit.extent.Extent;
|
|||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
@ -63,7 +63,7 @@ public class FaweQueueDelegateExtent extends DelegateFaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return parentExtent.setBiome(position, biome);
|
return parentExtent.setBiome(position, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ public class FaweQueueDelegateExtent extends DelegateFaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return parentExtent.getBiome(position);
|
return parentExtent.getBiome(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import com.sk89q.worldedit.regions.Region;
|
|||||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -76,7 +76,7 @@ public interface IDelegateFaweQueue extends FaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default BaseBiome getBiome(BlockVector2 position) {
|
default BiomeType getBiome(BlockVector2 position) {
|
||||||
return getQueue().getBiome(position);
|
return getQueue().getBiome(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ public interface IDelegateFaweQueue extends FaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
default boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return getQueue().setBiome(position, biome);
|
return getQueue().setBiome(position, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ public interface IDelegateFaweQueue extends FaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default boolean setBiome(int x, int z, BaseBiome biome) {
|
default boolean setBiome(int x, int z, BiomeType biome) {
|
||||||
return getQueue().setBiome(x, z, biome);
|
return getQueue().setBiome(x, z, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ public interface IDelegateFaweQueue extends FaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default boolean regenerateChunk(int x, int z, @Nullable BaseBiome biome, @Nullable Long seed) {
|
default boolean regenerateChunk(int x, int z, @Nullable BiomeType biome, @Nullable Long seed) {
|
||||||
return getQueue().regenerateChunk(x, z, biome, seed);
|
return getQueue().regenerateChunk(x, z, biome, seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import com.boydti.fawe.object.visitor.FaweChunkVisitor;
|
|||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
|
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -171,7 +171,7 @@ public abstract class LazyFaweChunk<T extends FaweChunk> extends FaweChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBiome(int x, int z, BaseBiome biome) {
|
public void setBiome(int x, int z, BiomeType biome) {
|
||||||
internalGetOrCacheChunk().setBiome(x, z, biome);
|
internalGetOrCacheChunk().setBiome(x, z, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import com.boydti.fawe.util.SetQueue;
|
|||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ public class NullFaweQueue implements FaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(int x, int z, BaseBiome biome) {
|
public boolean setBiome(int x, int z, BiomeType biome) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ public class NullFaweQueue implements FaweQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean regenerateChunk(int x, int z, @Nullable BaseBiome biome, @Nullable Long seed) {
|
public boolean regenerateChunk(int x, int z, @Nullable BiomeType biome, @Nullable Long seed) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ import com.sk89q.worldedit.math.Vector3;
|
|||||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.util.TargetBlock;
|
import com.sk89q.worldedit.util.TargetBlock;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||||
@ -630,7 +630,7 @@ public class SchemVis extends ImmutableVirtualWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import com.sk89q.jnbt.CompoundTag;
|
|||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.extension.platform.Capability;
|
import com.sk89q.worldedit.extension.platform.Capability;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.biome.Biomes;
|
import com.sk89q.worldedit.world.biome.Biomes;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
@ -84,7 +84,7 @@ public class FaweLocalBlockQueue extends LocalBlockQueue {
|
|||||||
return PlotBlock.get(state.getInternalBlockTypeId(), state.getInternalPropertiesId());
|
return PlotBlock.get(state.getInternalBlockTypeId(), state.getInternalPropertiesId());
|
||||||
}
|
}
|
||||||
|
|
||||||
private BaseBiome biome;
|
private BiomeType biome;
|
||||||
private String lastBiome;
|
private String lastBiome;
|
||||||
private BiomeRegistry reg;
|
private BiomeRegistry reg;
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ public class FaweLocalBlockQueue extends LocalBlockQueue {
|
|||||||
if (reg == null) {
|
if (reg == null) {
|
||||||
reg = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.USER_COMMANDS).getRegistries().getBiomeRegistry();
|
reg = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.USER_COMMANDS).getRegistries().getBiomeRegistry();
|
||||||
}
|
}
|
||||||
List<BaseBiome> biomes = reg.getBiomes();
|
List<BiomeType> biomes = reg.getBiomes();
|
||||||
lastBiome = biome;
|
lastBiome = biome;
|
||||||
this.biome = Biomes.findBiomeByName(biomes, biome, reg);
|
this.biome = Biomes.findBiomeByName(biomes, biome, reg);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import com.sk89q.worldedit.WorldEdit;
|
|||||||
import com.sk89q.worldedit.extension.platform.Capability;
|
import com.sk89q.worldedit.extension.platform.Capability;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.biome.Biomes;
|
import com.sk89q.worldedit.world.biome.Biomes;
|
||||||
import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -55,8 +55,8 @@ public class PlotSetBiome extends Command {
|
|||||||
checkTrue(args.length == 1, Captions.COMMAND_SYNTAX, getUsage());
|
checkTrue(args.length == 1, Captions.COMMAND_SYNTAX, getUsage());
|
||||||
final HashSet<RegionWrapper> regions = plot.getRegions();
|
final HashSet<RegionWrapper> regions = plot.getRegions();
|
||||||
BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();
|
BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();
|
||||||
List<BaseBiome> knownBiomes = biomeRegistry.getBiomes();
|
List<BiomeType> knownBiomes = biomeRegistry.getBiomes();
|
||||||
final BaseBiome biome = Biomes.findBiomeByName(knownBiomes, args[0], biomeRegistry);
|
final BiomeType biome = Biomes.findBiomeByName(knownBiomes, args[0], biomeRegistry);
|
||||||
if (biome == null) {
|
if (biome == null) {
|
||||||
String biomes = StringMan.join(WorldUtil.IMP.getBiomeList(), Captions.BLOCK_LIST_SEPARATER.s());
|
String biomes = StringMan.join(WorldUtil.IMP.getBiomeList(), Captions.BLOCK_LIST_SEPARATER.s());
|
||||||
Captions.NEED_BIOME.send(player);
|
Captions.NEED_BIOME.send(player);
|
||||||
|
@ -19,7 +19,7 @@ import com.sk89q.worldedit.util.Location;
|
|||||||
import com.sk89q.worldedit.util.TreeGenerator;
|
import com.sk89q.worldedit.util.TreeGenerator;
|
||||||
import com.sk89q.worldedit.world.AbstractWorld;
|
import com.sk89q.worldedit.world.AbstractWorld;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||||
@ -246,12 +246,12 @@ public class WorldWrapper extends AbstractWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBiome getBiome(BlockVector2 position) {
|
public BiomeType getBiome(BlockVector2 position) {
|
||||||
return parent.getBiome(position);
|
return parent.getBiome(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBiome(BlockVector2 position, BaseBiome biome) {
|
public boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||||
return parent.setBiome(position, biome);
|
return parent.setBiome(position, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment;
|
|||||||
import com.sk89q.worldedit.session.request.RequestSelection;
|
import com.sk89q.worldedit.session.request.RequestSelection;
|
||||||
import com.sk89q.worldedit.util.command.binding.Switch;
|
import com.sk89q.worldedit.util.command.binding.Switch;
|
||||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
|
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
@ -414,7 +414,7 @@ public class MaskCommands extends MethodCommands {
|
|||||||
min = 1,
|
min = 1,
|
||||||
max = 1
|
max = 1
|
||||||
)
|
)
|
||||||
public Mask biome(Extent extent, BaseBiome biome) throws ExpressionException {
|
public Mask biome(Extent extent, BiomeType biome) throws ExpressionException {
|
||||||
return new BiomeMask(extent, biome);
|
return new BiomeMask(extent, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment;
|
|||||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||||
import com.sk89q.worldedit.util.command.binding.Range;
|
import com.sk89q.worldedit.util.command.binding.Range;
|
||||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -268,7 +268,7 @@ public class PatternCommands extends MethodCommands {
|
|||||||
min = 1,
|
min = 1,
|
||||||
max = 1
|
max = 1
|
||||||
)
|
)
|
||||||
public Pattern biome(Actor actor, LocalSession session, Extent extent, BaseBiome biome) {
|
public Pattern biome(Actor actor, LocalSession session, Extent extent, BiomeType biome) {
|
||||||
return new BiomePattern(extent, biome);
|
return new BiomePattern(extent, biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
|||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import com.sk89q.worldedit.world.biome.BaseBiome;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
import com.sk89q.worldedit.world.biome.Biomes;
|
import com.sk89q.worldedit.world.biome.Biomes;
|
||||||
import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
import com.sk89q.worldedit.world.registry.BiomeRegistry;
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public class ExpressionMaskParser extends InputParser<Mask> {
|
|||||||
if (context.getActor() instanceof SessionOwner) {
|
if (context.getActor() instanceof SessionOwner) {
|
||||||
SessionOwner owner = (SessionOwner) context.getActor();
|
SessionOwner owner = (SessionOwner) context.getActor();
|
||||||
IntSupplier timeout = () -> WorldEdit.getInstance().getSessionManager().get(owner).getTimeout();
|
IntSupplier timeout = () -> WorldEdit.getInstance().getSessionManager().get(owner).getTimeout();
|
||||||
return new ExpressionMask(exp, timeout);
|
// TODO timeout
|
||||||
}
|
}
|
||||||
return new ExpressionMask(exp);
|
return new ExpressionMask(exp);
|
||||||
} catch (ExpressionException e) {
|
} catch (ExpressionException e) {
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* WorldEdit, a Minecraft world manipulation toolkit
|
||||||
|
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||||
|
* Copyright (C) WorldEdit team and contributors
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sk89q.worldedit.function.operation;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.WorldEditException;
|
||||||
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
|
import com.sk89q.worldedit.util.LocatedBlock;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SetLocatedBlocks implements Operation {
|
||||||
|
|
||||||
|
private final Extent extent;
|
||||||
|
private final Iterable<LocatedBlock> blocks;
|
||||||
|
|
||||||
|
public SetLocatedBlocks(Extent extent, Iterable<LocatedBlock> blocks) {
|
||||||
|
this.extent = checkNotNull(extent);
|
||||||
|
this.blocks = checkNotNull(blocks);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Operation resume(RunContext run) throws WorldEditException {
|
||||||
|
for (LocatedBlock block : blocks) {
|
||||||
|
extent.setBlock(block.getLocation(), block.getBlock());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addStatusMessages(List<String> messages) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -79,17 +79,17 @@ public abstract class ArbitraryBiomeShape {
|
|||||||
*
|
*
|
||||||
* @param x X coordinate to be queried
|
* @param x X coordinate to be queried
|
||||||
* @param z Z coordinate to be queried
|
* @param z Z coordinate to be queried
|
||||||
* @param defaultBaseBiome The default biome for the current column.
|
* @param defaultBiomeType The default biome for the current column.
|
||||||
* @return material to place or null to not place anything.
|
* @return material to place or null to not place anything.
|
||||||
*/
|
*/
|
||||||
protected abstract BiomeType getBiome(int x, int z, BiomeType defaultBaseBiome);
|
protected abstract BiomeType getBiome(int x, int z, BiomeType defaultBiomeType);
|
||||||
|
|
||||||
private BiomeType getBiomeCached(int x, int z, BiomeType baseBiome) {
|
private BiomeType getBiomeCached(int x, int z, BiomeType BiomeType) {
|
||||||
final int index = (z - cacheOffsetZ) + (x - cacheOffsetX) * cacheSizeZ;
|
final int index = (z - cacheOffsetZ) + (x - cacheOffsetX) * cacheSizeZ;
|
||||||
|
|
||||||
final BiomeType cacheEntry = cache[index];
|
final BiomeType cacheEntry = cache[index];
|
||||||
if (cacheEntry == null) {// unknown, fetch material
|
if (cacheEntry == null) {// unknown, fetch material
|
||||||
final BiomeType material = getBiome(x, z, baseBiome);
|
final BiomeType material = getBiome(x, z, BiomeType);
|
||||||
if (material == null) {
|
if (material == null) {
|
||||||
// outside
|
// outside
|
||||||
cache[index] = BiomeTypes.THE_VOID;
|
cache[index] = BiomeTypes.THE_VOID;
|
||||||
@ -108,13 +108,13 @@ public abstract class ArbitraryBiomeShape {
|
|||||||
return cacheEntry;
|
return cacheEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isInsideCached(int x, int z, BiomeType baseBiome) {
|
private boolean isInsideCached(int x, int z, BiomeType BiomeType) {
|
||||||
final int index = (z - cacheOffsetZ) + (x - cacheOffsetX) * cacheSizeZ;
|
final int index = (z - cacheOffsetZ) + (x - cacheOffsetX) * cacheSizeZ;
|
||||||
|
|
||||||
final BiomeType cacheEntry = cache[index];
|
final BiomeType cacheEntry = cache[index];
|
||||||
if (cacheEntry == null) {
|
if (cacheEntry == null) {
|
||||||
// unknown block, meaning they must be outside the extent at this stage, but might still be inside the shape
|
// unknown block, meaning they must be outside the extent at this stage, but might still be inside the shape
|
||||||
return getBiomeCached(x, z, baseBiome) != null;
|
return getBiomeCached(x, z, BiomeType) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cacheEntry != BiomeTypes.THE_VOID;
|
return cacheEntry != BiomeTypes.THE_VOID;
|
||||||
@ -124,11 +124,11 @@ public abstract class ArbitraryBiomeShape {
|
|||||||
* Generates the shape.
|
* Generates the shape.
|
||||||
*
|
*
|
||||||
* @param editSession The EditSession to use.
|
* @param editSession The EditSession to use.
|
||||||
* @param baseBiome The default biome type.
|
* @param BiomeType The default biome type.
|
||||||
* @param hollow Specifies whether to generate a hollow shape.
|
* @param hollow Specifies whether to generate a hollow shape.
|
||||||
* @return number of affected blocks.
|
* @return number of affected blocks.
|
||||||
*/
|
*/
|
||||||
public int generate(EditSession editSession, BiomeType baseBiome, boolean hollow) {
|
public int generate(EditSession editSession, BiomeType BiomeType, boolean hollow) {
|
||||||
int affected = 0;
|
int affected = 0;
|
||||||
|
|
||||||
for (BlockVector2 position : getExtent()) {
|
for (BlockVector2 position : getExtent()) {
|
||||||
@ -136,7 +136,7 @@ public abstract class ArbitraryBiomeShape {
|
|||||||
int z = position.getBlockZ();
|
int z = position.getBlockZ();
|
||||||
|
|
||||||
if (!hollow) {
|
if (!hollow) {
|
||||||
final BiomeType material = getBiome(x, z, baseBiome);
|
final BiomeType material = getBiome(x, z, BiomeType);
|
||||||
if (material != null && material != BiomeTypes.THE_VOID) {
|
if (material != null && material != BiomeTypes.THE_VOID) {
|
||||||
editSession.getWorld().setBiome(position, material);
|
editSession.getWorld().setBiome(position, material);
|
||||||
++affected;
|
++affected;
|
||||||
@ -145,26 +145,26 @@ public abstract class ArbitraryBiomeShape {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final BiomeType material = getBiomeCached(x, z, baseBiome);
|
final BiomeType material = getBiomeCached(x, z, BiomeType);
|
||||||
if (material == null) {
|
if (material == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean draw = false;
|
boolean draw = false;
|
||||||
do {
|
do {
|
||||||
if (!isInsideCached(x + 1, z, baseBiome)) {
|
if (!isInsideCached(x + 1, z, BiomeType)) {
|
||||||
draw = true;
|
draw = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!isInsideCached(x - 1, z, baseBiome)) {
|
if (!isInsideCached(x - 1, z, BiomeType)) {
|
||||||
draw = true;
|
draw = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!isInsideCached(x, z + 1, baseBiome)) {
|
if (!isInsideCached(x, z + 1, BiomeType)) {
|
||||||
draw = true;
|
draw = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!isInsideCached(x, z - 1, baseBiome)) {
|
if (!isInsideCached(x, z - 1, BiomeType)) {
|
||||||
draw = true;
|
draw = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren