initial commit
This commit is contained in:
parent
3c9ee26b06
commit
22186c33b9
1458 changed files with 282792 additions and 0 deletions
35
java/src/game/worldgen/FeatureGenerator.java
Executable file
35
java/src/game/worldgen/FeatureGenerator.java
Executable file
|
@ -0,0 +1,35 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue