mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-03 06:04:43 +02:00
Compare commits
1 Commits
docs/ploti
...
remove-coc
Author | SHA1 | Date | |
---|---|---|---|
701a6f95b4 |
@ -550,7 +550,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
this.startMetrics();
|
||||
|
||||
if (Settings.Enabled_Components.WORLDS) {
|
||||
TaskManager.getPlatformImplementation().taskRepeat(this::unload, TaskTime.seconds(10L));
|
||||
TaskManager.getPlatformImplementation().taskRepeat(this::unload, TaskTime.seconds(1L));
|
||||
try {
|
||||
singleWorldListener = injector().getInstance(SingleWorldListener.class);
|
||||
Bukkit.getPluginManager().registerEvents(singleWorldListener, this);
|
||||
|
@ -25,9 +25,9 @@ import java.util.UUID;
|
||||
public interface OfflinePlotPlayer extends PermissionHolder {
|
||||
|
||||
/**
|
||||
* Returns the UUID of the player.
|
||||
* Gets the {@code UUID} of this player
|
||||
*
|
||||
* @return the UUID of the player
|
||||
* @return the player {@link UUID}
|
||||
*/
|
||||
UUID getUUID();
|
||||
|
||||
@ -39,9 +39,9 @@ public interface OfflinePlotPlayer extends PermissionHolder {
|
||||
long getLastPlayed();
|
||||
|
||||
/**
|
||||
* Returns the name of the player.
|
||||
* Gets the name of this player.
|
||||
*
|
||||
* @return the name of the player
|
||||
* @return the player name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
|
@ -273,9 +273,8 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
|
||||
return this.meta == null ? null : this.meta.remove(key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the name of the player.
|
||||
* This player's name.
|
||||
*
|
||||
* @return the name of the player
|
||||
*/
|
||||
|
@ -26,8 +26,8 @@ import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/**
|
||||
* The PlotId class represents a Plot's x and y coordinates within a {@link PlotArea}. PlotId x,y values do not correspond to Block locations.
|
||||
* A PlotId instance can be created using the {@link #of(int, int)} method or parsed from a string using the {@link #fromString(String)} method.
|
||||
* Plot (X,Y) tuples for plot locations
|
||||
* within a plot area
|
||||
*/
|
||||
public final class PlotId {
|
||||
|
||||
@ -36,10 +36,10 @@ public final class PlotId {
|
||||
private final int hash;
|
||||
|
||||
/**
|
||||
* Constructs a new PlotId with the given x and y coordinates.
|
||||
* PlotId class (PlotId x,y values do not correspond to Block locations)
|
||||
*
|
||||
* @param x the x-coordinate of the plot
|
||||
* @param y the y-coordinate of the plot
|
||||
* @param x The plot x coordinate
|
||||
* @param y The plot y coordinate
|
||||
*/
|
||||
private PlotId(final int x, final int y) {
|
||||
this.x = x;
|
||||
@ -48,11 +48,11 @@ public final class PlotId {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new PlotId instance with the specified x and y coordinates.
|
||||
* Create a new plot ID instance
|
||||
*
|
||||
* @param x the x-coordinate of the plot
|
||||
* @param y the y-coordinate of the plot
|
||||
* @return a new PlotId instance with the specified x and y coordinates
|
||||
* @param x The plot x coordinate
|
||||
* @param y The plot y coordinate
|
||||
* @return a new PlotId at x,y
|
||||
*/
|
||||
public static @NonNull PlotId of(final int x, final int y) {
|
||||
return new PlotId(x, y);
|
||||
@ -74,13 +74,10 @@ public final class PlotId {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a PlotId object from the given string, or null if the string is invalid.
|
||||
* The string should be in the format "x;y" where x and y are integers.
|
||||
* The string can also contain any combination of the characters ";_,."
|
||||
* as delimiters.
|
||||
* Attempt to parse a plot ID from a string
|
||||
*
|
||||
* @param string the string to parse
|
||||
* @return a PlotId object parsed from the given string, or null if the string is invalid
|
||||
* @param string ID string
|
||||
* @return Plot ID, or {@code null} if none could be parsed
|
||||
*/
|
||||
public static @Nullable PlotId fromStringOrNull(final @NonNull String string) {
|
||||
final String[] parts = string.split("[;_,.]");
|
||||
@ -98,39 +95,39 @@ public final class PlotId {
|
||||
return of(x, y);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a new PlotId instance from the given hash.
|
||||
* Gets the PlotId from the HashCode<br>
|
||||
* Note: Only accurate for small x,z values (short)
|
||||
*
|
||||
* @param hash the hash to unpair
|
||||
* @return a new PlotId instance
|
||||
* @param hash ID hash
|
||||
* @return Plot ID
|
||||
*/
|
||||
public static @NonNull PlotId unpair(final int hash) {
|
||||
return PlotId.of(hash >> 16, hash & 0xFFFF);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the x-coordinate of this Plot ID.
|
||||
* Get the ID X component
|
||||
*
|
||||
* @return the x-coordinate of this Plot ID
|
||||
* @return X component
|
||||
*/
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the y-coordinate of this Plot ID.
|
||||
* Get the ID Y component
|
||||
*
|
||||
* @return the y-coordinate of this Plot ID
|
||||
* @return Y component
|
||||
*/
|
||||
public int getY() {
|
||||
return this.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next Plot ID for claiming purposes based on the current Plot ID.
|
||||
* Get the next plot ID for claiming purposes
|
||||
*
|
||||
* @return the next Plot ID
|
||||
* @return Next plot ID
|
||||
*/
|
||||
public @NonNull PlotId getNextId() {
|
||||
final int absX = Math.abs(x);
|
||||
@ -162,11 +159,10 @@ public final class PlotId {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new Plot ID in the specified relative direction based on the
|
||||
* current Plot ID.
|
||||
* Get the PlotId in a relative direction
|
||||
*
|
||||
* @param direction the direction in which to get the relative Plot ID
|
||||
* @return the relative Plot ID
|
||||
* @param direction Direction
|
||||
* @return Relative plot ID
|
||||
*/
|
||||
public @NonNull PlotId getRelative(final @NonNull Direction direction) {
|
||||
return switch (direction) {
|
||||
@ -197,11 +193,10 @@ public final class PlotId {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of this Plot ID in the format "x;y".
|
||||
* Get a String representation of the plot ID where the
|
||||
* components are separated by ";"
|
||||
*
|
||||
* <p> The format is {@code x + ";" + y}
|
||||
*
|
||||
* @return a string representation of this Plot ID
|
||||
* @return {@code x + ";" + y}
|
||||
*/
|
||||
@Override
|
||||
public @NonNull String toString() {
|
||||
@ -209,40 +204,41 @@ public final class PlotId {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of this Plot ID with the specified separator.
|
||||
* <p>
|
||||
* The format is {@code x + separator + y}
|
||||
* Get a String representation of the plot ID where the
|
||||
* components are separated by a specified string
|
||||
*
|
||||
* @param separator the separator to use between the X and Y coordinates
|
||||
* @return a string representation of this Plot ID with the specified separator
|
||||
* @param separator Separator
|
||||
* @return {@code x + separator + y}
|
||||
*/
|
||||
public @NonNull String toSeparatedString(String separator) {
|
||||
return this.getX() + separator + this.getY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of this Plot ID in the format "x,y".
|
||||
* Get a String representation of the plot ID where the
|
||||
* components are separated by ","
|
||||
*
|
||||
* @return a string representation of this Plot ID
|
||||
* @return {@code x + "," + y}
|
||||
*/
|
||||
public @NonNull String toCommaSeparatedString() {
|
||||
return this.getX() + "," + this.getY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of this Plot ID in the format "x_y".
|
||||
* Get a String representation of the plot ID where the
|
||||
* components are separated by "_"
|
||||
*
|
||||
* @return a string representation of this Plot ID
|
||||
* @return {@code x + "_" + y}
|
||||
*/
|
||||
|
||||
public @NonNull String toUnderscoreSeparatedString() {
|
||||
return this.getX() + "_" + this.getY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of this Plot ID in the format "x-y".
|
||||
* Get a String representation of the plot ID where the
|
||||
* components are separated by "-"
|
||||
*
|
||||
* @return a string representation of this Plot ID
|
||||
* @return {@code x + "-" + y}
|
||||
*/
|
||||
public @NonNull String toDashSeparatedString() {
|
||||
return this.getX() + "-" + this.getY();
|
||||
@ -254,10 +250,6 @@ public final class PlotId {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* An iterator that iterates over a range of {@link PlotId}s.
|
||||
* The range is defined by a start and end {@link PlotId}.
|
||||
*/
|
||||
public static final class PlotRangeIterator implements Iterator<PlotId>, Iterable<PlotId> {
|
||||
|
||||
private final PlotId start;
|
||||
@ -273,13 +265,6 @@ public final class PlotId {
|
||||
this.y = this.start.getY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new {@link PlotRangeIterator} that iterates over the range of Plots between the specified start and end Plots (inclusive).
|
||||
*
|
||||
* @param start the starting Plot of the range
|
||||
* @param end the ending Plot of the range
|
||||
* @return a new {@link PlotRangeIterator} that iterates over the range of Plots between the specified start and end Plots (inclusive)
|
||||
*/
|
||||
public static PlotRangeIterator range(final @NonNull PlotId start, final @NonNull PlotId end) {
|
||||
return new PlotRangeIterator(start, end);
|
||||
}
|
||||
|
@ -67,25 +67,14 @@ public class PlotItemStack {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of items in this stack.
|
||||
* Valid values range from 1-255.
|
||||
*
|
||||
* @return the amount of items in this stack
|
||||
*/
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the given name of this stack of items. The name is displayed when
|
||||
* hovering over the item.
|
||||
*
|
||||
* @return the given name of this stack of items
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String[] getLore() {
|
||||
return lore;
|
||||
}
|
||||
|
@ -891,6 +891,7 @@ public final class PlotModificationManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* /**
|
||||
* Sets components such as border, wall, floor.
|
||||
* (components are generator specific)
|
||||
*
|
||||
|
@ -18,25 +18,9 @@
|
||||
*/
|
||||
package com.plotsquared.core.plot;
|
||||
|
||||
/**
|
||||
* The different types of weather that can be set for a Plot.
|
||||
*/
|
||||
public enum PlotWeather {
|
||||
|
||||
/**
|
||||
* Rainy weather conditions
|
||||
*/
|
||||
RAIN,
|
||||
/**
|
||||
* Clear weather conditions
|
||||
*/
|
||||
CLEAR,
|
||||
/**
|
||||
* Use the weather of the world the plot is in
|
||||
*/
|
||||
WORLD,
|
||||
/**
|
||||
* Turn off weather for the plot
|
||||
*/
|
||||
OFF
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ log4j = "2.19.0"
|
||||
|
||||
# Plugins
|
||||
worldedit = "7.2.15"
|
||||
fawe = "2.7.1"
|
||||
fawe = "2.7.0"
|
||||
placeholderapi = "2.11.3"
|
||||
luckperms = "5.4"
|
||||
essentialsx = "2.20.1"
|
||||
@ -30,12 +30,12 @@ bstats = "3.0.2"
|
||||
paperlib = "1.0.8"
|
||||
informative-annotations = "1.3"
|
||||
vault = "1.7.1"
|
||||
serverlib = "2.3.4"
|
||||
serverlib = "2.3.1"
|
||||
|
||||
# Gradle plugins
|
||||
shadow = "8.1.1"
|
||||
grgit = "4.1.1"
|
||||
spotless = "6.21.0"
|
||||
spotless = "6.20.0"
|
||||
nexus = "1.3.0"
|
||||
runPaper = "2.1.0"
|
||||
|
||||
|
Reference in New Issue
Block a user