Merge branch 'IntellectualSites:main' into main

This commit is contained in:
Telesphoreo 2023-04-21 19:41:30 -05:00 committed by GitHub
commit d9b6d04fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 276 additions and 149 deletions

View File

@ -25,5 +25,5 @@
],
"labels": ["Renovate"],
"rebaseWhen": "conflicted",
"schedule": ["on the first day of the week"]
"schedule": ["on the first day of the month"]
}

View File

@ -11,7 +11,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1
uses: gradle/wrapper-validation-action@v1
- name: Setup Java
uses: actions/setup-java@v3
with:

View File

@ -11,7 +11,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1
uses: gradle/wrapper-validation-action@v1
- name: Setup Java
uses: actions/setup-java@v3
with:
@ -44,7 +44,7 @@ jobs:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
- name: Publish core javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 # main
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
@ -56,7 +56,7 @@ jobs:
target-directory: worldedit-core
- name: Publish bukkit javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 # main
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
@ -78,7 +78,7 @@ jobs:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
- name: Publish to CurseForge
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
uses: itsmeow/curseforge-upload@13f278adc4cc7b881555f87e6ea528387dd6492b # v3
uses: itsmeow/curseforge-upload@v3
with:
file_path: worldedit-bukkit/build/libs/FastAsyncWorldEdit-Bukkit-${{ github.event.release.tag_name }}.jar
# https://minecraft.curseforge.com/api/game/versions?token=redacted

View File

@ -19,10 +19,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2
uses: github/codeql-action/analyze@v2

View File

@ -9,7 +9,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1
uses: gradle/wrapper-validation-action@v1
- name: Setup Java
uses: actions/setup-java@v3
with:
@ -19,7 +19,7 @@ jobs:
- name: Clean Build
run: ./gradlew clean build --no-daemon
- name: Upload Release Assets
uses: AButler/upload-release-assets@ec6d3263266dc57eb6645b5f75e827987f7c217d # ratchet:AButler/upload-release-assets@v2.0
uses: AButler/upload-release-assets@v2.0
with:
files: 'worldedit-bukkit/build/libs/FastAsyncWorldEdit-Bukkit-*.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}

140
.idea/icon.svg generated
View File

