mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
feat: Split configuration for teleport on claim/auto (#3308)
- Fixes #2953
This commit is contained in:
parent
30d06b7801
commit
c1163cdb2e
@ -556,8 +556,10 @@ public class Settings extends Config {
|
|||||||
public static boolean ON_DEATH = false;
|
public static boolean ON_DEATH = false;
|
||||||
@Comment("Teleport to your plot on login")
|
@Comment("Teleport to your plot on login")
|
||||||
public static boolean ON_LOGIN = false;
|
public static boolean ON_LOGIN = false;
|
||||||
@Comment("Teleport to your plot on claim")
|
@Comment("Teleport to your plot on claim (/plot claim)")
|
||||||
public static boolean ON_CLAIM = true;
|
public static boolean ON_CLAIM = true;
|
||||||
|
@Comment("Teleport to your plot on auto (/plot auto)")
|
||||||
|
public static boolean ON_AUTO = true;
|
||||||
@Comment({"Add a delay to all teleport commands (in seconds)",
|
@Comment({"Add a delay to all teleport commands (in seconds)",
|
||||||
"Assign `plots.teleport.delay.bypass` to bypass the cooldown"})
|
"Assign `plots.teleport.delay.bypass` to bypass the cooldown"})
|
||||||
public static int DELAY = 0;
|
public static int DELAY = 0;
|
||||||
|
@ -1708,9 +1708,14 @@ public class Plot {
|
|||||||
}
|
}
|
||||||
this.getPlotModificationManager().setSign(player.getName());
|
this.getPlotModificationManager().setSign(player.getName());
|
||||||
player.sendMessage(TranslatableCaption.of("working.claimed"), Template.of("plot", this.getId().toString()));
|
player.sendMessage(TranslatableCaption.of("working.claimed"), Template.of("plot", this.getId().toString()));
|
||||||
if (teleport && Settings.Teleport.ON_CLAIM) {
|
if (teleport) {
|
||||||
teleportPlayer(player, auto ? TeleportCause.COMMAND_AUTO : TeleportCause.COMMAND_CLAIM, result -> {
|
if (!auto && Settings.Teleport.ON_CLAIM) {
|
||||||
|
teleportPlayer(player, TeleportCause.COMMAND_CLAIM, result -> {
|
||||||
});
|
});
|
||||||
|
} else if (auto && Settings.Teleport.ON_AUTO) {
|
||||||
|
teleportPlayer(player, TeleportCause.COMMAND_AUTO, result -> {
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PlotArea plotworld = getArea();
|
PlotArea plotworld = getArea();
|
||||||
if (plotworld.isSchematicOnClaim()) {
|
if (plotworld.isSchematicOnClaim()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user