public override bool Generate(World world, int x, int y, int z) { if (!Blocks.IsPlantSustaining(world.GetBlockState(x, y, z)) || !world.IsAir(x, y + 1, z)) { return(false); } if (y < yMin || y > yMax) { return(false); } if (random.NextDouble() < chance / 128f) { if (schematic != null) { return(schematic.Build(world, x, y + 1, z, random)); } else { return(world.SetBlock(x, y + 1, z, block)); } } else { return(false); } }
public void LoadSchematic(string path) { Schematic newSchematic = Circuit.Schematic.Load(path); Circuit.Circuit circuit = newSchematic.Build(); SetCircuit(circuit); Schematic = newSchematic; SchematicPath = path; }