mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Regarding #393
- 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:
parent
7b9a64e9a6
commit
b52fc46f19
@ -148,7 +148,7 @@ public interface IQueueExtent<T extends IChunk> extends Flushable, Trimable, ICh
|
|||||||
if (newChunk != null) {
|
if (newChunk != null) {
|
||||||
chunk = newChunk;
|
chunk = newChunk;
|
||||||
if (block == null) {
|
if (block == null) {
|
||||||
block = this.initFilterBlock();
|
block = this.initFilterBlock().initChunk(chunkX, chunkZ);
|
||||||
}
|
}
|
||||||
chunk.filterBlocks(filter, block, region, full);
|
chunk.filterBlocks(filter, block, region, full);
|
||||||
}
|
}
|
||||||
|
@ -169,8 +169,11 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
|
|||||||
public Set<BlockVector2> getChunks() {
|
public Set<BlockVector2> getChunks() {
|
||||||
final Set<BlockVector2> chunks = new HashSet<>();
|
final Set<BlockVector2> chunks = new HashSet<>();
|
||||||
|
|
||||||
final BlockVector3 min = getMinimumPoint().divide(16);
|
final BlockVector3 minBlock = getMinimumPoint();
|
||||||
final BlockVector3 max = getMaximumPoint().divide(16);
|
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 X = min.getBlockX(); X <= max.getBlockX(); ++X) {
|
||||||
for (int Z = min.getBlockZ(); Z <= max.getBlockZ(); ++Z) {
|
for (int Z = min.getBlockZ(); Z <= max.getBlockZ(); ++Z) {
|
||||||
|
Loading…
Reference in New Issue
Block a user