Telesphoreo 2024-11-03 14:25:00 -06:00
commit f054d29656
23 changed files with 69 additions and 38 deletions

View File

@ -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 snapshot by extra("SNAPSHOT")
var revision: String by extra("") var revision: String by extra("")
var buildNumber by extra("") var buildNumber by extra("")

View File

@ -28,7 +28,7 @@ dependencies {
implementation(gradleApi()) implementation(gradleApi())
implementation("org.ajoberstar.grgit:grgit-gradle:5.3.0") implementation("org.ajoberstar.grgit:grgit-gradle:5.3.0")
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.3") 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 { constraints {
val asmVersion = "[9.7,)" val asmVersion = "[9.7,)"
implementation("org.ow2.asm:asm:$asmVersion") { implementation("org.ow2.asm:asm:$asmVersion") {

View File

@ -14,8 +14,8 @@ mapmanager = "1.8.0-SNAPSHOT"
griefprevention = "17.0.0" griefprevention = "17.0.0"
griefdefender = "2.1.0-SNAPSHOT" griefdefender = "2.1.0-SNAPSHOT"
residence = "4.5._13.1" residence = "4.5._13.1"
towny = "0.100.4.4" towny = "0.100.4.7"
plotsquared = "7.3.11" plotsquared = "7.3.12"
# Third party # Third party
bstats = "3.1.0" bstats = "3.1.0"
@ -23,7 +23,7 @@ sparsebitset = "1.3"
parallelgzip = "1.0.5" parallelgzip = "1.0.5"
adventure = "4.17.0" adventure = "4.17.0"
adventure-bukkit = "4.3.4" adventure-bukkit = "4.3.4"
checkerqual = "3.47.0" checkerqual = "3.48.1"
truezip = "6.8.4" truezip = "6.8.4"
auto-value = "1.11.0" auto-value = "1.11.0"
findbugs = "3.0.2" findbugs = "3.0.2"
@ -40,14 +40,14 @@ paperlib = "1.0.8"
paster = "1.1.6" paster = "1.1.6"
vault = "1.7.1" vault = "1.7.1"
serverlib = "2.3.6" serverlib = "2.3.6"
linbus = "0.1.2" linbus = "0.2.0"
## Internal ## Internal
text-adapter = "3.0.6" text-adapter = "3.0.6"
text = "3.0.4" text = "3.0.4"
piston = "0.5.10" piston = "0.5.10"
# Tests # Tests
mockito = "5.14.1" mockito = "5.14.2"
# Gradle plugins # Gradle plugins
pluginyml = "0.6.0" pluginyml = "0.6.0"

View File

@ -12,6 +12,6 @@ repositories {
dependencies { dependencies {
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.21.1-R0.1-SNAPSHOT/ // 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) compileOnly(libs.paperlib)
} }

View File

@ -65,6 +65,7 @@ import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.entity.EntityTypes; import com.sk89q.worldedit.world.entity.EntityTypes;
import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemType;
import net.minecraft.SharedConstants;
import net.minecraft.Util; import net.minecraft.Util;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder; 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.CraftEntity;
import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
@ -194,7 +194,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
// A simple test // A simple test
CraftServer.class.cast(Bukkit.getServer()); CraftServer.class.cast(Bukkit.getServer());
int dataVersion = CraftMagicNumbers.INSTANCE.getDataVersion(); int dataVersion = SharedConstants.getCurrentVersion().getDataVersion().getVersion();
if (dataVersion != 3953 && dataVersion != 3955) { if (dataVersion != 3953 && dataVersion != 3955) {
throw new UnsupportedClassVersionError("Not 1.21(.1)!"); throw new UnsupportedClassVersionError("Not 1.21(.1)!");
} }
@ -213,7 +213,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
); );
chunkProviderExecutorField.setAccessible(true); chunkProviderExecutorField.setAccessible(true);
this.dataFixer = new PaperweightDataConverters(CraftMagicNumbers.INSTANCE.getDataVersion(), this); this.dataFixer = new PaperweightDataConverters(dataVersion, this);
Watchdog watchdog; Watchdog watchdog;
try { try {

View File

@ -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 * Utilises ConcurrentHashMap#compute for easy synchronisation for all of the above. Only tryWriteLock is used in blocks
* synchronised using ConcurrentHashMap methods. * synchronised using ConcurrentHashMap methods.
* *
* @since TODO * @since 2.12.0
*/ */
protected static <LevelChunkSection> boolean setSectionAtomic( protected static <LevelChunkSection> boolean setSectionAtomic(
String worldName, String worldName,
@ -212,7 +212,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl {
* <p> * <p>
* Utilises ConcurrentHashMap#compute for easy synchronisation * Utilises ConcurrentHashMap#compute for easy synchronisation
* *
* @since TODO * @since 2.12.0
*/ */
protected static void beginChunkPacketSend(String worldName, IntPair pair, StampLockHolder stampedLock) { protected static void beginChunkPacketSend(String worldName, IntPair pair, StampLockHolder stampedLock) {
ConcurrentHashMap<IntPair, ChunkSendLock> chunks = FaweBukkitWorld.getWorldSendingChunksMap(worldName); 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 * 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) { protected static void endChunkPacketSend(String worldName, IntPair pair, StampLockHolder lockHolder) {
ConcurrentHashMap<IntPair, ChunkSendLock> chunks = FaweBukkitWorld.getWorldSendingChunksMap(worldName); ConcurrentHashMap<IntPair, ChunkSendLock> chunks = FaweBukkitWorld.getWorldSendingChunksMap(worldName);

View File

@ -55,7 +55,7 @@ public class LimitExtent extends AbstractDelegateExtent implements IBatchProcess
* @param limit the limit * @param limit the limit
* @deprecated Use {@link LimitExtent#LimitExtent(Extent, FaweLimit, Consumer, boolean)} * @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) { public LimitExtent(Extent extent, FaweLimit limit) {
this(extent, limit, c -> { 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 * @param onErrorMessage consumer to handle a component generated by exceptions
* @deprecated Use {@link LimitExtent#LimitExtent(Extent, FaweLimit, Consumer, boolean)} * @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) { public LimitExtent(Extent extent, FaweLimit limit, Consumer<Component> onErrorMessage) {
this(extent, limit, onErrorMessage, false); this(extent, limit, onErrorMessage, false);
} }
@ -81,7 +81,7 @@ public class LimitExtent extends AbstractDelegateExtent implements IBatchProcess
* @param limit the limit * @param limit the limit
* @param onErrorMessage consumer to handle a component generated by exceptions * @param onErrorMessage consumer to handle a component generated by exceptions
* @param processing if this limit extent is expected to be processing * @param processing if this limit extent is expected to be processing
* @since TODO * @since 2.12.0
*/ */
public LimitExtent( public LimitExtent(
Extent extent, Extent extent,

View File

@ -60,7 +60,7 @@ public abstract class LinearClipboard extends SimpleClipboard {
/** /**
* @deprecated will be removed as it is unused and uses outdated types * @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(); public abstract Collection<CompoundTag> getTileEntities();
@Override @Override

View File

@ -3,6 +3,7 @@ package com.fastasyncworldedit.core.extent.filter;
import com.fastasyncworldedit.core.extent.filter.block.FilterBlock; import com.fastasyncworldedit.core.extent.filter.block.FilterBlock;
import com.fastasyncworldedit.core.internal.simd.VectorizedFilter; import com.fastasyncworldedit.core.internal.simd.VectorizedFilter;
import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.ShortVector;
import jdk.incubator.vector.VectorMask;
public class CountFilter extends ForkedFilter<CountFilter> implements VectorizedFilter { public class CountFilter extends ForkedFilter<CountFilter> implements VectorizedFilter {
@ -36,8 +37,8 @@ public class CountFilter extends ForkedFilter<CountFilter> implements Vectorized
} }
@Override @Override
public ShortVector applyVector(final ShortVector get, final ShortVector set) { public ShortVector applyVector(final ShortVector get, final ShortVector set, VectorMask<Short> mask) {
total += set.length(); total += mask.trueCount();
return set; return set;
} }

View File

@ -6,6 +6,7 @@ import com.fastasyncworldedit.core.queue.Filter;
import com.fastasyncworldedit.core.queue.IChunk; import com.fastasyncworldedit.core.queue.IChunk;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.ShortVector;
import jdk.incubator.vector.VectorMask;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
/** /**
@ -77,9 +78,9 @@ public sealed class LinkedFilter<L extends Filter, R extends Filter> implements
} }
@Override @Override
public ShortVector applyVector(final ShortVector get, final ShortVector set) { public ShortVector applyVector(final ShortVector get, final ShortVector set, VectorMask<Short> mask) {
ShortVector res = getLeft().applyVector(get, set); ShortVector res = getLeft().applyVector(get, set, mask);
return getRight().applyVector(get, res); return getRight().applyVector(get, res, mask);
} }
@Override @Override

View File

@ -82,11 +82,10 @@ public class MaskFilter<T extends Filter> extends DelegateFilter<T> {
} }
@Override @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(); final T parent = getParent();
VectorMask<Short> masked = vectorizedMask.compareVector(set, get); VectorMask<Short> masked = vectorizedMask.compareVector(set, get);
ShortVector res = parent.applyVector(get, set); ShortVector res = parent.applyVector(get, set, mask.and(masked));
res = set.blend(res, masked);
VectorMask<Short> changed = res.compare(VectorOperators.NE, set); VectorMask<Short> changed = res.compare(VectorOperators.NE, set);
changes.getAndAdd(changed.trueCount()); changes.getAndAdd(changed.trueCount());
return res; return res;

View File

@ -14,6 +14,7 @@ import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.block.BlockTypesCache;
import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.ShortVector;
import jdk.incubator.vector.VectorMask;
import jdk.incubator.vector.VectorOperators; import jdk.incubator.vector.VectorOperators;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -101,8 +102,9 @@ public class SimdSupport {
} }
@Override @Override
public ShortVector applyVector(final ShortVector get, final ShortVector set) { public ShortVector applyVector(final ShortVector get, final ShortVector set, VectorMask<Short> mask) {
return ShortVector.broadcast(ShortVector.SPECIES_PREFERRED, ordinal); // only change the lanes the mask dictates us to change, keep the rest
return set.blend(ShortVector.broadcast(ShortVector.SPECIES_PREFERRED, ordinal), mask);
} }
@Override @Override

View File

@ -4,6 +4,7 @@ import com.fastasyncworldedit.core.extent.filter.block.CharFilterBlock;
import com.fastasyncworldedit.core.queue.Filter; import com.fastasyncworldedit.core.queue.Filter;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.ShortVector;
import jdk.incubator.vector.VectorMask;
import jdk.incubator.vector.VectorSpecies; import jdk.incubator.vector.VectorSpecies;
public class VectorizedCharFilterBlock extends CharFilterBlock { public class VectorizedCharFilterBlock extends CharFilterBlock {
@ -18,15 +19,17 @@ public class VectorizedCharFilterBlock extends CharFilterBlock {
throw new IllegalStateException("Unexpected VectorizedCharFilterBlock " + filter); throw new IllegalStateException("Unexpected VectorizedCharFilterBlock " + filter);
} }
final VectorSpecies<Short> species = ShortVector.SPECIES_PREFERRED; final VectorSpecies<Short> species = ShortVector.SPECIES_PREFERRED;
// TODO can we avoid eager initSet?
initSet(); // set array is null before initSet(); // set array is null before
char[] setArr = this.setArr; char[] setArr = this.setArr;
assert setArr != null; assert setArr != null;
char[] getArr = this.getArr; char[] getArr = this.getArr;
// assume setArr.length == getArr.length == 4096 // assume setArr.length == getArr.length == 4096
VectorMask<Short> affectAll = species.maskAll(true);
for (int i = 0; i < 4096; i += species.length()) { for (int i = 0; i < 4096; i += species.length()) {
ShortVector set = ShortVector.fromCharArray(species, setArr, i); ShortVector set = ShortVector.fromCharArray(species, setArr, i);
ShortVector get = ShortVector.fromCharArray(species, getArr, 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); res.intoCharArray(setArr, i);
} }
} }

View File

@ -2,7 +2,18 @@ package com.fastasyncworldedit.core.internal.simd;
import com.fastasyncworldedit.core.queue.Filter; import com.fastasyncworldedit.core.queue.Filter;
import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.ShortVector;
import jdk.incubator.vector.VectorMask;
public interface VectorizedFilter extends Filter { 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);
} }

View File

@ -3,6 +3,7 @@ package com.fastasyncworldedit.core.internal.simd;
import com.fastasyncworldedit.core.queue.IChunk; import com.fastasyncworldedit.core.queue.IChunk;
import com.fastasyncworldedit.core.queue.IChunkGet; import com.fastasyncworldedit.core.queue.IChunkGet;
import com.fastasyncworldedit.core.queue.IChunkSet; import com.fastasyncworldedit.core.queue.IChunkSet;
import com.sk89q.worldedit.world.block.BlockTypesCache;
import jdk.incubator.vector.ShortVector; import jdk.incubator.vector.ShortVector;
import jdk.incubator.vector.VectorMask; import jdk.incubator.vector.VectorMask;
import jdk.incubator.vector.VectorSpecies; 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) { 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); VectorMask<Short> compareVector(ShortVector set, ShortVector get);
} }

View File

@ -299,7 +299,7 @@ public class FaweLimit {
/** /**
* Get an {@link FaweLimit} representing the amount of a limit used from a given "original" limit * 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) { public FaweLimit getLimitUsed(FaweLimit originalLimit) {
FaweLimit newLimit = new FaweLimit(); FaweLimit newLimit = new FaweLimit();

View File

@ -924,7 +924,7 @@ public class ChunkHolder<T extends Future<T>> implements IQueueChunk<T> {
@Override @Override
public boolean tile(final int x, final int y, final int z, final FaweCompoundTag tag) { 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);
} }
/** /**

View File

@ -216,7 +216,7 @@ public final class NbtUtils {
* {@return the position data of the given tag} * {@return the position data of the given tag}
* *
* @param compoundTag the tag to extract position information from * @param compoundTag the tag to extract position information from
* @since TODO * @since 2.12.0
*/ */
public static Vector3 entityPosition(FaweCompoundTag compoundTag) { public static Vector3 entityPosition(FaweCompoundTag compoundTag) {
LinListTag<LinDoubleTag> pos = compoundTag.linTag().getListTag("Pos", LinTagType.doubleTag()); LinListTag<LinDoubleTag> pos = compoundTag.linTag().getListTag("Pos", LinTagType.doubleTag());

View File

@ -44,7 +44,7 @@ public interface Brush {
/** /**
* If this brush is expected to set blocks synchronously, i.e. from one thread (at a time) * 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() { default boolean setsSynchronously() {
return true; return true;

View File

@ -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) * 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) @Retention(RetentionPolicy.RUNTIME)
@Target({ @Target({

View File

@ -465,6 +465,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
if (state == null) { if (state == null) {
throw new NoMatchException(Caption.of("fawe.error.invalid-block-type", TextComponent.of(input))); throw new NoMatchException(Caption.of("fawe.error.invalid-block-type", TextComponent.of(input)));
} }
nbt = state.getNbtData();
} }
//FAWE end //FAWE end

View File

@ -100,7 +100,7 @@ dependencies {
} }
// No need for this at runtime // 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. // Hook these up manually, because Fabric doesn't seem to quite do it properly.
"compileOnly"("net.fabricmc:sponge-mixin:${project.versions.mixin}") "compileOnly"("net.fabricmc:sponge-mixin:${project.versions.mixin}")

View File

@ -28,7 +28,7 @@ dependencies {
}) })
api("org.apache.logging.log4j:log4j-api") api("org.apache.logging.log4j:log4j-api")
api("org.bstats:bstats-sponge:1.7") api("org.bstats:bstats-sponge:1.7")
testImplementation("org.mockito:mockito-core:5.14.1") testImplementation("org.mockito:mockito-core:5.14.2")
} }
<<<<<<< HEAD <<<<<<< HEAD