From 5242efb4cfc419381e3bd33606f042d3b5e9fb84 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 19 Jul 2019 06:52:01 +1000 Subject: [PATCH] remove mapped fawe queue --- .../fawe/object/ChangeSetFaweQueue.java | 92 -------------- .../boydti/fawe/object/MaskedFaweQueue.java | 113 ------------------ 2 files changed, 205 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/ChangeSetFaweQueue.java delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/MaskedFaweQueue.java diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/ChangeSetFaweQueue.java b/worldedit-core/src/main/java/com/boydti/fawe/object/ChangeSetFaweQueue.java deleted file mode 100644 index 143be2689..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/ChangeSetFaweQueue.java +++ /dev/null @@ -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 > boolean setBlock(BlockVector3 p, B block) throws WorldEditException { - return setBlock(p.getX(), p.getY(), p.getZ(), block.getInternalId(), block.getNbtData()); - } - - @Override - public > 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); - } -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/MaskedFaweQueue.java b/worldedit-core/src/main/java/com/boydti/fawe/object/MaskedFaweQueue.java deleted file mode 100644 index 9d8baa3f4..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/MaskedFaweQueue.java +++ /dev/null @@ -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; - } -}