Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…WorldEdit into main
  • Loading branch information
MattBDev committed Dec 14, 2020
2 parents 44619e1 + 6676d77 commit fdeaa8a
Show file tree
Hide file tree
Showing 115 changed files with 4,290 additions and 626 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ assignees: ''
**Required Information**
- FAWE Version Number (`/version FastAsyncWorldEdit`):
- Spigot/Paper Version Number (`/version`):
- Minecraft Version: [e.g. 1.16.3]
- Minecraft Version: [e.g. 1.16.4]

**Describe the bug**
A clear and concise description of what the bug is.
Expand All @@ -43,5 +43,5 @@ Steps to reproduce the behavior:
<!--- Make sure you've completed the following steps (put an "X" between of brackets): -->
- [] I included all information required in the sections above
- [] I made sure there are no duplicates of this report [(Use Search)](https://github.com/IntellectualSites/FastAsyncWorldEdit/issues?q=is%3Aissue)
- [] I made sure I am using an up-to-date version of [FastAsyncWorldEdit for 1.16.3](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/)
- [] I made sure I am using an up-to-date version of [FastAsyncWorldEdit for 1.16.4](https://ci.athion.net/job/FastAsyncWorldEdit-1.16/)
- [] I made sure the bug/error is not caused by any other plugin
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: "[+] Enhancement"
labels: "Enhancement"
assignees: ''

---
Expand Down
18 changes: 18 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
daysUntilStale: 60
daysUntilClose: 7
only: issues
exemptLabels:
- "Bug"
- "Enhancement"
- "Approved"
- "Priority"
- "Under investigation"
staleLabel: "resolution: stale"
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
closeComment: >
This issue has been automatically closed because it has not had activity in
a long time. If the issue still applies to the most recent supported
version, please open a new issue referencing this original issue.
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "build"

on: ["pull_request", "push"]

jobs:
build:
strategy:
matrix:
java: ["1.8", "11"]
os: ["ubuntu-18.04"]
runs-on: "${{ matrix.os }}"
steps:
- name: "Checkout Repository"
uses: "actions/[email protected]"
- name: "Setup JDK ${{ matrix.java }}"
uses: "actions/[email protected]"
with:
java-version: "${{ matrix.java }}"
- name: "Cache Gradle"
uses: "actions/[email protected]"
with:
path: |
"~/.gradle/caches"
"~/.gradle/wrapper"
key: "${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }}"
restore-keys: |
"${{ runner.os }}-${{ matrix.java }}-gradle-"
- name: "Cache Local Maven Repository"
uses: "actions/[email protected]"
with:
path: "~/.m2/repository"
key: "${{ runner.os }}-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}"
restore-keys: |
"${{ runner.os }}-${{ matrix.java }}-maven-"
- name: "Cache BuildTools Decompiled Code"
uses: "actions/[email protected]"
with:
path: "$GITHUB_WORKSPACE/work"
key: "${{ runner.os }}-buildtools"
restore-keys: |
"${{ runner.os }}-buildtools"
- name: "Test Enviornment"
run: "echo $GITHUB_WORKSPACE"
- name: "Download BuildTools"
run: "wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
- name: "Run BuildTools"
run: "java -jar BuildTools.jar --rev 1.16.4"
- name: "Clean Build"
run: "./gradlew clean build sourcesJar javadocJar"

56 changes: 0 additions & 56 deletions .github/workflows/gradle.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/validate-gradle-wrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "validate gradle wrapper"

on: ["pull_request", "push"]

jobs:
build:
runs-on: "ubuntu-18.04"
steps:
- name: "Checkout Repository"
uses: "actions/[email protected]"
- name: "Validate Gradle Wrapper"
uses: "gradle/[email protected]"
25 changes: 17 additions & 8 deletions buildSrc/src/main/kotlin/LibsConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ fun Project.applyLibrariesConfiguration() {

group = "${rootProject.group}.worldedit-libs"

val relocations = mapOf(
"net.kyori.text" to "com.sk89q.worldedit.util.formatting.text",
"net.kyori.minecraft" to "com.sk89q.worldedit.util.kyori"
)

tasks.register<ShadowJar>("jar") {
configurations = listOf(project.configurations["shade"])
archiveClassifier.set("")
Expand All @@ -36,13 +41,15 @@ fun Project.applyLibrariesConfiguration() {
exclude(dependency("org.slf4j:slf4j-api"))
}

relocate("net.kyori.text", "com.sk89q.worldedit.util.formatting.text")
relocations.forEach { (from, to) ->
relocate(from, to)
}
}
val altConfigFiles = { artifactType: String ->
val deps = configurations["shade"].incoming.dependencies
.filterIsInstance<ModuleDependency>()
.map { it.copy() }
.map { dependency: ModuleDependency ->
.map { dependency ->
dependency.artifact {
name = dependency.name
type = artifactType
Expand All @@ -61,13 +68,15 @@ fun Project.applyLibrariesConfiguration() {
from({
altConfigFiles("sources")
})
val filePattern = Regex("(.*)net/kyori/text((?:/|$).*)")
val textPattern = Regex("net\\.kyori\\.text")
eachFile {
filter {
it.replaceFirst(textPattern, "com.sk89q.worldedit.util.formatting.text")
relocations.forEach { (from, to) ->
val filePattern = Regex("(.*)${from.replace('.', '/')}((?:/|$).*)")
val textPattern = Regex.fromLiteral(from)
eachFile {
filter {
it.replaceFirst(textPattern, to)
}
path = path.replaceFirst(filePattern, "$1${to.replace('.', '/')}$2")
}
path = path.replaceFirst(filePattern, "$1com/sk89q/worldedit/util/formatting/text$2")
}
archiveClassifier.set("sources")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ Example usage:
/cs maze.js glowstone 10 10

You may or may not install these scripts -- it is optional. If you are, however,
place the entire craftscripts/ folder into the respective directory for the platform
place the entire `craftscripts/` folder into the respective directory for the platform
that you have installed WorldEdit.

In order to be able to use CraftScripts, you must install the Rhino JavaScript library.
The installation page linked above has information about that. More information
about scripts in general can be found at
https://worldedit.enginehub.org/en/latest/usage/other/craftscripts/
about scripts in general can be found [on the WorldEdit docs](https://worldedit.enginehub.org/en/latest/usage/other/craftscripts/)
5 changes: 5 additions & 0 deletions contrib/craftscripts/SUBMITTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Write a cool script? You can submit a pull request to [our GitHub Repository](https://github.com/IntellectualSites/FastAsyncWorldEdit).
We will consider your script for inclusion in the FastAsyncWorldEdit repository. CraftScripts in the FastAsyncWorldEdit repository are
licensed under GPLv3, like the rest of FastAsybcWorldEdit.

You can also post your scripts on [our Discord](https://discord.gg/KxkjDVg) in the `#sharing-is-caring` channel.
10 changes: 0 additions & 10 deletions contrib/craftscripts/SUBMITTING.txt

This file was deleted.

11 changes: 9 additions & 2 deletions worldedit-bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,23 @@ dependencies {
"api"(project(":worldedit-core"))
"api"(project(":worldedit-libs:bukkit"))
"compile"(":worldedit-adapters:")
// Paper-patched NMS jars
"compile"("com.destroystokyo.paperv1_15_r1:paperv1_15_r1:1_15_r1")
"compile"("com.destroystokyo.paperv1_16_r1:paperv1_16_r1:1_16_r1")
"compile"("com.destroystokyo.paperv1_16_r2:paperv1_16_r2:1_16_r2")
"compile"("com.destroystokyo.paperv1_16_r3:paperv1_16_r3:1_16_r3")
"compile"("org.spigotmcv1_15_r1:spigotmcv1_15_r1:1_15_r1")
"compile"("org.spigotmcv1_16_r1:spigotmcv1_16_r1:1_16_r1")
"compile"("org.spigotmcv1_16_r2:spigotmcv1_16_r2:1_16_r2")
"compile"("org.spigotmcv1_16_r3:spigotmcv1_16_r3:1_16_r3")
"implementation"("it.unimi.dsi:fastutil:${Versions.FAST_UTIL}")
"api"("com.destroystokyo.paper:paper-api:1.16.2-R0.1-SNAPSHOT") {
"api"("com.destroystokyo.paper:paper-api:1.16.4-R0.1-SNAPSHOT") {
exclude("junit", "junit")
isTransitive = false
}
"compileOnly"("org.jetbrains:annotations:20.1.0")
"testCompileOnly"("org.jetbrains:annotations:20.1.0")
"compileOnly"("org.spigotmc:spigot:1.16.2-R0.1-SNAPSHOT")
"compileOnly"("org.spigotmc:spigot:1.16.4-R0.1-SNAPSHOT")
"implementation"("io.papermc:paperlib:1.0.4")
"compileOnly"("com.sk89q:dummypermscompat:1.10") {
exclude("com.github.MilkBowl", "VaultAPI")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.boydti.fawe.bukkit.util.image.BukkitImageViewer;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.regions.FaweMaskManager;
import com.boydti.fawe.util.Jars;
import com.boydti.fawe.util.ThirdPartyManager;
import com.boydti.fawe.util.TaskManager;
import com.boydti.fawe.util.WEManager;
import com.boydti.fawe.util.image.ImageViewer;
Expand Down Expand Up @@ -123,15 +123,15 @@ public synchronized ImageViewer getImageViewer(com.sk89q.worldedit.entity.Player
if (manager.getPlugin("PacketListenerApi") == null) {
File output = new File(plugin.getDataFolder().getParentFile(),
"PacketListenerAPI_v3.7.6-SNAPSHOT.jar");
byte[] jarData = Jars.PL_v3_7_6.download();
byte[] jarData = ThirdPartyManager.PacketListenerAPI.download();
try (FileOutputStream fos = new FileOutputStream(output)) {
fos.write(jarData);
}
}
if (manager.getPlugin("MapManager") == null) {
File output = new File(plugin.getDataFolder().getParentFile(),
"MapManager_v1.7.8-SNAPSHOT.jar");
byte[] jarData = Jars.MM_v1_7_8.download();
byte[] jarData = ThirdPartyManager.MapManager.download();
try (FileOutputStream fos = new FileOutputStream(output)) {
fos.write(jarData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.boydti.fawe.util.MathMan;
import com.boydti.fawe.util.ReflectionUtils;
import com.boydti.fawe.util.TaskManager;
import com.destroystokyo.paper.util.misc.PooledLinkedHashSets;
import com.mojang.datafixers.util.Either;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockState;
Expand All @@ -25,6 +26,7 @@
import net.minecraft.server.v1_16_R2.DataPalette;
import net.minecraft.server.v1_16_R2.DataPaletteBlock;
import net.minecraft.server.v1_16_R2.DataPaletteLinear;
import net.minecraft.server.v1_16_R2.EntityPlayer;
import net.minecraft.server.v1_16_R2.GameProfileSerializer;
import net.minecraft.server.v1_16_R2.IBlockData;
import net.minecraft.server.v1_16_R2.PacketPlayOutLightUpdate;
Expand Down Expand Up @@ -205,14 +207,40 @@ public static void sendChunk(WorldServer nmsWorld, int chunkX, int chunkZ, int m
playerChunk.players.a(chunkCoordIntPair, false).forEach(p -> {
p.playerConnection.sendPacket(chunkpacket);
});
}

if (lighting) {
boolean trustEdges = true; //This needs to be true otherwise Minecraft will update lighting from/at the chunk edges (bad)
PacketPlayOutLightUpdate packet = new PacketPlayOutLightUpdate(chunkCoordIntPair, nmsWorld.getChunkProvider().getLightEngine(), trustEdges);
playerChunk.players.a(chunkCoordIntPair, false).forEach(p -> {
p.playerConnection.sendPacket(packet);
});
if (lighting) {
boolean trustEdges = true; //This needs to be true otherwise Minecraft will update lighting from/at the chunk edges (bad)
PacketPlayOutLightUpdate packet = new PacketPlayOutLightUpdate(chunkCoordIntPair, nmsWorld.getChunkProvider().getLightEngine(), trustEdges);
playerChunk.players.a(chunkCoordIntPair, false).forEach(p -> {
p.playerConnection.sendPacket(packet);
});
}
} else if (PaperLib.isPaper()) {
//Require generic here to work with multiple dependencies trying to take control.
PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<?> objects =
nmsWorld.getChunkProvider().playerChunkMap.playerViewDistanceNoTickMap.getObjectsInRange(chunkX, chunkZ);
if (objects == null) {
return null;
}
for (Object obj : objects.getBackingSet()) {
if (obj == null) {
continue;
}
EntityPlayer p = (EntityPlayer) obj;
Chunk chunk = nmsWorld.getChunkProvider().getChunkAtIfLoadedImmediately(chunkX, chunkZ);
if (chunk != null) {
PacketPlayOutMapChunk chunkpacket = new PacketPlayOutMapChunk(chunk, 65535);
p.playerConnection.sendPacket(chunkpacket);

if (lighting) {
boolean trustEdges =
true; //This needs to be true otherwise Minecraft will update lighting from/at the chunk edges (bad)
PacketPlayOutLightUpdate packet =
new PacketPlayOutLightUpdate(chunkCoordIntPair, nmsWorld.getChunkProvider().getLightEngine(), trustEdges);
p.playerConnection.sendPacket(packet);
}
}
}
}
return null;
});
Expand Down
Loading

0 comments on commit fdeaa8a

Please sign in to comment.