~hnaguski/rconn

8060fb4ea9c96822cfe4bc12ab1215a9982ba014 — Henry Naguski 2 years ago b137bc6
initial commit
M src/main/java/net/henry/rconn/mixin/RconCommandOutputMixin.java => src/main/java/net/henry/rconn/mixin/RconCommandOutputMixin.java +4 -4
@@ 1,7 1,6 @@
package net.henry.rconn.mixin;

import net.minecraft.server.rcon.RconCommandOutput;
import net.minecraft.text.Text;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;


@@ 11,10 10,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(RconCommandOutput.class)
public class RconCommandOutputMixin {
    @Shadow private StringBuffer buffer;
    @Shadow
	private StringBuffer buffer;

	@Inject(method = "sendMessage", at = @At("RETURN"))
	private void newline(Text message, CallbackInfo info) {
	@Inject(method = "sendMessage", at = @At("TAIL"))
	private void newline(CallbackInfo info) {
		buffer.append(System.lineSeparator());
	}
}

M src/main/resources/fabric.mod.json => src/main/resources/fabric.mod.json +2 -2
@@ 3,8 3,8 @@
  "id": "rconn",
  "version": "${version}",

  "name": "rconn",
  "description": "Makes rcon messages print a newline",
  "name": "rcon\\n",
  "description": "Makes rcon messages print a newline. The backslash in the name is an escape character, so you can't see it ;)",
  "authors": [
    "henry"
  ],