geforkt von Mirrors/FastAsyncWorldEdit
Attempt to fix compile and other small changes
Dieser Commit ist enthalten in:
Ursprung
6cbbefc0de
Commit
630245bb9f
@ -103,7 +103,7 @@ public class AsyncWorld extends PassthroughExtent implements World {
|
|||||||
/**
|
/**
|
||||||
* @deprecated use {@link #wrap(World)} instead
|
* @deprecated use {@link #wrap(World)} instead
|
||||||
* @param parent
|
* @param parent
|
||||||
* @param queue
|
* @param extent
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public AsyncWorld(World parent, Extent extent) {
|
public AsyncWorld(World parent, Extent extent) {
|
||||||
|
@ -22,8 +22,6 @@ public class ChunkCache<T extends Trimable> implements IChunkCache<T> {
|
|||||||
/**
|
/**
|
||||||
* Get or create the IGetBlocks
|
* Get or create the IGetBlocks
|
||||||
*
|
*
|
||||||
* @param index chunk index {@link com.boydti.fawe.util.MathMan#pairInt(int, int)}
|
|
||||||
* @param provider used to create if it isn't already cached
|
|
||||||
* @return cached IGetBlocks
|
* @return cached IGetBlocks
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,7 +29,7 @@ import java.util.concurrent.Future;
|
|||||||
* Single threaded implementation for IQueueExtent (still abstract) - Does not implement creation of
|
* Single threaded implementation for IQueueExtent (still abstract) - Does not implement creation of
|
||||||
* chunks (that has to implemented by the platform e.g., Bukkit)
|
* chunks (that has to implemented by the platform e.g., Bukkit)
|
||||||
* <p>
|
* <p>
|
||||||
* This queue is reusable {@link #init(IChunkCache)}
|
* This queue is reusable {@link #init(Extent, IChunkCache, IChunkCache)} }
|
||||||
*/
|
*/
|
||||||
public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implements IQueueExtent<IQueueChunk> {
|
public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implements IQueueExtent<IQueueChunk> {
|
||||||
|
|
||||||
@ -103,7 +103,6 @@ public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implemen
|
|||||||
/**
|
/**
|
||||||
* Initialize the queue
|
* Initialize the queue
|
||||||
*
|
*
|
||||||
* @param cache
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized void init(Extent extent, IChunkCache<IChunkGet> get, IChunkCache<IChunkSet> set) {
|
public synchronized void init(Extent extent, IChunkCache<IChunkGet> get, IChunkCache<IChunkSet> set) {
|
||||||
@ -146,7 +145,6 @@ public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implemen
|
|||||||
* Submit without first checking that it has been removed from the chunk map
|
* Submit without first checking that it has been removed from the chunk map
|
||||||
*
|
*
|
||||||
* @param chunk
|
* @param chunk
|
||||||
* @param <T>
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private <V extends Future<V>> V submitUnchecked(IQueueChunk chunk) {
|
private <V extends Future<V>> V submitUnchecked(IQueueChunk chunk) {
|
||||||
|
@ -75,7 +75,6 @@ import java.util.function.Consumer;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
|
||||||
import org.enginehub.piston.annotation.Command;
|
import org.enginehub.piston.annotation.Command;
|
||||||
import org.enginehub.piston.annotation.CommandContainer;
|
import org.enginehub.piston.annotation.CommandContainer;
|
||||||
import org.enginehub.piston.annotation.param.Arg;
|
import org.enginehub.piston.annotation.param.Arg;
|
||||||
@ -88,7 +87,7 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
public class CFICommands {
|
public class CFICommands {
|
||||||
|
|
||||||
private final WorldEdit worldEdit;
|
private final WorldEdit worldEdit;
|
||||||
private final @NonNull TextComponent doubleNewLine = TextComponent.of("\n\n");
|
private final TextComponent doubleNewLine = TextComponent.of("\n\n");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance.
|
* Create a new instance.
|
||||||
@ -111,7 +110,7 @@ public class CFICommands {
|
|||||||
desc = "Start CFI with a height map as a base"
|
desc = "Start CFI with a height map as a base"
|
||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.anvil.cfi")
|
@CommandPermissions("worldedit.anvil.cfi")
|
||||||
public void heightmap(Player player, @Arg(def = "", desc = "image url or filename") ProvideBindings.ImageUri image, @Arg(name = "yscale", desc = "double", def = "1") double yscale) {
|
public void heightmap(Player player, @Arg(def = "", desc = "image url or filename") ProvideBindings.ImageUri image, @Arg(desc = "double", def = "1") double yscale) {
|
||||||
if (yscale != 0) {
|
if (yscale != 0) {
|
||||||
int[] raw = ((DataBufferInt) image.load().getRaster().getDataBuffer()).getData();
|
int[] raw = ((DataBufferInt) image.load().getRaster().getDataBuffer()).getData();
|
||||||
int[] table = IntStream.range(0, 256).map(i -> Math.min(255, (int) (i * yscale)))
|
int[] table = IntStream.range(0, 256).map(i -> Math.min(255, (int) (i * yscale)))
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package com.boydti.fawe.object.collection;
|
package com.boydti.fawe.object.collection;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import com.boydti.fawe.object.FaweInputStream;
|
import com.boydti.fawe.object.FaweInputStream;
|
||||||
import com.boydti.fawe.object.FaweOutputStream;
|
import com.boydti.fawe.object.FaweOutputStream;
|
||||||
import com.boydti.fawe.object.io.serialize.Serialize;
|
import com.boydti.fawe.object.io.serialize.Serialize;
|
||||||
@ -8,12 +11,8 @@ import java.io.IOException;
|
|||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Records changes made through the {@link #setByte(int, byte)} or {@link #setChar(int, char)} method<br/>
|
* Records changes made through the {@link #setByte(int, byte)} or {@link #setInt(int, int)} method<br/>
|
||||||
* If you are editing the raw data, use {@link #record(Runnable)}
|
* If you are editing the raw data, use {@link #record(Runnable)}
|
||||||
* @param <T>
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
|
@ -6,7 +6,7 @@ import java.io.IOException;
|
|||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Records changes made through the {@link #set(int, int, int, int)} method<br/>
|
* Records changes made through the {@link #set(int, int, int, char)} method<br/>
|
||||||
* Changes are not recorded if you edit the raw data
|
* Changes are not recorded if you edit the raw data
|
||||||
*/
|
*/
|
||||||
public final class DifferentialBlockBuffer implements DifferentialCollection<char[][][][][]> {
|
public final class DifferentialBlockBuffer implements DifferentialCollection<char[][][][][]> {
|
||||||
|
@ -502,9 +502,12 @@ public class BrushCommands {
|
|||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.brush.scatter")
|
@CommandPermissions("worldedit.brush.scatter")
|
||||||
public void scatterBrush(InjectedValueAccess context, Pattern fill,
|
public void scatterBrush(InjectedValueAccess context, Pattern fill,
|
||||||
@Arg(desc = "Expression", def = "5") Expression radius,
|
@Arg(desc = "Expression", def = "5")
|
||||||
@Arg(desc = "double", def = "5") double points,
|
Expression radius,
|
||||||
@Arg(desc = "double", def = "1") double distance,
|
@Arg(desc = "double", def = "5")
|
||||||
|
double points,
|
||||||
|
@Arg(desc = "double", def = "1")
|
||||||
|
double distance,
|
||||||
@Switch(name = 'o', desc = "Overlay the block") boolean overlay) throws WorldEditException {
|
@Switch(name = 'o', desc = "Overlay the block") boolean overlay) throws WorldEditException {
|
||||||
worldEdit.checkMaxBrushRadius(radius);
|
worldEdit.checkMaxBrushRadius(radius);
|
||||||
Brush brush;
|
Brush brush;
|
||||||
@ -585,14 +588,18 @@ public class BrushCommands {
|
|||||||
desc = "Run commands at random points on a surface",
|
desc = "Run commands at random points on a surface",
|
||||||
descFooter =
|
descFooter =
|
||||||
"Run commands at random points on a surface\n" +
|
"Run commands at random points on a surface\n" +
|
||||||
" - The scatter radius is the min distance between each point\n" +
|
|
||||||
" - Your selection will be expanded to the specified size around each point\n" +
|
" - Your selection will be expanded to the specified size around each point\n" +
|
||||||
" - Placeholders: {x}, {y}, {z}, {world}, {size}"
|
" - Placeholders: {x}, {y}, {z}, {world}, {size}"
|
||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.brush.scattercommand")
|
@CommandPermissions("worldedit.brush.scattercommand")
|
||||||
public void scatterCommandBrush(Player player, InjectedValueAccess context,
|
public void scatterCommandBrush(Player player, InjectedValueAccess context,
|
||||||
@Arg(desc = "Expression") Expression radius, double points,
|
@Arg(desc = "The minimum distance between each point")
|
||||||
double distance, List<String> commandStr) throws WorldEditException {
|
Expression radius,
|
||||||
|
@Arg(desc = "double", def = "1")
|
||||||
|
double points,
|
||||||
|
@Arg(desc = "double", def = "1")
|
||||||
|
double distance,
|
||||||
|
List<String> commandStr) throws WorldEditException {
|
||||||
worldEdit.checkMaxBrushRadius(radius);
|
worldEdit.checkMaxBrushRadius(radius);
|
||||||
set(context,
|
set(context,
|
||||||
new ScatterCommand((int) points, (int) distance, StringMan.join(commandStr, " ")))
|
new ScatterCommand((int) points, (int) distance, StringMan.join(commandStr, " ")))
|
||||||
|
@ -295,14 +295,13 @@ public interface World extends Extent, Keyed, IChunkCache<IChunkGet> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refresh a specific chunk with a bitMask (0 = default, 65535 = all block sections)
|
* Refresh a specific chunk
|
||||||
* Note: only 0 is guaranteed to send all tiles / entities
|
* Note: only 0 is guaranteed to send all tiles / entities
|
||||||
* Note: Only 65535 is guaranteed to send all blocks
|
* Note: Only 65535 is guaranteed to send all blocks
|
||||||
* @param chunkX
|
* @param chunkX
|
||||||
* @param chunkZ
|
* @param chunkZ
|
||||||
* @param bitMask
|
|
||||||
*/
|
*/
|
||||||
void refreshChunk(final int X, final int Z);
|
void refreshChunk(final int chunkX, final int chunkZ);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
IChunkGet get(int x, int z);
|
IChunkGet get(int x, int z);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren