diff options
author | syeyoung <cyong06@naver.com> | 2021-03-06 22:12:16 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-03-06 22:12:16 +0900 |
commit | 80d792f7de6748b1cb31f1720af563ddbe0ce2dc (patch) | |
tree | e60190aedbf853e9b798a7f6398f704ce799b684 /src/main | |
parent | 1da442fd77d241f563f1a57dc88ab04cc4c3cbb4 (diff) | |
download | Skyblock-Dungeons-Guide-80d792f7de6748b1cb31f1720af563ddbe0ce2dc.tar.gz Skyblock-Dungeons-Guide-80d792f7de6748b1cb31f1720af563ddbe0ce2dc.tar.bz2 Skyblock-Dungeons-Guide-80d792f7de6748b1cb31f1720af563ddbe0ce2dc.zip |
breh
Diffstat (limited to 'src/main')
11 files changed, 73 insertions, 6 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java index fd72e758..04cb96ba 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide; +import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.events.SkyblockJoinedEvent; import kr.syeyoung.dungeonsguide.events.SkyblockLeftEvent; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; @@ -61,16 +62,22 @@ public class RichPresenceManager implements Runnable { } else { DiscordRichPresence.Builder richPresenceBuilder = new DiscordRichPresence.Builder(skyblockStatus.getDungeonName()); richPresenceBuilder.setBigImage("mort", "mort") - .setParty(PartyManager.INSTANCE.getPartyID(), PartyManager.INSTANCE.getMemberCount(), 5); + .setParty(PartyManager.INSTANCE.getPartyID(), PartyManager.INSTANCE.getMemberCount(), PartyManager.INSTANCE.getMaxParty()); if (skyblockStatus.getContext() != null) { - long init = skyblockStatus.getContext().getInit(); + DungeonContext dungeonContext = skyblockStatus.getContext(); + long init = dungeonContext.getInit(); richPresenceBuilder.setStartTimestamps(init); - } else { - if (PartyManager.INSTANCE.isAllowAskToJoin()) - richPresenceBuilder.setSecrets(PartyManager.INSTANCE.getAskToJoinSecret(), null); + + if (dungeonContext.getBossfightProcessor() != null) { + richPresenceBuilder.setDetails("Fighting "+dungeonContext.getBossfightProcessor().getBossName()+": "+dungeonContext.getBossfightProcessor().getCurrentPhase()); + } else { + richPresenceBuilder.setDetails("Clearing rooms"); + } } - richPresenceBuilder.setDetails("Dungeons Guide RichPresence Test"); + if (PartyManager.INSTANCE.isAllowAskToJoin()) + richPresenceBuilder.setSecrets(PartyManager.INSTANCE.getAskToJoinSecret(), null); + richPresenceBuilder.setDetails("Dungeons Guide"); DiscordRPC.discordUpdatePresence(richPresenceBuilder.build()); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java index 455b8930..e4291a55 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java @@ -241,6 +241,24 @@ public class CommandDungeonsGuide extends CommandBase { PartyManager.INSTANCE.toggleAllowAskToJoin(); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fToggled Ask to join to "+(PartyManager.INSTANCE.isAllowAskToJoin() ? "§eon" : "§coff"))); } + } else if (args[0].equalsIgnoreCase("partymax") || args[0].equalsIgnoreCase("pm")) { + if (args.length == 1){ + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fCurrent party max is §e"+PartyManager.INSTANCE.getMaxParty())); + } else if (args.length == 2) { + try { + int partyMax = Integer.parseInt(args[1]); + if (partyMax < 2) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cparty max can't be smaller than 2")); + return; + } + + PartyManager.INSTANCE.setMaxParty(partyMax); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully set partymax to §e"+PartyManager.INSTANCE.getMaxParty())); + } catch (Exception e) { + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §c"+args[1]+" is not valid number.")); + return; + } + } } else if (args[0].equals("partyid")) { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fInternal Party id: "+PartyManager.INSTANCE.getPartyID())); } else if (args[0].equalsIgnoreCase("loc")) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java index 36ce815f..02fdc610 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java @@ -12,6 +12,7 @@ import kr.syeyoung.dungeonsguide.stomp.StompPayload; import kr.syeyoung.dungeonsguide.stomp.StompSubscription; import kr.syeyoung.dungeonsguide.utils.TextUtils; import lombok.Getter; +import lombok.Setter; import net.minecraft.client.Minecraft; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; @@ -44,6 +45,10 @@ public class PartyManager implements StompMessageHandler { private boolean canInvite = false; private int invitedDash =0; + @Getter + @Setter + private int maxParty = 5; + public void toggleAllowAskToJoin() { if (canInvite) allowAskToJoin = !allowAskToJoin; if (allowAskToJoin) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessor.java index 9d2541c0..907c3d49 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessor.java @@ -10,4 +10,6 @@ public interface BossfightProcessor extends RoomProcessor { List<String> getNextPhases(); List<HealthData> getHealths(); + + String getBossName(); }
\ No newline at end of file diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java index 05722565..a1b05145 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorBonzo.java @@ -51,6 +51,11 @@ public class BossfightProcessorBonzo extends GeneralBossfightProcessor { return healths; } + @Override + public String getBossName() { + return "Bonzo"; + } + private EntityArmorStand bonzoStand; @Override // §e﴾ §c§lBonzo§r §e71k§c❤ §e﴿ diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java index f9c41cbf..d53722a0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorLivid.java @@ -61,4 +61,9 @@ public class BossfightProcessorLivid extends GeneralBossfightProcessor { healths.add(new HealthData(realLividName == null ? "unknown" : realLividName, (int) health,7000000 , true)); return healths; } + + @Override + public String getBossName() { + return realLividName == null ? "Livid" : realLividName; + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorNecron.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorNecron.java index 0ad12a11..6260f62d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorNecron.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorNecron.java @@ -49,6 +49,11 @@ public class BossfightProcessorNecron extends GeneralBossfightProcessor { return healths; } + @Override + public String getBossName() { + return "Necron"; + } + private EntityArmorStand bonzoStand; @Override // §e﴾ §c§lBonzo§r §e71k§c❤ §e﴿ diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorProf.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorProf.java index 2bb269f6..4580cd32 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorProf.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorProf.java @@ -98,6 +98,11 @@ public class BossfightProcessorProf extends GeneralBossfightProcessor { return healths; } + @Override + public String getBossName() { + return "The Professor"; + } + private EntityArmorStand profStand; private EntityArmorStand laserGuard; private EntityArmorStand chaosGuard; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorSadan.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorSadan.java index 2a0ee850..ae210b57 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorSadan.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorSadan.java @@ -98,6 +98,11 @@ public class BossfightProcessorSadan extends GeneralBossfightProcessor { return healths; } + @Override + public String getBossName() { + return "Sadan"; + } + private EntityArmorStand sadanStand; private EntityArmorStand diamondGiant; private EntityArmorStand laserGiant; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorScarf.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorScarf.java index cfd01a1f..36fe2eb6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorScarf.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorScarf.java @@ -88,6 +88,11 @@ public class BossfightProcessorScarf extends GeneralBossfightProcessor { return healths; } + @Override + public String getBossName() { + return "Scarf"; + } + private EntityArmorStand scarfStand; private EntityArmorStand priestStand; private EntityArmorStand mageStand; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorThorn.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorThorn.java index 5732d68c..d07c4989 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorThorn.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/BossfightProcessorThorn.java @@ -57,6 +57,11 @@ public class BossfightProcessorThorn extends GeneralBossfightProcessor { return healths; } + @Override + public String getBossName() { + return "Thorn"; + } + public double calculatePercentage() { int total = progressBar.size(), lit = 0; if (total == 0) return 0; |