TechHider refactoring, simple Blocktagging

This commit is contained in:
Lixfel
2024-12-21 16:53:49 +01:00
parent 1b47700c19
commit 793fc31b5c
16 changed files with 269 additions and 208 deletions
@@ -187,9 +187,6 @@ public class Hull {
for (Map.Entry<IntVector, List<IntVector>> entry : sectionWise.entrySet()) {
Object packet = HullHiderWrapper.impl.generateBlockChangePacket(entry.getValue());
if(packet == null)
continue;
players.forEach(player -> TinyProtocol.instance.sendPacket(player, packet));
}
}
@@ -112,7 +112,9 @@ public class TechHiderWrapper extends StateDependent implements TechHider.Locati
public TechHider.State check(Player player, int x, int y, int z) {
if(hiddenRegion.computeIfAbsent(player, this::getHiddenRegion).inRegion(x, y, z)) {
if(FightSystem.getHullHider().isBlockHidden(player, x, y, z)) {
return TechHider.State.HIDE;
long pattern = player.getUniqueId().getLeastSignificantBits();
int id = ((y&3) << 4) + ((z&3) << 2) + (x&3);
return (pattern & (1L << id)) == 0 ? TechHider.State.HIDE : TechHider.State.HIDE_AIR;
} else {
return TechHider.State.CHECK;
}