diff --git a/build.gradle.kts b/build.gradle.kts index adab2bddb..824a50ad1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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("") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index f0d72abd4..c45d410c7 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -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") { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a11448070..e1f5f0dd8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" diff --git a/worldedit-bukkit/adapters/adapter-1_21/build.gradle.kts b/worldedit-bukkit/adapters/adapter-1_21/build.gradle.kts index 4face9389..a2b3da35a 100644 --- a/worldedit-bukkit/adapters/adapter-1_21/build.gradle.kts +++ b/worldedit-bukkit/adapters/adapter-1_21/build.gradle.kts @@ -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().paperDevBundle("1.21.1-R0.1-20241012.212042-119") + the().paperDevBundle("1.21.1-R0.1-20241021.162528-124") compileOnly(libs.paperlib) } diff --git a/worldedit-bukkit/adapters/adapter-1_21/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/v1_21_R1/PaperweightAdapter.java b/worldedit-bukkit/adapters/adapter-1_21/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/v1_21_R1/PaperweightAdapter.java index b958c8ba7..125d000bf 100644 --- a/worldedit-bukkit/adapters/adapter-1_21/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/v1_21_R1/PaperweightAdapter.java +++ b/worldedit-bukkit/adapters/adapter-1_21/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/v1_21_R1/PaperweightAdapter.java @@ -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 boolean setSectionAtomic( String worldName, @@ -212,7 +212,7 @@ public class NMSAdapter implements FAWEPlatformAdapterImpl { *

* Utilises ConcurrentHashMap#compute for easy synchronisation * - * @since TODO + * @since 2.12.0 */ protected static void beginChunkPacketSend(String worldName, IntPair pair, StampLockHolder stampedLock) { ConcurrentHashMap 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 chunks = FaweBukkitWorld.getWorldSendingChunksMap(worldName); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/LimitExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/LimitExtent.java index 0bef1afc2..90ca09810 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/LimitExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/LimitExtent.java @@ -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 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, diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LinearClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LinearClipboard.java index cc0bb07f6..7d60f3ee4 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LinearClipboard.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/LinearClipboard.java @@ -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 getTileEntities(); @Override diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/CountFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/CountFilter.java index f6844e684..7c6767bf2 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/CountFilter.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/CountFilter.java @@ -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 implements VectorizedFilter { @@ -36,8 +37,8 @@ public class CountFilter extends ForkedFilter 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 mask) { + total += mask.trueCount(); return set; } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/LinkedFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/LinkedFilter.java index 26700ccc5..ff57a4625 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/LinkedFilter.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/LinkedFilter.java @@ -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 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 mask) { + ShortVector res = getLeft().applyVector(get, set, mask); + return getRight().applyVector(get, res, mask); } @Override diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/MaskFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/MaskFilter.java index ac31938e2..2ce1527df 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/MaskFilter.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/filter/MaskFilter.java @@ -82,11 +82,10 @@ public class MaskFilter extends DelegateFilter { } @Override - public ShortVector applyVector(final ShortVector get, final ShortVector set) { + public ShortVector applyVector(final ShortVector get, final ShortVector set, VectorMask mask) { final T parent = getParent(); VectorMask 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 changed = res.compare(VectorOperators.NE, set); changes.getAndAdd(changed.trueCount()); return res; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/SimdSupport.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/SimdSupport.java index 5f2d6a711..eefdc1929 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/SimdSupport.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/SimdSupport.java @@ -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 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 diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedCharFilterBlock.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedCharFilterBlock.java index 5c15da22a..9f557b134 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedCharFilterBlock.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedCharFilterBlock.java @@ -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 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 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); } } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedFilter.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedFilter.java index 7357bbd59..b0801fcd0 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedFilter.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedFilter.java @@ -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 mask); + } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedMask.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedMask.java index 0f453f32b..a6fd18b48 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedMask.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/internal/simd/VectorizedMask.java @@ -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 compareVector(ShortVector set, ShortVector get); } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/limit/FaweLimit.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/limit/FaweLimit.java index 2bb002914..0dde6baac 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/limit/FaweLimit.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/limit/FaweLimit.java @@ -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(); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/ChunkHolder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/ChunkHolder.java index 7c36eb94c..5e951cd2b 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/ChunkHolder.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/chunk/ChunkHolder.java @@ -924,7 +924,7 @@ public class ChunkHolder> implements IQueueChunk { @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); } /** diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/util/NbtUtils.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/util/NbtUtils.java index 8b427c322..07a047360 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/util/NbtUtils.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/util/NbtUtils.java @@ -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 pos = compoundTag.linTag().getListTag("Pos", LinTagType.doubleTag()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/Brush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/Brush.java index e38ae0d99..938a2f8dd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/Brush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/Brush.java @@ -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; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/annotation/SynchronousSettingExpected.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/annotation/SynchronousSettingExpected.java index 3cc936fda..6d94fb3ff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/annotation/SynchronousSettingExpected.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/annotation/SynchronousSettingExpected.java @@ -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({ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java index 03cfb51e3..7ef47de45 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java @@ -465,6 +465,7 @@ public class DefaultBlockParser extends InputParser { if (state == null) { throw new NoMatchException(Caption.of("fawe.error.invalid-block-type", TextComponent.of(input))); } + nbt = state.getNbtData(); } //FAWE end diff --git a/worldedit-fabric/build.gradle.kts b/worldedit-fabric/build.gradle.kts index 4ba08c6eb..9f785fd6d 100644 --- a/worldedit-fabric/build.gradle.kts +++ b/worldedit-fabric/build.gradle.kts @@ -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}") diff --git a/worldedit-sponge/build.gradle.kts b/worldedit-sponge/build.gradle.kts index fedd48c00..356a4d635 100644 --- a/worldedit-sponge/build.gradle.kts +++ b/worldedit-sponge/build.gradle.kts @@ -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