mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 22:16:22 +00:00
feat: make warmup cancellation conditions configurable, close #564
This commit is contained in:
2 files changed
+8
-2
No files matched your search
@@ -137,6 +137,12 @@ public final class Settings {
|
|||||||
@Comment("How long a player has to stand still and not take damage for when teleporting (in seconds) ")
|
@Comment("How long a player has to stand still and not take damage for when teleporting (in seconds) ")
|
||||||
private int teleportWarmupTime = 5;
|
private int teleportWarmupTime = 5;
|
||||||
|
|
||||||
|
@Comment("Whether the teleport warmup timer should be cancelled if the player takes damage")
|
||||||
|
private boolean teleportWarmupCancelOnDamage = true;
|
||||||
|
|
||||||
|
@Comment("Whether the teleport warmup timer should be cancelled if the player moves")
|
||||||
|
private boolean teleportWarmupCancelOnMove = true;
|
||||||
|
|
||||||
@Comment("Where the teleport warmup timer should display (CHAT, ACTION_BAR, TITLE, SUBTITLE or NONE)")
|
@Comment("Where the teleport warmup timer should display (CHAT, ACTION_BAR, TITLE, SUBTITLE or NONE)")
|
||||||
private Locales.DisplaySlot teleportWarmupDisplay = Locales.DisplaySlot.ACTION_BAR;
|
private Locales.DisplaySlot teleportWarmupDisplay = Locales.DisplaySlot.ACTION_BAR;
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public class TimedTeleport extends Teleport implements Runnable, Completable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cancel the timed teleport if the player takes damage
|
// Cancel the timed teleport if the player takes damage
|
||||||
if (hasTeleporterTakenDamage()) {
|
if (hasTeleporterTakenDamage() && plugin.getSettings().getGeneral().isTeleportWarmupCancelOnDamage()) {
|
||||||
plugin.getLocales().getLocale("teleporting_cancelled_damage")
|
plugin.getLocales().getLocale("teleporting_cancelled_damage")
|
||||||
.ifPresent(teleporter::sendMessage);
|
.ifPresent(teleporter::sendMessage);
|
||||||
plugin.getLocales().getLocale("teleporting_action_bar_cancelled")
|
plugin.getLocales().getLocale("teleporting_action_bar_cancelled")
|
||||||
@@ -152,7 +152,7 @@ public class TimedTeleport extends Teleport implements Runnable, Completable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cancel the timed teleport if the player moves
|
// Cancel the timed teleport if the player moves
|
||||||
if (hasTeleporterMoved()) {
|
if (hasTeleporterMoved() && plugin.getSettings().getGeneral().isTeleportWarmupCancelOnMove()) {
|
||||||
plugin.getLocales().getLocale("teleporting_cancelled_movement")
|
plugin.getLocales().getLocale("teleporting_cancelled_movement")
|
||||||
.ifPresent(teleporter::sendMessage);
|
.ifPresent(teleporter::sendMessage);
|
||||||
plugin.getLocales().getLocale("teleporting_action_bar_cancelled")
|
plugin.getLocales().getLocale("teleporting_action_bar_cancelled")
|
||||||
|
|||||||
Reference in new issue
Block a user