Skip to content

Commit

Permalink
chore(JOML): migrate SectorUtils and Events
Browse files Browse the repository at this point in the history
  • Loading branch information
skaldarnar committed Jan 9, 2021
1 parent 4bf3093 commit 1e894b0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public void onMultiBlockPartRemoved(BeforeRemoveComponent event, EntityRef entit

@ReceiveEvent
public void beforeChunkUnloaded(BeforeChunkUnload beforeChunkUnload, EntityRef world) {
BlockRegion chunkRegion = getChunkRegion(JomlUtil.from(beforeChunkUnload.getChunkPos()));
BlockRegion chunkRegion = getChunkRegion(beforeChunkUnload.getChunkPos());
Iterator<Map.Entry<BlockRegion, EntityRef>> iterator = loadedMultiBlocks.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<BlockRegion, EntityRef> multiBlock = iterator.next();
Expand Down Expand Up @@ -299,11 +299,11 @@ private void processLoadedMultiBlockMain(EntityRef mainBlockEntity, MultiBlockMa
}
}

private BlockRegion getChunkRegion(Vector3i chunkPos) {
private BlockRegion getChunkRegion(Vector3ic chunkPos) {
//TODO: provide this as utility on Chunks?
return new BlockRegion(chunkPos.x << Chunks.POWER_X,
chunkPos.y << Chunks.POWER_Y,
chunkPos.z << Chunks.POWER_Z).setSize(Chunks.CHUNK_SIZE);
return new BlockRegion(chunkPos.x() << Chunks.POWER_X,
chunkPos.y() << Chunks.POWER_Y,
chunkPos.z() << Chunks.POWER_Z).setSize(Chunks.CHUNK_SIZE);
}

private void destroyMultiBlock(EntityRef multiBlockMainBlockEntity) {
Expand Down

0 comments on commit 1e894b0

Please sign in to comment.