aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-22 01:09:29 +0900
committersyeyoung <cyong06@naver.com>2021-02-22 01:09:29 +0900
commit4f289db303d4e68e68789767b91e3106ff1866d7 (patch)
tree63eea29ec022ecaba104f5fb81f98636848d7a66 /src/main/java/kr/syeyoung/dungeonsguide/features/impl
parent19e32413deb3dfc722ae66b861a76c43af6d0829 (diff)
downloadSkyblock-Dungeons-Guide-4f289db303d4e68e68789767b91e3106ff1866d7.tar.gz
Skyblock-Dungeons-Guide-4f289db303d4e68e68789767b91e3106ff1866d7.tar.bz2
Skyblock-Dungeons-Guide-4f289db303d4e68e68789767b91e3106ff1866d7.zip
events
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java4
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java19
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCopyMessages.java24
3 files changed, 47 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java
index 33b88be8..46827fce 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java
@@ -2,6 +2,7 @@ package kr.syeyoung.dungeonsguide.features.impl.dungeon;
import kr.syeyoung.dungeonsguide.SkyblockStatus;
import kr.syeyoung.dungeonsguide.dungeon.DungeonContext;
+import kr.syeyoung.dungeonsguide.dungeon.events.DungeonDeathEvent;
import kr.syeyoung.dungeonsguide.e;
import kr.syeyoung.dungeonsguide.features.FeatureParameter;
import kr.syeyoung.dungeonsguide.features.GuiFeature;
@@ -10,6 +11,7 @@ import kr.syeyoung.dungeonsguide.features.listener.TickListener;
import kr.syeyoung.dungeonsguide.features.text.StyledText;
import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature;
import kr.syeyoung.dungeonsguide.utils.TextUtils;
+import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.util.ChatComponentText;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
@@ -125,6 +127,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener
String nickname = TextUtils.stripColor(m.group(1));
int deaths = context.getDeaths().containsKey(nickname) ? context.getDeaths().get(nickname) : 0;
context.getDeaths().put(nickname, deaths + 1);
+ context.createEvent(new DungeonDeathEvent(nickname, txt, deaths));
e.sendDebugChat(new ChatComponentText("Death verified :: "+nickname+" / "+(deaths + 1)));
}
Matcher m2 = meDeathPattern.matcher(txt);
@@ -132,6 +135,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener
String nickname = "me";
int deaths = context.getDeaths().containsKey(nickname) ? context.getDeaths().get(nickname) : 0;
context.getDeaths().put(nickname, deaths + 1);
+ context.createEvent(new DungeonDeathEvent(Minecraft.getMinecraft().thePlayer.getName(), txt, deaths));
e.sendDebugChat(new ChatComponentText("Death verified :: me / "+(deaths + 1)));
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java
index 71261369..443e5d79 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java
@@ -45,6 +45,25 @@ public class FeatureDungeonSecrets extends TextHUDFeature {
return 0;
}
+ public int getTotalSecretsInt() {
+ DungeonContext context = skyblockStatus.getContext();
+ int totalSecrets = 0;
+ for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) {
+ if (dungeonRoom.getTotalSecrets() != -1)
+ totalSecrets += dungeonRoom.getTotalSecrets();
+ }
+ return totalSecrets;
+ }
+ public boolean sureOfTotalSecrets() {
+ DungeonContext context = skyblockStatus.getContext();
+ if (context.getMapProcessor().getUndiscoveredRoom() > 0) return false;
+ boolean allknown = true;
+ for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) {
+ if (dungeonRoom.getTotalSecrets() == -1) allknown = false;
+ }
+ return allknown;
+ }
+
public String getTotalSecrets() {
DungeonContext context = skyblockStatus.getContext();
int totalSecrets = 0;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCopyMessages.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCopyMessages.java
new file mode 100644
index 00000000..bb91ddf1
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCopyMessages.java
@@ -0,0 +1,24 @@
+package kr.syeyoung.dungeonsguide.features.impl.etc;
+
+import kr.syeyoung.dungeonsguide.features.SimpleFeature;
+import kr.syeyoung.dungeonsguide.features.listener.ChatListener;
+import kr.syeyoung.dungeonsguide.utils.TextUtils;
+import net.minecraft.event.ClickEvent;
+import net.minecraft.event.HoverEvent;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.ChatStyle;
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
+
+public class FeatureCopyMessages extends SimpleFeature implements ChatListener {
+ public FeatureCopyMessages() {
+ super("ETC", "Copy Chat Messages", "Click on copy to copy", "etc.copymsg");
+ setEnabled(false);
+ }
+ @Override
+ public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) {
+ if (!isEnabled()) return;
+ if (clientChatReceivedEvent.type == 2) return;
+
+ clientChatReceivedEvent.message.appendSibling(new ChatComponentText(" §7[Copy]").setChatStyle(new ChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, TextUtils.stripColor(clientChatReceivedEvent.message.getFormattedText()))).setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("§eCopy Message")))));
+ }
+}