Skip to content

Commit

Permalink
Account for fluids with negative density
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Jul 16, 2016
1 parent e60d120 commit 904d1e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "1.0.0"
version = "1.0.1"
group= "josephcsible.infinitefluids" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "infinitefluids"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public static void maybeCreateSourceBlock(BlockFluidClassic block, World world,
(block.isSourceBlock(world, x + 1, y, z) ? 1 : 0) +
(block.isSourceBlock(world, x, y, z - 1) ? 1 : 0) +
(block.isSourceBlock(world, x, y, z + 1) ? 1 : 0);
if(adjacentSourceBlocks >= 2 && (world.getBlock(x, y - 1, z).getMaterial().isSolid() || block.isSourceBlock(world, x, y - 1, z))) {
int densityDir = block.getDensity(world, x, y, z) > 0 ? -1 : 1;
if(adjacentSourceBlocks >= 2 && (world.getBlock(x, y + densityDir, z).getMaterial().isSolid() || block.isSourceBlock(world, x, y + densityDir, z))) {
world.setBlockMetadataWithNotify(x, y, z, 0, 3); // 0: source block. 3: block update and notify clients
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class InfiniteFluidsModContainer extends DummyModContainer {

// XXX duplication with mcmod.info and build.gradle
public static final String MODID = "infinitefluids";
public static final String VERSION = "1.0.0";
public static final String VERSION = "1.0.1";

public InfiniteFluidsModContainer() {
super(new ModMetadata());
Expand Down

0 comments on commit 904d1e5

Please sign in to comment.