Skip to content

Commit

Permalink
Merge branch 'main' into v3
Browse files Browse the repository at this point in the history
# Conflicts:
#	worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/TransformExtent.java
#	worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/RandomPattern.java
  • Loading branch information
dordsor21 committed Jun 7, 2024
2 parents fbb8a9b + c095c49 commit 111eebe
Show file tree
Hide file tree
Showing 363 changed files with 5,415 additions and 3,637 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ body:
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
multiple: false
options:
- '1.20.4'
- '1.20.5/6'
- '1.20'
- '1.19.4'
- '1.18.2'
validations:
required: true

Expand Down
3 changes: 2 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema" : "https://docs.renovatebot.com/renovate-schema.json",
"extends" : [
"config:recommended",
":semanticCommitsDisabled"
":semanticCommitsDisabled",
"schedule:earlyMondays"
],
"automerge" : true,
"ignoreDeps" : [
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
cache: gradle
java-version: 17
java-version: 21
- name: Build on ${{ matrix.os }}
run: ./gradlew build -s
- name: Archive artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
cache: gradle
java-version: 17
java-version: 21
- name: Clean Build
run: ./gradlew clean build --no-daemon
- name: Determine release status
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
distribution: temurin
cache: gradle
java-version: 17
java-version: 21
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-merge-conflicts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Label conflicting PRs
uses: eps1lon/[email protected].0
uses: eps1lon/[email protected].2
with:
dirtyLabel: "unresolved-merge-conflict"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
cache: gradle
java-version: 17
java-version: 21
- name: Clean Build
run: ./gradlew clean build --no-daemon
- name: Upload Release Assets
Expand Down
6 changes: 3 additions & 3 deletions COMPILING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

= Compiling

You can compile FastAsyncWorldEdit as long as you have some version of Java greater than or equal to 17 installed. Gradle will download JDK 17 specifically if needed,
You can compile FastAsyncWorldEdit as long as you have some version of Java greater than or equal to 21 installed. Gradle will download JDK 21 specifically if needed,
but it needs some version of Java to bootstrap from.

Note that if you have JRE 8 installed, Gradle will currently attempt to use that to compile, which will not work. It is easiest to uninstall JRE 8 and replace it with JDK 17.
Note that if you have JRE 8 installed, Gradle will currently attempt to use that to compile, which will not work. It is easiest to uninstall JRE 8 and replace it with JDK 21.

You can get the JDK 17 link:https://adoptium.net/[here] from Adoptium.
You can get the JDK 21 link:https://adoptium.net/[here] from Adoptium.

The build process uses Gradle, which you do *not* need to download. FastAsyncWorldEdit is a multi-module project with three active modules:

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pipeline {
stage('Build') {
steps {
withEnv([
"PATH+JAVA=${tool 'Temurin-17.0.7_7'}/bin"
"PATH+JAVA=${tool 'Temurin-21.0.3_9'}/bin"
]) {
sh './gradlew clean build'
}
Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import java.time.format.DateTimeFormatter
import xyz.jpenilla.runpaper.task.RunServer

plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("xyz.jpenilla.run-paper") version "2.2.3"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("xyz.jpenilla.run-paper") version "2.3.0"
}

if (!File("$rootDir/.git").exists()) {
Expand All @@ -34,7 +34,7 @@ logger.lifecycle("""
*******************************************
""")

var rootVersion by extra("2.9.2")
var rootVersion by extra("2.10.1")
var snapshot by extra("SNAPSHOT")
var revision: String by extra("")
var buildNumber by extra("")
Expand Down Expand Up @@ -83,7 +83,7 @@ allprojects {
}

applyCommonConfiguration()
val supportedVersions = listOf("1.18.2", "1.19.4", "1.20", "1.20.4")
val supportedVersions = listOf("1.19.4", "1.20", "1.20.4", "1.20.5", "1.20.6")

tasks {
supportedVersions.forEach {
Expand Down
16 changes: 14 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@ dependencies {
implementation(gradleApi())
implementation("org.ajoberstar.grgit:grgit-gradle:5.2.2")
implementation("com.github.johnrengelman:shadow:8.1.1")
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.5.11")
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.7.1")
constraints {
val asmVersion = "[9.7,)"
implementation("org.ow2.asm:asm:$asmVersion") {
because("Need Java 21 support in shadow")
}
implementation("org.ow2.asm:asm-commons:$asmVersion") {
because("Need Java 21 support in shadow")
}
implementation("org.vafer:jdependency:[2.10,)") {
because("Need Java 21 support in shadow")
}
}
}

kotlin {
jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(17))
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(21))
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/CommonConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fun Project.applyCommonConfiguration() {

plugins.withId("java") {
the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/CommonJavaConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean
.matching { it.name == "compileJava" || it.name == "compileTestJava" }
.configureEach {
val disabledLint = listOf(
"processing", "path", "fallthrough", "serial"
"processing", "path", "fallthrough", "serial", "overloads", "this-escape",
)
options.release.set(17)
options.compilerArgs.addAll(listOf("-Xlint:all") + disabledLint.map { "-Xlint:-$it" })
Expand All @@ -31,7 +31,7 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean
}

configurations.all {
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21)
}

tasks.withType<Test>().configureEach {
Expand Down Expand Up @@ -61,7 +61,7 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean
"https://jd.advntr.dev/api/latest/",
"https://logging.apache.org/log4j/2.x/javadoc/log4j-api/",
"https://www.antlr.org/api/Java/",
"https://jd.papermc.io/paper/1.20/",
"https://jd.papermc.io/paper/1.20.6/",
"https://intellectualsites.github.io/fastasyncworldedit-javadocs/worldedit-core/"
)
docTitle = "${rootProject.name}-${project.description}" + " " + "${rootProject.version}"
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/LibsConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fun Project.applyLibrariesConfiguration() {
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.SHADOWED))
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21)
}
outgoing.artifact(tasks.named("jar"))
}
Expand All @@ -137,7 +137,7 @@ fun Project.applyLibrariesConfiguration() {
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.SHADOWED))
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21)
}
outgoing.artifact(tasks.named("jar"))
}
Expand Down
26 changes: 13 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
# Minecraft expectations
paper = "1.20.4-R0.1-SNAPSHOT"
paper = "1.20.6-R0.1-SNAPSHOT"
fastutil = "8.5.9"
guava = "31.1-jre"
log4j = "2.19.0"
Expand All @@ -9,44 +9,44 @@ snakeyaml = "2.0"

