spockbot.mcdata.windows module

class spockbot.mcdata.windows.BaseClick

Bases: object

apply(inv_plugin)

Called by on_success(). Abstract method.

Parameters:inv_plugin (InventoryPlugin) – inventory plugin instance
cleanup_if_empty(slot)
copy_slot_type(slot_from, slot_to)
get_packet(inv_plugin)

Called by send_click() to prepare the sent packet. Abstract method.

Parameters:inv_plugin (InventoryPlugin) – inventory plugin instance
mark_dirty(slot)
on_success(inv_plugin, emit_set_slot)

Called when the click was successful and should be applied to the inventory.

Parameters:
  • inv_plugin (InventoryPlugin) – inventory plugin instance
  • emit_set_slot (func) – function to signal a slot change, should be InventoryPlugin().emit_set_slot
swap_slots(slot_a, slot_b)
transfer(from_slot, to_slot, max_amount)
class spockbot.mcdata.windows.DropClick(slot, drop_stack=False)

Bases: spockbot.mcdata.windows.BaseClick

apply(inv_plugin)
get_packet(inv_plugin)
class spockbot.mcdata.windows.SingleClick(slot, button=0)

Bases: spockbot.mcdata.windows.BaseClick

apply(inv_plugin)
get_packet(inv_plugin)
class spockbot.mcdata.windows.Slot(window, slot_nr, id=-1, damage=0, amount=0, enchants=None)

Bases: object

copy()
get_dict()

Formats the slot for network packing.

is_empty
matches(other)
move_to_window(window, slot_nr)
stacks_with(other)
class spockbot.mcdata.windows.SlotCursor(id=-1, damage=0, amount=0, enchants=None)

Bases: spockbot.mcdata.windows.Slot

class spockbot.mcdata.windows.Window(window_id, title, slot_count, inv_type=None, persistent_slots=None, eid=None)

Bases: object

Base class for all inventory types.

hotbar_slots
inv_data = {}
inv_type = None
inventory_slots
name = None
persistent_slots
window_slots

All slots except inventory and hotbar. Useful for searching.

spockbot.mcdata.windows.make_slot_check(wanted)

Creates and returns a function that takes a slot and checks if it matches the wanted item.

Parameters:wanted – function(Slot) or Slot or itemID or (itemID, metadata)