def _build_inputs(self): commands = [] for x in range(self.length + 1): if x % 2 == 0: continue elif x == 1: commands.append( fill(Position(x, 2, 0), Position(x, 2, self.width), base_block())) commands.append( fill(Position(x, 3, 0), Position(x, 3, self.width), redstone_dust())) if self.input_side == 'left': for z in range(0, self.width, 16): commands.append( setblock(Position(x, 3, z), repeater(facing='+z'))) if self.input_side == 'right': for z in range(self.width, 0, -16): commands.append( setblock(Position(x, 3, z), repeater(facing='-z'))) else: commands.append( clone(Position(1, 2, 0), Position(1, 3, self.width), Position(x, 2, 0))) return commands
def _copy_module(self, xsrc, ysrc, xdest, ydest): Xsrc = xsrc * 2 Ysrc = ysrc * 2 Xdest = xdest * 2 Ydest = ydest * 2 self.commands.append( clone(Position(Xsrc, -4, Ysrc), Position(Xsrc + 1, 1, Ysrc + 1), Position(Xdest, -4, Ydest)))
def _build_inputs(self): self.commands.append( fill(Position(2, -2, 0), Position(2, -2, 1), base_block())) self.commands.append(setblock(Position(2, -1, 0), repeater('+z'))) self.commands.append(setblock(Position(2, -1, 1), redstone_dust())) availableLanes = 1 leftToBuild = len(self.modules[0]) - 1 x = 1 while leftToBuild > 0: toCopy = min(availableLanes, leftToBuild) depth = toCopy * 2 - 1 self.commands.append( clone(Position(2, -2, 0), Position(2 + depth, -1, 1), Position(x * 2 + 2, -2, 0))) availableLanes += toCopy leftToBuild -= toCopy x += toCopy
def _build_outputs(self): commands = [] for z in range(self.width): if z % 2 == 1: continue elif z == 0: commands.append( fill(Position(0, 0, z), Position(self.length, 0, z), base_block())) commands.append( fill(Position(0, 1, z), Position(self.length, 1, z), redstone_dust())) for x in range(15, self.length, 16): commands.append( setblock(Position(x, 1, 0), repeater(facing='-x'))) else: commands.append( clone(Position(0, 0, 0), Position(self.length, 1, 0), Position(0, 0, z))) if self.input_side == 'left': for command in commands: command.translate(0, 0, 1) return commands
def generate_build(self, ): self._add_command( clone(Position(0, 0, 0), Position(1, 1, 1), Position(2, 0, 2))) self._add_command( clone(Position(0, 0, 0), Position(1, 1, 1), Position(2, 0, 2))) self._add_command( clone(Position(0, 0, 0), Position(1, 1, 1), Position(2, 0, 2))) self._add_command( clone(Position(0, 0, 0), Position(1, 1, 1), Position(2, 0, 2))) self._add_command( clone(Position(0, 0, 0), Position(1, 1, 1), Position(2, 0, 2))) self._add_command( clone(Position(0, 0, 0), Position(1, 1, 1), Position(2, 0, 2)))
def generate_build(self, length, width, height, rotation): self._add_command( clone(Position(0, 0, 0), Position(width, height, length), Position(width + 1, 0, length + 1))) self._rotate(rotation)
def generate_build(self, length, width, height): self._add_command( clone(Position(0, 0, 0), Position(length, height, width), Position(length + 1, 0, width + 1)))
def generate_build(self, pos_x, pos_y, pos_z): self._add_command( clone(Position(0, 0, 0), Position(1, 1, 1), Position(2, 0, 2))) self._translate(pos_x, pos_y, pos_z)
def _copy_output_lanes(self, count, Y): length = len(self.modules[0]) * 2 depth = count * 2 - 1 self.commands.append( clone(Position(1, -3, 2), Position(length + 3, -4, 2 + depth), Position(1, -4, Y)))