def __init__(self,
              name: str,
              fluid: OreListable,
              material: OreListable = None):
     """Create a new uniform distribution."""
     super().__init__(name)
     self.fluid = OreList(fluid)
     self.material = OreList(material)
Exemplo n.º 2
0
    def __init__(self,
                 *names: Iterable[str],
                 blocks: OreListable = None,
                 underground: bool = False):
        """Create a new biome set."""
        self._names = set()

        self.blocks = OreList.convert(blocks)
        self.underground = underground

        for name in names:
            self.add_biome(name)

        if self.blocks is None:
            if self.underground:
                self.blocks = OreList(mc.stone)
            else:
                self.blocks = OreList(mc.grass, mc.dirt, mc.sand)

        if BiomeSet.ANY is None:
            BiomeSet.ANY = ""
            BiomeSet.ANY = BiomeSet(None)
Exemplo n.º 3
0
    def __init__(self,
                 vein: Vein,
                 liquid: OreListable,
                 diameter: int = 8,
                 **kwargs):
        """Create a new lake deposit."""
        liquid = OreList.convert(liquid)
        if "deposit_name" not in kwargs:
            kwargs["deposit_name"] = f"{liquid.short_name}-{vein.name}-LAKE"
        super().__init__(vein, **kwargs)

        self.diameter = diameter
        self.liquid = liquid
class SubmergedDistribution(Distribution):
    """SubmergedDistribution places deposits immediately below a body of liquid.."""
    def __init__(self,
                 name: str,
                 fluid: OreListable,
                 material: OreListable = None):
        """Create a new uniform distribution."""
        super().__init__(name)
        self.fluid = OreList(fluid)
        self.material = OreList(material)

    # Overridden Methods ###########################################################################

    def as_json(self) -> Dict[str, Any]:
        """Create a dict representation of this deposit suitable for being converted to JSON."""
        result = {
            "distribution": "underfluid",
            "fluid": self.fluid.as_json(),
        }
        if not self.material.is_empty:
            result["material"] = self.material.as_json()

        return result
Exemplo n.º 5
0
 def __init__(
     self,
     vein: Vein,
     deposit_name: str = None,
     biomes: BiomeSet = None,
     cluster_count: int = 1,
     distribution: Distribution = None,
     replaces: OreListable = None,
     percent: int = 100,
     dimension: int = 0,
 ):
     """Create a new deposit."""
     self.biomes = biomes if biomes is not None else BiomeSet.ANY
     self.base_cluster_count = cluster_count
     self.deposit_name = deposit_name if deposit_name is not None else vein.name
     self.dimension = dimension
     self.distribution = distribution if distribution is not None else UniformDistribution(
         "any", 0, 256)
     self.percent = percent
     self.replaces = OreList.convert(
         replaces if replaces is not None else vein.material_ore)
     self.vein = vein
Exemplo n.º 6
0
    def __init__(
        self,
        *ores: Iterable[Ore],
        material_ore: Optional[Ore] = None,
        name: Optional[str] = None,
        purity: int = 100,
    ):
        """
        Create a new vein with a certain name, base material, and collection of ores.

        Arguments:
            ores: an iterable collection of Ores to include in this vein
            material_ore: a single Ore used as filler for veins of less than 100% purity
            name: an alternate name to use in case the name of the first ore isn't desired
            purity: a value between 0–100 giving the percentage of the vein made of ore

        """
        self.ores = OreList.convert(ores)

        self.name = name if name is not None else self.ores.short_name
        self.material_ore = material_ore if material_ore is not None else Ore(
            "minecraft:stone", 0)
        self.purity = purity
Exemplo n.º 7
0
DUSK = [Range(0, 1000), Range(23000, 24000)]

TWILIGHT = DAWN + DUSK

# Group Size Presets ###################################################################################################

LONER = Range(1, 1)
PAIR = Range(1, 2)
CLUSTER = Range(2, 3)
TROOP = Range(3, 6)
HERD = Range(6, 10)
SWARM = Range(10, 20)

# Spawn Block Sets #####################################################################################################

AERIAL = OreList(mc.air)
AQUATIC = OreList(mc.water)
CARPETED = OreList(mc.grass, mc.dirt, mc.sand)
FUNGAL = OreList(mc.mycelium)
GRASSY = OreList(mc.grass, mc.dirt, mc.sand)
GRAVELLY = OreList(mc.gravel, mc.dirt, mc.sand)
HELLISH = OreList(mc.netherrack, mc.soul_sand, mc.nether_brick, mc.bedrock,
                  mc.stone)
MOLTEN = OreList(mc.lava)
SANDY = OreList(mc.dirt, mc.sand, mc.sandstone)
SNOWY = OreList(mc.dirt, mc.gravel, mc.ice, mc.sand, mc.snow)
STONY = OreList(mc.cobblestone, mc.stone)
SWAMPY = OreList(mc.dirt, mc.grass, mc.sand, mc.water)

MOUNTAINOUS = OreList(
    mc.cobblestone,
Exemplo n.º 8
0
DUSK = [Range(0, 1000), Range(23000, 24000)]

TWILIGHT = DAWN + DUSK

# Group Size Presets ###################################################################################################

LONER = Range(1, 1)
PAIR = Range(1, 2)
CLUSTER = Range(2, 3)
TROOP = Range(3, 6)
HERD = Range(6, 10)
SWARM = Range(10, 20)

# Spawn Block Sets #####################################################################################################

AERIAL = OreList(mc.air)
AQUATIC = OreList(mc.water)
CARPETED = OreList(mc.grass, mc.dirt, mc.sand)
FUNGAL = OreList(mc.mycelium)
GRASSY = OreList(mc.grass, mc.dirt, mc.sand)
GRAVELLY = OreList(mc.gravel, mc.dirt, mc.sand)
HELLISH = OreList(mc.netherrack, mc.soul_sand, mc.nether_brick, mc.bedrock)
MOLTEN = OreList(mc.lava)
SANDY = OreList(mc.dirt, mc.sand, mc.sandstone)
SNOWY = OreList(mc.dirt, mc.gravel, mc.ice, mc.sand, mc.snow)
STONY = OreList(mc.cobblestone, mc.stone)
SWAMPY = OreList(mc.dirt, mc.grass, mc.sand, mc.water)

# Biome Sets ###########################################################################################################

beach_cold = BiomeSet("Cold Beach", blocks=SNOWY)