Compare commits

..

1 Commits

Author SHA1 Message Date
5087e9776f Update dependency com.github.johnrengelman.shadow to v8 2023-03-03 18:44:22 +00:00
15 changed files with 12 additions and 209 deletions

View File

@ -11,7 +11,7 @@ jobs:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: PlotSquared Release
DISCORD_AVATAR: https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.png
uses: Ilshidur/action-discord@08d9328877d6954120eef2b07abbc79249bb6210 # ratchet:Ilshidur/action-discord@0.3.2
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9 # ratchet:Ilshidur/action-discord@0.3.2
with:
args: |
"<@&525015541815967744> <@&679322738552471574> <@&699293353862496266>"

View File

@ -71,7 +71,6 @@ import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.type.Dispenser;
import org.bukkit.block.data.type.Farmland;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Fireball;
import org.bukkit.entity.Player;
@ -710,33 +709,20 @@ public class BlockEventListener implements Listener {
Block block = event.getBlock();
Location location = BukkitUtil.adapt(block.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getOwnedPlot(location);
if (plot == null) {
event.setCancelled(true);
return;
}
if (block.getBlockData() instanceof Farmland farmland && event.getNewState().getBlockData() instanceof Farmland newFarmland) {
int currentMoisture = farmland.getMoisture();
int newMoisture = newFarmland.getMoisture();
// farmland gets moisturizes
if (newMoisture > currentMoisture) {
return;
Material blockType = block.getType();
if (blockType == Material.FARMLAND) {
if (!plot.getFlag(SoilDryFlag.class)) {
plot.debug("Soil could not dry because soil-dry = false");
event.setCancelled(true);
}
if (plot.getFlag(SoilDryFlag.class)) {
return;
}
plot.debug("Soil could not dry because soil-dry = false");
event.setCancelled(true);
}
}

View File

@ -50,9 +50,7 @@ public class Config {
* @param root configuration class
* @param <T> value type
* @return value
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
@SuppressWarnings("unchecked")
public static <T> T get(String key, Class<?> root) {
String[] split = key.split("\\.");
@ -447,10 +445,6 @@ public class Config {
return INSTANCES.values();
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public Collection<String> getSections() {
return INSTANCES.keySet();
}

View File

@ -22,7 +22,7 @@ import com.sk89q.worldedit.entity.Entity;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* @since 6.11.1
* @since TODO
*/
public abstract class EntityEvent {

View File

@ -380,10 +380,6 @@ public class HybridUtils {
run.run();
}
/**
* @deprecated Unused internally and poor implementation. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public int checkModified(QueueCoordinator queue, int x1, int x2, int y1, int y2, int z1, int z2, BlockState[] blocks) {
int count = 0;
for (int y = y1; y <= y2; y++) {

View File

@ -79,10 +79,6 @@ public class PlotSettings {
this.ratings = ratings;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release. Use {@link PlotSettings#setMerged(Direction, boolean)}
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public boolean setMerged(int direction, boolean merged) {
if (this.merged[direction] != merged) {
this.merged[direction] = merged;

View File

@ -114,9 +114,7 @@ public final class BlockUtil {
*
* @param commaDelimited List of block states
* @return Parsed block states
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static @NonNull BlockState[] parse(final @NonNull String commaDelimited) {
final String[] split = commaDelimited.split(",(?![^\\(\\[]*[\\]\\)])");
final BlockState[] result = new BlockState[split.length];
@ -132,9 +130,7 @@ public final class BlockUtil {
* @param map Serialized block state
* @return Deserialized block state, or {@code null} if the map is
* not a properly serialized block state
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static @Nullable BlockState deserialize(final @NonNull Map<String, Object> map) {
if (map.containsKey("material")) {
final Object object = map.get("material");

View File

@ -114,9 +114,7 @@ public class ChunkUtil {
* @param pos2 Region maximum point
* @param chunk BlockVector2 of chunk coordinates
* @return {@code true} if the region pos1-pos2 contains the chunk
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean isWholeChunk(@NonNull Location pos1, @NonNull Location pos2, @NonNull BlockVector2 chunk) {
int x1 = pos1.getX();
int z1 = pos1.getZ();

View File

@ -70,67 +70,35 @@ public class MathMan {
return result;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static long pairInt(int x, int y) {
return (((long) x) << 32) | (y & 0xffffffffL);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static int unpairIntX(long pair) {
return (int) (pair >> 32);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static int unpairIntY(long pair) {
return (int) pair;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static byte pair16(byte x, byte y) {
return (byte) (x + (y << 4));
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static byte unpair16x(byte value) {
return (byte) (value & 0xF);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static byte unpair16y(byte value) {
return (byte) ((value >> 4) & 0xF);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static long inverseRound(double val) {
long round = Math.round(val);
return (long) (round + Math.signum(val - round));
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static int sqrt(int x) {
int xn;
@ -207,10 +175,6 @@ public class MathMan {
return count / array.length;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static double getMean(double[] array) {
double count = 0;
for (double i : array) {
@ -227,19 +191,10 @@ public class MathMan {
return (a & b) + (a ^ b) / 2;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static short unpairX(int hash) {
return (short) (hash >> 16);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static short unpairY(int hash) {
return (short) (hash & 0xFFFF);
}
@ -250,19 +205,13 @@ public class MathMan {
* @param yaw yaw
* @param pitch pitch
* @return x, y, z unit vector
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static float[] getDirection(float yaw, float pitch) {
double pitch_sin = Math.sin(pitch);
return new float[]{(float) (pitch_sin * Math.cos(yaw)),
(float) (pitch_sin * Math.sin(yaw)), (float) Math.cos(pitch)};
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static int floorMod(int x, int y) {
int i = x % y;
if (i < 0) {
@ -282,18 +231,12 @@ public class MathMan {
* @param y y
* @param z z
* @return pitch and yaw of x,y,z from 0,0,0
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static float[] getPitchAndYaw(float x, float y, float z) {
float distance = sqrtApprox((z * z) + (x * x));
return new float[]{atan2(y, distance), atan2(x, z)};
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static final float atan2(float y, float x) {
float add;
float mul;
@ -329,28 +272,15 @@ public class MathMan {
return (atan2[(yi * ATAN2_DIM) + xi] + add) * mul;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static float sqrtApprox(float f) {
return f * Float.intBitsToFloat(0x5f375a86 - (Float.floatToIntBits(f) >> 1));
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static double sqrtApprox(double d) {
return Double
.longBitsToDouble(((Double.doubleToLongBits(d) - (1L << 52)) >> 1) + (1L << 61));
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static float invSqrt(float x) {
float xhalf = 0.5f * x;
int i = Float.floatToIntBits(x);
@ -391,10 +321,6 @@ public class MathMan {
return true;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static double getSD(double[] array, double av) {
double sd = 0;
for (double element : array) {
@ -411,10 +337,6 @@ public class MathMan {
return Math.sqrt(sd / array.length);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static int mod(int x, int y) {
if (isPowerOfTwo(y)) {
return x & (y - 1);
@ -422,10 +344,6 @@ public class MathMan {
return x % y;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static int unsignedmod(int x, int y) {
if (isPowerOfTwo(y)) {
return x & (y - 1);
@ -433,10 +351,6 @@ public class MathMan {
return x % y;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean isPowerOfTwo(int number) {
return (number & (number - 1)) == 0;
}

View File

@ -95,10 +95,6 @@ public class RegionUtil {
.getY() && y <= max.getY();
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static @NonNull Rectangle2D toRectangle(final @NonNull CuboidRegion region) {
final BlockVector2 min = region.getMinimumPoint().toBlockVector2();
final BlockVector2 max = region.getMaximumPoint().toBlockVector2();

View File

@ -39,10 +39,6 @@ public class StringMan {
// Stolen from https://stackoverflow.com/a/366532/12620913 | Debug: https://regex101.com/r/DudJLb/1
private static final Pattern STRING_SPLIT_PATTERN = Pattern.compile("[^\\s\"]+|\"([^\"]*)\"");
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static String replaceFromMap(String string, Map<String, String> replacements) {
StringBuilder sb = new StringBuilder(string);
int size = string.length();
@ -74,10 +70,6 @@ public class StringMan {
return count;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static String getString(Object obj) {
if (obj == null) {
return "null";
@ -110,10 +102,6 @@ public class StringMan {
}
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static String replaceFirst(char c, String s) {
if (s == null) {
return "";
@ -140,10 +128,6 @@ public class StringMan {
return s;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static String replaceAll(String string, Object... pairs) {
StringBuilder sb = new StringBuilder(string);
for (int i = 0; i < pairs.length; i += 2) {
@ -160,10 +144,6 @@ public class StringMan {
return sb.toString();
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean isAlphanumeric(String str) {
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
@ -185,10 +165,6 @@ public class StringMan {
return true;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean isAlpha(String str) {
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
@ -209,26 +185,14 @@ public class StringMan {
return join(array, delimiter);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static String join(Collection<?> collection, char delimiter) {
return join(collection.toArray(), delimiter + "");
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean isAsciiPrintable(char c) {
return (c >= ' ') && (c < '');
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean isAsciiPrintable(String s) {
for (char c : s.toCharArray()) {
if (!isAsciiPrintable(c)) {
@ -285,10 +249,6 @@ public class StringMan {
return result.toString();
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static String join(int[] array, String delimiter) {
Integer[] wrapped = new Integer[array.length];
for (int i = 0; i < array.length; i++) {
@ -297,10 +257,6 @@ public class StringMan {
return join(wrapped, delimiter);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean isEqualToAny(String a, String... args) {
for (String arg : args) {
if (StringMan.isEqual(a, arg)) {
@ -328,10 +284,6 @@ public class StringMan {
return a.equals(b);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean isEqualIgnoreCase(String a, String b) {
return a.equals(b) || ((a != null) && (b != null) && (a.length() == b.length()) && a
.equalsIgnoreCase(b));
@ -343,10 +295,6 @@ public class StringMan {
return sb.toString();
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean contains(String name, char c) {
for (char current : name.toCharArray()) {
if (c == current) {
@ -356,10 +304,6 @@ public class StringMan {
return false;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public <T> Collection<T> match(Collection<T> col, String startsWith) {
if (col == null) {
return null;

View File

@ -58,10 +58,6 @@ public class WEManager {
return false;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean maskContains(Set<CuboidRegion> mask, double dx, double dy, double dz) {
int x = Math.toIntExact(Math.round(dx >= 0 ? dx - 0.5 : dx + 0.5));
int y = Math.toIntExact(Math.round(dy - 0.5));
@ -74,10 +70,6 @@ public class WEManager {
return false;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean maskContains(Set<CuboidRegion> mask, double dx, double dz) {
int x = Math.toIntExact(Math.round(dx >= 0 ? dx - 0.5 : dx + 0.5));
int z = Math.toIntExact(Math.round(dz >= 0 ? dz - 0.5 : dz + 0.5));
@ -124,18 +116,10 @@ public class WEManager {
return regions;
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean intersects(CuboidRegion region1, CuboidRegion region2) {
return RegionUtil.intersects(region1, region2);
}
/**
* @deprecated Unused internally. Scheduled for removal in next major release.
*/
@Deprecated(forRemoval = true, since = "6.11.1")
public static boolean regionContains(CuboidRegion selection, HashSet<CuboidRegion> mask) {
for (CuboidRegion region : mask) {
if (intersects(region, selection)) {

View File

@ -18,7 +18,7 @@ plugins {
}
group = "com.plotsquared"
version = "6.11.2-SNAPSHOT"
version = "6.11.1-SNAPSHOT"
if (!File("$rootDir/.git").exists()) {
logger.lifecycle("""

View File

@ -14,12 +14,12 @@ mvdwapi = "3.1.1"
prtree = "2.0.1"
aopalliance = "1.0"
cloud-services = "1.8.2"
arkitektonika = "2.1.2"
arkitektonika = "2.1.1"
squirrelid = "0.3.1"
http4j = "1.3"
# Gradle plugins
shadow = "7.1.2"
shadow = "8.1.0"
grgit = "4.1.1"
spotless = "6.16.0"
nexus = "1.2.0"

View File

@ -4,7 +4,6 @@
"config:base",
":semanticCommitsDisabled"
],
"labels": ["dependencies"],
"rebaseWhen": "conflicted",
"schedule": ["on the first day of the week"]
"labels": ["Renovate"],
"rebaseWhen": "conflicted"
}