Up to now a simple counter variable was used to iterate through the hidden-blocks in engine-mode 2 while obfuscating. This results in low quality obfuscation. One could for example easily write a hack, which bypasses Anti-Xray by not showing ores, which have a certain pattern. Furthermore, engine-mode 1 is slightly optimized by this commit. However, engine-mode 2 is probably somewhat slower. I did some tests but I wasn't able to get stable results for some reason. Therefore this needs further testing. An optimized random algorithm is utilized to pick random blocks from the hidden-blocks list. This implementation uses xorshift and integer multiplication for bounding. The resulting distribution is negligibly biased because xorshift doesn't generate 0 and integer multiplication also implies biased results.
76 KiB
76 KiB