Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Telesphoreo committed Jan 24, 2024
2 parents 637dc2d + b919633 commit 811ed72
Show file tree
Hide file tree
Showing 19 changed files with 231 additions and 94 deletions.
20 changes: 10 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ ij_editorconfig_space_before_colon = false
ij_editorconfig_space_before_comma = false
ij_editorconfig_spaces_around_assignment_operators = true

[{*.ant, *.fxml, *.jhm, *.jnlp, *.jrxml, *.pom, *.rng, *.tld, *.wsdl, *.xml, *.xsd, *.xsl, *.xslt, *.xul}]
[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
ij_xml_align_attributes = true
ij_xml_align_text = false
ij_xml_attribute_wrap = normal
Expand All @@ -360,7 +360,7 @@ ij_xml_space_around_equals_in_attribute = false
ij_xml_space_inside_empty_tag = false
ij_xml_text_wrap = normal

[{*.ats, *.ts}]
[{*.ats,*.ts}]
ij_continuation_indent_size = 4
ij_typescript_align_imports = false
ij_typescript_align_multiline_array_initializer_expression = false
Expand Down Expand Up @@ -528,7 +528,7 @@ ij_typescript_while_brace_force = never
ij_typescript_while_on_new_line = false
ij_typescript_wrap_comments = false

[{*.bash, *.sh, *.zsh}]
[{*.bash,*.sh,*.zsh}]
indent_size = 2
tab_width = 2
ij_shell_binary_ops_start_line = false
Expand All @@ -537,7 +537,7 @@ ij_shell_minify_program = false
ij_shell_redirect_followed_by_space = false
ij_shell_switch_cases_indented = false

[{*.cjs, *.js}]
[{*.cjs,*.js}]
ij_continuation_indent_size = 4
ij_javascript_align_imports = false
ij_javascript_align_multiline_array_initializer_expression = false
Expand Down Expand Up @@ -702,10 +702,10 @@ ij_javascript_while_brace_force = never
ij_javascript_while_on_new_line = false
ij_javascript_wrap_comments = false

[{*.ft, *.vm, *.vsl}]
[{*.ft,*.vm,*.vsl}]
ij_vtl_keep_indents_on_empty_lines = false

[{*.gant, *.gradle, *.groovy, *.gy}]
[{*.gant,*.gradle,*.groovy,*.gy}]
ij_groovy_align_group_field_declarations = false
ij_groovy_align_multiline_array_initializer_expression = false
ij_groovy_align_multiline_assignment = false
Expand Down Expand Up @@ -884,7 +884,7 @@ ij_groovy_while_brace_force = never
ij_groovy_while_on_new_line = false
ij_groovy_wrap_long_lines = false

[{*.gradle.kts, *.kt, *.kts, *.main.kts}]
[{*.gradle.kts,*.kt,*.kts,*.main.kts}]
ij_kotlin_align_in_columns_case_branch = false
ij_kotlin_align_multiline_binary_operation = false
ij_kotlin_align_multiline_extends_list = false
Expand Down Expand Up @@ -963,7 +963,7 @@ ij_kotlin_wrap_elvis_expressions = 1
ij_kotlin_wrap_expression_body_functions = 0
ij_kotlin_wrap_first_method_in_call_chain = false

[{*.har, *.jsb2, *.jsb3, *.json, .babelrc, .eslintrc, .stylelintrc, bowerrc, jest.config, mcmod.info}]
[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config,mcmod.info}]
indent_size = 2
ij_json_keep_blank_lines_in_code = 0
ij_json_keep_indents_on_empty_lines = false
Expand All @@ -976,7 +976,7 @@ ij_json_spaces_within_braces = false
ij_json_spaces_within_brackets = false
ij_json_wrap_long_lines = false

[{*.htm, *.html, *.sht, *.shtm, *.shtml}]
[{*.htm,*.html,*.sht,*.shtm,*.shtml}]
ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3
ij_html_align_attributes = true
ij_html_align_text = false
Expand Down Expand Up @@ -1004,7 +1004,7 @@ ij_html_space_inside_empty_tag = false
ij_html_text_wrap = normal
ij_html_uniform_ident = false

