Normalize block entity IDs and handle bundled packets

- Normalize hidden block entity identifiers across versions
- Add block break and tile entity handling for newer protocol versions
- Preserve packet filtering through bundle packets and fix chunk section copying
This commit is contained in:
2026-05-11 23:40:36 +02:00
parent 1ea8dea381
commit 5305aaf669
11 changed files with 291 additions and 22 deletions
@@ -19,6 +19,7 @@
package de.steamwar.techhider;
import de.steamwar.Reflection;
import org.bukkit.entity.Player;
import java.util.function.BiFunction;
@@ -27,6 +28,7 @@ public class ProtocolWrapper19 extends ProtocolWrapper18 {
@Override
public BiFunction<Player, Object, Object> blockBreakHiderGenerator(Class<?> blockBreakPacket, TechHider techHider) {
return null;
Reflection.Field<?> blockBreakPosition = Reflection.getField(blockBreakPacket, TechHider.blockPosition, 0);
return (p, packet) -> techHider.getLocationEvaluator().checkBlockPos(p, blockBreakPosition.get(packet)) == TechHider.State.SKIP ? packet : null;
}
}