forked from SteamWar/SteamWar
TechHider refactoring, simple Blocktagging
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user