Пример #1
0
    def test_black_wool_matches_lime(self):
        """
        Lime wool plus an ink sac equals black wool.
        """

        table = [
            Slot.from_key(blocks["lime-wool"].key, 1),
            Slot.from_key(items["ink-sac"].key, 1),
            None,
            None,
        ]
        self.assertTrue(recipe_dict["black-wool"].matches(table, 2))
Пример #2
0
    def test_black_wool_matches_lime(self):
        """
        Lime wool plus an ink sac equals black wool.
        """

        if "black-wool" not in self.p:
            raise unittest.SkipTest("Plugin not present")

        table = [
            Slot.from_key(blocks["lime-wool"].key, 1),
            Slot.from_key(items["ink-sac"].key, 1),
            None,
            None,
        ]
        self.assertTrue(self.p["black-wool"].matches(table, 2))
Пример #3
0
    def test_black_wool_matches_lime(self):
        """
        Lime wool plus an ink sac equals black wool.
        """

        if "black-wool" not in self.p:
            raise unittest.SkipTest("Plugin not present")

        table = [
            Slot.from_key(blocks["lime-wool"].key, 1),
            Slot.from_key(items["ink-sac"].key, 1),
            None,
            None,
        ]
        self.assertTrue(self.p["black-wool"].matches(table, 2))
Пример #4
0
    def test_from_key(self):
        """
        Slots have an alternative constructor.
        """

        slot1 = Slot(2, 3, 1)
        slot2 = Slot.from_key((2, 3))
        self.assertEqual(slot1, slot2)
Пример #5
0
    def test_from_key(self):
        """
        Slots have an alternative constructor.
        """

        slot1 = Slot(2, 3, 1)
        slot2 = Slot.from_key((2, 3))
        self.assertEqual(slot1, slot2)
Пример #6
0
    def test_bed_matches_tie_dye(self):
        """
        Three different colors of wool can be used to build beds.
        """

        table = [
            None,
            None,
            None,
            Slot.from_key(blocks["blue-wool"].key, 1),
            Slot.from_key(blocks["red-wool"].key, 1),
            Slot.from_key(blocks["lime-wool"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
        ]
        self.assertTrue(recipe_dict["bed"].matches(table, 3))
Пример #7
0
    def test_bed_matches_tie_dye(self):
        """
        Three different colors of wool can be used to build beds.
        """

        if "bed" not in self.p:
            raise unittest.SkipTest("Plugin not present")

        table = [
            None,
            None,
            None,
            Slot.from_key(blocks["blue-wool"].key, 1),
            Slot.from_key(blocks["red-wool"].key, 1),
            Slot.from_key(blocks["lime-wool"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
        ]
        self.assertTrue(self.p["bed"].matches(table, 3))
Пример #8
0
    def test_bed_matches_tie_dye(self):
        """
        Three different colors of wool can be used to build beds.
        """

        if "bed" not in self.p:
            raise unittest.SkipTest("Plugin not present")

        table = [
            None,
            None,
            None,
            Slot.from_key(blocks["blue-wool"].key, 1),
            Slot.from_key(blocks["red-wool"].key, 1),
            Slot.from_key(blocks["lime-wool"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
            Slot.from_key(blocks["wood"].key, 1),
        ]
        self.assertTrue(self.p["bed"].matches(table, 3))
Пример #9
0
from bravo.beta.structures import Slot
from bravo.blocks import blocks, items
from bravo.inventory.windows import FurnaceWindow
'''
Furnace recipes
'''
furnace_recipes = {
    blocks["cactus"].slot: Slot.from_key(items["green-dye"].key, 1),
    blocks["cobblestone"].slot: Slot.from_key(blocks["stone"].key, 1),
    blocks["diamond-ore"].slot: Slot.from_key(items["diamond"].key, 1),
    blocks["gold-ore"].slot: Slot.from_key(items["gold-ingot"].key, 1),
    blocks["iron-ore"].slot: Slot.from_key(items["iron-ingot"].key, 1),
    blocks["log"].slot: Slot.from_key(items["charcoal"].key, 1),
    blocks["sand"].slot: Slot.from_key(blocks["glass"].key, 1),
    items["clay-balls"].slot: Slot.from_key(items["clay-brick"].key, 1),
    items["raw-fish"].slot: Slot.from_key(items["cooked-fish"].key, 1),
    items["raw-porkchop"].slot: Slot.from_key(items["cooked-porkchop"].key, 1),
}


def update_all_windows_slot(factory, coords, slot, item):
    '''
    For players who have THIS furnace's window opened send update for
    specified slot: crafting, crafted or fuel.

    :param `BravoFactory` factory: The factory
    :param tuple coords: (bigx, smallx, bigz, smallz, y) - coords of the furnace
    :param int slot: 0 - crafting slot, 1 - fuel slot, 2 - crafted slot
    :param `Slot` item: the slot content
    '''
    for p in factory.protocols.itervalues():
Пример #10
0
from bravo.beta.structures import Slot
from bravo.blocks import blocks, items
from bravo.inventory.windows import FurnaceWindow

'''
Furnace recipes
'''
furnace_recipes = {
    blocks["cactus"].slot     : Slot.from_key(items["green-dye"].key, 1),
    blocks["cobblestone"].slot: Slot.from_key(blocks["stone"].key, 1),
    blocks["diamond-ore"].slot: Slot.from_key(items["diamond"].key, 1),
    blocks["gold-ore"].slot   : Slot.from_key(items["gold-ingot"].key, 1),
    blocks["iron-ore"].slot   : Slot.from_key(items["iron-ingot"].key, 1),
    blocks["log"].slot        : Slot.from_key(items["charcoal"].key, 1),
    blocks["sand"].slot       : Slot.from_key(blocks["glass"].key, 1),
    items["clay-balls"].slot  : Slot.from_key(items["clay-brick"].key, 1),
    items["raw-fish"].slot    : Slot.from_key(items["cooked-fish"].key, 1),
    items["raw-porkchop"].slot: Slot.from_key(items["cooked-porkchop"].key, 1),
}

def update_all_windows_slot(factory, coords, slot, item):
    '''
    For players who have THIS furnace's window opened send update for
    specified slot: crafting, crafted or fuel.

    :param `BravoFactory` factory: The factory
    :param tuple coords: (bigx, smallx, bigz, smallz, y) - coords of the furnace
    :param int slot: 0 - crafting slot, 1 - fuel slot, 2 - crafted slot
    :param `Slot` item: the slot content
    '''
    for p in factory.protocols.itervalues():