Skip to content

Commit

Permalink
feat(JOML): migrate world generation (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrueckert authored Dec 26, 2020
1 parent 3dc0964 commit 5812413
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion module.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "FlowingLiquids",
"version": "1.3.0",
"version": "1.3.0-SNAPSHOT",
"author": "4Denthusiast",
"displayName": "FlowingLiquids",
"description": "Lets water flow, conserving its volume.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.terasology.world.WorldProvider;
import org.terasology.world.block.Block;
import org.terasology.world.block.BlockManager;
import org.terasology.world.block.BlockRegion;
import org.terasology.world.block.family.BlockFamily;
import org.terasology.world.block.items.OnBlockItemPlaced;
import org.terasology.world.block.items.BlockItemComponent;
Expand Down Expand Up @@ -396,11 +397,11 @@ public void update(float delta) {
* to spread out piles of liquid and hopefully trigger cascades.
*/
private void randomUpdate() {
for (Region3i region : worldProvider.getRelevantRegions()) {
for (BlockRegion region : worldProvider.getRelevantRegions()) {
for (int i=0; i<10; i++) {
int x = region.minX() + rand.nextInt(region.sizeX());
int y = region.minY() + rand.nextInt(region.sizeY());
int z = region.minZ() + rand.nextInt(region.sizeZ());
int x = region.minX() + rand.nextInt(region.getSizeX());
int y = region.minY() + rand.nextInt(region.getSizeY());
int z = region.minZ() + rand.nextInt(region.getSizeZ());
if (((x + y + z) % 2 == 0) != evenTick) {
z += 1;
}
Expand Down

0 comments on commit 5812413

Please sign in to comment.