mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-02 21:54:43 +02:00
Compare commits
12 Commits
fix/expire
...
feature/v6
Author | SHA1 | Date | |
---|---|---|---|
aed8aae591 | |||
fa53b9c3fe | |||
25ce7a83f1 | |||
55c8a590e7 | |||
28bd993680 | |||
8330f37d8a | |||
985fae65b6 | |||
db2d590e8e | |||
c8d356783a | |||
4947450ff0 | |||
de4e91ff62 | |||
fe5e3d5f6d |
@ -104,6 +104,12 @@ public class BlockEventListener117 implements Listener {
|
||||
if (entity instanceof Item item) {
|
||||
UUID itemThrower = item.getThrower();
|
||||
if (plot != null) {
|
||||
if (itemThrower == null && (itemThrower = item.getOwner()) == null) {
|
||||
plot.debug(
|
||||
"A thrown item couldn't trigger sculk sensors because misc-interact = false and the item's owner could not be resolved.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (!plot.isAdded(itemThrower)) {
|
||||
if (!plot.isAdded(itemThrower)) {
|
||||
plot.debug("A thrown item couldn't trigger sculk sensors because misc-interact = false");
|
||||
|
@ -596,7 +596,7 @@ public class PlayerEventListener implements Listener {
|
||||
this.tmpTeleport = true;
|
||||
return;
|
||||
}
|
||||
int border = area.getBorder();
|
||||
int border = area.getBorder(true);
|
||||
int x1;
|
||||
if (x2 > border && this.tmpTeleport) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
@ -687,7 +687,7 @@ public class PlayerEventListener implements Listener {
|
||||
this.tmpTeleport = true;
|
||||
return;
|
||||
}
|
||||
int border = area.getBorder();
|
||||
int border = area.getBorder(true);
|
||||
int z1;
|
||||
if (z2 > border && this.tmpTeleport) {
|
||||
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
|
@ -289,7 +289,7 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
||||
* Get the {@link ExpireManager} implementation for the platform
|
||||
*
|
||||
* @return Expire manager
|
||||
* @since TODO
|
||||
* @since 6.10.2
|
||||
*/
|
||||
default @NonNull ExpireManager expireManager() {
|
||||
return injector().getInstance(ExpireManager.class);
|
||||
|
@ -142,6 +142,14 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ public class Claim extends SubCommand {
|
||||
}
|
||||
}
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
int border = area.getBorder();
|
||||
int border = area.getBorder(false);
|
||||
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
||||
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||
return false;
|
||||
|
@ -124,7 +124,7 @@ public class Merge extends SubCommand {
|
||||
return false;
|
||||
}
|
||||
final int size = plot.getConnectedPlots().size();
|
||||
int max = Permissions.hasPermissionRange(player, "plots.merge", Settings.Limit.MAX_PLOTS);
|
||||
int max = Permissions.hasPermissionRange(player, Permission.PERMISSION_MERGE, Settings.Limit.MAX_PLOTS);
|
||||
PlotMergeEvent event =
|
||||
this.eventDispatcher.callMerge(plot, direction, max, player);
|
||||
if (event.getEventResult() == Result.DENY) {
|
||||
|
@ -298,7 +298,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
int roadSchemHeight;
|
||||
|
||||
if (schematic1 != null) {
|
||||
roadSchemHeight = schematic1.getClipboard().getDimensions().getY();
|
||||
roadSchemHeight = Math.max(
|
||||
schematic1.getClipboard().getDimensions().getY(),
|
||||
schematic2.getClipboard().getDimensions().getY()
|
||||
);
|
||||
maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
|
||||
if (maxSchematicHeight == worldGenHeight) {
|
||||
SCHEM_Y = getMinGenHeight();
|
||||
@ -486,7 +489,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
/**
|
||||
* @deprecated This method should not be available for public API usage and will be made private.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
@Deprecated(forRemoval = true, since = "6.10.2")
|
||||
public void addOverlayBlock(short x, short y, short z, BaseBlock id, boolean rotate, int height) {
|
||||
if (z < 0) {
|
||||
z += this.SIZE;
|
||||
@ -521,7 +524,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
/**
|
||||
* @deprecated This method should not be available for public API usage and will be made private.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
@Deprecated(forRemoval = true, since = "6.10.2")
|
||||
public void addOverlayBiome(short x, short z, BiomeType id) {
|
||||
if (z < 0) {
|
||||
z += this.SIZE;
|
||||
|
@ -2690,6 +2690,11 @@ public class Plot {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum distance of the plot from x=0, z=0.
|
||||
*
|
||||
* @return max block distance from 0,0
|
||||
*/
|
||||
public int getDistanceFromOrigin() {
|
||||
Location bot = getManager().getPlotBottomLocAbs(id);
|
||||
Location top = getManager().getPlotTopLocAbs(id);
|
||||
@ -2703,7 +2708,7 @@ public class Plot {
|
||||
* Expands the world border to include this plot if it is beyond the current border.
|
||||
*/
|
||||
public void updateWorldBorder() {
|
||||
int border = this.area.getBorder();
|
||||
int border = this.area.getBorder(false);
|
||||
if (border == Integer.MAX_VALUE) {
|
||||
return;
|
||||
}
|
||||
|
@ -143,6 +143,7 @@ public abstract class PlotArea {
|
||||
private Map<String, PlotExpression> prices = new HashMap<>();
|
||||
private List<String> schematics = new ArrayList<>();
|
||||
private boolean worldBorder = false;
|
||||
private int extraBorder;
|
||||
private boolean useEconomy = false;
|
||||
private int hash;
|
||||
private CuboidRegion region;
|
||||
@ -352,6 +353,7 @@ public abstract class PlotArea {
|
||||
this.plotChat = config.getBoolean("chat.enabled");
|
||||
this.forcingPlotChat = config.getBoolean("chat.forced");
|
||||
this.worldBorder = config.getBoolean("world.border");
|
||||
this.extraBorder = config.getInt("world.extra_border");
|
||||
this.maxBuildHeight = config.getInt("world.max_height");
|
||||
this.minBuildHeight = config.getInt("world.min_height");
|
||||
this.minGenHeight = config.getInt("world.min_gen_height");
|
||||
@ -469,6 +471,7 @@ public abstract class PlotArea {
|
||||
options.put("event.spawn.custom", this.isSpawnCustom());
|
||||
options.put("event.spawn.breeding", this.isSpawnBreeding());
|
||||
options.put("world.border", this.hasWorldBorder());
|
||||
options.put("world.extra_border", this.getExtaBorder());
|
||||
options.put("home.default", "side");
|
||||
String position = config.getString(
|
||||
"home.nonmembers",
|
||||
@ -908,7 +911,9 @@ public abstract class PlotArea {
|
||||
* Get the plot border distance for a world<br>
|
||||
*
|
||||
* @return The border distance or Integer.MAX_VALUE if no border is set
|
||||
* @deprecated Use {@link PlotArea#getBorder(boolean)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
public int getBorder() {
|
||||
final Integer meta = (Integer) getMeta("worldBorder");
|
||||
if (meta != null) {
|
||||
@ -922,6 +927,27 @@ public abstract class PlotArea {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the plot border distance for a world, specifying whether the returned value should include the world.extra-border
|
||||
* value.
|
||||
*
|
||||
* @param includeExtra If the extra border given by world.extra-border should be included
|
||||
* @return Border distance of Integer.MAX_VALUE if no border is set
|
||||
* @since TODO
|
||||
*/
|
||||
public int getBorder(boolean includeExtra) {
|
||||
final Integer meta = (Integer) getMeta("worldBorder");
|
||||
if (meta != null) {
|
||||
int border = meta + 1;
|
||||
if (border == 0) {
|
||||
return Integer.MAX_VALUE;
|
||||
} else {
|
||||
return includeExtra ? border + extraBorder : border;
|
||||
}
|
||||
}
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup the plot border for a world (usually done when the world is created).
|
||||
*/
|
||||
@ -1181,6 +1207,16 @@ public abstract class PlotArea {
|
||||
return worldBorder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the "extra border" size of the plot area.
|
||||
*
|
||||
* @return Plot area extra border size
|
||||
* @since TODO
|
||||
*/
|
||||
public int getExtaBorder() {
|
||||
return extraBorder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether plot signs are allowed or not.
|
||||
*
|
||||
|
@ -112,7 +112,7 @@ public final class PlotId {
|
||||
* @return Plot ID copy
|
||||
* @deprecated PlotId is immutable, copy is not required.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
@Deprecated(forRemoval = true, since = "6.10.2")
|
||||
public @NonNull PlotId copy() {
|
||||
return this;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class ExpireManager {
|
||||
/**
|
||||
* @deprecated Use {@link PlotPlatform#expireManager()} instead
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "TODO")
|
||||
@Deprecated(forRemoval = true, since = "6.10.2")
|
||||
public static ExpireManager IMP;
|
||||
private final ConcurrentHashMap<UUID, Long> dates_cache;
|
||||
private final ConcurrentHashMap<UUID, Long> account_age_cache;
|
||||
|
@ -19,7 +19,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.plotsquared"
|
||||
version = "6.10.2-SNAPSHOT"
|
||||
version = "6.10.4-SNAPSHOT"
|
||||
|
||||
subprojects {
|
||||
group = rootProject.group
|
||||
@ -65,7 +65,7 @@ subprojects {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.16"))
|
||||
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.18"))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
Reference in New Issue
Block a user