36 lines
750 B
Java
36 lines
750 B
Java
![]() |
package game.worldgen;
|
||
|
|
||
|
import game.rng.Random;
|
||
|
import game.world.BlockPos;
|
||
|
import game.world.State;
|
||
|
import game.world.WorldServer;
|
||
|
|
||
|
public abstract class FeatureGenerator
|
||
|
{
|
||
|
private final boolean doBlockNotify;
|
||
|
|
||
|
public FeatureGenerator()
|
||
|
{
|
||
|
this(false);
|
||
|
}
|
||
|
|
||
|
public FeatureGenerator(boolean notify)
|
||
|
{
|
||
|
this.doBlockNotify = notify;
|
||
|
}
|
||
|
|
||
|
public abstract boolean generate(WorldServer worldIn, Random rand, BlockPos position);
|
||
|
|
||
|
protected void setBlockAndNotifyAdequately(WorldServer worldIn, BlockPos pos, State state)
|
||
|
{
|
||
|
if (this.doBlockNotify)
|
||
|
{
|
||
|
worldIn.setState(pos, state, 3);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
worldIn.setState(pos, state, 2);
|
||
|
}
|
||
|
}
|
||
|
}
|