mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 06:34:42 +02:00
Compare commits
10 Commits
6.10.4
...
docs/plot-
Author | SHA1 | Date | |
---|---|---|---|
1646f2f426 | |||
3a8fae47a0 | |||
70cb1cd100 | |||
2067cc1670 | |||
e6338976dd | |||
90ebd5d5ed | |||
c973ee8649 | |||
c1543f034c | |||
6baf339ecb | |||
11906ef1c9 |
@ -142,14 +142,6 @@ public class Auto extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int maxMerge = Permissions.hasPermissionRange(player, Permission.PERMISSION_MERGE, Settings.Limit.MAX_PLOTS);
|
|
||||||
if (sizeX * sizeZ > maxMerge) {
|
|
||||||
player.sendMessage(
|
|
||||||
TranslatableCaption.of("permission.no_permission"),
|
|
||||||
Template.of("node", Permission.PERMISSION_MERGE + "." + (sizeX * sizeZ))
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public class Merge extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final int size = plot.getConnectedPlots().size();
|
final int size = plot.getConnectedPlots().size();
|
||||||
int max = Permissions.hasPermissionRange(player, Permission.PERMISSION_MERGE, Settings.Limit.MAX_PLOTS);
|
int max = Permissions.hasPermissionRange(player, "plots.merge", Settings.Limit.MAX_PLOTS);
|
||||||
PlotMergeEvent event =
|
PlotMergeEvent event =
|
||||||
this.eventDispatcher.callMerge(plot, direction, max, player);
|
this.eventDispatcher.callMerge(plot, direction, max, player);
|
||||||
if (event.getEventResult() == Result.DENY) {
|
if (event.getEventResult() == Result.DENY) {
|
||||||
@ -282,7 +282,28 @@ public class Merge extends SubCommand {
|
|||||||
run.run();
|
run.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!force && !isOnline) {
|
if (force || !isOnline) {
|
||||||
|
if (force || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_MERGE_OTHER_OFFLINE)) {
|
||||||
|
if (plot.getPlotModificationManager().autoMerge(direction, maxSize - size, uuids.iterator().next(), player, terrain)) {
|
||||||
|
if (this.econHandler.isEnabled(plotArea) && price > 0d) {
|
||||||
|
if (!force && this.econHandler.getMoney(player) < price) {
|
||||||
|
player.sendMessage(
|
||||||
|
TranslatableCaption.of("economy.cannot_afford_merge"),
|
||||||
|
Template.of("money", this.econHandler.format(price))
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.econHandler.withdrawMoney(player, price);
|
||||||
|
player.sendMessage(
|
||||||
|
TranslatableCaption.of("economy.removed_balance"),
|
||||||
|
Template.of("money", this.econHandler.format(price))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
player.sendMessage(TranslatableCaption.of("merge.success_merge"));
|
||||||
|
eventDispatcher.callPostMerge(player, plot);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -234,44 +234,52 @@ public class HybridUtils {
|
|||||||
Set<BlockType> types = new HashSet<>();
|
Set<BlockType> types = new HashSet<>();
|
||||||
for (int yIndex = 0; yIndex < height; yIndex++) {
|
for (int yIndex = 0; yIndex < height; yIndex++) {
|
||||||
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
||||||
try {
|
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
||||||
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
if (now == null) {
|
||||||
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
throw new NullPointerException(String.format(
|
||||||
changes[i]++;
|
"\"now\" block null attempting to perform plot analysis. Indexes: x=%d of %d, yIndex=%d" +
|
||||||
}
|
" of %d, z=%d of %d",
|
||||||
if (now.getBlockType().getMaterial().isAir()) {
|
x,
|
||||||
air[i]++;
|
width,
|
||||||
} else {
|
yIndex,
|
||||||
// check vertices
|
height,
|
||||||
// modifications_adjacent
|
z,
|
||||||
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
|
length
|
||||||
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
|
));
|
||||||
faces[i]++;
|
}
|
||||||
}
|
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
||||||
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
|
changes[i]++;
|
||||||
faces[i]++;
|
}
|
||||||
}
|
if (now.getBlockType().getMaterial().isAir()) {
|
||||||
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
|
air[i]++;
|
||||||
faces[i]++;
|
} else {
|
||||||
}
|
// check vertices
|
||||||
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
|
// modifications_adjacent
|
||||||
faces[i]++;
|
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
|
||||||
}
|
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
|
||||||
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
|
faces[i]++;
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!now.equals(now.getBlockType().getDefaultState())) {
|
if (!now.equals(now.getBlockType().getDefaultState())) {
|
||||||
data[i]++;
|
data[i]++;
|
||||||
}
|
|
||||||
types.add(now.getBlockType());
|
|
||||||
}
|
}
|
||||||
} catch (NullPointerException e) {
|
types.add(now.getBlockType());
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
variety[i] = types.size();
|
variety[i] = types.size();
|
||||||
|
@ -162,6 +162,7 @@ public enum Permission {
|
|||||||
PERMISSION_LIST_AREA("plots.list.area"),
|
PERMISSION_LIST_AREA("plots.list.area"),
|
||||||
PERMISSION_ADMIN_COMMAND_LOAD("plots.admin.command.load"),
|
PERMISSION_ADMIN_COMMAND_LOAD("plots.admin.command.load"),
|
||||||
PERMISSION_ADMIN_COMMAND_MERGE("plots.admin.command.merge"),
|
PERMISSION_ADMIN_COMMAND_MERGE("plots.admin.command.merge"),
|
||||||
|
PERMISSION_ADMIN_COMMAND_MERGE_OTHER_OFFLINE("plots.admin.command.merge.other.offline"),
|
||||||
PERMISSION_ADMIN_COMMAND_SET_OWNER("plots.admin.command.setowner"),
|
PERMISSION_ADMIN_COMMAND_SET_OWNER("plots.admin.command.setowner"),
|
||||||
PERMISSION_COMMENT("plots.comment"),
|
PERMISSION_COMMENT("plots.comment"),
|
||||||
PERMISSION_INBOX("plots.inbox"),
|
PERMISSION_INBOX("plots.inbox"),
|
||||||
|
@ -34,7 +34,9 @@ import java.util.UUID;
|
|||||||
* Generic settings class.
|
* Generic settings class.
|
||||||
* - Does not keep a reference to a parent class
|
* - Does not keep a reference to a parent class
|
||||||
* - Direct changes here will not occur in the db (Use the parent plot object for that)
|
* - Direct changes here will not occur in the db (Use the parent plot object for that)
|
||||||
|
* This class is not part of the API and may change at any time. It is recommended to use equivalent methods in the Plot class.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class PlotSettings {
|
public class PlotSettings {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,7 +19,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.plotsquared"
|
group = "com.plotsquared"
|
||||||
version = "6.10.4"
|
version = "6.10.6-SNAPSHOT"
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
group = rootProject.group
|
group = rootProject.group
|
||||||
@ -65,7 +65,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.18"))
|
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.20"))
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
12
gradlew
vendored
12
gradlew
vendored
@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@ -80,10 +80,10 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
@ -143,12 +143,16 @@ fi
|
|||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
1
gradlew.bat
vendored
1
gradlew.bat
vendored
@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
|
|||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user