aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-03-01 21:37:28 +0900
committersyeyoung <cyong06@naver.com>2021-03-01 21:37:28 +0900
commitca37e92e857b8de791f9ddea16743c4139fe9880 (patch)
treefc086d9027ae2cbe46f6504bb98629cb55396bea /src/main/java/kr/syeyoung/dungeonsguide/features
parent497512bd3b0f7c2d161b4cc5b7512eeaa07ebdd9 (diff)
downloadSkyblock-Dungeons-Guide-ca37e92e857b8de791f9ddea16743c4139fe9880.tar.gz
Skyblock-Dungeons-Guide-ca37e92e857b8de791f9ddea16743c4139fe9880.tar.bz2
Skyblock-Dungeons-Guide-ca37e92e857b8de791f9ddea16743c4139fe9880.zip
stomp.
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureBlah.java38
2 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java
index adbf15c4..fa1b3c92 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java
@@ -66,6 +66,7 @@ public class FeatureRegistry {
public static final FeatureRepartyCommand ETC_REPARTY = register(new FeatureRepartyCommand());
public static final FeatureDecreaseExplosionSound ETC_EXPLOSION_SOUND = register(new FeatureDecreaseExplosionSound());
public static final FeatureAutoAcceptReparty ETC_AUTO_ACCEPT_REPARTY = register(new FeatureAutoAcceptReparty());
+ public static final FeatureBlah ETC_TEST = register(new FeatureBlah());
public static final SimpleFeature FIX_SPIRIT_BOOTS = register(new SimpleFeature("Fixes", "Spirit Boots Fixer", "Fix Spirit boots messing up with inventory", "fixes.spirit", true));
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureBlah.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureBlah.java
new file mode 100644
index 00000000..16c99db2
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureBlah.java
@@ -0,0 +1,38 @@
+package kr.syeyoung.dungeonsguide.features.impl.etc;
+
+import kr.syeyoung.dungeonsguide.e;
+import kr.syeyoung.dungeonsguide.features.SimpleFeature;
+import kr.syeyoung.dungeonsguide.features.listener.TickListener;
+import kr.syeyoung.dungeonsguide.stomp.StompInterface;
+import kr.syeyoung.dungeonsguide.stomp.StompMessageHandler;
+import kr.syeyoung.dungeonsguide.stomp.StompPayload;
+import kr.syeyoung.dungeonsguide.stomp.StompSubscription;
+import net.minecraft.client.Minecraft;
+import net.minecraft.util.ChatComponentText;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+public class FeatureBlah extends SimpleFeature implements StompMessageHandler, TickListener {
+ public FeatureBlah() {
+ super("ETC", "TEST","test.test");
+ e.getDungeonsGuide().getStompConnection().subscribe(StompSubscription.builder()
+ .destination("/topic/updates")
+ .ackMode(StompSubscription.AckMode.AUTO)
+ .stompMessageHandler(this).build());
+ }
+
+ Queue<StompPayload> stompPayloadQueue = new ConcurrentLinkedQueue<StompPayload>();
+ @Override
+ public void handle(StompInterface stompInterface, StompPayload stompPayload) {
+ stompPayloadQueue.add(stompPayload);
+ }
+
+
+ @Override
+ public void onTick() {
+ while (!stompPayloadQueue.isEmpty()) {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(stompPayloadQueue.poll().payload()));
+ }
+ }
+}