- FriendsManager persists a per-user friend list at config/clientirc-friends.json. - MarkerManager holds one ephemeral marker per owner (5 min expiry). - IRC protocol extended with marker_set / marker_remove; server relays them. - IrcService DisplayLine replaced with sealed IrcEvent (Chat / System / MarkerSet / MarkerRemove); chat formatting moved into the client. - ClientIrcMod handles .friends add/remove/list, .marker remove, .help; chat lines from friends are prefixed with a green dot; marker events from non-friends are ignored. - OverlayHud draws a top-center compass strip and a top-left watermark (nick / FPS / ping) via HudLayerRegistrationCallback. - WorldOverlayRenderer draws green crosses above friends and magenta beams + base cubes at active markers via WorldRenderEvents.AFTER_ENTITIES. - MiddleClickHandler binds MMB via KeyMapping, raycasts a block or 20-block look ray, stores locally and sends marker_set on a daemon executor. - ChatScreenMixin completes . prefix commands on Tab; first mixin in the project, plumbed through clientirc.client.mixins.json and fabric.mod.json.
61 lines
1.8 KiB
Java
61 lines
1.8 KiB
Java
package ru.nevetime.clientirc;
|
|
|
|
public final class IrcMessage {
|
|
public String type;
|
|
public String client;
|
|
public String player;
|
|
public String message;
|
|
public String token;
|
|
public String dimensionId;
|
|
public Double x;
|
|
public Double y;
|
|
public Double z;
|
|
public long timestamp;
|
|
|
|
public static IrcMessage hello(String clientName, String playerName, String token) {
|
|
IrcMessage m = new IrcMessage();
|
|
m.type = "hello";
|
|
m.client = clientName;
|
|
m.player = playerName;
|
|
m.token = token;
|
|
m.timestamp = System.currentTimeMillis();
|
|
return m;
|
|
}
|
|
|
|
public static IrcMessage chat(String clientName, String playerName, String text, String token) {
|
|
IrcMessage m = new IrcMessage();
|
|
m.type = "chat";
|
|
m.client = clientName;
|
|
m.player = playerName;
|
|
m.message = text;
|
|
m.token = token;
|
|
m.timestamp = System.currentTimeMillis();
|
|
return m;
|
|
}
|
|
|
|
public static IrcMessage markerSet(String clientName, String playerName, String token,
|
|
String dimensionId, double x, double y, double z) {
|
|
IrcMessage m = new IrcMessage();
|
|
m.type = "marker_set";
|
|
m.client = clientName;
|
|
m.player = playerName;
|
|
m.token = token;
|
|
m.dimensionId = dimensionId;
|
|
m.x = x;
|
|
m.y = y;
|
|
m.z = z;
|
|
m.timestamp = System.currentTimeMillis();
|
|
return m;
|
|
}
|
|
|
|
public static IrcMessage markerRemove(String clientName, String playerName, String token) {
|
|
IrcMessage m = new IrcMessage();
|
|
m.type = "marker_remove";
|
|
m.client = clientName;
|
|
m.player = playerName;
|
|
m.token = token;
|
|
m.timestamp = System.currentTimeMillis();
|
|
return m;
|
|
}
|
|
}
|