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