3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 02:50:05 +01:00

Attempt to fix compiling

Dieser Commit ist enthalten in:
MattBDev 2019-10-03 19:35:55 -04:00
Ursprung e5c1d9e6cf
Commit f963e63f58
11 geänderte Dateien mit 136 neuen und 86 gelöschten Zeilen

Datei anzeigen

@ -1,9 +1,14 @@
package com.boydti.fawe.beta;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import javax.annotation.Nullable;
@ -88,4 +93,26 @@ public class ArrayFilterBlock extends SimpleFilterBlock {
public int getZ() {
return z;
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 position, T block)
throws WorldEditException {
return getExtent().setBlock(position.getX(),position.getY(), position.getZ(), block);
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block)
throws WorldEditException {
return getExtent().setBlock(x,y, z, block);
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
return getExtent().setBiome(position.getX(),0, position.getZ(), biome);
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
return getExtent().setBiome(x,y, z,biome);
}
}

Datei anzeigen

@ -4,11 +4,15 @@ import static com.sk89q.worldedit.world.block.BlockTypes.states;
import com.boydti.fawe.beta.implementation.blocks.CharGetBlocks;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.registry.BlockMaterial;
import javax.annotation.Nullable;
@ -406,6 +410,23 @@ public class CharFilterBlock extends ChunkFilterBlock {
return getExtent().getBiomeType(x, z);
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 position, T block)
throws WorldEditException {
return false;
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block)
throws WorldEditException {
return false;
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
return false;
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
if (x >> 4 == chunkX && z >> 4 == chunkZ) {

Datei anzeigen

@ -3,9 +3,12 @@ package com.boydti.fawe.beta;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import javax.annotation.Nullable;
public class SingleFilterBlock extends FilterBlock {
@ -95,4 +98,26 @@ public class SingleFilterBlock extends FilterBlock {
public BlockVector3 getMaximumPoint() {
return BlockVector3.at(x, y, z);
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 position, T block)
throws WorldEditException {
return getExtent().setBlock(position.getX(),position.getY(), position.getZ(), block);
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block)
throws WorldEditException {
return getExtent().setBlock(x,y, z, block);
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
return getExtent().setBiome(position.getX(),0, position.getZ(), biome);
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
return getExtent().setBiome(x,y, z,biome);
}
}

Datei anzeigen

@ -2,7 +2,6 @@ package com.boydti.fawe.beta.implementation;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.FaweCache;
import com.boydti.fawe.beta.ChunkFilterBlock;
import com.boydti.fawe.beta.IChunk;
import com.boydti.fawe.beta.IChunkGet;
import com.boydti.fawe.beta.IChunkSet;
@ -14,7 +13,6 @@ import com.boydti.fawe.util.MemUtil;
import com.boydti.fawe.util.TaskManager;
import com.boydti.fawe.wrappers.WorldWrapper;
import com.google.common.util.concurrent.Futures;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.world.World;
import java.lang.ref.WeakReference;
import java.util.HashMap;
@ -33,6 +31,7 @@ import java.util.function.Supplier;
/**
* Class which handles all the queues {@link IQueueExtent}
*/
@SuppressWarnings("UnstableApiUsage")
public abstract class QueueHandler implements Trimable, Runnable {
private ForkJoinPool forkJoinPoolPrimary = new ForkJoinPool();
@ -77,7 +76,6 @@ public abstract class QueueHandler implements Trimable, Runnable {
// TODO reduce mem usage
}
long taskAllocate = currentAllocate;
boolean wait = false;
do {
Runnable task = syncTasks.poll();
@ -100,7 +98,7 @@ public abstract class QueueHandler implements Trimable, Runnable {
task.run();
wait = true;
}
} while (System.currentTimeMillis() - now < taskAllocate);
} while (System.currentTimeMillis() - now < currentAllocate);
}
while (!syncTasks.isEmpty()) {
final FutureTask task = syncTasks.poll();

Datei anzeigen

@ -14,7 +14,12 @@ import com.boydti.fawe.config.Settings;
import com.boydti.fawe.util.MathMan;
import com.boydti.fawe.util.MemUtil;
import com.google.common.util.concurrent.Futures;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
@ -306,4 +311,16 @@ public class SingleThreadQueueExtent implements IQueueExtent {
public ChunkFilterBlock initFilterBlock() {
return new CharFilterBlock(this);
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 position, T block)
throws WorldEditException {
return setBlock(position.getX(),position.getY(), position.getZ(), block);
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
return setBiome(position.getX(),0, position.getZ(), biome);
}
}

Datei anzeigen

@ -4,6 +4,9 @@ import com.boydti.fawe.FaweCache;
import com.boydti.fawe.beta.IChunkSet;
import com.boydti.fawe.object.collection.MemBlockSet;
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.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
@ -40,11 +43,22 @@ public class BitSetBlocks implements IChunkSet {
return row.isEmpty();
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 position, T block)
throws WorldEditException {
return setBlock(position.getX(), position.getY(), position.getZ(), block);
}
@Override
public boolean setTile(int x, int y, int z, CompoundTag tile) {
return false;
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
return setBiome(position.getX(),0, position.getZ(), biome);
}
@Override
public void setEntity(CompoundTag tag) {
}

Datei anzeigen

@ -5,6 +5,9 @@ import com.boydti.fawe.beta.IChunkSet;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.util.MathMan;
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.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
@ -78,6 +81,12 @@ public class CharSetBlocks extends CharBlocks implements IChunkSet {
return true;
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 position, T block)
throws WorldEditException {
return setBlock(position.getX(), position.getY(), position.getZ(), block);
}
@Override
public boolean setTile(int x, int y, int z, CompoundTag tile) {
if (tiles == null) {
@ -88,6 +97,11 @@ public class CharSetBlocks extends CharBlocks implements IChunkSet {
return true;
}
@Override
public boolean setBiome(BlockVector2 position, BiomeType biome) {
return setBiome(position.getX(),0, position.getZ(), biome);
}
@Override
public void setEntity(CompoundTag tag) {
if (entities == null) {

Datei anzeigen

@ -1,24 +0,0 @@
package com.boydti.fawe.object.clipboard;
import java.util.Arrays;
import java.util.HashSet;
public abstract class AbstractClipboardFormat implements IClipboardFormat {
private final String name;
private final HashSet<String> aliases;
public AbstractClipboardFormat(String name, String... aliases) {
this.name = name;
this.aliases = new HashSet<>(Arrays.asList(aliases));
}
@Override
public String getName() {
return name;
}
@Override
public HashSet<String> getAliases() {
return aliases;
}
}

Datei anzeigen

@ -69,6 +69,12 @@ public class EmptyClipboard implements Clipboard {
return false;
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block)
throws WorldEditException {
return false;
}
@Override
public boolean setTile(int x, int y, int z, CompoundTag tile) throws WorldEditException {
return false;
@ -79,4 +85,9 @@ public class EmptyClipboard implements Clipboard {
return false;
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
return false;
}
}

Datei anzeigen

@ -1,58 +0,0 @@
package com.boydti.fawe.object.clipboard;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Set;
public interface IClipboardFormat {
/**
* Returns the name of this format.
*
* @return The name of the format
*/
String getName();
/**
* Create a reader.
*
* @param inputStream the input stream
* @return a reader
* @throws java.io.IOException thrown on I/O error
*/
ClipboardReader getReader(InputStream inputStream) throws IOException;
/**
* Create a writer.
*
* @param outputStream the output stream
* @return a writer
* @throws IOException thrown on I/O error
*/
ClipboardWriter getWriter(OutputStream outputStream) throws IOException;
/**
* Return whether the given file is of this format.
*
* @param file the file
* @return true if the given file is of this format
*/
boolean isFormat(File file);
/**
* Get the default extension
*
* @return
*/
String getExtension();
/**
* Get a set of aliases.
*
* @return a set of aliases
*/
Set<String> getAliases();
}

Datei anzeigen

@ -254,6 +254,11 @@ public class BlockArrayClipboard implements Clipboard, Closeable {
return IMP.setBiome(x, z, biome);
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
return IMP.setBiome(x, z, biome);
}
@Nullable
@Override
public Operation commit() {