mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Fix sponge compile
This commit is contained in:
parent
8b084839fd
commit
dda6849412
@ -5,7 +5,6 @@ import com.intellectualcrafters.plot.generator.AugmentedUtils;
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.util.block.DelegateLocalBlockQueue;
|
||||
import com.plotsquared.sponge.util.SpongeUtil;
|
||||
import java.util.List;
|
||||
import org.spongepowered.api.block.BlockState;
|
||||
import org.spongepowered.api.world.World;
|
||||
import org.spongepowered.api.world.extent.ImmutableBiomeArea;
|
||||
@ -13,6 +12,8 @@ import org.spongepowered.api.world.extent.MutableBlockVolume;
|
||||
import org.spongepowered.api.world.gen.GenerationPopulator;
|
||||
import org.spongepowered.api.world.gen.WorldGenerator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SpongeAugmentedGenerator implements GenerationPopulator {
|
||||
|
||||
private static SpongeAugmentedGenerator generator;
|
||||
@ -44,14 +45,14 @@ public class SpongeAugmentedGenerator implements GenerationPopulator {
|
||||
AugmentedUtils.generate(world.getName(), cx, cz, new DelegateLocalBlockQueue(null) {
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, int id, int data) {
|
||||
terrain.setBlock(bx + x, y, bz + z, SpongeUtil.getBlockState(id, data));
|
||||
terrain.setBlock(bx + x, y, bz + z, SpongeUtil.getBlockState(id, data), SpongeUtil.CAUSE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlotBlock getBlock(int x, int y, int z) {
|
||||
BlockState block = terrain.getBlock(bx + x, y, bz + z);
|
||||
return block == null ? PlotBlock.get(0, 0) : SpongeUtil.getPlotBlock(block);
|
||||
return SpongeUtil.getPlotBlock(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,6 +35,7 @@ import org.spongepowered.api.event.cause.NamedCause;
|
||||
import org.spongepowered.api.text.Text;
|
||||
import org.spongepowered.api.text.serializer.TextSerializers;
|
||||
import org.spongepowered.api.text.translation.Translation;
|
||||
import org.spongepowered.api.world.BlockChangeFlag;
|
||||
import org.spongepowered.api.world.World;
|
||||
import org.spongepowered.api.world.biome.BiomeType;
|
||||
import org.spongepowered.api.world.biome.BiomeTypes;
|
||||
@ -303,7 +304,8 @@ public class SpongeUtil extends WorldUtil {
|
||||
StringComparison<PlotBlock> outer = new StringComparison<PlotBlock>();
|
||||
return outer.new ComparisonResult(match, block);
|
||||
|
||||
} catch (NumberFormatException ignored) {}
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -429,7 +431,7 @@ public class SpongeUtil extends WorldUtil {
|
||||
@Override
|
||||
public void setSign(String worldName, int x, int y, int z, String[] lines) {
|
||||
World world = SpongeUtil.getWorld(worldName);
|
||||
world.setBlock(x, y, z, BlockTypes.WALL_SIGN.getDefaultState());
|
||||
world.setBlock(x, y, z, BlockTypes.WALL_SIGN.getDefaultState(), BlockChangeFlag.NONE, CAUSE);
|
||||
Optional<TileEntity> block = world.getTileEntity(x, y, z);
|
||||
if (!block.isPresent()) {
|
||||
return;
|
||||
|
@ -52,7 +52,7 @@ public class GenChunk extends ScopedLocalBlockQueue {
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, int id, int data) {
|
||||
modified = true;
|
||||
this.terrain.setBlock(this.bx + x, y, this.bz + z, SpongeUtil.getBlockState(id, data));
|
||||
this.terrain.setBlock(this.bx + x, y, this.bz + z, SpongeUtil.getBlockState(id, data),SpongeUtil.CAUSE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -7,9 +7,6 @@ import com.intellectualcrafters.plot.util.StringMan;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.intellectualcrafters.plot.util.block.BasicLocalBlockQueue;
|
||||
import com.plotsquared.sponge.util.SpongeUtil;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
@ -35,6 +32,10 @@ import org.spongepowered.api.world.extent.UnmodifiableBlockVolume;
|
||||
import org.spongepowered.api.world.extent.worker.MutableBlockVolumeWorker;
|
||||
import org.spongepowered.api.world.extent.worker.procedure.BlockVolumeMapper;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
||||
|
||||
public SpongeLocalQueue(String world) {
|
||||
@ -441,7 +442,7 @@ public class SpongeLocalQueue extends BasicLocalBlockQueue<char[]> {
|
||||
World worldObj = getSpongeWorld();
|
||||
org.spongepowered.api.world.Chunk spongeChunk = (org.spongepowered.api.world.Chunk) getChunk(worldObj, lc.getX(), lc.getZ());
|
||||
char[][] ids = ((CharLocalChunk) lc).blocks;
|
||||
MutableBlockVolumeWorker<? extends org.spongepowered.api.world.Chunk> blockWorker = spongeChunk.getBlockWorker();
|
||||
MutableBlockVolumeWorker<? extends org.spongepowered.api.world.Chunk> blockWorker = spongeChunk.getBlockWorker(SpongeUtil.CAUSE);
|
||||
blockWorker.map(new BlockVolumeMapper() {
|
||||
@Override
|
||||
public BlockState map(UnmodifiableBlockVolume volume, int xx, int y, int zz) {
|
||||
|
Loading…
Reference in New Issue
Block a user