diff options
Diffstat (limited to 'src/main')
3 files changed, 17 insertions, 5 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java index 5a7a34b7..47a2f4e1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java @@ -364,6 +364,13 @@ public class CommandDungeonsGuide extends CommandBase { cosmeticsManager.requestCosmeticsList(); cosmeticsManager.requestActiveCosmetics(); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully purged API Cache!")); + } else if (args[0].equals("pbroadcast")) { + try { + String[] payload = new String[args.length - 1]; + System.arraycopy(args, 1, payload, 0, payload.length); + String actualPayload = String.join(" ", payload).replace("$C$", "§"); + DungeonsGuide.getDungeonsGuide().getStompConnection().send(new StompPayload().header("destination", "/queue/party.broadcast").payload(actualPayload)); + } catch (Exception e) {e.printStackTrace();} } else { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg §7-§fOpens configuration gui")); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg gui §7-§fOpens configuration gui")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java index 2fc96a82..d08a46a9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/DungeonListener.java @@ -109,9 +109,8 @@ public class DungeonListener { GlStateManager.color(1,1,1,1); GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GlStateManager.popAttrib(); GlStateManager.enableAlpha(); - } catch (Throwable e2) {e2.printStackTrace();} + } catch (Throwable e2) {e2.printStackTrace(); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDG HAS RAN INTO ERROR WHILE RENDERING SCREEN! Please report to support channel"));} } @SubscribeEvent public void onEntityUpdate(LivingEvent.LivingUpdateEvent e) { @@ -250,7 +249,6 @@ public class DungeonListener { SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); if (!skyblockStatus.isOnDungeon()) return; - GlStateManager.pushAttrib(); if (skyblockStatus.getContext() != null) { DungeonContext context = skyblockStatus.getContext(); EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; @@ -270,10 +268,9 @@ public class DungeonListener { GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); Minecraft.getMinecraft().entityRenderer.setupOverlayRendering(); - GlStateManager.popAttrib(); GlStateManager.enableAlpha(); } catch (Throwable e) { - e.printStackTrace(); + e.printStackTrace();Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cDG HAS RAN INTO ERROR WHILE RENDERING SCREEN! Please report to support channel")); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java index f756eb08..0368ecfc 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java @@ -393,6 +393,12 @@ public class PartyManager implements StompMessageHandler { if (secret.equals(askToJoinSecret) && partyID != null) { Minecraft.getMinecraft().thePlayer.sendChatMessage("/p invite "+playerName); } + } else if ("/user/queue/party.broadcast".equals(stompPayload.headers().get("destination"))) { + try { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: Message Broadcasted from player:: \n" + stompPayload.payload())); + } catch (Exception e) { + e.printStackTrace(); + } } else { String str = object.getString("status"); if ("success".equals(str)) { @@ -411,5 +417,7 @@ public class PartyManager implements StompMessageHandler { .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/party.check").build()); stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/party.join").build()); + stompConnectedEvent.getStompInterface().subscribe(StompSubscription.builder() + .stompMessageHandler(this).ackMode(StompSubscription.AckMode.AUTO).destination("/user/queue/party.broadcast").build()); } } |