@ -1,44 +1,112 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="svg2" xml:space="preserve" width="4000" height="3333.3333" viewBox="0 0 4000 3333.3333" sodipodi:docname="FastAsyncWorldEdit.ai">
<metadata id="metadata8">
<svg
version="1.1"
id="svg2"
xml:space="preserve"
width="512"
height="512"
viewBox="0 0 512 512.00001"
sodipodi:docname="icon.svg"
inkscape:version="1.1.2 (b8e25be8, 2022-02-05)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work rdf:about="">
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs id="defs6">
<clipPath clipPathUnits="userSpaceOnUse" id="clipPath18">
<path d="M 0,2500 H 3000 V 0 H 0 Z" id="path16" />
<defs
id="defs6">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath18">
<path
d="M 0,2500 H 3000 V 0 H 0 Z"
id="path16" />
</clipPath>
</defs>
<sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="640" inkscape:window-height="480" id="namedview4" />
<g id="g10" inkscape:groupmode="layer" inkscape:label="FastAsyncWorldEdit" transform="matrix(1.3333333,0,0,-1.3333333,0,3333.3333)">
<g id="g12">
<g id="g14" clip-path="url(#clipPath18)">
<g id="g20" transform="translate(1643.0798,2025.9724)">
<path d="m 0,0 c 34.839,11.026 70.869,18.313 107.28,21.408 18.861,-48.96 46.604,-93.992 77.514,-136.19 49.794,-66.487 110.495,-124.616 178.34,-172.506 78.156,-55.366 165.481,-97.254 256.496,-126.783 83.229,-27.124 169.601,-44.008 256.592,-53.295 -1.047,-153.146 -64.344,-303.076 -167.124,-415.762 -47.77,-52.914 -103.208,-99.136 -164.838,-135.047 -91.873,-53.843 -197.557,-83.896 -304.076,-85.705 -10.764,101.16 -31.91,201.534 -67.273,297.051 -28.243,76.537 -65.678,149.835 -112.853,216.465 -47.865,67.583 -105.685,128.332 -172.125,177.888 -42.102,31.22 -87.348,58.939 -136.404,77.823 3.834,48.628 15.479,96.636 33.625,141.906 19.169,46.769 46.96,90.968 85.752,123.926 C -91.706,-36.816 -46.722,-14.717 0,0" style="fill:#4c8fcc;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path22" />
</g>
<g id="g24" transform="translate(1887.3362,1969.7008)">
<path d="m 0,0 c 20.837,19.313 56.319,19.718 77.228,0.333 32.243,-32.053 64.272,-64.296 96.492,-96.373 17.313,-17.384 20.766,-46.27 8.93,-67.631 -9.073,-15.431 -23.813,-26.314 -35.744,-39.388 -37.339,25.29 -72.917,53.105 -106.637,83.015 -17.122,17.074 -36.316,32.076 -51.771,50.794 -8.525,10.74 -20.432,18.813 -26.457,31.458 C -25.242,-25.242 -12.788,-12.431 0,0" style="fill:#062f4c;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path26" />
</g>
<g id="g28" transform="translate(1463.3822,1497.8577)">
<path d="m 0,0 c -4.644,-0.786 -9.097,-2.786 -12.383,-6.168 -292.384,-292.645 -585.053,-585.029 -877.484,-877.627 -6.74,-6.382 -14.741,-13.145 -14.717,-23.337 -1.262,-12.383 8.668,-21.242 17.384,-28.291 9.882,-6.882 24.552,-4.215 32.481,4.525 293.718,293.693 587.411,587.387 881.104,881.104 10.74,9.049 12.241,27.219 1.929,37.101 C 21.48,-4.406 11.264,2.715 0,0 M -994.266,-946.234 C -647.088,-599.055 -299.885,-251.901 47.27,95.326 84.134,65.44 116.592,30.505 147.502,-5.382 c 23.266,-26.814 43.579,-55.986 64.749,-84.419 -346.679,-346.584 -693.215,-693.286 -1039.941,-1039.822 -20.623,-21.98 -58.439,-23.599 -80.514,-2.953 -32.172,32.149 -64.321,64.345 -96.493,96.493 -16.503,16.741 -19.932,44.007 -9.882,64.963 4.572,9.907 12.692,17.384 20.313,24.886" style="fill:#062f4c;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path30" />
</g>
<g id="g32" transform="translate(1827.8735,1911.1907)">
<path d="M 0,0 C 7.859,6.168 14.288,13.883 21.504,20.718 27.529,8.073 39.435,0 47.961,-10.74 c 15.455,-18.717 34.648,-33.72 51.77,-50.794 33.721,-29.91 69.298,-57.725 106.638,-83.015 -9.383,-9.263 -18.67,-18.67 -28.029,-27.957 C 110.495,-124.617 49.794,-66.488 0,0" style="fill:#081d2d;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path34" />
</g>
<g id="g36" transform="translate(1531.0129,1613.4966)">
<path d="m 0,0 c 66.44,-49.556 124.26,-110.305 172.125,-177.888 -9.145,-9.192 -18.36,-18.336 -27.505,-27.552 -21.17,28.433 -41.483,57.605 -64.749,84.419 C 48.961,-85.134 16.503,-50.199 -20.361,-20.313 -13.574,-13.55 -6.811,-6.763 0,0" style="fill:#081d2d;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path38" />
</g>
<g id="g40" transform="translate(2519.302,1558.6062)">
<path d="M 0,0 C 21.408,-2.334 42.865,-3.763 64.321,-5.596 73.179,-84.086 63.178,-164.123 40.126,-239.47 3.072,-360.657 -72.393,-468.319 -168.696,-549.976 c -101.446,-87.038 -230.349,-142.429 -363.943,-152.121 -32.72,-2.548 -65.726,-2.453 -98.279,1.786 -0.857,21.313 -3.072,42.555 -5.12,63.797 106.518,1.81 212.203,31.862 304.076,85.705 61.63,35.911 117.068,82.133 164.838,135.047 C -64.344,-303.076 -1.048,-153.145 0,0" style="fill:#6fc4ee;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path42" />
</g>
<g id="g44" transform="translate(1463.3822,1497.8577)">
<path d="m 0,0 c 11.264,2.715 21.48,-4.406 28.314,-12.693 10.312,-9.882 8.811,-28.052 -1.929,-37.101 -293.693,-293.717 -587.386,-587.411 -881.104,-881.104 -7.929,-8.74 -22.599,-11.407 -32.481,-4.525 -8.716,7.049 -18.646,15.908 -17.384,28.291 -0.024,10.192 7.977,16.955 14.717,23.337 292.431,292.598 585.1,584.982 877.484,877.627 C -9.097,-2.786 -4.644,-0.786 0,0" style="fill:#105677;fill-opacity:1;fill-rule:nonzero;stroke:none" id="path46" />
</g>
</g>
</g>
</g>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath18-2"><path
d="M 0,2500 H 3000 V 0 H 0 Z"
id="path16-1" /></clipPath></defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1440"
inkscape:window-height="872"
id="namedview4"
inkscape:pagecheckerboard="0"
showgrid="false"
width="512px"
inkscape:snap-others="false"
inkscape:zoom="0.2263301"
inkscape:cx="797.50773"
inkscape:cy="547.87234"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="0"
inkscape:current-layer="g10" />
<g
id="g10"
inkscape:groupmode="layer"
inkscape:label="FastAsyncWorldEdit"
transform="matrix(1.3333333,0,0,-1.3333333,0,3333.3333)">
<g
id="g12"
transform="matrix(0.17875858,0,0,0.17875858,-78.817913,2093.6589)"><g
id="g14"
clip-path="url(#clipPath18-2)"><g
id="g20"
transform="translate(1643.0798,2025.9724)"><path
d="m 0,0 c 34.839,11.026 70.869,18.313 107.28,21.408 18.861,-48.96 46.604,-93.992 77.514,-136.19 49.794,-66.487 110.495,-124.616 178.34,-172.506 78.156,-55.366 165.481,-97.254 256.496,-126.783 83.229,-27.124 169.601,-44.008 256.592,-53.295 -1.047,-153.146 -64.344,-303.076 -167.124,-415.762 -47.77,-52.914 -103.208,-99.136 -164.838,-135.047 -91.873,-53.843 -197.557,-83.896 -304.076,-85.705 -10.764,101.16 -31.91,201.534 -67.273,297.051 -28.243,76.537 -65.678,149.835 -112.853,216.465 -47.865,67.583 -105.685,128.332 -172.125,177.888 -42.102,31.22 -87.348,58.939 -136.404,77.823 3.834,48.628 15.479,96.636 33.625,141.906 19.169,46.769 46.96,90.968 85.752,123.926 C -91.706,-36.816 -46.722,-14.717 0,0"
style="fill:#4c8fcc;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path22" /></g><g
id="g24"
transform="translate(1887.3362,1969.7008)"><path
d="m 0,0 c 20.837,19.313 56.319,19.718 77.228,0.333 32.243,-32.053 64.272,-64.296 96.492,-96.373 17.313,-17.384 20.766,-46.27 8.93,-67.631 -9.073,-15.431 -23.813,-26.314 -35.744,-39.388 -37.339,25.29 -72.917,53.105 -106.637,83.015 -17.122,17.074 -36.316,32.076 -51.771,50.794 -8.525,10.74 -20.432,18.813 -26.457,31.458 C -25.242,-25.242 -12.788,-12.431 0,0"
style="fill:#062f4c;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path26" /></g><g
id="g28"
transform="translate(1463.3822,1497.8577)"><path
d="m 0,0 c -4.644,-0.786 -9.097,-2.786 -12.383,-6.168 -292.384,-292.645 -585.053,-585.029 -877.484,-877.627 -6.74,-6.382 -14.741,-13.145 -14.717,-23.337 -1.262,-12.383 8.668,-21.242 17.384,-28.291 9.882,-6.882 24.552,-4.215 32.481,4.525 293.718,293.693 587.411,587.387 881.104,881.104 10.74,9.049 12.241,27.219 1.929,37.101 C 21.48,-4.406 11.264,2.715 0,0 M -994.266,-946.234 C -647.088,-599.055 -299.885,-251.901 47.27,95.326 84.134,65.44 116.592,30.505 147.502,-5.382 c 23.266,-26.814 43.579,-55.986 64.749,-84.419 -346.679,-346.584 -693.215,-693.286 -1039.941,-1039.822 -20.623,-21.98 -58.439,-23.599 -80.514,-2.953 -32.172,32.149 -64.321,64.345 -96.493,96.493 -16.503,16.741 -19.932,44.007 -9.882,64.963 4.572,9.907 12.692,17.384 20.313,24.886"
style="fill:#062f4c;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path30" /></g><g
id="g32"
transform="translate(1827.8735,1911.1907)"><path
d="M 0,0 C 7.859,6.168 14.288,13.883 21.504,20.718 27.529,8.073 39.435,0 47.961,-10.74 c 15.455,-18.717 34.648,-33.72 51.77,-50.794 33.721,-29.91 69.298,-57.725 106.638,-83.015 -9.383,-9.263 -18.67,-18.67 -28.029,-27.957 C 110.495,-124.617 49.794,-66.488 0,0"
style="fill:#081d2d;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path34" /></g><g
id="g36"
transform="translate(1531.0129,1613.4966)"><path
d="m 0,0 c 66.44,-49.556 124.26,-110.305 172.125,-177.888 -9.145,-9.192 -18.36,-18.336 -27.505,-27.552 -21.17,28.433 -41.483,57.605 -64.749,84.419 C 48.961,-85.134 16.503,-50.199 -20.361,-20.313 -13.574,-13.55 -6.811,-6.763 0,0"
style="fill:#081d2d;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path38" /></g><g
id="g40"
transform="translate(2519.302,1558.6062)"><path
d="M 0,0 C 21.408,-2.334 42.865,-3.763 64.321,-5.596 73.179,-84.086 63.178,-164.123 40.126,-239.47 3.072,-360.657 -72.393,-468.319 -168.696,-549.976 c -101.446,-87.038 -230.349,-142.429 -363.943,-152.121 -32.72,-2.548 -65.726,-2.453 -98.279,1.786 -0.857,21.313 -3.072,42.555 -5.12,63.797 106.518,1.81 212.203,31.862 304.076,85.705 61.63,35.911 117.068,82.133 164.838,135.047 C -64.344,-303.076 -1.048,-153.145 0,0"
style="fill:#6fc4ee;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path42" /></g><g
id="g44"
transform="translate(1463.3822,1497.8577)"><path
d="m 0,0 c 11.264,2.715 21.48,-4.406 28.314,-12.693 10.312,-9.882 8.811,-28.052 -1.929,-37.101 -293.693,-293.717 -587.386,-587.411 -881.104,-881.104 -7.929,-8.74 -22.599,-11.407 -32.481,-4.525 -8.716,7.049 -18.646,15.908 -17.384,28.291 -0.024,10.192 7.977,16.955 14.717,23.337 292.431,292.598 585.1,584.982 877.484,877.627 C -9.097,-2.786 -4.644,-0.786 0,0"
style="fill:#105677;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path46" /></g></g></g></g>
</svg>

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -1,8 +1,9 @@
import org.ajoberstar.grgit.Grgit
import java.time.format.DateTimeFormatter
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import java.net.URI
import java.time.format.DateTimeFormatter
import xyz.jpenilla.runpaper.task.RunServer
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
@ -82,8 +83,19 @@ allprojects {
}
applyCommonConfiguration()
val supportedVersions = listOf("1.16.5", "1.17", "1.17.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4")
tasks {
supportedVersions.forEach {
register<RunServer>("runServer-$it") {
minecraftVersion(it)
pluginJars(*project(":worldedit-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
.toTypedArray())
jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
group = "run paper"
runDirectory.set(file("run-$it"))
}
}
runServer {
minecraftVersion("1.19.3")
pluginJars(*project(":worldedit-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }

View File

@ -14,7 +14,7 @@ residence = "4.5._13.1"
towny = "0.98.4.18"
# Third party
bstats = "3.0.1"
bstats = "3.0.2"
sparsebitset = "1.2"
parallelgzip = "1.0.5"
adventure = "4.9.3"

View File

@ -9,6 +9,6 @@ repositories {
}
dependencies {
paperDevBundle("1.19.4-R0.1-20230317.182750-6")
paperDevBundle("1.19.4-R0.1-20230412.010331-64")
compileOnly("io.papermc:paperlib")
}

View File

@ -306,54 +306,6 @@ public final class PaperweightFaweAdapter extends CachedBukkitAdapter implements
return SideEffectSet.defaults().getSideEffectsToApply();
}
public boolean setBlock(org.bukkit.Chunk chunk, int x, int y, int z, BlockStateHolder state, boolean update) {
CraftChunk craftChunk = (CraftChunk) chunk;
LevelChunk levelChunk = craftChunk.getHandle();
Level level = levelChunk.getLevel();
BlockPos blockPos = new BlockPos(x, y, z);
net.minecraft.world.level.block.state.BlockState blockState = ((PaperweightBlockMaterial) state.getMaterial()).getState();
LevelChunkSection[] levelChunkSections = levelChunk.getSections();
int y4 = y >> 4;
LevelChunkSection section = levelChunkSections[y4];
net.minecraft.world.level.block.state.BlockState existing;
if (section == null) {
existing = ((PaperweightBlockMaterial) BlockTypes.AIR.getDefaultState().getMaterial()).getState();
} else {
existing = section.getBlockState(x & 15, y & 15, z & 15);
}
levelChunk.removeBlockEntity(blockPos); // Force delete the old tile entity
CompoundBinaryTag compoundTag = state instanceof BaseBlock ? state.getNbt() : null;
if (compoundTag != null || existing instanceof TileEntityBlock) {
level.setBlock(blockPos, blockState, 0);
// remove tile
if (compoundTag != null) {
// We will assume that the tile entity was created for us,
// though we do not do this on the Forge version
BlockEntity blockEntity = level.getBlockEntity(blockPos);
if (blockEntity != null) {
net.minecraft.nbt.CompoundTag tag = (net.minecraft.nbt.CompoundTag) fromNativeBinary(compoundTag);
tag.put("x", IntTag.valueOf(x));
tag.put("y", IntTag.valueOf(y));
tag.put("z", IntTag.valueOf(z));
blockEntity.load(tag); // readTagIntoTileEntity - load data
}
}
} else {
if (existing == blockState) {
return true;
}
levelChunk.setBlockState(blockPos, blockState, false);
}
if (update) {
level.getMinecraftWorld().sendBlockUpdated(blockPos, existing, blockState, 0);
}
return true;
}
@Override
public WorldNativeAccess<?, ?, ?> createWorldNativeAccess(org.bukkit.World world) {
return new PaperweightFaweWorldNativeAccess(

View File

@ -102,7 +102,7 @@ public class PaperweightFaweWorldNativeAccess implements WorldNativeAccess<Level
}
// Since FAWE is.. Async we need to do it on the main thread (wooooo.. :( )
cachedChanges.add(new CachedChange(levelChunk, blockPos, blockState));
cachedChunksToSend.add(new IntPair(levelChunk.bukkitChunk.getX(), levelChunk.bukkitChunk.getZ()));
cachedChunksToSend.add(new IntPair(levelChunk.locX, levelChunk.locZ));
boolean nextTick = lastTick.get() > currentTick;
if (nextTick || cachedChanges.size() >= 1024) {
if (nextTick) {

View File

@ -41,6 +41,8 @@ import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.GlobalPalette;
import net.minecraft.world.level.chunk.HashMapPalette;
import net.minecraft.world.level.chunk.LevelChunk;
@ -57,6 +59,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@ -74,6 +77,7 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Semaphore;
import java.util.function.Function;
import static java.lang.invoke.MethodType.methodType;
import static net.minecraft.core.registries.Registries.BIOME;
public final class PaperweightPlatformAdapter extends NMSAdapter {
@ -103,6 +107,12 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
private static final MethodHandle methodRemoveGameEventListener;
private static final MethodHandle methodremoveTickingBlockEntity;
/*
* This is a workaround for the changes from https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/1fddefce1cdce44010927b888432bf70c0e88cde#src/main/java/org/bukkit/craftbukkit/CraftChunk.java
* and is only needed to support 1.19.4 versions before *and* after this change.
*/
private static final MethodHandle CRAFT_CHUNK_GET_HANDLE;
private static final Field fieldRemove;
static final boolean POST_CHUNK_REWRITE;
@ -111,6 +121,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
private static Field SERVER_LEVEL_ENTITY_MANAGER;
static {
final MethodHandles.Lookup lookup = MethodHandles.lookup();
try {
fieldData = PalettedContainer.class.getDeclaredField(Refraction.pickName("data", "d"));
fieldData.setAccessible(true);
@ -136,7 +147,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
"b"
), long.class);
getVisibleChunkIfPresent.setAccessible(true);
methodGetVisibleChunk = MethodHandles.lookup().unreflect(getVisibleChunkIfPresent);
methodGetVisibleChunk = lookup.unreflect(getVisibleChunkIfPresent);
Unsafe unsafe = ReflectionUtils.getUnsafe();
if (!PaperLib.isPaper()) {
@ -160,7 +171,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
ServerLevel.class
);
removeGameEventListener.setAccessible(true);
methodRemoveGameEventListener = MethodHandles.lookup().unreflect(removeGameEventListener);
methodRemoveGameEventListener = lookup.unreflect(removeGameEventListener);
Method removeBlockEntityTicker = LevelChunk.class.getDeclaredMethod(
Refraction.pickName(
@ -169,7 +180,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
), BlockPos.class
);
removeBlockEntityTicker.setAccessible(true);
methodremoveTickingBlockEntity = MethodHandles.lookup().unreflect(removeBlockEntityTicker);
methodremoveTickingBlockEntity = lookup.unreflect(removeBlockEntityTicker);
fieldRemove = BlockEntity.class.getDeclaredField(Refraction.pickName("remove", "p"));
fieldRemove.setAccessible(true);
@ -208,6 +219,20 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
rethrow.printStackTrace();
throw new RuntimeException(rethrow);
}
MethodHandle craftChunkGetHandle;
final MethodType type = methodType(ChunkAccess.class);
try {
craftChunkGetHandle = lookup.findVirtual(CraftChunk.class, "getHandle", type);
} catch (NoSuchMethodException | IllegalAccessException e) {
try {
final MethodType newType = methodType(ChunkAccess.class, ChunkStatus.class);
craftChunkGetHandle = lookup.findVirtual(CraftChunk.class, "getHandle", newType);
craftChunkGetHandle = MethodHandles.insertArguments(craftChunkGetHandle, 1, ChunkStatus.FULL);
} catch (NoSuchMethodException | IllegalAccessException ex) {
throw new RuntimeException(ex);
}
}
CRAFT_CHUNK_GET_HANDLE = craftChunkGetHandle;
}
static boolean setSectionAtomic(
@ -280,7 +305,7 @@ public final class PaperweightPlatformAdapter extends NMSAdapter {
CompletableFuture<org.bukkit.Chunk> future = serverLevel.getWorld().getChunkAtAsync(chunkX, chunkZ, true, true);
try {
CraftChunk chunk = (CraftChunk) future.get();
return chunk.getHandle();
return (LevelChunk) CRAFT_CHUNK_GET_HANDLE.invoke(chunk);
} catch (Throwable e) {
e.printStackTrace();
}

View File

@ -60,6 +60,7 @@ import net.minecraft.world.level.storage.LevelStorageSource;
import net.minecraft.world.level.storage.PrimaryLevelData;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.craftbukkit.v1_19_R3.CraftServer;
import org.bukkit.craftbukkit.v1_19_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_19_R3.generator.CustomChunkGenerator;
@ -440,7 +441,11 @@ public class PaperweightRegen extends Regenerator<ChunkAccess, ProtoChunk, Level
@Override
protected void populate(LevelChunk levelChunk, Random random, BlockPopulator blockPopulator) {
// BlockPopulator#populate has to be called synchronously for TileEntity access
TaskManager.taskManager().task(() -> blockPopulator.populate(freshWorld.getWorld(), random, levelChunk.getBukkitChunk()));
TaskManager.taskManager().task(() -> {
final CraftWorld world = freshWorld.getWorld();
final Chunk chunk = world.getChunkAt(levelChunk.locX, levelChunk.locZ);
blockPopulator.populate(world, random, chunk);
});
}
@Override

View File

@ -23,6 +23,7 @@ import com.sk89q.worldedit.world.World;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Locale;
import java.util.Set;
@ -176,15 +177,28 @@ public class PlotSquaredFeature extends FaweMaskManager {
maskedRegion = new RegionIntersection(world, weRegions);
}
return new FaweMask(maskedRegion) {
@Override
public boolean isValid(Player player, MaskType type) {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(finalPlot)) {
return false;
}
return isAllowed(player, finalPlot, type);
return new PlotSquaredMask(maskedRegion, finalPlot);
}
private final class PlotSquaredMask extends FaweMask {
private final Plot plot;
private final WeakReference<Set<Plot>> connectedPlots;
private PlotSquaredMask(Region region, Plot plot) {
super(region);
this.plot = plot;
connectedPlots = new WeakReference<>(plot.getConnectedPlots());
}
@Override
public boolean isValid(Player player, MaskType type) {
if (!connectedPlots.refersTo(plot.getConnectedPlots()) || (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot))) {
return false;
}
};
return isAllowed(player, plot, type);
}
}
}

View File

@ -64,9 +64,9 @@ public class DiskOptimizedClipboard extends LinearClipboard {
private final int headerSize;
private RandomAccessFile braf;
private MappedByteBuffer byteBuffer;
private MappedByteBuffer byteBuffer = null;
private FileChannel fileChannel;
private FileChannel fileChannel = null;
private boolean hasBiomes = false;
private boolean canHaveBiomes = true;
private int nbtBytesRemaining;
@ -133,7 +133,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
e.printStackTrace();
}
this.braf = new RandomAccessFile(file, "rw");
long fileLength = (long) getVolume() * 2L + (long) headerSize;
long fileLength = (long) (getVolume() << 1) + (long) headerSize;
braf.setLength(0);
braf.setLength(fileLength);
this.nbtBytesRemaining = Integer.MAX_VALUE - (int) fileLength;
@ -144,7 +144,11 @@ public class DiskOptimizedClipboard extends LinearClipboard {
byteBuffer.putChar(6, (char) getHeight());
byteBuffer.putChar(8, (char) getLength());
} catch (IOException e) {
close();
throw new RuntimeException(e);
} catch (Throwable t) {
close();
throw t;
}
}
@ -169,11 +173,15 @@ public class DiskOptimizedClipboard extends LinearClipboard {
nbtMap = new HashMap<>();
try {
this.file = file;
checkFileLength(file);
this.braf = new RandomAccessFile(file, "rw");
braf.setLength(file.length());
this.nbtBytesRemaining = Integer.MAX_VALUE - (int) file.length();
init();
long biomeLength = (long) ((getHeight() >> 2) + 1) * ((getLength() >> 2) + 1) * ((getWidth() >> 2) + 1);
int biomeLength = ((getHeight() >> 2) + 1) * ((getLength() >> 2) + 1) * ((getWidth() >> 2) + 1);
canHaveBiomes = (long) headerSize + biomeLength < Integer.MAX_VALUE;
if (headerSize >= VERSION_2_HEADER_SIZE) {
readBiomeStatusFromHeader();
int nbtCount = readNBTSavedCountFromHeader();
@ -181,12 +189,42 @@ public class DiskOptimizedClipboard extends LinearClipboard {
if (Settings.settings().CLIPBOARD.SAVE_CLIPBOARD_NBT_TO_DISK && (nbtCount + entitiesCount > 0)) {
loadNBTFromFileFooter(nbtCount, entitiesCount, biomeLength);
}
} else if (braf.length() - headerSize == ((long) getVolume() << 1) + biomeLength) {
} else if (canHaveBiomes && braf.length() - headerSize == ((long) getVolume() << 1) + biomeLength) {
hasBiomes = true;
}
getAndSetOffsetAndOrigin();
} catch (IOException e) {
close();
throw new RuntimeException(e);
} catch (Throwable t) {
close();
throw t;
}
}
private void checkFileLength(File file) throws IOException {
long expectedFileSize = headerSize + ((long) getVolume() << 1);
if (file.length() > Integer.MAX_VALUE) {
if (expectedFileSize >= Integer.MAX_VALUE) {
throw new IOException(String.format(
"Cannot load clipboard of file size: %d > 2147483647 bytes (2.147 GiB), " + "volume: %d blocks",
file.length(),
getVolume()
));
} else {
throw new IOException(String.format(
"Cannot load clipboard of file size > 2147483647 bytes (2.147 GiB). Possible corrupt file? Mismatch" +
" between volume `%d` and file length `%d`!",
file.length(),
getVolume()
));
}
} else if (expectedFileSize != file.length()) {
throw new IOException(String.format(
"Possible corrupt clipboard file? Mismatch between expected file size `%d` and actual file size `%d`!",
expectedFileSize,
file.length()
));
}
}
@ -486,13 +524,26 @@ public class DiskOptimizedClipboard extends LinearClipboard {
fileChannel.close();
braf.close();
file.setWritable(true);
closeDirectBuffer(byteBuffer);
MappedByteBuffer tmpBuffer = byteBuffer;
byteBuffer = null;
closeDirectBuffer(tmpBuffer);
fileChannel = null;
braf = null;
} else if (fileChannel != null) {
fileChannel.close();
fileChannel = null;
}
} catch (IOException e) {
e.printStackTrace();
if (fileChannel != null) {
try {
fileChannel.close();
fileChannel = null;
} catch (IOException ex) {
LOGGER.error("Could not close file channel on clipboard {}. If this belongs to a player, the server may " +
"need to be restarted for clipboard use to work.", getFile().getName(), ex);
}
}
}
}
@ -648,8 +699,6 @@ public class DiskOptimizedClipboard extends LinearClipboard {
char ordinal = byteBuffer.getChar(diskIndex);
return BlockState.getFromOrdinal(ordinal);
} catch (IndexOutOfBoundsException ignored) {
} catch (Exception e) {
e.printStackTrace();
}
return BlockTypes.AIR.getDefaultState();
}

View File

@ -169,9 +169,14 @@ public class ToolUtilCommands {
public void traceMask(
Player player, LocalSession session,
@Arg(desc = "The trace mask to set", def = "")
Mask maskOpt
Mask maskOpt
) throws WorldEditException {
session.getBrushTool(player, false).setTraceMask(maskOpt);
BrushTool brushTool = session.getBrushTool(player, false);
if (brushTool == null) {
player.print(Caption.of("worldedit.brush.none.equipped"));
return;
}
brushTool.setTraceMask(maskOpt);
if (maskOpt == null) {
player.print(Caption.of("worldedit.tool.tracemask.disabled"));
} else {

View File

@ -207,7 +207,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
}).collect(Collectors.toSet());
if (!blocked.isEmpty()) {
throw new DisallowedUsageException(Caption.of(
"fawe.error.limit.disallowed-block",
"fawe.error.limit.disallowed-property",
TextComponent.of(input)
));
}

View File

@ -671,31 +671,26 @@ public final class PlatformCommandManager {
Actor actor = event.getActor();
String args = event.getArguments();
TaskManager.taskManager().taskNow(() -> {
if (!Fawe.isMainThread()) {
Thread.currentThread().setName("FAWE Thread for player: " + actor.getName());
int space0 = args.indexOf(' ');
String arg0 = space0 == -1 ? args : args.substring(0, space0);
Optional<Command> optional = commandManager.getCommand(arg0);
if (optional.isEmpty()) {
return;
}
Command cmd = optional.get();
PermissionCondition queued = cmd.getCondition().as(PermissionCondition.class).orElse(null);
if (queued != null && !queued.isQueued()) {
TaskManager.taskManager().taskNow(() -> handleCommandOnCurrentThread(event), Fawe.isMainThread());
return;
} else {
actor.decline();
}
actor.runAction(() -> {
SessionKey key = actor.getSessionKey();
if (key.isActive()) {
PlatformCommandManager.this.handleCommandOnCurrentThread(event);
}
int space0 = args.indexOf(' ');
String arg0 = space0 == -1 ? args : args.substring(0, space0);
Optional<Command> optional = commandManager.getCommand(arg0);
if (!optional.isPresent()) {
return;
}
Command cmd = optional.get();
PermissionCondition queued = cmd.getCondition().as(PermissionCondition.class).orElse(null);
if (queued != null && !queued.isQueued()) {
handleCommandOnCurrentThread(event);
return;
} else {
actor.decline();
}
actor.runAction(() -> {
SessionKey key = actor.getSessionKey();
if (key.isActive()) {
PlatformCommandManager.this.handleCommandOnCurrentThread(event);
}
}, false, true);
}, Fawe.isMainThread());
}, false, true);
}
public void handleCommandOnCurrentThread(CommandEvent event) {

View File

@ -555,10 +555,11 @@ public class BlockTransformExtent extends ResettableExtent {
int transformedId = transformState(state, transform);
BlockState transformed = BlockState.getFromInternalId(transformedId);
if (block.hasNbtData()) {
boolean baseBlock = block instanceof BaseBlock;
if (baseBlock && block.hasNbtData()) {
return (B) transformBaseBlockNBT(transformed, block.getNbtData(), transform);
}
return (B) (block instanceof BaseBlock ? transformed.toBaseBlock() : transformed);
return (B) (baseBlock? transformed.toBaseBlock() : transformed);
//FAWE end
}

View File

@ -283,6 +283,7 @@
"worldedit.brush.butcher.equip": "Butcher brush equipped ({0}).",
"worldedit.brush.operation.equip": "Set brush to {0}.",
"worldedit.brush.none.equip": "Brush unbound from your current item.",
"worldedit.brush.none.equipped": "You have no brush bound to your current item. Try /brush sphere for a basic brush.",
"worldedit.setbiome.changed": "Biomes were changed in {0} columns. You may have to rejoin your game (or close and reopen your world) to see a change.",
"worldedit.setbiome.not-locatable": "Command sender must be present in the world to use the -p flag.",
"worldedit.drawsel.disabled": "Server CUI disabled.",