Merge branch 'v6' into refactor/v6/update-mm

This commit is contained in:
NotMyFault 2021-12-23 11:09:43 +01:00
commit 1b5dab3ddd
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
9 changed files with 65 additions and 26 deletions

View File

@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v2.3.5 uses: actions/checkout@v2.4.0
- name: Validate Gradle Wrapper" - name: Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@v1.0.4 uses: gradle/wrapper-validation-action@v1.0.4
- name: Setup Java - name: Setup Java

13
.whitesource Normal file
View File

@ -0,0 +1,13 @@
{
"scanSettings": {
"baseBranches": ["v6"]
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "success",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "LOW"
},
"enableRenovate": "true"
}

View File

@ -75,7 +75,7 @@ public class EntitySpawnListener implements Listener {
public static void testCreate(final Entity entity) { public static void testCreate(final Entity entity) {
@NonNull World world = entity.getWorld(); @NonNull World world = entity.getWorld();
if (areaName == world.getName()) { if (areaName.equals(world.getName())) {
} else { } else {
areaName = world.getName(); areaName = world.getName();
hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName); hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName);

View File

@ -58,6 +58,7 @@ import com.plotsquared.core.plot.flag.implementations.KeepFlag;
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag; import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
import com.plotsquared.core.plot.flag.types.DoubleFlag; import com.plotsquared.core.plot.flag.types.DoubleFlag;
import com.plotsquared.core.plot.schematic.Schematic; import com.plotsquared.core.plot.schematic.Schematic;
import com.plotsquared.core.plot.world.SinglePlotArea;
import com.plotsquared.core.queue.QueueCoordinator; import com.plotsquared.core.queue.QueueCoordinator;
import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MathMan; import com.plotsquared.core.util.MathMan;
@ -1512,6 +1513,12 @@ public class Plot {
int z; int z;
if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) { if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) {
// center // center
if (getArea() instanceof SinglePlotArea) {
int y = loc.getY() == Integer.MIN_VALUE
? (isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63)
: loc.getY();
return Location.at(plot.getWorldName(), 0, y, 0, 0, 0);
}
CuboidRegion largest = plot.getLargestRegion(); CuboidRegion largest = plot.getLargestRegion();
x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest
.getMinimumPoint() .getMinimumPoint()
@ -1530,6 +1537,10 @@ public class Plot {
: loc.getY(); : loc.getY();
return Location.at(plot.getWorldName(), x, y, z, loc.getYaw(), loc.getPitch()); return Location.at(plot.getWorldName(), x, y, z, loc.getYaw(), loc.getPitch());
} }
if (getArea() instanceof SinglePlotArea) {
int y = isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63;
return Location.at(plot.getWorldName(), 0, y, 0, 0, 0);
}
// Side // Side
return plot.getSideSynchronous(); return plot.getSideSynchronous();
} }
@ -1551,13 +1562,18 @@ public class Plot {
int z; int z;
if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) { if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) {
// center // center
CuboidRegion largest = plot.getLargestRegion(); if (getArea() instanceof SinglePlotArea) {
x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest x = 0;
.getMinimumPoint() z = 0;
.getX(); } else {
z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ() >> 1) + largest CuboidRegion largest = plot.getLargestRegion();
.getMinimumPoint() x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest
.getZ(); .getMinimumPoint()
.getX();
z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ() >> 1) + largest
.getMinimumPoint()
.getZ();
}
} else { } else {
// specific // specific
Location bot = plot.getBottomAbs(); Location bot = plot.getBottomAbs();
@ -1582,6 +1598,10 @@ public class Plot {
return; return;
} }
// Side // Side
if (getArea() instanceof SinglePlotArea) {
int y = isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63;
result.accept(Location.at(plot.getWorldName(), 0, y, 0, 0, 0));
}
plot.getSide(result); plot.getSide(result);
} }

View File

@ -286,15 +286,13 @@ public class StringMan {
} }
public static boolean isEqualIgnoreCase(String a, String b) { public static boolean isEqualIgnoreCase(String a, String b) {
return (a == b) || ((a != null) && (b != null) && (a.length() == b.length()) && a return (a.equals(b)) || ((a != null) && (b != null) && (a.length() == b.length()) && a
.equalsIgnoreCase(b)); .equalsIgnoreCase(b));
} }
public static String repeat(String s, int n) { public static String repeat(String s, int n) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < n; i++) { sb.append(String.valueOf(s).repeat(Math.max(0, n)));
sb.append(s);
}
return sb.toString(); return sb.toString();
} }

View File