# Plugins
dummypermscompat = "1.10"
worldguard-bukkit = "7.0.9"
worldguard-bukkit = "7.0.10"
mapmanager = "1.8.0-SNAPSHOT"
griefprevention = "17.0.0"
griefdefender = "2.1.0-SNAPSHOT"
residence = "4.5._13.1"
towny = "0.100.1.23"
plotsquared = "7.3.6"
towny = "0.100.2.12"
plotsquared = "7.3.8"

# Third party
bstats = "3.0.2"
sparsebitset = "1.3"
parallelgzip = "1.0.5"
adventure = "4.16.0"
adventure-bukkit = "4.3.2"
checkerqual = "3.42.0"
adventure = "4.17.0"
adventure-bukkit = "4.3.3"
checkerqual = "3.43.0"
truezip = "6.8.4"
auto-value = "1.10.4"
findbugs = "3.0.2"
rhino-runtime = "1.7.14"
rhino-runtime = "1.7.15"
zstd-jni = "1.4.8-1" # Not latest as it can be difficult to obtain latest ZSTD libs
antlr4 = "4.13.1"
json-simple = "1.1.1"
jlibnoise = "1.0.0"
jchronic = "0.2.4a"
lz4-java = "1.8.0"
lz4-stream = "1.0.0"
commons-cli = "1.6.0"
commons-cli = "1.8.0"
paperlib = "1.0.8"
paster = "1.1.5"
paster = "1.1.6"
vault = "1.7.1"
serverlib = "2.3.4"
serverlib = "2.3.6"
## Internal
text-adapter = "3.0.6"
text = "3.0.4"
piston = "0.5.8"
piston = "0.5.10"

# Tests
mockito = "5.11.0"
mockito = "5.12.0"

# Gradle plugins
pluginyml = "0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ rootProject.name = "FastAsyncWorldEdit"

include("worldedit-libs")