[{*.yaml, *.yml}]
[{*.yaml,*.yml}]
indent_size = 2
ij_yaml_keep_indents_on_empty_lines = false
ij_yaml_keep_line_breaks = true
Expand Down
50 changes: 40 additions & 10 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"$schema" : "https://docs.renovatebot.com/renovate-schema.json",
"extends" : [
"config:recommended",
":semanticCommitsDisabled"
],
"automerge": true,
"ignoreDeps": [
"guava",
"automerge" : true,
"ignoreDeps" : [
"guava",
"com.google.guava:guava",
"rhino-runtime",
"org.antlr",
"antlr4-runtime",
"fastutil",
"it.unimi.dsi:fastutil",
"it.unimi.dsi:fastutil",
"auto-value-annotations",
"auto-value",
"com.google.code.gson:gson",
Expand All @@ -29,7 +29,37 @@
"org.spongepowered:spongeapi",
"org.yaml:snakeyaml"
],
"labels": ["Renovate"],
"rebaseWhen": "conflicted",
"schedule": ["on the first day of the month"]
"labels" : [
"Renovate"
],
"rebaseWhen" : "conflicted",
"schedule" : [
"on the first day of the month"
],
"customManagers" : [
{
"customType" : "regex",
"datasourceTemplate" : "custom.paperweight-userdev",
"fileMatch" : "^worldedit-bukkit\\/adapters\\/adapter-\\d+_\\d+(_\\d+)?\\/build\\.gradle\\.kts$",
"matchStrings" : [
"url=(?<registryUrl>.*)\\s",
"paperDevBundle\\(\"(?<currentValue>.*?)\"\\)\\s"
],
"matchStringsStrategy": "combination",
"depNameTemplate" : "paperweight-userdev",
"extractVersionTemplate" : "(?<version>\\d+\\.\\d+\\.?\\d*-R0\\.1-\\d+\\.\\d+-\\d+)"
}
],
"customDatasources" : {
"paperweight-userdev": {
"defaultRegistryUrlTemplate": "",
"format": "html"
}
},
"packageRules" : [
{
"matchDatasources" : ["custom.paperweight-userdev"],
"versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)?-R0\\.1-\\d+\\d+\\.\\d+-(?<build>\\d+)$"
}
]
}
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ snakeyaml = "2.0"
dummypermscompat = "1.10"
worldguard-bukkit = "7.0.9"
mapmanager = "1.8.0-SNAPSHOT"
griefprevention = "16.18.1"
griefprevention = "17.0.0"
griefdefender = "2.1.0-SNAPSHOT"
residence = "4.5._13.1"
towny = "0.100.0.11"
plotsquared = "7.2.1"
towny = "0.100.1.5"
plotsquared = "7.3.1"

# Third party
bstats = "3.0.2"
Expand Down Expand Up @@ -46,7 +46,7 @@ text = "3.0.4"
piston = "0.5.7"

# Tests
mockito = "5.8.0"
mockito = "5.9.0"

# Gradle plugins
pluginyml = "0.6.0"
Expand Down
1 change: 1 addition & 0 deletions worldedit-bukkit/adapters/adapter-1_17_1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ configurations.all {


dependencies {
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.17.1-R0.1-SNAPSHOT
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.17.1-R0.1-20220414.034903-210")
compileOnly(libs.paperlib)
}
2 changes: 1 addition & 1 deletion worldedit-bukkit/adapters/adapter-1_18_2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
}

dependencies {
// https://papermc.io/repo/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.18.2-R0.1-SNAPSHOT
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.18.2-R0.1-20220920.010157-167")
compileOnly(libs.paperlib)
}
1 change: 1 addition & 0 deletions worldedit-bukkit/adapters/adapter-1_19_4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repositories {
}

dependencies {
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.19.4-R0.1-SNAPSHOT
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.19.4-R0.1-20230608.201059-104")
compileOnly(libs.paperlib)
}
2 changes: 1 addition & 1 deletion worldedit-bukkit/adapters/adapter-1_20/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
}

dependencies {
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.20.1-R0.1-SNAPSHOT
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.20.1-R0.1-20230921.165944-178")
compileOnly(libs.paperlib)
}
2 changes: 1 addition & 1 deletion worldedit-bukkit/adapters/adapter-1_20_2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
}

dependencies {
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.20.2-R0.1-SNAPSHOT
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.20.2-R0.1-20231203.034718-121")
compileOnly(libs.paperlib)
}
4 changes: 2 additions & 2 deletions worldedit-bukkit/adapters/adapter-1_20_4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
}

