Skip to content

Commit

Permalink
Shift bitwise operations to variable initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSwag committed Dec 12, 2024
1 parent 21df973 commit e9f0583
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ default IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set) {
if (tx >= min.x() && bx <= max.x() && tz >= min.z() && bz <= max.z()) {
// contains some
boolean processExtra = false;
final int minLayer = Math.max(getMinimumY(), chunk.getMinY());
final int maxLayer = Math.min(getMaximumY(), chunk.getMaxY());
for (int layer = minLayer >> 4; layer <= maxLayer >> 4; layer++) {
final int minLayer = Math.max(getMinimumY(), chunk.getMinY()) >> 4;
final int maxLayer = Math.min(getMaximumY(), chunk.getMaxY()) >> 4;
for (int layer = minLayer; layer <= maxLayer; layer++) {
if (!set.hasSection(layer)) {
continue;
}
Expand Down Expand Up @@ -459,9 +459,9 @@ default IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set, boolean
if (tx >= min.x() && bx <= max.x() && tz >= min.z() && bz <= max.z()) {
// contains some
boolean processExtra = false;
final int minLayer = Math.max(getMinimumY(), chunk.getMinY());
final int maxLayer = Math.min(getMaximumY(), chunk.getMaxY());
for (int layer = minLayer >> 4; layer <= maxLayer >> 4; layer++) {
final int minLayer = Math.max(getMinimumY(), chunk.getMinY()) >> 4;
final int maxLayer = Math.min(getMaximumY(), chunk.getMaxY()) >> 4;
for (int layer = minLayer; layer <= maxLayer; layer++) {
int by = layer << 4;
int ty = by + 15;
if (containsEntireCuboid(bx, tx, by, ty, bz, tz)) {
Expand Down

0 comments on commit e9f0583

Please sign in to comment.