mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 01:07:38 +00:00
This commit is contained in:
commit
f054d29656
@ -34,7 +34,7 @@ logger.lifecycle("""
|
||||
*******************************************
|
||||
""")
|
||||
|
||||
var rootVersion by extra("2.11.3")
|
||||
var rootVersion by extra("2.12.1")
|
||||
var snapshot by extra("SNAPSHOT")
|
||||
var revision: String by extra("")
|
||||
var buildNumber by extra("")
|
||||
|
@ -28,7 +28,7 @@ dependencies {
|
||||
implementation(gradleApi())
|
||||
implementation("org.ajoberstar.grgit:grgit-gradle:5.3.0")
|
||||
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.3")
|
||||
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.7.3")
|
||||
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.7.4")
|
||||
constraints {
|
||||
val asmVersion = "[9.7,)"
|
||||
implementation("org.ow2.asm:asm:$asmVersion") {
|
||||
|
@ -14,8 +14,8 @@ mapmanager = "1.8.0-SNAPSHOT"
|
||||
griefprevention = "17.0.0"
|
||||
griefdefender = "2.1.0-SNAPSHOT"
|
||||
residence = "4.5._13.1"
|
||||
towny = "0.100.4.4"
|
||||
plotsquared = "7.3.11"
|
||||
towny = "0.100.4.7"
|
||||
plotsquared = "7.3.12"
|
||||
|
||||
# Third party
|
||||
bstats = "3.1.0"
|
||||
@ -23,7 +23,7 @@ sparsebitset = "1.3"
|
||||
parallelgzip = "1.0.5"
|
||||
adventure = "4.17.0"
|
||||
adventure-bukkit = "4.3.4"
|
||||
checkerqual = "3.47.0"
|
||||
checkerqual = "3.48.1"
|
||||
truezip = "6.8.4"
|
||||
auto-value = "1.11.0"
|
||||
findbugs = "3.0.2"
|
||||
@ -40,14 +40,14 @@ paperlib = "1.0.8"
|
||||
paster = "1.1.6"
|
||||
vault = "1.7.1"
|
||||
serverlib = "2.3.6"
|
||||
linbus = "0.1.2"
|
||||
linbus = "0.2.0"
|
||||
## Internal
|
||||
text-adapter = "3.0.6"
|
||||
text = "3.0.4"
|
||||
piston = "0.5.10"
|
||||
|
||||
# Tests
|
||||
mockito = "5.14.1"
|
||||
mockito = "5.14.2"
|
||||
|
||||
# Gradle plugins
|
||||
pluginyml = "0.6.0"
|
||||
|
@ -12,6 +12,6 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.21.1-R0.1-SNAPSHOT/
|
||||
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.1-R0.1-20241012.212042-119")
|
||||
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.21.1-R0.1-20241021.162528-124")
|
||||
compileOnly(libs.paperlib)
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.entity.EntityTypes;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Holder;
|
||||
@ -124,7 +125,6 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
@ -194,7 +194,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
|
||||
// A simple test
|
||||
CraftServer.class.cast(Bukkit.getServer());
|
||||
|
||||
int dataVersion = CraftMagicNumbers.INSTANCE.getDataVersion();
|
||||
int dataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
|
||||
if (dataVersion != 3953 && dataVersion != 3955) {
|
||||
throw new UnsupportedClassVersionError("Not 1.21(.1)!");
|
||||
}
|
||||
@ -213,7 +213,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
|
||||
);
|
||||
chunkProviderExecutorField.setAccessible(true);
|
||||
|
||||
this.dataFixer = new PaperweightDataConverters(CraftMagicNumbers.INSTANCE.getDataVersion(), this);
|
||||
this.dataFixer = new PaperweightDataConverters(dataVersion, this);
|
||||
|
||||
Watchdog watchdog;
|
||||
try {
|
||||
|
@ -155,7 +155,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
|
||||
* Utilises ConcurrentHashMap#compute for easy synchronisation for all of the above. Only tryWriteLock is used in blocks
|
||||
* synchronised using ConcurrentHashMap methods.
|
||||
*
|
||||
* @since TODO
|
||||
* @since 2.12.0
|
||||
*/
|
||||
protected static <LevelChunkSection> boolean setSectionAtomic(
|
||||
String worldName,
|
||||
@ -212,7 +212,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
|
||||
* <p>
|
||||
* Utilises ConcurrentHashMap#compute for easy synchronisation
|
||||
*
|
||||
* @since TODO
|
||||
* @since 2.12.0
|
||||
*/
|
||||
protected static void beginChunkPacketSend(String worldName, IntPair pair, StampLockHolder stampedLock) {
|
||||
ConcurrentHashMap<IntPair, ChunkSendLock> chunks = FaweBukkitWorld.getWorldSendingChunksMap(worldName);
|
||||
@ -233,7 +233,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
|
||||
/**
|
||||
* Releases the read lock acquired when sending a chunk packet for a chunk
|
||||
*
|
||||
* @since TODO
|
||||
* @since 2.12.0
|
||||
*/
|
||||
protected static void endChunkPacketSend(String worldName, IntPair pair, StampLockHolder lockHolder) {
|
||||
ConcurrentHashMap<IntPair, ChunkSendLock> chunks = FaweBukkitWorld.getWorldSendingChunksMap(worldName);
|
||||
|
@ -55,7 +55,7 @@ public class LimitExtent extends AbstractDelegateExtent implements IBatchProcess
|
||||
* @param limit the limit
|
||||
* @deprecated Use {@link LimitExtent#LimitExtent(Extent, FaweLimit, Consumer, boolean)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
@Deprecated(forRemoval = true, since = "2.12.0")
|
||||
public LimitExtent(Extent extent, FaweLimit limit) {
|
||||
this(extent, limit, c -> {
|
||||
});
|
||||
@ -69,7 +69,7 @@ public class LimitExtent extends AbstractDelegateExtent implements IBatchProcess
|
||||
* @param onErrorMessage consumer to handle a component generated by exceptions
|
||||
* @deprecated Use {@link LimitExtent#LimitExtent(Extent, FaweLimit, Consumer, boolean)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
@Deprecated(forRemoval = true, since = "2.12.0")
|
||||
public LimitExtent(Extent extent, FaweLimit limit, Consumer<Component> onErrorMessage) {
|
||||
this(extent, limit, onErrorMessage, false);
|
||||
}
|
||||
@ -81,7 +81,7 @@ public class LimitExtent extends AbstractDelegateExtent implements IBatchProcess
|
||||
* @param limit the limit
|
||||
* @param onErrorMessage consumer to handle a component generated by exceptions
|
||||
* @param processing if this limit extent is expected to be processing
|
||||
* @since TODO
|
||||
* @since 2.12.0
|
||||
*/
|
||||
public LimitExtent(
|
||||
Extent extent,
|
||||
|
@ -60,7 +60,7 @@ public abstract class LinearClipboard extends SimpleClipboard {
|
||||
/**
|
||||
* @deprecated will be removed as it is unused and uses outdated types
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
@Deprecated(forRemoval = true, since = "2.12.0")
|
||||
public abstract Collection<CompoundTag> getTileEntities();
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package com.fastasyncworldedit.core.extent.filter;
|
||||
import com.fastasyncworldedit.core.extent.filter.block.FilterBlock;
|
||||
import com.fastasyncworldedit.core.internal.simd.VectorizedFilter;
|
||||
import jdk.incubator.vector.ShortVector;
|
||||
import jdk.incubator.vector.VectorMask;
|
||||
|
||||
public class CountFilter extends ForkedFilter<CountFilter> implements VectorizedFilter {
|
||||
|
||||
@ -36,8 +37,8 @@ public class CountFilter extends ForkedFilter<CountFilter> implements Vectorized
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShortVector applyVector(final ShortVector get, final ShortVector set) {
|
||||
total += set.length();
|
||||
public ShortVector applyVector(final ShortVector get, final ShortVector set, VectorMask<Short> mask) {
|
||||
total += mask.trueCount();
|
||||
return set;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.fastasyncworldedit.core.queue.Filter;
|
||||
import com.fastasyncworldedit.core.queue.IChunk;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import jdk.incubator.vector.ShortVector;
|
||||
import jdk.incubator.vector.VectorMask;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@ -77,9 +78,9 @@ public sealed class LinkedFilter<L extends Filter, R extends Filter> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShortVector applyVector(final ShortVector get, final ShortVector set) {
|
||||
ShortVector res = getLeft().applyVector(get, set);
|
||||
return getRight().applyVector(get, res);
|
||||
public ShortVector applyVector(final ShortVector get, final ShortVector set, VectorMask<Short> mask) {
|
||||
ShortVector res = getLeft().applyVector(get, set, mask);
|
||||
return getRight().applyVector(get, res, mask);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,11 +82,10 @@ public class MaskFilter<T extends Filter> extends DelegateFilter<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShortVector applyVector(final ShortVector get, final ShortVector set) {
|
||||
public ShortVector applyVector(final ShortVector get, final ShortVector set, VectorMask<Short> mask) {
|
||||
final T parent = getParent();
|
||||
VectorMask<Short> masked = vectorizedMask.compareVector(set, get);
|
||||
ShortVector res = parent.applyVector(get, set);
|
||||
res = set.blend(res, masked);
|
||||
ShortVector res = parent.applyVector(get, set, mask.and(masked));
|
||||
VectorMask<Short> changed = res.compare(VectorOperators.NE, set);
|
||||
changes.getAndAdd(changed.trueCount());
|
||||
return res;
|
||||
|
@ -14,6 +14,7 @@ import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypesCache;
|
||||
import jdk.incubator.vector.ShortVector;
|
||||
import jdk.incubator.vector.VectorMask;
|
||||
import jdk.incubator.vector.VectorOperators;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -101,8 +102,9 @@ public class SimdSupport {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShortVector applyVector(final ShortVector get, final ShortVector set) {
|
||||
return ShortVector.broadcast(ShortVector.SPECIES_PREFERRED, ordinal);
|
||||
public ShortVector applyVector(final ShortVector get, final ShortVector set, VectorMask<Short> mask) {
|
||||
// only change the lanes the mask dictates us to change, keep the rest
|
||||
return set.blend(ShortVector.broadcast(ShortVector.SPECIES_PREFERRED, ordinal), mask);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,6 +4,7 @@ import com.fastasyncworldedit.core.extent.filter.block.CharFilterBlock;
|
||||
import com.fastasyncworldedit.core.queue.Filter;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import jdk.incubator.vector.ShortVector;
|
||||
import jdk.incubator.vector.VectorMask;
|
||||
import jdk.incubator.vector.VectorSpecies;
|
||||
|
||||
public class VectorizedCharFilterBlock extends CharFilterBlock {
|
||||
@ -18,15 +19,17 @@ public class VectorizedCharFilterBlock extends CharFilterBlock {
|
||||
throw new IllegalStateException("Unexpected VectorizedCharFilterBlock " + filter);
|
||||
}
|
||||
final VectorSpecies<Short> species = ShortVector.SPECIES_PREFERRED;
|
||||
// TODO can we avoid eager initSet?
|
||||
initSet(); // set array is null before
|
||||
char[] setArr = this.setArr;
|
||||
assert setArr != null;
|
||||
char[] getArr = this.getArr;
|
||||
// assume setArr.length == getArr.length == 4096
|
||||
VectorMask<Short> affectAll = species.maskAll(true);
|
||||
for (int i = 0; i < 4096; i += species.length()) {
|
||||
ShortVector set = ShortVector.fromCharArray(species, setArr, i);
|
||||
ShortVector get = ShortVector.fromCharArray(species, getArr, i);
|
||||
ShortVector res = vecFilter.applyVector(get, set);
|
||||
ShortVector res = vecFilter.applyVector(get, set, affectAll);
|
||||
res.intoCharArray(setArr, i);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,18 @@ package com.fastasyncworldedit.core.internal.simd;
|
||||
|
||||
import com.fastasyncworldedit.core.queue.Filter;
|
||||
import jdk.incubator.vector.ShortVector;
|
||||
import jdk.incubator.vector.VectorMask;
|
||||
|
||||
public interface VectorizedFilter extends Filter {
|
||||
ShortVector applyVector(ShortVector get, ShortVector set);
|
||||
|
||||
/**
|
||||
* Applies a filter to a vector pair of get and set.
|
||||
*
|
||||
* @param get the get vector
|
||||
* @param set the set vector
|
||||
* @param mask the mask with the lanes set to true which should be affected by the filter
|
||||
* @return the resulting set vector.
|
||||
*/
|
||||
ShortVector applyVector(ShortVector get, ShortVector set, VectorMask<Short> mask);
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.fastasyncworldedit.core.internal.simd;
|
||||
import com.fastasyncworldedit.core.queue.IChunk;
|
||||
import com.fastasyncworldedit.core.queue.IChunkGet;
|
||||
import com.fastasyncworldedit.core.queue.IChunkSet;
|
||||
import com.sk89q.worldedit.world.block.BlockTypesCache;
|
||||
import jdk.incubator.vector.ShortVector;
|
||||
import jdk.incubator.vector.VectorMask;
|
||||
import jdk.incubator.vector.VectorSpecies;
|
||||
@ -31,10 +32,22 @@ public interface VectorizedMask {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the set vector with all lanes that do not match this mask set to 0}
|
||||
*
|
||||
* @param set the set vector
|
||||
* @param get the get vector
|
||||
*/
|
||||
default ShortVector processVector(ShortVector set, ShortVector get) {
|
||||
return set.blend(0, compareVector(set, get).not());
|
||||
return set.blend(BlockTypesCache.ReservedIDs.__RESERVED__, compareVector(set, get).not());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return a mask with all lanes set that match this mask}
|
||||
*
|
||||
* @param set the set vector
|
||||
* @param get the get vector
|
||||
*/
|
||||
VectorMask<Short> compareVector(ShortVector set, ShortVector get);
|
||||
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ public class FaweLimit {
|
||||
/**
|
||||
* Get an {@link FaweLimit} representing the amount of a limit used from a given "original" limit
|
||||
*
|
||||
* @since TODO
|
||||
* @since 2.12.0
|
||||
*/
|
||||
public FaweLimit getLimitUsed(FaweLimit originalLimit) {
|
||||
FaweLimit newLimit = new FaweLimit();
|
||||
|
@ -924,7 +924,7 @@ public class ChunkHolder<T extends Future<T>> implements IQueueChunk<T> {
|
||||
|
||||
@Override
|
||||
public boolean tile(final int x, final int y, final int z, final FaweCompoundTag tag) {
|
||||
return false;
|
||||
return delegate.set(this).tile(x, y, z, tag);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -216,7 +216,7 @@ public final class NbtUtils {
|
||||
* {@return the position data of the given tag}
|
||||
*
|
||||
* @param compoundTag the tag to extract position information from
|
||||
* @since TODO
|
||||
* @since 2.12.0
|
||||
*/
|
||||
public static Vector3 entityPosition(FaweCompoundTag compoundTag) {
|
||||
LinListTag<LinDoubleTag> pos = compoundTag.linTag().getListTag("Pos", LinTagType.doubleTag());
|
||||
|
@ -44,7 +44,7 @@ public interface Brush {
|
||||
/**
|
||||
* If this brush is expected to set blocks synchronously, i.e. from one thread (at a time)
|
||||
*
|
||||
* @since TODO
|
||||
* @since 2.12.0
|
||||
*/
|
||||
default boolean setsSynchronously() {
|
||||
return true;
|
||||
|
@ -10,7 +10,7 @@ import java.lang.annotation.Target;
|
||||
/**
|
||||
* Indicates it is expected that blocks will only be set synchronously, i.e. from one thread (at a time)
|
||||
*
|
||||
* @since TODO
|
||||
* @since 2.12.0
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({
|
||||
|
@ -465,6 +465,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
if (state == null) {
|
||||
throw new NoMatchException(Caption.of("fawe.error.invalid-block-type", TextComponent.of(input)));
|
||||
}
|
||||
nbt = state.getNbtData();
|
||||
}
|
||||
//FAWE end
|
||||
|
||||
|
@ -100,7 +100,7 @@ dependencies {
|
||||
}
|
||||
|
||||
// No need for this at runtime
|
||||
"modCompileOnly"("me.lucko:fabric-permissions-api:0.3.1")
|
||||
"modCompileOnly"("me.lucko:fabric-permissions-api:0.3.2")
|
||||
|
||||
// Hook these up manually, because Fabric doesn't seem to quite do it properly.
|
||||
"compileOnly"("net.fabricmc:sponge-mixin:${project.versions.mixin}")
|
||||
|
@ -28,7 +28,7 @@ dependencies {
|
||||
})
|
||||
api("org.apache.logging.log4j:log4j-api")
|
||||
api("org.bstats:bstats-sponge:1.7")
|
||||
testImplementation("org.mockito:mockito-core:5.14.1")
|
||||
testImplementation("org.mockito:mockito-core:5.14.2")
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
Loading…
Reference in New Issue
Block a user