diff --git a/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/PoiManagerMixin.java b/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/PoiManagerMixin.java index 0d7250ba..65329e1c 100644 --- a/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/PoiManagerMixin.java +++ b/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/PoiManagerMixin.java @@ -103,8 +103,8 @@ private void initHook(RegionStorageInfo regionStorageInfo, Path path, DataFixer */ @Overwrite public int sectionsToVillage(final SectionPos pos) { - this.villageDistanceTracker.propagateUpdates(); // Paper - replace distance tracking util - return convertBetweenLevels(this.villageDistanceTracker.getLevel(CoordinateUtils.getChunkSectionKey(pos))); // Paper - replace distance tracking util + this.villageDistanceTracker.propagateUpdates(); + return convertBetweenLevels(this.villageDistanceTracker.getLevel(CoordinateUtils.getChunkSectionKey(pos))); } /** diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java b/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java index f5b4c3c3..31a993d5 100644 --- a/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java +++ b/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java @@ -331,13 +331,15 @@ private static VoxelShape sliceShapeOptimised(final VoxelShape src, final Direct final BitSetDiscreteVoxelShape shape = new BitSetDiscreteVoxelShape(local_len_x, local_len_y, local_len_z); - final int idx_off = shape_sz + shape_sy*size_z + shape_sx*(size_z*size_y); + final int bitset_mul_x = size_z*size_y; + final int idx_off = shape_sz + shape_sy*size_z + shape_sx*bitset_mul_x; + final int shape_mul_x = local_len_y*local_len_z; for (int x = 0; x < local_len_x; ++x) { boolean setX = false; for (int y = 0; y < local_len_y; ++y) { boolean setY = false; for (int z = 0; z < local_len_z; ++z) { - final int unslicedIdx = idx_off + z + y*size_z + x*(size_z*size_y); + final int unslicedIdx = idx_off + z + y*size_z + x*bitset_mul_x; if ((bitset[unslicedIdx >>> 6] & (1L << unslicedIdx)) == 0L) { continue; } @@ -348,7 +350,7 @@ private static VoxelShape sliceShapeOptimised(final VoxelShape src, final Direct shape.zMax = Math.max(shape.zMax, z + 1); shape.storage.set( - z + y*local_len_z + x*(local_len_y*local_len_z) + z + y*local_len_z + x*shape_mul_x ); }