remove mapped fawe queue

This commit is contained in:
Jesse Boyd 2019-07-19 06:52:01 +10:00
parent e86e4c9c53
commit 5242efb4cf
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 0 additions and 205 deletions

View File

@ -1,92 +0,0 @@
package com.boydti.fawe.object;
import com.boydti.fawe.FaweCache;
import com.boydti.fawe.object.changeset.FaweChangeSet;
import com.boydti.fawe.object.queue.DelegateIQueueExtent;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
public class ChangeSetIQueueExtent extends DelegateIQueueExtent {
private FaweChangeSet set;
public ChangeSetIQueueExtent(FaweChangeSet set, IQueueExtent parent) {
super(parent);
this.set = set;
}
public FaweChangeSet getChangeSet() {
return set;
}
public void setChangeSet(FaweChangeSet set) {
this.set = set;
}
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 p, B block) throws WorldEditException {
return setBlock(p.getX(), p.getY(), p.getZ(), block.getInternalId(), block.getNbtData());
}
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(int x, int y, int z, B block) throws WorldEditException {
return setBlock(x, y, z, block.getInternalId(), block.getNbtData());
}
@Override
public boolean setBlock(int x, int y, int z, int combinedId, CompoundTag nbt) {
if (setBlock(x, y, z, combinedId)) {
if (nbt != null) {
set.addTileCreate(nbt);
}
return true;
}
return false;
}
@Override
public boolean setBlock(int x, int y, int z, int combinedId) {
if (super.setBlock(x, y, z, combinedId)) {
int combinedFrom = getParent().getCombinedId4Data(x, y, z);
BlockType typeFrom = BlockTypes.getFromStateId(combinedFrom);
if (typeFrom.getMaterial().hasContainer()) {
CompoundTag nbt = getParent().getTileEntity(x, y, z);
if (nbt != null) {
set.addTileRemove(nbt);
}
}
set.add(x, y, z, combinedFrom, combinedId);
return true;
}
return false;
}
@Override
public boolean setBiome(int x, int z, BiomeType biome) {
if (super.setBiome(x, z, biome)) {
BiomeType oldBiome = getParent().getBiomeType(x, z);
if (oldBiome != biome) {
set.addBiomeChange(x, z, oldBiome, biome);
return true;
}
}
return false;
}
@Override
public void setTile(int x, int y, int z, CompoundTag tag) {
super.setTile(x, y, z, tag);
set.addTileCreate(tag);
}
@Override
public void setEntity(int x, int y, int z, CompoundTag tag) {
super.setEntity(x, y, z, tag);
set.addEntityCreate(tag);
}
}

View File

@ -1,113 +0,0 @@
package com.boydti.fawe.object;
import com.boydti.fawe.object.extent.FaweRegionExtent;
import com.boydti.fawe.object.extent.HeightBoundExtent;
import com.boydti.fawe.object.extent.MultiRegionExtent;
import com.boydti.fawe.object.extent.SingleRegionExtent;
import com.boydti.fawe.object.queue.DelegateIQueueExtent;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockStateHolder;
public class MaskedIQueueExtent extends DelegateIQueueExtent {
private FaweRegionExtent region;
public MaskedIQueueExtent(IQueueExtent parent, Region[] mask) {
super(parent);
setMask(mask);
}
public void setMask(Region[] mask) {
switch (mask.length) {
case 0:
region = new HeightBoundExtent(this, FaweLimit.MAX.copy(), 0, 255);
break;
case 1:
region = new SingleRegionExtent(this, FaweLimit.MAX.copy(), mask[0]);
break;
default:
region = new MultiRegionExtent(this, FaweLimit.MAX.copy(), mask);
break;
}
if (mask.length == 1) {
region = new SingleRegionExtent(this, FaweLimit.MAX.copy(), mask[0]);
} else {
region = new MultiRegionExtent(this, FaweLimit.MAX.copy(), mask);
}
}
@Override
public void setTile(int x, int y, int z, CompoundTag tag) {
if (region.contains(x, y, z)) {
super.setTile(x, y, z, tag);
}
}
@Override
public void setEntity(int x, int y, int z, CompoundTag tag) {
if (region.contains(x, y, z)) {
super.setEntity(x, y, z, tag);
}
}
@Override
public boolean setBlock(int x, int y, int z, int combinedId) {
if (region.contains(x, y, z)) {
return super.setBlock(x, y, z, combinedId);
}
return false;
}
@Override
public boolean setBlock(int x, int y, int z, int combinedId, CompoundTag nbt) {
if (region.contains(x, y, z)) {
return super.setBlock(x, y, z, combinedId, nbt);
}
return false;
}
@Override
public boolean setBlock(BlockVector3 position, BlockStateHolder block) throws WorldEditException {
if (region.contains(position.getBlockX(), position.getBlockZ())) {
return super.setBlock(position, block);
}
return false;
}
@Override
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
if (region.contains(x, y, z)) {
return super.setBlock(x, y, z, block);
}
return false;
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
if (region.contains(x, y, z)) {
return super.setBiome(x, y, z, biome);
}
return false;
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
if (region.contains(position.getBlockX(), position.getBlockZ())) {
return super.setBiome(position, biome);
}
return false;
}
@Override
public boolean setBiome(int x, int z, BiomeType biome) {
if (region.contains(x, z)) {
return super.setBiome(x, z, biome);
}
return false;
}
}