Skip to content

Commit

Permalink
feat(xaero): Add packets for XaerosWorldMap
Browse files Browse the repository at this point in the history
  • Loading branch information
funniray committed Nov 11, 2023
1 parent 38a3974 commit b410c40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public abstract class JavaMinimapPlugin implements MinimapPlugin {
"journeymap:teleport_req",
"journeymap:common",
"worldinfo:world_id",
"xaerominimap:main"
"xaerominimap:main",
"xaeroworldmap:main"
);

private final JMHandler jmHandler = new JMHandler(this);
Expand Down Expand Up @@ -89,6 +90,7 @@ public void onPluginMessage(String channel, MinimapPlayer player, byte[] message
jmHandler.onPluginMessage(channel, player, message);
break;
case "xaerominimap":
case "xaeroworldmap":
xaerosHandler.onPluginMessage(channel, player, message);
break;
case "worldinfo":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
import net.kyori.adventure.text.minimessage.MiniMessage;

import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

public class XaerosHandler implements MessageHandler {
private JavaMinimapPlugin plugin;

public static String XAEROS_CHANNEL = "xaerominimap:main";
public static String XAEROS_MAP_CHANNEL = "xaeroworldmap:main";


public XaerosHandler(JavaMinimapPlugin plugin) {
this.plugin = plugin;
Expand All @@ -30,6 +29,7 @@ public void sendXaerosHandshake(MinimapPlayer player) {
out.writeByte(1);
out.writeInt(2);
player.sendPluginMessage(out.toByteArray(), XAEROS_CHANNEL);
player.sendPluginMessage(out.toByteArray(), XAEROS_MAP_CHANNEL);
}

public void sendXaerosConfig(MinimapPlayer player) {
Expand All @@ -49,6 +49,7 @@ public void sendXaerosConfig(MinimapPlayer player) {
new Nbt().toStream(tag, out);
byte[] arr = out.toByteArray();
player.sendPluginMessage(arr, XAEROS_CHANNEL);
player.sendPluginMessage(out.toByteArray(), XAEROS_MAP_CHANNEL);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit b410c40

Please sign in to comment.