@ -22,7 +22,7 @@
"web.plot_merged": "<prefix><red>This plot is merged and therefore cannot be downloaded</red>", "web.plot_merged": "<prefix><red>This plot is merged and therefore cannot be downloaded</red>",
"web.generating_link_failed": "<prefix><red>Failed to generate download link for plot <plot>!</red>", "web.generating_link_failed": "<prefix><red>Failed to generate download link for plot <plot>!</red>",
"web.generation_link_success": "<prefix><gold>Download: <gray><click:open_url:<download>><download></click></gray> \n Deletion: <gray><click:open_url:<delete>><delete></click></gray>\n<red>Attention: Opening the deletion link will delete the file immediately.</red></gold>", "web.generation_link_success": "<prefix><gold>Download: <gray><click:open_url:<download>><download></click></gray> \n Deletion: <gray><click:open_url:<delete>><delete></click></gray>\n<red>Attention: Opening the deletion link will delete the file immediately.</red></gold>",
"web.generation_link_success_legacy_world": "<prefix><gold>Download: <gray><click:open_url:<url>><url></click></gray>", "web.generation_link_success_legacy_world": "<prefix><gold>Download: <gray><click:open_url:<url>><url></click></gray></gold>",
"web.save_failed": "<prefix><red>Failed to save.</red>", "web.save_failed": "<prefix><red>Failed to save.</red>",
"web.load_null": "<prefix><gray>Please use </gray><dark_aqua><command> </dark_aqua><gray>to get a list of schematics.</gray>", "web.load_null": "<prefix><gray>Please use </gray><dark_aqua><command> </dark_aqua><gray>to get a list of schematics.</gray>",
"web.load_failed": "<prefix><red>Failed to load schematic.</red>", "web.load_failed": "<prefix><red>Failed to load schematic.</red>",

View File

@ -72,10 +72,18 @@ allprojects {
plugins.withId("java") { plugins.withId("java") {
the<JavaPluginExtension>().toolchain { the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(16)) languageVersion.set(JavaLanguageVersion.of(17))
} }
} }
tasks.compileJava.configure {
options.release.set(16)
}
configurations.all {
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
}
configure<LicenseExtension> { configure<LicenseExtension> {
header(rootProject.file("HEADER.txt")) header(rootProject.file("HEADER.txt"))
include("**/*.java") include("**/*.java")

View File

@ -1,15 +1,15 @@
[versions] [versions]
# Minecraft expectations # Minecraft expectations
gson = "2.8.0" # Version set by Minecraft gson = "2.8.9" # Version set by Minecraft
log4j-api = "2.16.0" # Version set by Minecraft log4j-api = "2.17.0" # Version set by Minecraft
guava = "21.0" # Version set by Minecraft guava = "31.0.1-jre" # Version set by Minecraft
# Platform expectations # Platform expectations
paper = "1.17.1-R0.1-SNAPSHOT" paper = "1.18.1-R0.1-SNAPSHOT"
checker-qual = "3.20.0" checker-qual = "3.21.0"
guice = "5.0.1" guice = "5.0.1"
findbugs = "3.0.1" findbugs = "3.0.1"
snakeyaml = "1.28" # Version set by Bukkit snakeyaml = "1.30" # Version set by Bukkit
# Adventure & MiniMessage # Adventure & MiniMessage
adventure-api = "4.10.0-SNAPSHOT" adventure-api = "4.10.0-SNAPSHOT"
@ -19,9 +19,9 @@ adventure-platform-bukkit = "4.0.1"
worldedit = "7.2.8" worldedit = "7.2.8"
fawe = "1.17-419" fawe = "1.17-419"
vault = "1.7.1" vault = "1.7.1"
placeholderapi = "2.10.10" placeholderapi = "2.11.0"
luckperms = "5.3" luckperms = "5.3"
essentialsx = "2.19.0" essentialsx = "2.19.2"
hyperverse = "0.6.0-SNAPSHOT" hyperverse = "0.6.0-SNAPSHOT"
mvdwapi = "3.1.1" mvdwapi = "3.1.1"
@ -30,7 +30,7 @@ prtree = "2.0.0"
aopalliance = "1.0" aopalliance = "1.0"
rorledning = "1.4.0-SNAPSHOT" rorledning = "1.4.0-SNAPSHOT"
arkitektonika = "2.1.1" arkitektonika = "2.1.1"
paster = "1.1.1" paster = "1.1.3"
bstats = "2.2.1" bstats = "2.2.1"
paperlib = "1.0.7" paperlib = "1.0.7"
squirrelid = "0.3.0" squirrelid = "0.3.0"
@ -38,7 +38,7 @@ serverlib = "2.3.1"
http4j = "1.3" http4j = "1.3"
# Gradle plugins # Gradle plugins
shadow = "7.1.0" shadow = "7.1.1"
grgit = "4.1.1" grgit = "4.1.1"
licenser = "0.6.1" licenser = "0.6.1"
nexus = "1.1.0" nexus = "1.1.0"

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists