aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker/features')
-rw-r--r--src/main/java/me/Danker/features/CrystalHollowWaypoints.java6
-rw-r--r--src/main/java/me/Danker/features/CustomMusic.java133
2 files changed, 110 insertions, 29 deletions
diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java
index 17578fe..37f709a 100644
--- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java
+++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java
@@ -44,7 +44,7 @@ public class CrystalHollowWaypoints {
World world = mc.theWorld;
if (DankersSkyblockMod.tickAmount % 20 == 0) {
- if (ToggleCommand.crystalAutoWaypoints && Utils.inCrystalHollows && world != null) {
+ if (ToggleCommand.crystalAutoWaypoints && Utils.tabLocation.equals("Crystal Hollows") && world != null) {
boolean found = false;
List<String> scoreboard = ScoreboardHandler.getSidebarLines();
@@ -118,7 +118,7 @@ public class CrystalHollowWaypoints {
$SBECHWP:Mines of Divan@-673,117,426
$SBECHWP:Khazad-dûm@-292,63,281\nFairy Grotto@-216,110,400\njungle temple@-525,110,395\nJungle Temple@-493,101,425\nMines of Divan@-673,117,426
*/
- if (ToggleCommand.crystalHollowWaypoints && Utils.inCrystalHollows) {
+ if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) {
if (!message.contains(player.getName()) && (message.contains(": $DSMCHWP:") || message.contains(": $SBECHWP:"))) {
ChatComponentText add = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [ADD]\n");
add.setChatStyle(add.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dsmaddcrystalhollowwaypoints " + message.substring(message.lastIndexOf(":") + 1))));
@@ -137,7 +137,7 @@ public class CrystalHollowWaypoints {
@SubscribeEvent
public void onWorldRender(RenderWorldLastEvent event) {
- if (ToggleCommand.crystalHollowWaypoints && Utils.inCrystalHollows) {
+ if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) {
for (Waypoint waypoint : waypoints) {
if (waypoint.toggled) Utils.draw3DWaypointString(waypoint, event.partialTicks);
}
diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java
index 5080821..d61b640 100644
--- a/src/main/java/me/Danker/features/CustomMusic.java
+++ b/src/main/java/me/Danker/features/CustomMusic.java
@@ -35,6 +35,29 @@ public class CustomMusic {
public static int bloodroomVolume;
public static Song dungeon;
public static int dungeonVolume;
+ public static Song hub;
+ public static int hubVolume;
+ public static Song island;
+ public static int islandVolume;
+ public static Song dungeonHub;
+ public static int dungeonHubVolume;
+ public static Song farmingIslands;
+ public static int farmingIslandsVolume;
+ public static Song goldMine;
+ public static int goldMineVolume;
+ public static Song deepCaverns;
+ public static int deepCavernsVolume;
+ public static Song dwarvenMines;
+ public static int dwarvenMinesVolume;
+ public static Song crystalHollows;
+ public static int crystalHollowsVolume;
+ public static Song blazingFortress;
+ public static int blazingFortressVolume;
+ public static Song end;
+ public static int endVolume;
+ public static Song park;
+ public static int parkVolume;
+
@SubscribeEvent
public void onWorldChange(WorldEvent.Load event) {
@@ -49,28 +72,66 @@ public class CustomMusic {
EntityPlayerSP player = mc.thePlayer;
World world = mc.theWorld;
if (DankersSkyblockMod.tickAmount % 10 == 0) {
- if (Utils.inDungeons && world != null && player != null) {
- prevInDungeonBossRoom = inDungeonBossRoom;
- List<String> scoreboard = ScoreboardHandler.getSidebarLines();
- if (scoreboard.size() > 2) {
- String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1));
- String secondLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 2));
- if (firstLine.contains("30,30") || // F1
- firstLine.contains("30,125") || // F2
- firstLine.contains("30,225") || // F3
- secondLine.contains("- Healthy") || // F3
- firstLine.contains("30,344") || // F4
- firstLine.contains("livid") || // F5
- firstLine.contains("sadan") || // F6
- firstLine.contains("necron")) { // F7
-
- inDungeonBossRoom = true;
- if (!prevInDungeonBossRoom) {
- bloodroom.stop();
- if (ToggleCommand.dungeonBossMusic) dungeonboss.start();
+ if (world != null && player != null) {
+ if (Utils.inDungeons) {
+ prevInDungeonBossRoom = inDungeonBossRoom;
+ List<String> scoreboard = ScoreboardHandler.getSidebarLines();
+ if (scoreboard.size() > 2) {
+ String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1));
+ String secondLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 2));
+ if (firstLine.contains("30,30") || // F1
+ firstLine.contains("30,125") || // F2
+ firstLine.contains("30,225") || // F3
+ secondLine.contains("- Healthy") || // F3
+ firstLine.contains("30,344") || // F4
+ firstLine.contains("livid") || // F5
+ firstLine.contains("sadan") || // F6
+ firstLine.contains("necron")) { // F7
+
+ inDungeonBossRoom = true;
+ if (!prevInDungeonBossRoom) {
+ bloodroom.stop();
+ if (ToggleCommand.dungeonBossMusic) dungeonboss.start();
+ }
+ } else {
+ inDungeonBossRoom = false;
}
- } else {
- inDungeonBossRoom = false;
+ }
+ } else {
+ switch (Utils.tabLocation) {
+ case "Hub":
+ if (ToggleCommand.hubMusic) hub.start();
+ break;
+ case "Private World":
+ if (ToggleCommand.islandMusic) island.start();
+ break;
+ case "Dungeon Hub":
+ if (ToggleCommand.dungeonHubMusic) dungeonHub.start();
+ break;
+ case "The Farming Islands":
+ if (ToggleCommand.farmingIslandsMusic) farmingIslands.start();
+ break;
+ case "Gold Mine":
+ if (ToggleCommand.goldMineMusic) goldMine.start();
+ break;
+ case "Deep Caverns":
+ if (ToggleCommand.deepCavernsMusic) deepCaverns.start();
+ break;
+ case "Dwarven Mines":
+ if (ToggleCommand.dwarvenMinesMusic) dwarvenMines.start();
+ break;
+ case "Crystal Hollows":
+ if (ToggleCommand.crystalHollowsMusic) crystalHollows.start();
+ break;
+ case "Blazing Fortress":
+ if (ToggleCommand.blazingFortressMusic) blazingFortress.start();
+ break;
+ case "The End":
+ if (ToggleCommand.endMusic) end.start();
+ break;
+ case "The Park":
+ if (ToggleCommand.parkMusic) park.start();
+ break;
}
}
}
@@ -118,12 +179,34 @@ public class CustomMusic {
dungeonboss = new Song(directory, "dungeonboss", dungeonbossVolume);
bloodroom = new Song(directory, "bloodroom", bloodroomVolume);
dungeon = new Song(directory, "dungeon", dungeonVolume);
+ hub = new Song(directory, "hub", hubVolume);
+ island = new Song(directory, "island", hubVolume);
+ dungeonHub = new Song(directory, "dungeonhub", dungeonHubVolume);
+ farmingIslands = new Song(directory, "farmingislands", farmingIslandsVolume);
+ goldMine = new Song(directory, "goldmine", goldMineVolume);
+ deepCaverns = new Song(directory, "deepcaverns", deepCavernsVolume);
+ dwarvenMines = new Song(directory, "dwarvenmines", dwarvenMinesVolume);
+ crystalHollows = new Song(directory, "crystalhollows", crystalHollowsVolume);
+ blazingFortress = new Song(directory, "blazingfortress", blazingFortressVolume);
+ end = new Song(directory, "end", endVolume);
+ park = new Song(directory, "park", parkVolume);
}
public static void reset() {
if (dungeonboss != null) dungeonboss.stop();
if (bloodroom != null) bloodroom.stop();
if (dungeon != null) dungeon.stop();
+ if (hub != null) hub.stop();
+ if (island != null) island.stop();
+ if (dungeonHub != null) dungeonHub.stop();
+ if (farmingIslands != null) farmingIslands.stop();
+ if (goldMine != null) goldMine.stop();
+ if (deepCaverns != null) deepCaverns.stop();
+ if (dwarvenMines != null) dwarvenMines.stop();
+ if (crystalHollows != null) crystalHollows.stop();
+ if (blazingFortress != null) blazingFortress.stop();
+ if (end != null) end.stop();
+ if (park != null) park.stop();
}
public static class Song {
@@ -153,8 +236,8 @@ public class CustomMusic {
}
public void start() {
- reset();
- if (music != null) {
+ if (music != null && !music.isRunning()) {
+ reset();
shuffle();
cancelNotes = true;
music.setMicrosecondPosition(0);
@@ -183,9 +266,7 @@ public class CustomMusic {
float decibels = (float) (20 * Math.log(volume / 100.0));
for (Clip music : playlist) {
FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN);
- if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) {
- return false;
- }
+ if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) return false;
control.setValue(decibels);
}