listOf("1_18_2", "1_19_4", "1_20", "1_20_2", "1_20_4").forEach {
listOf("1_19_4", "1_20", "1_20_2", "1_20_4", "1_20_5").forEach {
include("worldedit-bukkit:adapters:adapter-$it")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.google.common.util.concurrent.Futures;
import com.mojang.datafixers.util.Either;
import com.mojang.serialization.Lifecycle;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.NBTConstants;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.BaseItem;
Expand Down Expand Up @@ -531,7 +530,7 @@ public Property<?> load(net.minecraft.world.level.block.state.properties.Propert
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundBinaryTag nbtData) {
((CraftPlayer) player).getHandle().connection.send(ClientboundBlockEntityDataPacket.create(
new StructureBlockEntity(
new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()),
new BlockPos(pos.x(), pos.y(), pos.z()),
Blocks.STRUCTURE_BLOCK.defaultBlockState()
),
__ -> (net.minecraft.nbt.CompoundTag) fromNativeBinary(nbtData)
Expand Down Expand Up @@ -581,10 +580,10 @@ public boolean simulateItemUse(org.bukkit.World world, BlockVector3 position, Ba
return false;
}
fakePlayer.setItemInHand(InteractionHand.MAIN_HAND, stack);
fakePlayer.absMoveTo(position.getBlockX(), position.getBlockY(), position.getBlockZ(),
fakePlayer.absMoveTo(position.x(), position.y(), position.z(),
(float) face.toVector().toYaw(), (float) face.toVector().toPitch());

final BlockPos blockPos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ());
final BlockPos blockPos = new BlockPos(position.x(), position.y(), position.z());
final Vec3 blockVec = Vec3.atLowerCornerOf(blockPos);
final net.minecraft.core.Direction enumFacing = adapt(face);
BlockHitResult rayTrace = new BlockHitResult(blockVec, enumFacing, blockPos, false);
Expand All @@ -605,7 +604,7 @@ public boolean simulateItemUse(org.bukkit.World world, BlockVector3 position, Ba
public boolean canPlaceAt(org.bukkit.World world, BlockVector3 position, BlockState blockState) {
int internalId = BlockStateIdAccess.getBlockStateId(blockState);
net.minecraft.world.level.block.state.BlockState blockData = Block.stateById(internalId);
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.getX(), position.getY(), position.getZ()));
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.x(), position.y(), position.z()));
}

@Override
Expand Down Expand Up @@ -725,7 +724,7 @@ private void regenForWorld(Region region, Extent extent, ServerLevel serverWorld
}

for (BlockVector3 vec : region) {
BlockPos pos = new BlockPos(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ());
BlockPos pos = new BlockPos(vec.x(), vec.y(), vec.z());
ChunkAccess chunk = chunks.get(new ChunkPos(pos));
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(pos);
int internalId = Block.getId(blockData);
Expand All @@ -738,7 +737,7 @@ private void regenForWorld(Region region, Extent extent, ServerLevel serverWorld
}
extent.setBlock(vec, state.toBaseBlock());
if (options.shouldRegenBiomes()) {
Biome origBiome = chunk.getNoiseBiome(vec.getX(), vec.getY(), vec.getZ()).value();
Biome origBiome = chunk.getNoiseBiome(vec.x(), vec.y(), vec.z()).value();
BiomeType adaptedBiome = adapt(serverWorld, origBiome);
if (adaptedBiome != null) {
extent.setBiome(vec, adaptedBiome);
Expand All @@ -757,7 +756,7 @@ private List<CompletableFuture<ChunkAccess>> submitChunkLoadTasks(Region region,
//noinspection unchecked
chunkLoadings.add(
((CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>)
getChunkFutureMethod.invoke(chunkManager, chunk.getX(), chunk.getZ(), ChunkStatus.FEATURES, true))
getChunkFutureMethod.invoke(chunkManager, chunk.x(), chunk.z(), ChunkStatus.FEATURES, true))
.thenApply(either -> either.left().orElse(null))
);
} catch (IllegalAccessException | InvocationTargetException e) {
Expand Down Expand Up @@ -797,7 +796,7 @@ public Set<SideEffect> getSupportedSideEffects() {
public boolean clearContainerBlockContents(org.bukkit.World world, BlockVector3 pt) {
ServerLevel originalWorld = ((CraftWorld) world).getHandle();

BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()));
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.x(), pt.y(), pt.z()));
if (entity instanceof Clearable) {
((Clearable) entity).clearContent();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public boolean canPlaceAt(org.bukkit.World world, BlockVector3 blockVector3, Blo
net.minecraft.world.level.block.state.BlockState blockState1 = Block.stateById(internalId);
return blockState1.hasPostProcess(
getServerLevel(world),
new BlockPos(blockVector3.getX(), blockVector3.getY(), blockVector3.getZ())
new BlockPos(blockVector3.x(), blockVector3.y(), blockVector3.z())
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,9 @@ public synchronized <T extends Future<T>> T call(IChunkSet set, Runnable finaliz
for (final Map.Entry<BlockVector3, CompoundTag> entry : tiles.entrySet()) {
final CompoundTag nativeTag = entry.getValue();
final BlockVector3 blockHash = entry.getKey();
final int x = blockHash.getX() + bx;
final int y = blockHash.getY();
final int z = blockHash.getZ() + bz;
final int x = blockHash.x() + bx;
final int y = blockHash.y();
final int z = blockHash.z() + bz;
final BlockPos pos = new BlockPos(x, y, z);

synchronized (nmsWorld) {
Expand Down
Loading

0 comments on commit 111eebe

Please sign in to comment.