- Fix CharFilterBlock not being properly created (the chunk X and Z were never set)
 - Replace BlockVector3#divide with bitshift because you can't divide down and then bitshift back up with the correct results for negative values
This commit is contained in:
dordsor21 2020-04-19 13:56:02 +01:00
parent 7b9a64e9a6
commit b52fc46f19
2 changed files with 6 additions and 3 deletions

View File

@ -148,7 +148,7 @@ public interface IQueueExtent<T extends IChunk> extends Flushable, Trimable, ICh
if (newChunk != null) {
chunk = newChunk;
if (block == null) {
block = this.initFilterBlock();
block = this.initFilterBlock().initChunk(chunkX, chunkZ);
}
chunk.filterBlocks(filter, block, region, full);
}

View File

@ -169,8 +169,11 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
public Set<BlockVector2> getChunks() {
final Set<BlockVector2> chunks = new HashSet<>();
final BlockVector3 min = getMinimumPoint().divide(16);
final BlockVector3 max = getMaximumPoint().divide(16);
final BlockVector3 minBlock = getMinimumPoint();
final BlockVector3 maxBlock = getMaximumPoint();
final BlockVector2 min = BlockVector2.at(minBlock.getX() >> 4, minBlock.getZ() >> 4);
final BlockVector2 max = BlockVector2.at(maxBlock.getX() >> 4, maxBlock.getZ() >> 4);
for (int X = min.getBlockX(); X <= max.getBlockX(); ++X) {
for (int Z = min.getBlockZ(); Z <= max.getBlockZ(); ++Z) {