Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 02:50:06 +01:00
Commit
ba6c391461
@ -104,7 +104,7 @@ public final class BukkitAdapter_1_15_2 extends NMSAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected static DelegateLock applyLock(ChunkSection section) {
|
protected static DelegateLock applyLock(ChunkSection section) {
|
||||||
//todo there has to be a better way to do this. Maybe using a() in DataPaletteBlock which aquires the lock in NMS?
|
//todo there has to be a better way to do this. Maybe using a() in DataPaletteBlock which acquires the lock in NMS?
|
||||||
try {
|
try {
|
||||||
synchronized (section) {
|
synchronized (section) {
|
||||||
DataPaletteBlock<IBlockData> blocks = section.getBlocks();
|
DataPaletteBlock<IBlockData> blocks = section.getBlocks();
|
||||||
|
@ -167,7 +167,7 @@ public abstract class QueueHandler implements Trimable, Runnable {
|
|||||||
return sync(call, syncTasks);
|
return sync(call, syncTasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lower priorty sync task (runs only when there are no other tasks)
|
// Lower priority sync task (runs only when there are no other tasks)
|
||||||
public <T> Future<T> syncWhenFree(Runnable run, T value) {
|
public <T> Future<T> syncWhenFree(Runnable run, T value) {
|
||||||
return sync(run, value, syncWhenFree);
|
return sync(run, value, syncWhenFree);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ public abstract class ReadOnlyClipboard extends SimpleClipboard {
|
|||||||
if (current.getWorld().equals(world)) {
|
if (current.getWorld().equals(world)) {
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
throw new UnsupportedOperationException("TODO: Cannot lazy copy accross worlds (bug jesse)");
|
throw new UnsupportedOperationException("TODO: Cannot lazy copy across worlds (bug jesse)");
|
||||||
}
|
}
|
||||||
throw new IllegalStateException("No world");
|
throw new IllegalStateException("No world");
|
||||||
};
|
};
|
||||||
|
@ -100,7 +100,7 @@ public class SparseBitSet implements Cloneable, Serializable
|
|||||||
bits (setting, flipping, clearing, etc.) do not attempt to normalize the
|
bits (setting, flipping, clearing, etc.) do not attempt to normalize the
|
||||||
set, in the interests of speed. However, when a set is scanned as the
|
set, in the interests of speed. However, when a set is scanned as the
|
||||||
resultant set of some operation, then, in most cases, the set will be
|
resultant set of some operation, then, in most cases, the set will be
|
||||||
normalized--the exception being level2 areas that are not completly scanned
|
normalized--the exception being level2 areas that are not completely scanned
|
||||||
in a particular pass.
|
in a particular pass.
|
||||||
|
|
||||||
The sizes of the blocks and areas has been the result of some investigation
|
The sizes of the blocks and areas has been the result of some investigation
|
||||||
@ -338,8 +338,8 @@ public class SparseBitSet implements Cloneable, Serializable
|
|||||||
* needed actions to initialise the bit set.
|
* needed actions to initialise the bit set.
|
||||||
* <p>
|
* <p>
|
||||||
* The capacity is taken to be a <i>suggestion</i> for a size of the bit set,
|
* The capacity is taken to be a <i>suggestion</i> for a size of the bit set,
|
||||||
* in bits. An appropiate table size (a power of two) is then determined and
|
* in bits. An appropriate table size (a power of two) is then determined and
|
||||||
* used. The size will be grown as needed to accomodate any bits addressed
|
* used. The size will be grown as needed to accommodate any bits addressed
|
||||||
* during the use of the bit set.
|
* during the use of the bit set.
|
||||||
*
|
*
|
||||||
* @param capacity a size in terms of bits
|
* @param capacity a size in terms of bits
|
||||||
@ -530,7 +530,7 @@ public class SparseBitSet implements Cloneable, Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a bit set from thie first <code>SparseBitSet</code> whose
|
* Creates a bit set from the first <code>SparseBitSet</code> whose
|
||||||
* corresponding bits are cleared by the set bits of the second
|
* corresponding bits are cleared by the set bits of the second
|
||||||
* <code>SparseBitSet</code>. The resulting bit set is created so that a bit
|
* <code>SparseBitSet</code>. The resulting bit set is created so that a bit
|
||||||
* in it has the value <code>true</code> if and only if the corresponding bit
|
* in it has the value <code>true</code> if and only if the corresponding bit
|
||||||
@ -1669,7 +1669,7 @@ public class SparseBitSet implements Cloneable, Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intializes all the additional objects required for correct operation.
|
* Initializes all the additional objects required for correct operation.
|
||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
|
@ -513,11 +513,11 @@ public class MainUtil {
|
|||||||
}
|
}
|
||||||
try (FileInputStream fIn = new FileInputStream(sourceFile); FileChannel source = fIn.getChannel();
|
try (FileInputStream fIn = new FileInputStream(sourceFile); FileChannel source = fIn.getChannel();
|
||||||
FileOutputStream fOut = new FileOutputStream(destFile); FileChannel destination = fOut.getChannel()) {
|
FileOutputStream fOut = new FileOutputStream(destFile); FileChannel destination = fOut.getChannel()) {
|
||||||
long transfered = 0;
|
long transferred = 0;
|
||||||
long bytes = source.size();
|
long bytes = source.size();
|
||||||
while (transfered < bytes) {
|
while (transferred < bytes) {
|
||||||
transfered += destination.transferFrom(source, 0, source.size());
|
transferred += destination.transferFrom(source, 0, source.size());
|
||||||
destination.position(transfered);
|
destination.position(transferred);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return destFile;
|
return destFile;
|
||||||
|
@ -131,13 +131,13 @@ public class ReflectionUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T callConstructor(Constructor<T> constructor, Object... paramaters) {
|
public static <T> T callConstructor(Constructor<T> constructor, Object... parameters) {
|
||||||
if (constructor == null) {
|
if (constructor == null) {
|
||||||
throw new RuntimeException("No such constructor");
|
throw new RuntimeException("No such constructor");
|
||||||
}
|
}
|
||||||
constructor.setAccessible(true);
|
constructor.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
return constructor.newInstance(paramaters);
|
return constructor.newInstance(parameters);
|
||||||
} catch (InvocationTargetException ex) {
|
} catch (InvocationTargetException ex) {
|
||||||
throw new RuntimeException(ex.getCause());
|
throw new RuntimeException(ex.getCause());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -37,7 +37,7 @@ public class ReflectionUtils9 {
|
|||||||
// 3. build new enum
|
// 3. build new enum
|
||||||
T newValue = (T) makeEnum(enumType, // The target enum class
|
T newValue = (T) makeEnum(enumType, // The target enum class
|
||||||
enumName, // THE NEW ENUM INSTANCE TO BE DYNAMICALLY ADDED
|
enumName, // THE NEW ENUM INSTANCE TO BE DYNAMICALLY ADDED
|
||||||
values.size()); // can be used to pass values to the enum constuctor
|
values.size()); // can be used to pass values to the enum constructor
|
||||||
|
|
||||||
// 4. add new value
|
// 4. add new value
|
||||||
values.add(newValue);
|
values.add(newValue);
|
||||||
|
@ -72,7 +72,7 @@ public final class NBTUtils {
|
|||||||
} else if (clazz.equals(LongArrayTag.class)) {
|
} else if (clazz.equals(LongArrayTag.class)) {
|
||||||
return "TAG_Long_Array";
|
return "TAG_Long_Array";
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Invalid tag classs ("
|
throw new IllegalArgumentException("Invalid tag class ("
|
||||||
+ clazz.getName() + ").");
|
+ clazz.getName() + ").");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ public final class NBTUtils {
|
|||||||
} else if (clazz.equals(LongArrayTag.class)) {
|
} else if (clazz.equals(LongArrayTag.class)) {
|
||||||
return NBTConstants.TYPE_LONG_ARRAY;
|
return NBTConstants.TYPE_LONG_ARRAY;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Invalid tag classs ("
|
throw new IllegalArgumentException("Invalid tag class ("
|
||||||
+ clazz.getName() + ").");
|
+ clazz.getName() + ").");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ public final class StringUtil {
|
|||||||
/**
|
/**
|
||||||
* Trim a string if it is longer than a certain length.
|
* Trim a string if it is longer than a certain length.
|
||||||
*
|
*
|
||||||
* @param str the stirng
|
* @param str the string
|
||||||
* @param len the length to trim to
|
* @param len the length to trim to
|
||||||
* @return a new string
|
* @return a new string
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ import com.sk89q.worldedit.event.Event;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when configuration has been loaded and the platform is in the
|
* Fired when configuration has been loaded and the platform is in the
|
||||||
* intialization stage.
|
* initialization stage.
|
||||||
*
|
*
|
||||||
* <p>This event is fired once.</p>
|
* <p>This event is fired once.</p>
|
||||||
*/
|
*/
|
||||||
|
@ -84,7 +84,7 @@ class CompilingVisitor extends ExpressionBaseVisitor<MethodHandle> {
|
|||||||
* General idea is that we don't need to pass around variables, they're all in ExecutionData.
|
* General idea is that we don't need to pass around variables, they're all in ExecutionData.
|
||||||
* We do need to pass that around, so most MethodHandles will be of the type
|
* We do need to pass that around, so most MethodHandles will be of the type
|
||||||
* (ExecutionData)Double, with a few as (ExecutionData,Double)Double where it needs an existing
|
* (ExecutionData)Double, with a few as (ExecutionData,Double)Double where it needs an existing
|
||||||
* value passed in. EVERY handle returned from an overriden method must be of the first type.
|
* value passed in. EVERY handle returned from an overridden method must be of the first type.
|
||||||
*/
|
*/
|
||||||
private final Functions functions;
|
private final Functions functions;
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren