mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-27 15:33:08 +00:00
Added a boolean returning function to the interface
Signed-off-by: Justin Wiblin <[email protected]>
This commit is contained in:
1 parent
9d3db1ef70
commit
81746edfde
2 files changed
+16
-3
No files matched your search
@@ -4,4 +4,10 @@ package vazkii.botania.api.item;
|
||||
* A World Provider that implements this will not have Botania flowers generated.
|
||||
*/
|
||||
public interface IFlowerlessWorld {
|
||||
|
||||
/**
|
||||
*
|
||||
* @return False to not have flowers generate, True to have them generate
|
||||
*/
|
||||
public boolean generateFlowers();
|
||||
}
|
||||
@@ -35,9 +35,16 @@ public class BiomeDecorationHandler {
|
||||
int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4);
|
||||
int z1 = z + event.rand.nextInt(8) - event.rand.nextInt(8);
|
||||
|
||||
if(!(event.world.provider instanceof IFlowerlessWorld) && event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1))
|
||||
event.world.setBlock(x1, y1, z1, ModBlocks.flower, color, 2);
|
||||
}
|
||||
boolean flowers;
|
||||
if((event.world.provider instanceof IFlowerlessWorld)) {
|
||||
flowers = ((IFlowerlessWorld) event.world.provider).generateFlowers();
|
||||
}else{
|
||||
flowers = true;
|
||||
}
|
||||
if (flowers && event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1))
|
||||
event.world.setBlock(x1, y1, z1, ModBlocks.flower, color, 2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user