    001package net.minecraft.world.gen.structure;
    002
    003import java.util.Iterator;
    004import java.util.Map;
    005import java.util.Map.Entry;
    006import net.minecraft.util.MathHelper;
    007
    008public class MapGenMineshaft extends MapGenStructure
    009{
    010    private double field_82673_e = 0.01D;
    011
    012    public MapGenMineshaft() {}
    013
    014    public MapGenMineshaft(Map par1Map)
    015    {
    016        Iterator var2 = par1Map.entrySet().iterator();
    017
    018        while (var2.hasNext())
    019        {
    020            Entry var3 = (Entry)var2.next();
    021
    022            if (((String)var3.getKey()).equals("chance"))
    023            {
    024                this.field_82673_e = MathHelper.parseDoubleWithDefault((String)var3.getValue(), this.field_82673_e);
    025            }
    026        }
    027    }
    028
    029    protected boolean canSpawnStructureAtCoords(int par1, int par2)
    030    {
    031        return this.rand.nextDouble() < this.field_82673_e && this.rand.nextInt(80) < Math.max(Math.abs(par1), Math.abs(par2));
    032    }
    033
    034    protected StructureStart getStructureStart(int par1, int par2)
    035    {
    036        return new StructureMineshaftStart(this.worldObj, this.rand, par1, par2);
    037    }
    038}