mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 22:16:22 +00:00
Closes #8, adds options for setting custom teleport sounds
This commit is contained in:
1 parent
5c6a3df5a4
commit
90127d819d
4 files changed
+21
-1
No files matched your search
@@ -53,6 +53,10 @@ public class Settings {
|
|||||||
int teleportRequestExpiryTime;
|
int teleportRequestExpiryTime;
|
||||||
int teleportWarmupTime;
|
int teleportWarmupTime;
|
||||||
|
|
||||||
|
// Sounds
|
||||||
|
String teleportationCompleteSound;
|
||||||
|
String teleportWarmupSound;
|
||||||
|
|
||||||
// Number of items per page on lists
|
// Number of items per page on lists
|
||||||
int privateHomesPerPage;
|
int privateHomesPerPage;
|
||||||
int publicHomesPerPage;
|
int publicHomesPerPage;
|
||||||
@@ -130,6 +134,9 @@ public class Settings {
|
|||||||
this.publicHomeCost = configFile.getDouble("economy_integration.costs.make_home_public");
|
this.publicHomeCost = configFile.getDouble("economy_integration.costs.make_home_public");
|
||||||
this.rtpCost = configFile.getDouble("economy_integration.costs.random_teleport");
|
this.rtpCost = configFile.getDouble("economy_integration.costs.random_teleport");
|
||||||
|
|
||||||
|
this.teleportationCompleteSound = configFile.getString("general.sounds.teleportation_complete");
|
||||||
|
this.teleportWarmupSound = configFile.getString("general.sounds.teleportation_warmup");
|
||||||
|
|
||||||
this.checkVanishedPlayers = configFile.getBoolean("handle_vanished_players");
|
this.checkVanishedPlayers = configFile.getBoolean("handle_vanished_players");
|
||||||
|
|
||||||
this.doSpawnCommand = configFile.getBoolean("spawn_command.enabled");
|
this.doSpawnCommand = configFile.getBoolean("spawn_command.enabled");
|
||||||
@@ -308,4 +315,12 @@ public class Settings {
|
|||||||
public int getWarpsPerPage() {
|
public int getWarpsPerPage() {
|
||||||
return warpsPerPage;
|
return warpsPerPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTeleportationCompleteSound() {
|
||||||
|
return teleportationCompleteSound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTeleportWarmupSound() {
|
||||||
|
return teleportWarmupSound;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ public class runEverySecond {
|
|||||||
if (timedTeleport.getTimeRemaining() > 0) {
|
if (timedTeleport.getTimeRemaining() > 0) {
|
||||||
if (!timedTeleport.hasMoved(teleporter)) {
|
if (!timedTeleport.hasMoved(teleporter)) {
|
||||||
if (!timedTeleport.hasLostHealth(teleporter)) {
|
if (!timedTeleport.hasLostHealth(teleporter)) {
|
||||||
teleporter.playSound(teleporter.getLocation(), Sound.BLOCK_NOTE_BLOCK_BANJO, 2, 1);
|
teleporter.playSound(teleporter.getLocation(), Sound.valueOf(HuskHomes.settings.getTeleportWarmupSound()), 2, 1);
|
||||||
messageManager.sendActionBarMessage(teleporter, "teleporting_action_bar_countdown",
|
messageManager.sendActionBarMessage(teleporter, "teleporting_action_bar_countdown",
|
||||||
Integer.toString(timedTeleport.getTimeRemaining()));
|
Integer.toString(timedTeleport.getTimeRemaining()));
|
||||||
timedTeleport.decrementTimeRemaining();
|
timedTeleport.decrementTimeRemaining();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import me.william278.huskhomes2.Objects.RandomPoint;
|
|||||||
import me.william278.huskhomes2.Objects.TeleportationPoint;
|
import me.william278.huskhomes2.Objects.TeleportationPoint;
|
||||||
import me.william278.huskhomes2.Objects.TimedTeleport;
|
import me.william278.huskhomes2.Objects.TimedTeleport;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@@ -33,6 +34,7 @@ public class teleportManager {
|
|||||||
String server = teleportationPoint.getServer();
|
String server = teleportationPoint.getServer();
|
||||||
if (!HuskHomes.settings.doBungee() || server.equals(HuskHomes.settings.getServerID())) {
|
if (!HuskHomes.settings.doBungee() || server.equals(HuskHomes.settings.getServerID())) {
|
||||||
p.teleport(teleportationPoint.getLocation());
|
p.teleport(teleportationPoint.getLocation());
|
||||||
|
p.playSound(p.getLocation(), Sound.valueOf(HuskHomes.settings.getTeleportationCompleteSound()), 1, 1);
|
||||||
messageManager.sendMessage(p, "teleporting_complete");
|
messageManager.sendMessage(p, "teleporting_complete");
|
||||||
dataManager.setPlayerTeleporting(p, false);
|
dataManager.setPlayerTeleporting(p, false);
|
||||||
dataManager.clearPlayerDestination(p.getName());
|
dataManager.clearPlayerDestination(p.getName());
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ general:
|
|||||||
max_sethomes: 10
|
max_sethomes: 10
|
||||||
teleport_warmup_time: 5
|
teleport_warmup_time: 5
|
||||||
teleport_request_expiry_time: 60
|
teleport_request_expiry_time: 60
|
||||||
|
sounds:
|
||||||
|
teleportation_complete: 'ENTITY_ENDERMAN_TELEPORT'
|
||||||
|
teleportation_warmup: 'BLOCK_NOTE_BLOCK_BANJO'
|
||||||
lists:
|
lists:
|
||||||
private_homes_per_page: 10
|
private_homes_per_page: 10
|
||||||
public_homes_per_page: 10
|
public_homes_per_page: 10
|
||||||
|
|||||||
Reference in new issue
Block a user