dependencies {
// https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.20.4-R0.1-20231221.211952-22")
// url=https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/1.20.4-R0.1-SNAPSHOT
the<PaperweightUserDependenciesExtension>().paperDevBundle("1.20.4-R0.1-20240106.182028-62")
compileOnly(libs.paperlib)
}
22 changes: 13 additions & 9 deletions worldedit-bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,15 @@ tasks.named<Jar>("jar") {
addJarManifest(WorldEditKind.Plugin, includeClasspath = true)

tasks.named<ShadowJar>("shadowJar") {
dependsOn(project.project(":worldedit-bukkit:adapters").subprojects.map { it.tasks.named("assemble") })
from(Callable {
adapters.resolve()
.map { f ->
zipTree(f).matching {
exclude("META-INF/")
}
}
})
configurations.add(adapters)
archiveFileName.set("${rootProject.name}-Bukkit-${project.version}.${archiveExtension.getOrElse("jar")}")
dependencies {
// In tandem with not bundling log4j, we shouldn't relocate base package here.
// relocate("org.apache.logging", "com.sk89q.worldedit.log4j")
relocate("org.antlr.v4", "com.sk89q.worldedit.antlr4")

exclude(dependency("$group:$name"))

include(dependency(":worldedit-core"))
include(dependency(":worldedit-libs:bukkit"))
// Purposefully not included, we assume (even though no API exposes it) that Log4J will be present at runtime
Expand Down Expand Up @@ -192,6 +187,15 @@ tasks.named<ShadowJar>("shadowJar") {
include(dependency("org.anarres:parallelgzip:1.0.5"))
}
}

project.project(":worldedit-bukkit:adapters").subprojects.forEach {
dependencies {
include(dependency("${it.group}:${it.name}"))
}
minimize {
exclude(dependency("${it.group}:${it.name}"))
}
}
}

tasks.named("assemble").configure {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
import com.sk89q.worldedit.function.FlatRegionFunction;
Expand Down Expand Up @@ -217,7 +218,6 @@ public void swap(
) {
TaskManager.taskManager().async(() -> {
synchronized (FaweDelegateRegionManager.class) {
//todo because of the following code this should probably be in the Bukkit module
World pos1World = BukkitAdapter.adapt(getWorld(pos1.getWorldName()));
World pos3World = BukkitAdapter.adapt(getWorld(swapPos.getWorldName()));
EditSession sessionA = WorldEdit.getInstance().newEditSessionBuilder().world(pos1World)
Expand All @@ -236,14 +236,16 @@ public void swap(
CuboidRegion regionB = new CuboidRegion(
pos3World,
swapPos.getBlockVector3(),
swapPos.getBlockVector3().add(pos2.getBlockVector3()).subtract(pos1.getBlockVector3())
swapPos.getBlockVector3().add(pos2.getBlockVector3().subtract(pos1.getBlockVector3())).withY(pos2.getY())
);
Clipboard clipA = Clipboard.create(regionA, UUID.randomUUID());
Clipboard clipB = Clipboard.create(regionB, UUID.randomUUID());
Clipboard clipA = new BlockArrayClipboard(regionA, UUID.randomUUID());
Clipboard clipB = new BlockArrayClipboard(regionB, UUID.randomUUID());
ForwardExtentCopy copyA = new ForwardExtentCopy(sessionA, regionA, clipA, clipA.getMinimumPoint());
ForwardExtentCopy copyB = new ForwardExtentCopy(sessionB, regionB, clipB, clipB.getMinimumPoint());
copyA.setCopyingBiomes(true);
copyB.setCopyingBiomes(true);
copyA.setCopyingEntities(true);
copyB.setCopyingEntities(true);
try {
Operations.completeLegacy(copyA);
Operations.completeLegacy(copyB);
Expand All @@ -257,17 +259,16 @@ public void swap(
sessionA.close();
sessionB.close();
}
FaweAPI.fixLighting(pos1World, new CuboidRegion(pos1.getBlockVector3(), pos2.getBlockVector3()), null,
FaweAPI.fixLighting(
pos1World,
regionA,
null,
RelightMode.valueOf(com.fastasyncworldedit.core.configuration.Settings.settings().LIGHTING.MODE)
);
FaweAPI.fixLighting(pos1World, new CuboidRegion(
swapPos.getBlockVector3(),
BlockVector3.at(
swapPos.getX() + pos2.getX() - pos1.getX(),
0,
swapPos.getZ() + pos2.getZ() - pos1.getZ()
)
), null,
FaweAPI.fixLighting(
pos1World,
regionB,
null,
RelightMode.valueOf(com.fastasyncworldedit.core.configuration.Settings.settings().LIGHTING.MODE)
);
if (whenDone != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable, Fl

/**
* Creates a new {@link ReadOnlyClipboard}.
*
* @deprecated Internal use only. Use {@link BlockArrayClipboard#BlockArrayClipboard(Region)}
*/
@Deprecated
static Clipboard create(Region region) {
checkNotNull(region);
checkNotNull(
Expand All @@ -95,7 +98,10 @@ static Clipboard create(Region region) {
* - {@link DiskOptimizedClipboard}
* - {@link CPUOptimizedClipboard}
* - {@link MemoryOptimizedClipboard}
*
* @deprecated Internal use only. Use {@link BlockArrayClipboard#BlockArrayClipboard(Region, UUID)}
*/
@Deprecated
static Clipboard create(Region region, UUID uuid) {
if (Settings.settings().CLIPBOARD.USE_DISK) {
return new DiskOptimizedClipboard(region, uuid);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* WorldEdit, a Minecraft world manipulation toolkit
* Copyright (C) sk89q <http://www.sk89q.com>
* Copyright (C) WorldEdit team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.sk89q.worldedit.extent.clipboard.io;

import com.sk89q.worldedit.util.formatting.text.Component;

/**
* Raised when a known exception occurs during schematic load.
*/
public final class SchematicLoadException extends RuntimeException {

private final Component message;

public SchematicLoadException(Component message) {
this.message = message;
}

/**
* Get the message of this exception as a rich text component.
*
* @return The rich message
*/
public Component getRichMessage() {
return this.message;
}
}
Loading

0 comments on commit 811ed72

Please sign in to comment.