5 Commits

Author SHA1 Message Date
be700eb008 Fix outgoing packet mixin target
All checks were successful
Build and Release / build (push) Successful in 3m49s
2026-04-06 16:23:52 -05:00
b004e05575 Fix client network mixin targets
All checks were successful
Build and Release / build (push) Successful in 3m37s
2026-04-06 16:11:26 -05:00
5862f0bb1e Fix logging mixin and speed up builds
Some checks failed
Build and Release / build (push) Has been cancelled
2026-04-06 16:10:39 -05:00
2657bbe5af Fix chunk data mixin target
All checks were successful
Build and Release / build (push) Successful in 3m35s
2026-04-06 16:06:52 -05:00
32afc33f38 Log blocked sign rewrites
All checks were successful
Build and Release / build (push) Successful in 3m40s
2026-04-06 15:59:01 -05:00
4 changed files with 15 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ jobs:
shell: bash
run: |
set -euo pipefail
gradle --no-daemon clean build
gradle --no-daemon build
- name: Publish Gitea release
if: github.event_name != 'pull_request'

View File

@@ -1,6 +1,7 @@
package com.example.signleakshield.mixin;
import com.example.signleakshield.ExploitState;
import com.example.signleakshield.SignLeakShieldClient;
import com.example.signleakshield.TextSanitizer;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.PacketCallbacks;
@@ -12,9 +13,11 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import java.util.Arrays;
@Mixin(ClientConnection.class)
public abstract class ClientConnectionMixin {
@ModifyVariable(method = "send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;Z)V", at = @At("HEAD"), argsOnly = true)
@ModifyVariable(method = "method_10743(Lnet/minecraft/class_2596;)V", at = @At("HEAD"), argsOnly = true)
private Packet<?> signleakshield$rewriteOutgoing(Packet<?> packet) {
if (!(packet instanceof UpdateSignC2SPacket signPacket)) {
return packet;
@@ -50,6 +53,14 @@ public abstract class ClientConnectionMixin {
String line3 = TextSanitizer.sanitize(lines[2]);
String line4 = TextSanitizer.sanitize(lines[3]);
SignLeakShieldClient.LOGGER.info(
"Blocked forced sign translation event at {} front={}: got={}, returned={}",
pos,
signPacket.isFront(),
Arrays.toString(signPacket.getText()),
Arrays.toString(new String[] { line1, line2, line3, line4 })
);
ExploitState.clearForcedOpen();
return new UpdateSignC2SPacket(pos, signPacket.isFront(), line1, line2, line3, line4);
}

View File

@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ClientPlayNetworkHandler.class)
public abstract class ClientPlayNetworkHandlerBlockEntityUpdateMixin {
@Inject(method = "onBlockEntityUpdate", at = @At("HEAD"))
@Inject(method = "method_11094(Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;)V", at = @At("HEAD"))
private void signleakshield$captureSign(BlockEntityUpdateS2CPacket packet, CallbackInfo ci) {
if (packet.getNbt() == null) {
return;

View File

@@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ClientPlayNetworkHandler.class)
public abstract class ClientPlayNetworkHandlerChunkDataMixin {
@Inject(method = "onChunkData", at = @At("HEAD"))
@Inject(method = "method_11128(Lnet/minecraft/network/packet/s2c/play/ChunkDataS2CPacket;)V", at = @At("HEAD"))
private void signleakshield$captureChunkData(ChunkDataS2CPacket packet, CallbackInfo ci) {
packet.getChunkData().getBlockEntities(packet.getChunkX(), packet.getChunkZ()).accept((localPos, type, nbt) -> {
if (nbt == null) {