def destroy(self, delay): mcDraw = mcstuff.MinecraftDrawing(self.mc) #mcDraw.drawHollowSphere(self.pos.x, self.pos.y, self.pos.z, # self.radius, block.LAVA_STATIONARY.id) #sleep(delayLava) mcDraw.drawHollowSphere(self.pos.x, self.pos.y, self.pos.z, self.radius, block.COBBLESTONE.id) sleep(delay) self.clear()
def _fly(self, x, y, z, speed): mcDraw = mcstuff.MinecraftDrawing(self.mc) blocksBetween = mcDraw.getLine(self.craftShape.position.x, self.craftShape.position.y, self.craftShape.position.z, x, y, z) for blockBetween in blocksBetween: self.craftShape.move(blockBetween.x, blockBetween.y, blockBetween.z) # time to sleep between each block move sleep(speed)
def fire(self, x, y, z, delayStart, delayEnd): #draw a red line between the gun and the point sleep(delayStart) mcDraw = mcstuff.MinecraftDrawing(self.mc) mcDraw.drawLine(self.gunX, self.gunY, self.gunZ, x, y, z, block.WOOL.id, 14) sleep(delayEnd) #clear the line mcDraw.drawLine(self.gunX, self.gunY, self.gunZ, x, y, z, block.AIR.id)
def _draw(self): mcDraw = mcstuff.MinecraftDrawing(self.mc) #create hollow sphere for death star mcDraw.drawHollowSphere(self.pos.x, self.pos.y, self.pos.z, self.radius, block.WOOL.id, 7) #create a gun self.gunX, self.gunY, self.gunZ = self._findPointOnSphere(self.pos.x, self.pos.y, self.pos.z, 45, 25, self.radius) self.mc.setBlock(self.gunX, self.gunY, self.gunZ, block.WOOL.id, 14) #gunX, gunY, gunZ = self._findPointOnSphere(self.pos.x, self.pos.y, self.pos.z, # 45, 25, self.radius) #rotate around point and draw a circle #for angle in range(0,360,15): # circleX, circleY, circleZ = self._findPointOnSphere(gunX, gunY, gunZ, angle, 155, 5) # mc.setBlock(circleX, circleY, circleZ, block.WOOL.id, 15) #angles = ((45,17),(45,33),(37,25),(53,25)) #for angle in angles: # x,y,z = self._findPointOnSphere(self.pos.x, self.pos.y, self.pos.z, # angle[0], angle[1], self.radius) # self.mc.setBlock(x,y,z,block.WOOL.id,15) #gunX2, gunY2, gunZ2 = self._findPointOnSphere(self.pos.x, self.pos.y, self.pos.z, # 45, 25, int(self.radius + (self.radius / 2) + 1)) #draw a sphere of black wool, outside the death star to create the divit #mcDraw.drawSphere(gunX, gunY, gunZ, int(self.radius - (self.radius / 2.5)), block.AIR.id, 15) #mcDraw.drawSphere(gunX2, gunY2, gunZ2, int(self.radius - (self.radius / 2.5) + 1), block.AIR.id) #create some black blocks over the surface #for count in range(0,200): # angle = randint(0,359) # pitch = randint(-90,90) # x, y, z = self._findPointOnSphere(self.pos.x, self.pos.y, self.pos.z, # angle, pitch, self.radius - 1) # self.mc.setBlock(x, y, z, block.WOOL.id, 15) #create horizontal circle all the way round mcDraw.drawHorizontalCircle(self.pos.x, self.pos.y, self.pos.z, self.radius, block.AIR.id) mcDraw.drawHorizontalCircle(self.pos.x, self.pos.y, self.pos.z, self.radius - 1, block.WOOL.id, 15)
def _draw(self): pos = self.pos mc = self.mc width = self.width height = self.height length = self.length #create trench mc.setBlocks(pos.x, pos.y, pos.z, pos.x + width, pos.y + height, pos.z + length, block.WOOL.id, 15) mc.setBlocks(pos.x + 1, pos.y + 1, pos.z + 1, pos.x + width - 1, pos.y + height, pos.z + length - 1, block.AIR.id) #find the exhaust port position self.exhaustPortPos = Vec3(pos.x + (width / 2), pos.y + (height / 2), pos.z + 1) #draw exhaust post mcDraw = mcstuff.MinecraftDrawing(self.mc) mcDraw.drawCircle(self.exhaustPortPos.x, self.exhaustPortPos.y, self.exhaustPortPos.z, 2, block.IRON_BLOCK.id)
def clear(self): mcDraw = mcstuff.MinecraftDrawing(self.mc) mcDraw.drawSphere(self.pos.x, self.pos.y, self.pos.z, self.radius, block.AIR.id)
def _draw(self): mcDraw = mcstuff.MinecraftDrawing(self.mc) mcDraw.drawHollowSphere(self.pos.x, self.pos.y, self.pos.z, self.radius, self.blockType, self.blockData)
import math def findPointOnCircle(cx, cy, radius, angle): x = cx + math.sin(math.radians(angle)) * radius y = cy + math.cos(math.radians(angle)) * radius x = int(round(x, 0)) y = int(round(y, 0)) return (x, y) #create connection to minecraft mc = minecraft.Minecraft.create() #create minecraft drawing object mcdrawing = minecraftstuff.MinecraftDrawing(mc) #get the players position pos = mc.player.getTilePos() #create clock face above the player clockMiddle = pos clockMiddle.y = clockMiddle.y + 25 CLOCK_RADIUS = 20 HOUR_HAND_LENGTH = 10 MIN_HAND_LENGTH = 18 SEC_HAND_LENGTH = 20 #use mc drawing object to draw the circle of the clock face mcdrawing.drawCircle(clockMiddle.x, clockMiddle.y, clockMiddle.z, CLOCK_RADIUS,
def destroy(self): mcDraw = mcstuff.MinecraftDrawing(self.mc) mcDraw.drawSphere(self.pos.x, self.pos.y, self.pos.z, self.radius, block.LAVA_STATIONARY.id) sleep(3) self.clear()
def init(mc): global mcdrawing mcdrawing = minecraftstuff.MinecraftDrawing(mc)