Skip to content

Commit

Permalink
feat(JOML): migrate OnChunkGenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
pollend committed Jan 24, 2021
1 parent 8aeca10 commit d15e4cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void testGenerateSingleChunk() throws InterruptedException, ExecutionException,
Assertions.assertTrue(mustBeOnGeneratedEvent instanceof OnChunkGenerated,
"First world event must be OnChunkGenerated");
Assertions.assertEquals(((OnChunkGenerated) mustBeOnGeneratedEvent).getChunkPos(),
chunkPosition,
JomlUtil.from(chunkPosition),
"Chunk position at event not expected");
},
() -> {
Expand Down Expand Up @@ -150,7 +150,7 @@ void testGenerateSingleChunkWithBlockLifeCycle() throws InterruptedException, Ex
Assertions.assertTrue(mustBeOnGeneratedEvent instanceof OnChunkGenerated,
"First world event must be OnChunkGenerated");
Assertions.assertEquals(((OnChunkGenerated) mustBeOnGeneratedEvent).getChunkPos(),
chunkPosition,
JomlUtil.from(chunkPosition),
"Chunk position at event not expected");
},
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,24 @@
*/
package org.terasology.world.chunks.event;

import org.joml.Vector3i;
import org.joml.Vector3ic;
import org.terasology.entitySystem.event.Event;
import org.terasology.math.geom.Vector3i;

/**
*/
public class OnChunkGenerated implements Event {

private Vector3i chunkPos = new Vector3i();

public OnChunkGenerated(Vector3i chunkPos) {
public OnChunkGenerated() {
}

public OnChunkGenerated(Vector3ic chunkPos) {
this.chunkPos.set(chunkPos);
}

public Vector3i getChunkPos() {
public Vector3ic getChunkPos() {
return chunkPos;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private void processReadyChunk(final Chunk chunk) {
PerformanceMonitor.endActivity();


worldEntity.send(new OnChunkGenerated(chunk.getPosition()));
worldEntity.send(new OnChunkGenerated(chunk.getPosition(new org.joml.Vector3i())));
}
worldEntity.send(new OnChunkLoaded(chunk.getPosition(new org.joml.Vector3i())));
}
Expand Down

0 comments on commit d15e4cb

Please sign in to comment.