Compare commits

..

12 Commits

Author SHA1 Message Date
aed8aae591 Add since annotations 2022-11-14 18:13:58 +00:00
fa53b9c3fe feat: allow the world border to be larger than the road surrounding the outermost plots
- Closes #2962
2022-11-14 15:00:14 +00:00
25ce7a83f1 feat: check merge limits when completing auto-merge (#3868)
- Closes #3748
2022-11-13 11:57:41 +01:00
55c8a590e7 Fix item thrower/owner can be null (#3866)
fix: item thrower/owner can be nuill
 - Fixes #3862
2022-11-12 17:10:21 +01:00
28bd993680 Update dependency com.intellectualsites.bom:bom-1.18.x to v1.18 (#3864)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-06 11:13:29 +01:00
8330f37d8a Back to snapshot for development 2022-11-02 09:35:57 +01:00
985fae65b6 ÂRelease 6.10.3 2022-11-02 09:34:33 +01:00
db2d590e8e fix: account for mismatched road-schematic heights (#3854) 2022-10-23 21:22:21 +02:00
c8d356783a Update dependency com.intellectualsites.bom:bom-1.18.x to v1.17 (#3853)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-20 10:23:56 +02:00
4947450ff0 Back to snapshot for development 2022-10-18 23:14:03 +02:00
de4e91ff62 Release 6.10.2 2022-10-18 23:12:27 +02:00
fe5e3d5f6d Annotate ExpireManager with @Inject (#3852)
fix: annotate ExpireManager with @Inject
2022-10-18 10:17:34 +02:00
12 changed files with 71 additions and 13 deletions

View File

@ -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");

View File

@ -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)) {

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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;
}

View File

@ -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.
*

View File

@ -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;
}

View File

@ -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;

View File

@ -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 {