Ejemplo n.º 1
0
def perform(level, box, options):
    angle = math.pi * (options["Angle"] / 180.0)
    centerx = (box.maxx + box.minx) / 2.0
    centerz = (box.maxz + box.minz) / 2.0
    for (chunk, slices, point) in level.getChunkSlices(box):
        for e in chunk.Entities:
            x = e["Pos"][0].value
            y = e["Pos"][1].value
            z = e["Pos"][2].value
            if (x, y, z) in box:
                theta = math.atan2(-(x - centerx), z - centerz)
                theta += angle
                r = ((x - centerx)**2 + (z - centerz)**2)**0.5
                zn = r * math.cos(theta)
                xn = -r * math.sin(theta)

                e["Pos"][0] = TAG_Double(xn + centerx)
                e["Pos"][2] = TAG_Double(zn + centerz)
                if (e["Rotation"][0].value + options["Angle"]) < -180.0:
                    e["Rotation"][0] = TAG_Float(e["Rotation"][0].value +
                                                 options["Angle"] + 360)
                elif (e["Rotation"][0].value + options["Angle"]) > 180.0:
                    e["Rotation"][0] = TAG_Float(e["Rotation"][0].value +
                                                 options["Angle"] - 360)
                else:
                    e["Rotation"][0] = TAG_Float(e["Rotation"][0].value +
                                                 options["Angle"])
                chunk = level.getChunk(
                    int(math.floor(xn + centerx)) / 16,
                    int(math.floor(zn + centerz)) / 16)
                chunk.dirty = True
Ejemplo n.º 2
0
def placeChicken(level, x, y, z):
    chicken = TAG_Compound()
    chicken["id"] = TAG_String("chicken")
    chicken["Pos"] = TAG_List(
        [TAG_Double(x + 0.5),
         TAG_Double(y),
         TAG_Double(z + 0.5)])

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(chicken)
    chunk.dirty = True
Ejemplo n.º 3
0
def placePig(level, x, y, z):
    pig = TAG_Compound()
    pig["id"] = TAG_String("pig")
    pig["Pos"] = TAG_List(
        [TAG_Double(x + 0.5),
         TAG_Double(y),
         TAG_Double(z + 0.5)])

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(pig)
    chunk.dirty = True
Ejemplo n.º 4
0
def placeHorse(level, x, y, z):
    horse = TAG_Compound()
    horse["id"] = TAG_String("horse")
    horse["Pos"] = TAG_List(
        [TAG_Double(x + 0.5),
         TAG_Double(y),
         TAG_Double(z + 0.5)])

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(horse)
    chunk.dirty = True
Ejemplo n.º 5
0
def placeCow(level, x, y, z):
    cow = TAG_Compound()
    cow["id"] = TAG_String("cow")
    cow["Pos"] = TAG_List(
        [TAG_Double(x + 0.5),
         TAG_Double(y),
         TAG_Double(z + 0.5)])

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(cow)
    chunk.dirty = True
Ejemplo n.º 6
0
def placeSheep(level, x, y, z):
    sheep = TAG_Compound()
    sheep["id"] = TAG_String("sheep")
    sheep["Pos"] = TAG_List(
        [TAG_Double(x + 0.5),
         TAG_Double(y),
         TAG_Double(z + 0.5)])

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(sheep)
    chunk.dirty = True
def createArmorStand(level, x, y, z, customName, Invisible, CustomNameVisible,
                     Invulnerable, Marker, NoGravity, MotionX, MotionY,
                     MotionZ, RotationX, RotationY):  # After @Sethbling
    print("New ArmorStand named " + customName)

    mob = TAG_Compound()
    mob["CustomName"] = TAG_String(customName)
    mob["Invisible"] = TAG_Byte(Invisible)
    mob["CustomNameVisible"] = TAG_Byte(CustomNameVisible)
    mob["Invulnerable"] = TAG_Byte(Invulnerable)
    mob["Marker"] = TAG_Byte(Marker)
    mob["NoGravity"] = TAG_Byte(NoGravity)
    mob["OnGround"] = TAG_Byte(1)
    mob["Air"] = TAG_Short(300)
    mob["DeathTime"] = TAG_Short(0)
    mob["Fire"] = TAG_Short(-1)
    mob["Health"] = TAG_Short(20)
    mob["HurtTime"] = TAG_Short(0)
    mob["Age"] = TAG_Int(0)
    mob["FallDistance"] = TAG_Float(0)
    mob["Motion"] = TAG_List()
    mob["Motion"].append(TAG_Double(MotionX))
    mob["Motion"].append(TAG_Double(MotionY))
    mob["Motion"].append(TAG_Double(MotionZ))
    mob["Pos"] = TAG_List()
    mob["Pos"].append(TAG_Double(x + 0.5))
    mob["Pos"].append(TAG_Double(y))
    mob["Pos"].append(TAG_Double(z + 0.5))
    mob["Rotation"] = TAG_List()
    mob["Rotation"].append(TAG_Float(RotationX))
    mob["Rotation"].append(TAG_Float(RotationY))
    mob["id"] = TAG_String("ArmorStand")
    chunk = level.getChunk(x / CHUNKSIZE, z / CHUNKSIZE)
    chunk.Entities.append(mob)
    chunk.dirty = True
def dat(level, box, options):
    tileEntitiesToRemove = []

    for (chunk, slices, point) in level.getChunkSlices(box):
        for t in chunk.TileEntities:
            x1 = t["x"].value
            y1 = t["y"].value
            z1 = t["z"].value

            if x1 >= box.minx and x1 < box.maxx and y1 >= box.miny and y1 < box.maxy and z1 >= box.minz and z1 < box.maxz and t["id"].value == "MobSpawner":
                tileEntitiesToRemove.append((chunk, t))

                level.setBlockAt(x1, y1, z1, 0)

                cart = TAG_Compound()
                cart["id"] = TAG_String("MinecartSpawner")
                cart["Pos"] = TAG_List([TAG_Double(x1+0.5), TAG_Double(y1+0.35), TAG_Double(z1+0.5)])
                cart["PortalCooldown"] = TAG_Int(0)
                cart["Motion"] = TAG_List([TAG_Double(0), TAG_Double(0), TAG_Double(0)])
                cart["OnGround"] = TAG_Byte(0)
                cart["Type"] = TAG_Int(0)
                cart["Fire"] = TAG_Short(-1)
                cart["Dimension"] = TAG_Int(0)
                cart["FallDistance"] = TAG_Float(0)
                cart["Air"] = TAG_Short(300)
                cart["Rotation"] = TAG_List([TAG_Float(0), TAG_Float(0)])
                cart["Invunerable"] = TAG_Byte(0)
                for tag in t:
                        if tag not in ["id", "x", "y", "z"]:
                            cart[tag] = t[tag]

                chunk.Entities.append(cart)

    for (chunk, t) in tileEntitiesToRemove:
        chunk.TileEntities.remove(t)
Ejemplo n.º 9
0
def perform(level, box, options):
    inv = options["Invulnerable:"]
    fixLag = options["Fix lag by changing only outer blocks to sheep:"]

    temp = []

    for y in xrange(box.miny, box.maxy):
        for x in xrange(box.minx, box.maxx):
            for z in xrange(box.minz, box.maxz):
                if (level.blockAt(x, y, z) == 35):
                    if not fixLag or level.blockAt(
                            x + 1, y, z) == 0 or level.blockAt(
                                x, y + 1, z) == 0 or level.blockAt(
                                    x, y, z + 1) == 0 or level.blockAt(
                                        x - 1, y, z) == 0 or level.blockAt(
                                            x, y - 1, z) == 0 or level.blockAt(
                                                x, y, z - 1) == 0:
                        color = level.blockDataAt(x, y, z)

                        temp.append(Vector(x, y, z))

                        sheep = TAG_Compound()
                        sheep["Color"] = TAG_Byte(color)
                        sheep["PersistenceRequired"] = TAG_Byte(1)
                        sheep["OnGround"] = TAG_Byte(0)
                        sheep["Air"] = TAG_Short(300)
                        sheep["DeathTime"] = TAG_Short(0)
                        sheep["Fire"] = TAG_Short(-1)
                        sheep["Health"] = TAG_Float(8)
                        sheep["HurtTime"] = TAG_Short(0)
                        sheep["Age"] = TAG_Int(0)
                        sheep["FallDistance"] = TAG_Float(0)
                        sheep["Invulnerable"] = TAG_Byte(inv)
                        sheep["NoAI"] = TAG_Byte(1)
                        sheep["NoGravity"] = TAG_Byte(1)
                        sheep["Silent"] = TAG_Byte(options["Silent Sheep:"])
                        sheep["id"] = TAG_String("Sheep")
                        sheep["Motion"] = TAG_List([
                            TAG_Double(0.0),
                            TAG_Double(0.0),
                            TAG_Double(0.0)
                        ])
                        sheep["Pos"] = TAG_List([
                            TAG_Double(x + 0.5),
                            TAG_Double(y),
                            TAG_Double(z + 0.5)
                        ])
                        sheep["Rotation"] = TAG_List(
                            [TAG_Float(0), TAG_Float(0)])

                        chunk = level.getChunk(x / 16, z / 16)
                        chunk.Entities.append(sheep)
                        chunk.dirty = True

    while temp:
        cell = temp.pop()
        level.setBlockAt(cell.x, cell.y, cell.z, 0)
        level.setBlockDataAt(cell.x, cell.y, cell.z, 0)
Ejemplo n.º 10
0
def perform(level, box, options):
    method = "Spawner Pointer"
    xend = []
    yend = []
    zend = []
    radi = options["Change Spawn Radius?"]
    print '%s: Started at: %s' % (method, time.ctime())

    for x in xrange(box.minx, box.maxx):
        for y in xrange(box.miny, box.maxy):
            for z in xrange(box.minz, box.maxz):
                block = level.blockAt(x, y, z)
                if block == 19:
                    xend.append(x)
                    yend.append(y)
                    zend.append(z)

    for (chunk, slices, point) in level.getChunkSlices(box):
        for e in chunk.Entities:
            if e["id"].value == "MinecartSpawner":
                x2 = e["Pos"][0].value
                y2 = e["Pos"][1].value
                z2 = e["Pos"][2].value

                if x2 >= box.minx and x2 < box.maxx and y2 >=box.miny and y2 < box.maxy and z2 >= box.minz and z2 < box.maxz:
                    if "SpawnData" in e:
                        pos = e["Spawndata"]
                        pos["Pos"] = TAG_List()
                        pos["Pos"].append(TAG_Double(xend+0.5))
                        pos["Pos"].append(TAG_Double(yend+0.5))
                        pos["Pos"].append(TAG_Double(zend+0.5))
                        del e["SpawnPotentials"]
                        if radi:
                            e["SpawnRange"] = TAG_Short(1)
                        print '%s %s %s' % (xend, yend, zend)
                        print '%s: Ended at: %s' % (method, time.ctime())
                        level.markDirtyBox(box)
                    
                    
        for t in chunk.TileEntities:
            x1 = t["x"].value
            y1 = t["y"].value
            z1 = t["z"].value

            if x1 >= box.minx and x1 < box.maxx and y1 >= box.miny and y1 < box.maxy and z1 >= box.minz and z1 < box.maxz and t["id"].value == "MobSpawner":
                if "SpawnData" in t:
                    pos = t["Spawndata"]
                    pos["Pos"] = TAG_List()
                    pos["Pos"].append(TAG_Double(xend+0.5))
                    pos["Pos"].append(TAG_Double(yend+0.5))
                    pos["Pos"].append(TAG_Double(zend+0.5))
                    del t["Spawnpotentials"]
                    if radi:
                        t["SpawnRange"] = TAG_Short(1)
                    print '%s %s %s' % (xend, yend, zend)
                    print '%s: Ended at: %s' % (method, time.ctime())
                    level.markDirtyBox(box) 
Ejemplo n.º 11
0
def CreateItemFrame(x, y, z, dir, blockID, invuln):
	TileY = y
	posy = float(y) + 0.5
	if dir == 1:
		direction = dir
		rotation = 90.0
		TileX = x + 1
		TileZ = z
		posx = float(x) + 0.9375
		posz = float(z) + 0.5
	elif dir == 3:
		rotation = 270.0
		direction = dir
		TileX = x - 1
		TileZ = z
		posx = float(x) + 0.0625
		posz = float(z) + 0.5
	elif dir == 0:
		rotation = 0.0
		direction = 2
		TileZ = z + 1
		TileX = x
		posz = float(z) + 0.9375
		posx = float(x) + 0.5
	elif dir == 2:
		rotation = 180.0
		direction = 0
		TileZ = z - 1
		TileX = x
		posz = float(z) + 0.0625
		posx = float(x) + 0.5
	iframe = TAG_Compound()
	iframe["id"] = TAG_String("ItemFrame")
	iframe["Pos"] = TAG_List()
	iframe["Pos"].append(TAG_Double(posx))
	iframe["Pos"].append(TAG_Double(posy))
	iframe["Pos"].append(TAG_Double(posz))
	iframe["Facing"] = TAG_Byte(dir)
	iframe["Dir"] = TAG_Byte(dir)
	iframe["Direction"] = TAG_Byte(direction)
	iframe["Facing"] = TAG_Byte(direction)  #new tag here
	iframe["Invulnerable"] = TAG_Byte(invuln)
	iframe["Motion"] = TAG_List()
	iframe["Motion"].append(TAG_Double(0.0))
	iframe["Motion"].append(TAG_Double(0.0))
	iframe["Motion"].append(TAG_Double(0.0))
	iframe["TileX"] = TAG_Int(TileX)
	iframe["TileY"] = TAG_Int(TileY)
	iframe["TileZ"] = TAG_Int(TileZ)
	iframe["Rotation"] = TAG_List()
	iframe["Rotation"].append(TAG_Float(rotation))
	iframe["Rotation"].append(TAG_Float(0.0))
	iframe["Item"] = TAG_Compound()
	iframe["Item"]["id"] = TAG_String(names[blockID])
	iframe["Item"]["Damage"] = TAG_Short(0)
	iframe["Item"]["Count"] = TAG_Byte(1)
	return iframe	
Ejemplo n.º 12
0
def CreateItemFrameJava(x, y, z, dir, mapid, invuln):
    TileY = y
    posy = float(y) + 0.5
    if dir == 1:  #westward
        direction = dir
        rotation = 90.0
        TileX = x
        TileZ = z
        posx = float(x) + 0.96875
        posz = float(z) + 0.5
    elif dir == 3:  #eastward
        rotation = 270.0
        direction = dir
        TileX = x
        TileZ = z
        posx = float(x) + 0.03125
        posz = float(z) + 0.5
    elif dir == 0:  #northward
        rotation = 180.0
        direction = 2
        TileZ = z
        TileX = x
        posz = float(z) + 0.96875
        posx = float(x) + 0.5
    elif dir == 2:  #southward
        rotation = 0.0
        direction = 0
        TileZ = z
        TileX = x
        posz = float(z) + 0.03125
        posx = float(x) + 0.5
    iframe = TAG_Compound()
    iframe["id"] = TAG_String("item_frame")
    iframe["Pos"] = TAG_List()
    iframe["Pos"].append(TAG_Double(posx))
    iframe["Pos"].append(TAG_Double(posy))
    iframe["Pos"].append(TAG_Double(posz))
    iframe["Facing"] = TAG_Byte(direction)
    iframe["Invulnerable"] = TAG_Byte(invuln)
    iframe["Motion"] = TAG_List()
    iframe["Motion"].append(TAG_Double(0.0))
    iframe["Motion"].append(TAG_Double(0.0))
    iframe["Motion"].append(TAG_Double(0.0))
    iframe["TileX"] = TAG_Int(TileX)
    iframe["TileY"] = TAG_Int(TileY)
    iframe["TileZ"] = TAG_Int(TileZ)
    iframe["Rotation"] = TAG_List()
    iframe["Rotation"].append(TAG_Float(rotation))
    iframe["Rotation"].append(TAG_Float(0.0))
    iframe["Item"] = TAG_Compound()
    iframe["Item"]["id"] = TAG_String("minecraft:filled_map")
    iframe["Item"]["Damage"] = TAG_Short(mapid)
    iframe["Item"]["Count"] = TAG_Byte(1)
    return iframe
Ejemplo n.º 13
0
def perform(level, box, options):
    print "Follow Me On Twitter At @RedstonerLabs"
    ShowBottoms = options["ShowBottom"]
    Invun = options["Invulnerable"]
    target1 = options["Y"]
    target2 = options["X"]
    target3 = options["Z"]
    for x in xrange(box.minx, box.maxx):
        for y in xrange(box.miny, box.maxy):
            for z in xrange(box.minz, box.maxz):
                chunk = level.getChunk(x / 16, z / 16)
                enderCrystal = TAG_Compound()
                pos = TAG_List()
                pos.append(TAG_Double(x + 0.5))
                pos.append(TAG_Double(y))
                pos.append(TAG_Double(z + 0.5))
                enderCrystal["Pos"] = pos
                if options["1.11-1.12+Worlds"]:
                    enderCrystal["id"] = TAG_String(u'ender_crystal')
                else:
                    enderCrystal["id"] = TAG_String(u'EnderCrystal')

                if options["Offset X,Y,Z Coordinates"]:
                    beamTarget = TAG_Compound()
                    beamTarget["X"] = TAG_Int(x + target2)
                    beamTarget["Y"] = TAG_Int(y + target1)
                    beamTarget["Z"] = TAG_Int(z + target3)
                    enderCrystal["BeamTarget"] = beamTarget
                else:
                    beamTarget = TAG_Compound()
                    beamTarget["X"] = TAG_Int(target2)
                    beamTarget["Y"] = TAG_Int(target1)
                    beamTarget["Z"] = TAG_Int(target3)
                    enderCrystal["BeamTarget"] = beamTarget

                enderCrystal["OnGround"] = TAG_Byte(0)
                motion = TAG_List()
                motion.append(TAG_Double(0.0))
                motion.append(TAG_Double(0.0))
                motion.append(TAG_Double(0.0))
                enderCrystal["Motion"] = motion
                enderCrystal["Dimension"] = TAG_Int(0)
                enderCrystal["Air"] = TAG_Short(300)
                rotation = TAG_List()
                rotation.append(TAG_Float(0.0))
                rotation.append(TAG_Float(0.0))
                enderCrystal["Rotation"] = rotation
                enderCrystal["FallDistance"] = TAG_Float(0.0)
                enderCrystal["Fire"] = TAG_Short(0)
                enderCrystal["Invulnerable"] = TAG_Byte(Invun)
                enderCrystal["PortalCooldown"] = TAG_Int(0)
                enderCrystal["Glowing"] = TAG_Byte(0)
                enderCrystal["ShowBottom"] = TAG_Byte(ShowBottoms)
                chunk.Entities.append(enderCrystal)
Ejemplo n.º 14
0
def placeBoat(level, x, y, z, blocks):
    boatType = blocks["wood"]["type"].split("_")[0]  # Kinda janky, but works

    boat = TAG_Compound()
    boat["id"] = TAG_String("boat")
    boat["Type"] = TAG_String(boatType)
    boat["Pos"] = TAG_List([TAG_Double(x), TAG_Double(y), TAG_Double(z)])
    boat["Motion"] = TAG_List(
        [TAG_Double(0.0), TAG_Double(0.0),
         TAG_Double(0.0)])
    boat["Rotation"] = TAG_List([TAG_Float(0.0), TAG_Float(0.0)])

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(boat)
    chunk.dirty = True
def perform(level, box, options):
    for (chunk, slices, point) in level.getChunkSlices(
            box
    ):  # This is the slice method of accessing the world (See part 2)
        for e in chunk.Entities:  # This will iterate for every entity in the chunk
            x = e["Pos"][
                0].value  # e["Pos"][0].value will call the first value in the Pos tag from e and let x equal that value
            y = e["Pos"][
                1].value  # Same as above but will call the second value from the Pos tag
            z = e["Pos"][2].value
            if (
                    x, y, z
            ) in box:  # This will check if the entity is in the box because the entity might be in the
                # same chunk but it might not be in the specified box

                # Once again here are the ways to edit the tags
                del e["TAG"]  # This will delete the tag called TAG in e
                e["id"] = TAG_String(
                    "zombie")  # This will turn the entity into a zombie
                e["Pos"][1] = TAG_Double(
                    y)  # This will change the entity's y coordinate
Ejemplo n.º 16
0
def perform(level, box, options):
    # Read in the supplied text from the nominated file
    filename = options["File path"]
    text = loadTextFromFile(filename)
    tagName = options["Tag to replace"]
    tagType = options["Tag type"]

    for (chunk, _, _) in level.getChunkSlices(box):
        print "TileEntities:"
        for e in chunk.TileEntities:
            print e
            #if e["id"].value == "ChalkboardBlock":
            if tagName in e:
                if tagType == "TAG_String" and type(e[tagName]) is TAG_String:
                    e[tagName] = TAG_String(text)
                    chunk.dirty = True
                elif tagType == "TAG_Byte" and type(e[tagName]) is TAG_Byte:
                    e[tagName] = TAG_Byte(int(text))
                    chunk.dirty = True
                elif tagType == "TAG_Int" and type(e[tagName]) is TAG_Int:
                    e[tagName] = TAG_Int(int(text))
                    chunk.dirty = True
                elif tagType == "TAG_Short" and type(e[tagName]) is TAG_Short:
                    e[tagName] = TAG_Short(int(text))
                    chunk.dirty = True
                elif tagType == "TAG_Long" and type(e[tagName]) is TAG_Long:
                    e[tagName] = TAG_Long(int(text))
                    chunk.dirty = True
                elif tagType == "TAG_Float" and type(e[tagName]) is TAG_Float:
                    e[tagName] = TAG_Float(float(text))
                    chunk.dirty = True
                elif tagType == "TAG_Double" and type(
                        e[tagName]) is TAG_Double:
                    e[tagName] = TAG_Double(float(text))
                    chunk.dirty = True
                else:
                    print "Tag", tagName, "of type", tagType, "is a", type(
                        e[tagName])
Ejemplo n.º 17
0
def createSandEntity(x, y, z, block, data, life):
    sand = TAG_Compound()
    sand["Motion"] = TAG_List()
    sand["Motion"].append(TAG_Double(0))
    sand["Motion"].append(TAG_Double(0.04))
    sand["Motion"].append(TAG_Double(0))
    sand["OnGround"] = TAG_Byte(1)
    sand["DropItem"] = TAG_Byte(0)
    sand["Dimension"] = TAG_Int(0)
    sand["Air"] = TAG_Short(300)
    sand["Pos"] = TAG_List()
    sand["Pos"].append(TAG_Double(x + 0.5))
    sand["Pos"].append(TAG_Double(y + 0.5))
    sand["Pos"].append(TAG_Double(z + 0.5))
    sand["Data"] = TAG_Byte(data)
    sand["TileID"] = TAG_Int(block)
    sand["Tile"] = TAG_Byte(block)
    sand["Time"] = TAG_Byte(life)
    sand["Fire"] = TAG_Short(-1)
    sand["FallDistance"] = TAG_Float(0)
    sand["Rotation"] = TAG_List()
    sand["Rotation"].append(TAG_Float(0))
    sand["Rotation"].append(TAG_Float(0))
    return sand
Ejemplo n.º 18
0
def createShop(level, x, y, z, emptyTrade, invincible, profession, unlimited,
               xp, nomove, silent, name, yaxis, xaxis, IsCustomHead, SkullType,
               PlayerName):
    chest = level.tileEntityAt(x, y, z)
    if chest is None:
        return

    priceList = {}
    priceListB = {}
    saleList = {}

    for item in chest["Items"]:
        slot = item["Slot"].value
        if 0 <= slot <= 8:
            priceList[slot] = item
        elif 9 <= slot <= 17:
            priceListB[slot - 9] = item
        elif 18 <= slot <= 26:
            saleList[slot - 18] = item

    villager = TAG_Compound()
    villager["PersistenceRequired"] = TAG_Byte(1)
    villager["OnGround"] = TAG_Byte(1)
    villager["Air"] = TAG_Short(300)
    villager["AttackTime"] = TAG_Short(0)
    villager["DeathTime"] = TAG_Short(0)
    villager["Fire"] = TAG_Short(-1)
    villager["Health"] = TAG_Short(20)
    villager["HurtTime"] = TAG_Short(0)
    villager["Age"] = TAG_Int(0)
    villager["Profession"] = TAG_Int(profession)
    villager["Career"] = TAG_Int(1)
    villager["CareerLevel"] = TAG_Int(1000)
    villager["Riches"] = TAG_Int(200)
    villager["FallDistance"] = TAG_Float(0)
    villager["CustomNameVisible"] = TAG_Byte(1)
    villager["CustomName"] = TAG_String(name)
    villager["Invulnerable"] = TAG_Byte(invincible)
    villager["NoAI"] = TAG_Byte(nomove)
    villager["id"] = TAG_String("Villager")
    villager["Motion"] = TAG_List(
        [TAG_Double(0.0), TAG_Double(0.0),
         TAG_Double(0.0)])
    villager["Pos"] = TAG_List(
        [TAG_Double(x + 0.5),
         TAG_Double(y),
         TAG_Double(z + 0.5)])
    villager["Rotation"] = TAG_List([TAG_Float(yaxis), TAG_Float(xaxis)])

    villager["Willing"] = TAG_Byte(0)
    villager["Offers"] = TAG_Compound()
    villager["Offers"]["Recipes"] = TAG_List()

    if silent:
        villager["Silent"] = TAG_Byte(1)
    else:
        villager["Silent"] = TAG_Byte(0)

    for i in range(9):
        if (i in priceList or i in priceListB) and i in saleList:
            offer = TAG_Compound()
            if xp:
                offer["rewardExp"] = TAG_Byte(1)
            else:
                offer["rewardExp"] = TAG_Byte(0)

            if unlimited:
                offer["uses"] = TAG_Int(0)
                offer["maxUses"] = TAG_Int(2000000000)
            else:
                offer["uses"] = TAG_Int(0)
                offer["maxUses"] = TAG_Int(1)

            if i in priceList:
                offer["buy"] = priceList[i]
            if i in priceListB:
                if i in priceList:
                    offer["buyB"] = priceListB[i]
                else:
                    offer["buy"] = priceListB[i]

            offer["sell"] = saleList[i]
            villager["Offers"]["Recipes"].append(offer)

    if emptyTrade:
        offer = TAG_Compound()
        offer["buy"] = TAG_Compound()
        offer["buy"]["Count"] = TAG_Byte(1)
        offer["buy"]["Damage"] = TAG_Short(0)
        offer["buy"]["id"] = TAG_String("minecraft:barrier")
        offer["sell"] = TAG_Compound()
        offer["sell"]["Count"] = TAG_Byte(1)
        offer["sell"]["Damage"] = TAG_Short(0)
        offer["sell"]["id"] = TAG_String("minecraft:barrier")
        villager["Offers"]["Recipes"].append(offer)

    if IsCustomHead:
        Head = TAG_Compound()
        Head["id"] = TAG_Short(397)
        Head["Damage"] = TAG_Short(SkullType)
        if SkullType == 3 and PlayerName:
            Head["tag"] = TAG_Compound()
            Head["tag"]["SkullOwner"] = TAG_String(PlayerName)
        villager["Equipment"] = TAG_List([
            TAG_Compound(),
            TAG_Compound(),
            TAG_Compound(),
            TAG_Compound(), Head
        ])

    level.setBlockAt(x, y, z, 0)

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(villager)
    chunk.TileEntities.remove(chest)
    chunk.dirty = True
Ejemplo n.º 19
0
# Made by gentlegiantJGC
# https://www.youtube.com/gentlegiantJGC

# You need to import the TAG types so that MCedit can understand them
# This needs to go before the inputs section

from pymclevel import TAG_Compound, TAG_Int, TAG_Short, TAG_Byte, TAG_String, TAG_Float, TAG_Double, TAG_List, TileEntity


	# This is very similar to making Tile entities except the x, y and z values do not have integer values
	# and the format is slightly different for instance the position tags are sub tags of Pos in entities

	e = TAG_Compound()						# to create an entity you first of all need to make a TAG_compound
	e["id"] = TAG_String("zombie")		    # You can then specify values in the compound
	e["Pos"] = TAG_List()
	e["Pos"].append(TAG_Double(x)			# The part on the left is the name of the tag in the compound
	e["Pos"].append(TAG_Double(y)			# The right part is the data type and the new value
	e["Pos"].append(TAG_Double(z)			# For a string or a fixed value the value needs to be in quotes
											# otherwise it will try and call the stored value with that name
											# The data type must be correct. The correct type can be found on the chunk format wiki page
											# http://minecraft.gamepedia.com/Chunk_format

	chunk = level.getChunk(x/16, z/16)  # Chunk is not defined yet to this defines it

	chunk.Entities.append(e)		# You then need to append the compound tag to the world
	chunk.dirty = True				# And tell MCedit that the chunk has been updated
Ejemplo n.º 20
0
def performed(level, box, options):
    health = options["Health"]
    vx = options["VelocityX"]
    vy = options["VelocityY"]
    vz = options["VelocityZ"]
    fire = options["Fire"]
    fall = options["FallDistance"]
    air = options["Air"]
    attackTime = options["AttackTime"]
    hurtTime = options["HurtTime"]
    powered = options["Lightning Creeper"]
    blockId = options["Enderman Block Id"]
    blockData = options["Enderman Block Data"]
    profession = options["Villager Profession"]
    size = options["Slime Size"]
    breedTicks = options["Breeding Mode Ticks"]
    age = options["Child/Adult Age"]

    for (chunk, slices, point) in level.getChunkSlices(box):
        for e in chunk.Entities:
            x = e["Pos"][0].value
            y = e["Pos"][1].value
            z = e["Pos"][2].value

            if box.minx <= x < box.maxx and box.miny <= y < box.maxy and box.minz <= z < box.maxz:
                if "Health" in e:
                    if health != noop:
                        e["Health"] = TAG_Short(health)

                    if vx != noop:
                        e["Motion"][0] = TAG_Double(vx)
                    if vy != noop:
                        e["Motion"][1] = TAG_Double(vy)
                    if vz != noop:
                        e["Motion"][2] = TAG_Double(vz)

                    if fire != noop:
                        e["Fire"] = TAG_Short(fire)

                    if fall != noop:
                        e["FallDistance"] = TAG_Float(fall)

                    if air != noop:
                        e["Air"] = TAG_Short(air)

                    if attackTime != noop:
                        e["AttackTime"] = TAG_Short(attackTime)

                    if hurtTime != noop:
                        e["HurtTime"] = TAG_Short(hurtTime)

                    if powered != "N/A" and (e["id"].value == "Creeper"
                                             or MCEDIT_IDS.get(e["id"].value)
                                             == "DEF_ENTITIES_CREEPER"):
                        if powered == "Lightning":
                            e["powered"] = TAG_Byte(1)
                        if powered == "No Lightning":
                            e["powered"] = TAG_Byte(0)

                    if blockId != noop and (e["id"].value == "Enderman"
                                            or MCEDIT_IDS.get(e["id"].value)
                                            == "DEF_ENTITIES_ENDERMAN"):
                        e["carried"] = TAG_Short(blockId)
                    if blockData != noop and (e["id"].value == "Enderman"
                                              or MCEDIT_IDS.get(e["id"].value)
                                              == "DEF_ENTITIES_ENDERMAN"):
                        e["carriedData"] = TAG_Short(blockData)

                    if profession != "N/A" and (e["id"].value == "Villager" or
                                                MCEDIT_IDS.get(e["id"].value)
                                                == "DEF_ENTITIES_VILLAGER"):
                        e["Profession"] = TAG_Int(Professions[profession])

                    if size != noop and (e["id"].value == "Slime"
                                         or MCEDIT_IDS.get(e["id"].value)
                                         == "DEF_ENTITIES_SLIME"):
                        e["Size"] = TAG_Int(size)

                    if breedTicks != noop:
                        e["InLove"] = TAG_Int(breedTicks)

                    if age != noop:
                        e["Age"] = TAG_Int(age)

                    chunk.dirty = True
Ejemplo n.º 21
0
def createXeno(level, x, y, z, customName, Invisible, CustomNameVisible, Invulnerable, Marker, NoGravity, MotionX, MotionY, MotionZ, RotationX, RotationY, Small,ShowArms,NoBasePlate,HandItem1,HandItem2,ArmorItem1,ArmorItem2,ArmorItem3,ArmorItem4,ArmorItem4Data,PoseBodyX,PoseBodyY,PoseBodyZ,PoseHeadX,PoseHeadY,PoseHeadZ,PoseRightArmX,PoseRightArmY,PoseRightArmZ,PoseLeftArmX,PoseLeftArmY,PoseLeftArmZ,PoseRightLegX,PoseRightLegY,PoseRightLegZ,PoseLeftLegX,PoseLeftLegY,PoseLeftLegZ): # After @Sethbling
	print("New Xeno named "+customName+" at "+str(x)+","+str(y)+","+str(z))
	
	mob = TAG_Compound()
	mob["NoAI"] = TAG_Byte(1)
	mob["LeftHanded"] = TAG_Byte(1)
	mob["PersistenceRequired"] = TAG_Byte(1)
	mob["CustomName"] = TAG_String(customName)
	mob["Invisible"] = TAG_Byte(Invisible)
	mob["Small"] = TAG_Byte(Small)
#	mob["ShowArms"] = TAG_Byte(ShowArms)
#	mob["NoBasePlate"] = TAG_Byte(NoBasePlate)
	mob["CustomNameVisible"] = TAG_Byte(CustomNameVisible)
	mob["Invulnerable"] = TAG_Byte(Invulnerable)
#	mob["Marker"] = TAG_Byte(Marker)
	mob["NoGravity"] = TAG_Byte(NoGravity)
	mob["OnGround"] = TAG_Byte(1)
	mob["Air"] = TAG_Short(300)
	mob["DeathTime"] = TAG_Short(0)
	mob["Fire"] = TAG_Short(-1)
	mob["Health"] = TAG_Short(40)
	mob["HurtTime"] = TAG_Short(0)
	mob["Age"] = TAG_Int(0)
	mob["FallDistance"] = TAG_Float(0)
	mob["Motion"] = TAG_List()
	mob["Motion"].append(TAG_Double(MotionX))
	mob["Motion"].append(TAG_Double(MotionY))
	mob["Motion"].append(TAG_Double(MotionZ))
	mob["Pos"] = TAG_List()
	mob["Pos"].append(TAG_Double(x + 0.5))
	mob["Pos"].append(TAG_Double(y))
	mob["Pos"].append(TAG_Double(z + 0.5))
	mob["Rotation"] = TAG_List()
	mob["Rotation"].append(TAG_Float(RotationX))
	mob["Rotation"].append(TAG_Float(RotationY))

	tl_AI = TAG_List()
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(HandItem1)
	tl_AI.append(tc_AI1)
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(HandItem2)
	tl_AI.append(tc_AI1)
	mob["HandItems"] = tl_AI

	tl_AI = TAG_List()
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(ArmorItem1)
	tl_AI.append(tc_AI1)
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(ArmorItem2)
	tl_AI.append(tc_AI1)
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(ArmorItem3)
	tl_AI.append(tc_AI1)
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(ArmorItem4)
	tc_AI1["Damage"] = TAG_Short(ArmorItem4Data)
	tl_AI.append(tc_AI1)
	mob["ArmorItems"] = tl_AI

	# Cave Spider head
	tl_Pass = TAG_List()
	tc_Pass1 = TAG_Compound()
	tc_Pass1["id"] = TAG_String("CaveSpider")
	tc_Pass1["NoAI"] = TAG_Byte(1)
	tc_Pass1["PersistenceRequired"] = TAG_Byte(1)
	tc_Pass1["CustomName"] = TAG_String(customName)
	tc_Pass1["Invisible"] = TAG_Byte(Invisible)
	tc_Pass1["Small"] = TAG_Byte(Small)
	tc_Pass1["CustomNameVisible"] = TAG_Byte(CustomNameVisible)
	tc_Pass1["Invulnerable"] = TAG_Byte(Invulnerable)
	tc_Pass1["NoGravity"] = TAG_Byte(NoGravity)
	tc_Pass1["OnGround"] = TAG_Byte(1)
	tc_Pass1["Air"] = TAG_Short(300)
	tc_Pass1["DeathTime"] = TAG_Short(0)
	tc_Pass1["Fire"] = TAG_Short(-1)
	tc_Pass1["Health"] = TAG_Short(12)
	tc_Pass1["HurtTime"] = TAG_Short(0)
	tc_Pass1["Age"] = TAG_Int(0)
	tc_Pass1["FallDistance"] = TAG_Float(0)
	tc_Pass1["Motion"] = TAG_List()
	tc_Pass1["Motion"].append(TAG_Double(MotionX))
	tc_Pass1["Motion"].append(TAG_Double(MotionY))
	tc_Pass1["Motion"].append(TAG_Double(MotionZ))
	tc_Pass1["Pos"] = TAG_List()
	tc_Pass1["Pos"].append(TAG_Double(x + 0.5))
	tc_Pass1["Pos"].append(TAG_Double(y))
	tc_Pass1["Pos"].append(TAG_Double(z + 0.5))
	tc_Pass1["Rotation"] = TAG_List()
	tc_Pass1["Rotation"].append(TAG_Float(RotationX))
	tc_Pass1["Rotation"].append(TAG_Float(RotationY))
	tl_Pass.append(tc_Pass1)
	mob["Passengers"] = tl_Pass
	# End Cave Spider head
	
	mob["id"] = TAG_String("Enderman")
	chunk = level.getChunk(int(x) / CHUNKSIZE, int(z) / CHUNKSIZE)
	chunk.Entities.append(mob)
	chunk.dirty = True	
Ejemplo n.º 22
0
def createArmorStand(level, x, y, z, customName, Invisible, CustomNameVisible, Invulnerable, Marker, NoGravity, MotionX, MotionY, MotionZ, RotationX, RotationY, Small,ShowArms,NoBasePlate,HandItem1,HandItem2,ArmorItem1,ArmorItem2,ArmorItem3,ArmorItem4,ArmorItem4Data,PoseBodyX,PoseBodyY,PoseBodyZ,PoseHeadX,PoseHeadY,PoseHeadZ,PoseRightArmX,PoseRightArmY,PoseRightArmZ,PoseLeftArmX,PoseLeftArmY,PoseLeftArmZ,PoseRightLegX,PoseRightLegY,PoseRightLegZ,PoseLeftLegX,PoseLeftLegY,PoseLeftLegZ): # After @Sethbling
	print("New ArmorStand named "+customName+" at "+str(x)+","+str(y)+","+str(z))
	
	mob = TAG_Compound()
	mob["CustomName"] = TAG_String(customName)
	mob["Invisible"] = TAG_Byte(Invisible)
	mob["Small"] = TAG_Byte(Small)
	mob["ShowArms"] = TAG_Byte(ShowArms)
	mob["NoBasePlate"] = TAG_Byte(NoBasePlate)
	mob["CustomNameVisible"] = TAG_Byte(CustomNameVisible)
	mob["Invulnerable"] = TAG_Byte(Invulnerable)
	mob["Marker"] = TAG_Byte(Marker)
	mob["NoGravity"] = TAG_Byte(NoGravity)
	mob["OnGround"] = TAG_Byte(1)
	mob["Air"] = TAG_Short(300)
	mob["DeathTime"] = TAG_Short(0)
	mob["Fire"] = TAG_Short(-1)
	mob["Health"] = TAG_Short(20)
	mob["HurtTime"] = TAG_Short(0)
	mob["Age"] = TAG_Int(0)
	mob["FallDistance"] = TAG_Float(0)
	mob["Motion"] = TAG_List()
	mob["Motion"].append(TAG_Double(MotionX))
	mob["Motion"].append(TAG_Double(MotionY))
	mob["Motion"].append(TAG_Double(MotionZ))
	mob["Pos"] = TAG_List()
	mob["Pos"].append(TAG_Double(x + 0.5))
	mob["Pos"].append(TAG_Double(y))
	mob["Pos"].append(TAG_Double(z + 0.5))
	mob["Rotation"] = TAG_List()
	mob["Rotation"].append(TAG_Float(RotationX))
	mob["Rotation"].append(TAG_Float(RotationY))

	tl_AI = TAG_List()
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(HandItem1)
	tl_AI.append(tc_AI1)
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(HandItem2)
	tl_AI.append(tc_AI1)
	mob["HandItems"] = tl_AI
	
	tl_AI = TAG_List()
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(ArmorItem1)
	tl_AI.append(tc_AI1)
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(ArmorItem2)
	tl_AI.append(tc_AI1)
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(ArmorItem3)
	tl_AI.append(tc_AI1)
	tc_AI1 = TAG_Compound()
	tc_AI1["Count"] = TAG_Byte(1)
	tc_AI1["id"] = TAG_String(ArmorItem4)
	tc_AI1["Damage"] = TAG_Short(ArmorItem4Data)
	tl_AI.append(tc_AI1)
	mob["ArmorItems"] = tl_AI

	tc_Pose = TAG_Compound()
	tl_Pose = TAG_List()
	tl_Pose.append(TAG_Float(PoseBodyX))
	tl_Pose.append(TAG_Float(PoseBodyY))
	tl_Pose.append(TAG_Float(PoseBodyZ))
	tc_Pose["Body"] = tl_Pose
	tl_Pose = TAG_List()
	tl_Pose.append(TAG_Float(PoseHeadX))
	tl_Pose.append(TAG_Float(PoseHeadY))
	tl_Pose.append(TAG_Float(PoseHeadZ))
	tc_Pose["Head"] = tl_Pose
	tl_Pose = TAG_List()
	tl_Pose.append(TAG_Float(PoseRightArmX))
	tl_Pose.append(TAG_Float(PoseRightArmY))
	tl_Pose.append(TAG_Float(PoseRightArmZ))
	tc_Pose["RightArm"] = tl_Pose
	tl_Pose = TAG_List()
	tl_Pose.append(TAG_Float(PoseLeftArmX))
	tl_Pose.append(TAG_Float(PoseLeftArmY))
	tl_Pose.append(TAG_Float(PoseLeftArmZ))
	tc_Pose["LeftArm"] = tl_Pose
	tl_Pose = TAG_List()
	tl_Pose.append(TAG_Float(PoseRightLegX))
	tl_Pose.append(TAG_Float(PoseRightLegY))
	tl_Pose.append(TAG_Float(PoseRightLegZ))
	tc_Pose["RightLeg"] = tl_Pose
	tl_Pose = TAG_List()
	tl_Pose.append(TAG_Float(PoseLeftLegX))
	tl_Pose.append(TAG_Float(PoseLeftLegY))
	tl_Pose.append(TAG_Float(PoseLeftLegZ))
	tc_Pose["LeftLeg"] = tl_Pose	
	mob["Pose"] = tc_Pose
	
	mob["id"] = TAG_String("ArmorStand")
	chunk = level.getChunk(int(x) / CHUNKSIZE, int(z) / CHUNKSIZE)
	chunk.Entities.append(mob)
	chunk.dirty = True
Ejemplo n.º 23
0
def shield(level, x, y, z, tx, ty):  #define function
    e = TAG_Compound()  #make the entity

    #the rest is defining all the data that is required by the entity

    e["id"] = TAG_String("ArmorStand")

    e["Invisible"] = TAG_Byte(1)

    e["NoGravity"] = TAG_Byte(1)

    e["HandItems"] = TAG_List()
    e["HandItems"].append(TAG_Compound())
    e["HandItems"][0]["Count"] = TAG_Byte(1)
    e["HandItems"][0]["Damage"] = TAG_Short(0)
    e["HandItems"][0]["id"] = TAG_String("minecraft:stone_sword")
    e["HandItems"].append(TAG_Compound())
    e["HandItems"][1]["Count"] = TAG_Byte(1)
    e["HandItems"][1]["Damage"] = TAG_Short(0)
    e["HandItems"][1]["id"] = TAG_String("minecraft:shield")
    e["HandItems"][1]["tag"] = TAG_Compound()
    e["HandItems"][1]["tag"]["BlockEntityTag"] = TAG_Compound()
    e["HandItems"][1]["tag"]["BlockEntityTag"]["Base"] = TAG_Int(1)
    e["HandItems"][1]["tag"]["BlockEntityTag"]["Patterns"] = TAG_List()
    e["HandItems"][1]["tag"]["BlockEntityTag"]["Patterns"].append(
        TAG_Compound())
    e["HandItems"][1]["tag"]["BlockEntityTag"]["Patterns"][0][
        "Color"] = TAG_Int(11)
    e["HandItems"][1]["tag"]["BlockEntityTag"]["Patterns"][0][
        "Pattern"] = TAG_String("cr")
    e["HandItems"][1]["tag"]["BlockEntityTag"]["Patterns"].append(
        TAG_Compound())
    e["HandItems"][1]["tag"]["BlockEntityTag"]["Patterns"][1][
        "Color"] = TAG_Int(8)
    e["HandItems"][1]["tag"]["BlockEntityTag"]["Patterns"][1][
        "Pattern"] = TAG_String("mc")

    e["Pos"] = TAG_List()
    e["Pos"].append(TAG_Double(x))
    e["Pos"].append(TAG_Double(y - 0.7))
    e["Pos"].append(TAG_Double(z))

    e["Pose"] = TAG_Compound()
    e["Pose"]["LeftArm"] = TAG_List()
    e["Pose"]["LeftArm"].append(TAG_Float(0.0))
    e["Pose"]["LeftArm"].append(TAG_Float(ty + 90.0))
    e["Pose"]["LeftArm"].append(TAG_Float(90.0))
    e["Pose"]["RightArm"] = TAG_List()
    e["Pose"]["RightArm"].append(TAG_Float((-ty / 2.5) - 40.0))
    e["Pose"]["RightArm"].append(TAG_Float(ty / 4))
    e["Pose"]["RightArm"].append(TAG_Float(15.0))

    e["Rotation"] = TAG_List()
    e["Rotation"].append(TAG_Float(tx))
    e["Rotation"].append(TAG_Float(0.0))

    chunk = level.getChunk(int(math.floor(x)) / 16,
                           int(math.floor(z)) /
                           16)  #get the chunk that the entitiy is located at
    chunk.Entities.append(e)  #mark the entity to that chunk
    chunk.dirty = True  #tell mcedit that that chunk has been modified and needs to be saved
Ejemplo n.º 24
0
def perform(level, box, options):
    block = options["Block:"].ID
    data = options["Block Data:"]
    height = options["Block Height from Cart:"]
    typ = options["Type of Cart:"]
    tileEntitiesToRemove = []

    if typ == "Ridable":
        mc = TAG_String("MinecartRideable")
    elif typ == "Furnace":
        mc = TAG_String("MinecartFurnace")
    elif typ == "TNT":
        mc = TAG_String("MinecartTNT")
    elif typ == "Chest":
        mc = TAG_String("MinecartChest")
    elif typ == "Hopper":
        mc = TAG_String("MinecartHopper")
    elif typ == "Spawner":
        mc = TAG_String("MinecartSpawner")
    elif typ == "Command Block":
        mc = TAG_String("MinecartCommandBlock")

    for (chunk, slices, point) in level.getChunkSlices(box):
        for t in chunk.TileEntities:
            x = t["x"].value
            y = t["y"].value
            z = t["z"].value

            tileEntitiesToRemove.append((chunk, t))

            level.setBlockAt(x, y, z, 0)

            cart = TAG_Compound()
            cart["Air"] = TAG_Short(300)
            cart["FallDistance"] = TAG_Float(0)
            cart["Fire"] = TAG_Short(-1)
            cart["id"] = mc
            cart["Invulnerable"] = TAG_Byte(0)
            cart["Motion"] = TAG_List()
            cart["Motion"].append(TAG_Double(0))
            cart["Motion"].append(TAG_Double(-0))
            cart["Motion"].append(TAG_Double(0))
            cart["OnGround"] = TAG_Byte(1)
            cart["Pos"] = TAG_List()
            cart["Pos"].append(TAG_Double(box.minx + 0.5))
            cart["Pos"].append(TAG_Double(box.miny + 1))
            cart["Pos"].append(TAG_Double(box.minz + 0.5))
            cart["Rotation"] = TAG_List()
            cart["Rotation"].append(TAG_Float(0))
            cart["Rotation"].append(TAG_Float(0))
            cart["CustomDisplayTile"] = TAG_Byte(1)
            cart["DisplayTile"] = TAG_Int(block)
            cart["DisplayData"] = TAG_Int(data)
            cart["DisplayOffset"] = TAG_Int(height)
            if typ == "Spawner":
                for tag in t:
                    if tag not in ["id", "x", "y", "z"]:
                        cart[tag] = t[tag]
            if typ == "MinecartCommandBlock":
                if t["id"] == "Control":
                    cart["Command"] = t["Command"]
                    cart["CustomName"] = t["CustomName"]

            chunk.Entities.append(cart)
            chunk.dirty = True

    for (chunk, t) in tileEntitiesToRemove:
        chunk.TileEntities.remove(t)
Ejemplo n.º 25
0
def perform(level, box, options):
	print "Follow Me On Twitter At @RedstonerLabs"
	for x in xrange(box.minx, box.maxx):
		for z in xrange(box.minz, box.maxz):
			for y in xrange(box.miny, box.maxy):
			
				invun = options["Invuneable"]
			
				float = options["NoGravity"]

				silent = options["Silent"]
				
				ROTX = options["Rotation"]
				
				Text2 = options["CustomName"]
				
				glowing = options["Glowing"]
				
				fire = options["Fire"]
				
				off1 = options["Offset X"]
				
				off2 = options["Offset Y"]
				
				off3 = options["Offset Z"]
				
				vis = options["CustomNameVisible"]
				
				ItemsSmokeBox = Smokeboxs[options["Boat Type"]]
				
				ItemsSmokeBox2 = Smokeboxs2[options["Minecraft Type"]]
				
				chunk = level.getChunk(x/16, z/16)
				
				Boat = TAG_Compound()
				
				if options["(1.11)(1.11.2)(1.11.2+)"]:
					Boat["id"] = TAG_String(u'boat')
					
				else:
					Boat["id"] = TAG_String(u'Boat')
					
				pos = TAG_List()
				pos.append(TAG_Double(x+off1))
				pos.append(TAG_Double(y+off2))
				pos.append(TAG_Double(z+off3))
				Boat["Pos"] = pos
				Boat["OnGround"] = TAG_Byte(0)
				Boat["NoGravity"] = TAG_Byte(float)
				Boat["Silent"] = TAG_Byte(silent)
				motion = TAG_List()
				motion.append(TAG_Double(0.0))
				motion.append(TAG_Double(0.0))
				motion.append(TAG_Double(0.0))
				Boat["Motion"] = motion
				Boat["Dimension"] = TAG_Int(0)
				Boat["Air"] = TAG_Short(300)
				rotation = TAG_List()
				rotation.append(TAG_Float(ROTX))
				rotation.append(TAG_Float(0.0))
				Boat["Rotation"] = rotation
				Boat["FallDistance"] = TAG_Float(0.0)
				Boat["Invulnerable"] = TAG_Byte(invun)
				Boat["PortalCooldown"] = TAG_Int(0)
				Boat["Glowing"] = TAG_Byte(glowing)
				Boat["CustomNameVisible"] = TAG_Byte(vis)
				Boat["CustomName"] = TAG_String(Text2)
				Boat["Fire"] = TAG_Short(fire)
				
				if ItemsSmokeBox == "oak" and ItemsSmokeBox2 == "CONSOLE":
					Boat["Type"] = TAG_Int(0)
					
				if ItemsSmokeBox == "birch" and ItemsSmokeBox2 == "CONSOLE":
					Boat["Type"] = TAG_Int(1)
					
				if ItemsSmokeBox == "spruce" and ItemsSmokeBox2 == "CONSOLE":
					Boat["Type"] = TAG_Int(2)
					
				if ItemsSmokeBox == "jungle" and ItemsSmokeBox2 == "CONSOLE":
					Boat["Type"] = TAG_Int(3)
					
				if ItemsSmokeBox == "acaica" and ItemsSmokeBox2 == "CONSOLE":
					Boat["Type"] = TAG_Int(4)
					
				if ItemsSmokeBox == "dark_oak" and ItemsSmokeBox2 == "CONSOLE":
					Boat["Type"] = TAG_Int(5)
					
				if ItemsSmokeBox == "glitched" and ItemsSmokeBox2 == "CONSOLE":
					Boat["Type"] = TAG_Int(-1)
					
				if ItemsSmokeBox2 == "PC":
					Boat["Type"] = TAG_String(ItemsSmokeBox)
					
				chunk.Entities.append(Boat)
	print "Completed Work"
Ejemplo n.º 26
0
def createShop(level, x, y, z):
    chest = level.tileEntityAt(x, y, z)
    if chest == None:
        return

    priceList = {}
    saleList = {}
    profession = 0
    riches = 0

    for item in chest["Items"]:
        slot = item["Slot"].value
        if slot >= 0 and slot <= 8:
            priceList[slot] = item
        elif slot >= 9 and slot <= 17:
            saleList[slot-9] = item
        elif slot == 18:
            if item["id"].value == 35:
                dmg = item["Damage"].value
                if dmg == 12:
                    profession = 0 #brown villager
                elif dmg == 0:
                    profession = 1 #white villager
                elif dmg == 2 or dmg == 6 or dmg == 10 or dmg == 14:
                    profession = 2 #purple villager
                elif dmg == 15 or dmg == 7:
                    profession = 3 #black apron villager
                elif dmg == 8:
                    profession = 4 #white apron villager
                elif dmg == 5 or dmg == 13:
                    profession = 5 #green villager
        else:
            riches += item["Count"].value #other slots are used to count towards the "riches" total

    villager = TAG_Compound()
    villager["OnGround"] = TAG_Byte(1)
    villager["Air"] = TAG_Short(300)
    villager["AttackTime"] = TAG_Short(0)
    villager["DeathTime"] = TAG_Short(0)
    villager["Fire"] = TAG_Short(-1)
    villager["Health"] = TAG_Short(20)
    villager["HurtTime"] = TAG_Short(0)
    villager["Age"] = TAG_Int(0)
    villager["Profession"] = TAG_Int(profession)
    villager["Riches"] = TAG_Int(riches)
    villager["FallDistance"] = TAG_Float(0)
    villager["id"] = TAG_String("Villager")
    villager["Motion"] = TAG_List()
    villager["Motion"].append(TAG_Double(0))
    villager["Motion"].append(TAG_Double(0))
    villager["Motion"].append(TAG_Double(0))
    villager["Pos"] = TAG_List()
    villager["Pos"].append(TAG_Double(x + 0.5))
    villager["Pos"].append(TAG_Double(y))
    villager["Pos"].append(TAG_Double(z + 0.5))
    villager["Rotation"] = TAG_List()
    villager["Rotation"].append(TAG_Float(0))
    villager["Rotation"].append(TAG_Float(0))

    villager["Offers"] = TAG_Compound()
    villager["Offers"]["Recipes"] = TAG_List()
    for i in range(9):
        if i in priceList and i in saleList:
            offer = TAG_Compound()
            offer["buy"] = priceList[i]
            offer["sell"] = saleList[i]
            villager["Offers"]["Recipes"].append(offer)

    level.setBlockAt(x, y, z, 0)

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(villager)
    chunk.TileEntities.remove(chest)
    chunk.dirty = True
def perform(level, box, options):

    #**************#
    #Define Options#
    #**************#
    ItemsSmokeBox = Smokeboxs[options["Particle"]]
    colorvalue = dict([(trn._(a), b)
                       for a, b in Smokeboxs2.items()])[options["ColorValue"]]

    #****************#
    #Define Selection#
    #****************#
    for x in xrange(box.minx, box.maxx):

        for z in xrange(box.minz, box.maxz):

            for y in xrange(box.miny, box.maxy):

                #********************************#
                #Checks If Console Edtion Is True#
                #********************************#
                chunk = level.getChunk(x / 16, z / 16)

                #*******************************#
                #Define & Create AreaEffectCloud#
                #*******************************#
                areaEffectCloud = TAG_Compound()
                areaEffectCloud["Radius"] = TAG_Float(options["Radius"])
                areaEffectCloud["DurationOnUse"] = TAG_Int(0)
                areaEffectCloud["Invulnerable"] = TAG_Byte(
                    options["Invulnerable"])
                areaEffectCloud["PortalCooldown"] = TAG_Int(0)

                #*********************************************************************#
                #Checks If Console Edtion Is True And Converts Particle Ids To Console#
                #*********************************************************************#
                if options["Console Edtition"] and ItemsSmokeBox == "take":
                    areaEffectCloud["Particle"] = TAG_Int(0)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "take":
                    areaEffectCloud["Particle"] = TAG_String("take")

                if options["Console Edtition"] and ItemsSmokeBox == "note":
                    areaEffectCloud["Particle"] = TAG_Int(2)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "note":
                    areaEffectCloud["Particle"] = TAG_String("note")

                if options["Console Edtition"] and ItemsSmokeBox == "portal":
                    areaEffectCloud["Particle"] = TAG_Int(3)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "portal":
                    areaEffectCloud["Particle"] = TAG_String("portal")

                if options["Console Edtition"] and ItemsSmokeBox == "explode":
                    areaEffectCloud["Particle"] = TAG_Int(5)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "explode":
                    areaEffectCloud["Particle"] = TAG_String("explode")

                if options["Console Edtition"] and ItemsSmokeBox == "flame":
                    areaEffectCloud["Particle"] = TAG_Int(6)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "flame":
                    areaEffectCloud["Particle"] = TAG_String("flame")

                if options["Console Edtition"] and ItemsSmokeBox == "lava":
                    areaEffectCloud["Particle"] = TAG_Int(7)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "lava":
                    areaEffectCloud["Particle"] = TAG_String("lava")

                if options["Console Edtition"] and ItemsSmokeBox == "footstep":
                    areaEffectCloud["Particle"] = TAG_Int(8)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "footstep":
                    areaEffectCloud["Particle"] = TAG_String("footstep")

                if options["Console Edtition"] and ItemsSmokeBox == "droplet":
                    areaEffectCloud["Particle"] = TAG_Int(9)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "droplet":
                    areaEffectCloud["Particle"] = TAG_String("droplet")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "largesmoke":
                    areaEffectCloud["Particle"] = TAG_Int(10)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "largesmoke":
                    areaEffectCloud["Particle"] = TAG_String("largesmoke")

                if options["Console Edtition"] and ItemsSmokeBox == "reddust":
                    areaEffectCloud["Particle"] = TAG_Int(11)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "reddust":
                    areaEffectCloud["Particle"] = TAG_String("reddust")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "snowballpoof":
                    areaEffectCloud["Particle"] = TAG_Int(12)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "snowballpoof":
                    areaEffectCloud["Particle"] = TAG_String("snowballpoof")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "snowshovel":
                    areaEffectCloud["Particle"] = TAG_Int(13)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "snowshovel":
                    areaEffectCloud["Particle"] = TAG_String("snowshovel")

                if options["Console Edtition"] and ItemsSmokeBox == "slime":
                    areaEffectCloud["Particle"] = TAG_Int(14)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "slime":
                    areaEffectCloud["Particle"] = TAG_String("slime")

                if options["Console Edtition"] and ItemsSmokeBox == "heart":
                    areaEffectCloud["Particle"] = TAG_Int(15)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "heart":
                    areaEffectCloud["Particle"] = TAG_String("heart")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "depthsuspend":
                    areaEffectCloud["Particle"] = TAG_Int(17)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "depthsuspend":
                    areaEffectCloud["Particle"] = TAG_String("depthsuspend")

                if options["Console Edtition"] and ItemsSmokeBox == "crit":
                    areaEffectCloud["Particle"] = TAG_Int(18)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "crit":
                    areaEffectCloud["Particle"] = TAG_String("crit")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "hugeexplosion":
                    areaEffectCloud["Particle"] = TAG_Int(19)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "hugeexplosion":
                    areaEffectCloud["Particle"] = TAG_String("hugeexplosion")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "largeexplode":
                    areaEffectCloud["Particle"] = TAG_Int(20)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "largeexplode":
                    areaEffectCloud["Particle"] = TAG_String("largeexplode")

                if options["Console Edtition"] and ItemsSmokeBox == "spell":
                    areaEffectCloud["Particle"] = TAG_Int(22)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "spell":
                    areaEffectCloud["Particle"] = TAG_String("spell")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "witchMagic":
                    areaEffectCloud["Particle"] = TAG_Int(23)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "witchMagic":
                    areaEffectCloud["Particle"] = TAG_String("witchMagic")

                if options["Console Edtition"] and ItemsSmokeBox == "mobSpell":
                    areaEffectCloud["Particle"] = TAG_Int(24)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "mobSpell":
                    areaEffectCloud["Particle"] = TAG_String("mobSpell")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "mobSpellAmbient":
                    areaEffectCloud["Particle"] = TAG_Int(25)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "mobSpellAmbient":
                    areaEffectCloud["Particle"] = TAG_String("mobSpellAmbient")

                if options["Console Edtition"] and ItemsSmokeBox == "suspended":
                    areaEffectCloud["Particle"] = TAG_Int(27)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "suspended":
                    areaEffectCloud["Particle"] = TAG_String("suspended")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "fallingdust":
                    areaEffectCloud["Particle"] = TAG_Int(28)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "fallingdust":
                    areaEffectCloud["Particle"] = TAG_String("fallingdust")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "enchantmenttable":
                    areaEffectCloud["Particle"] = TAG_Int(29)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "enchantmenttable":
                    areaEffectCloud["Particle"] = TAG_String(
                        "enchantmenttable")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "angryVillager":
                    areaEffectCloud["Particle"] = TAG_Int(31)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "angryVillager":
                    areaEffectCloud["Particle"] = TAG_String("angryVillager")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "happyVillager":
                    areaEffectCloud["Particle"] = TAG_Int(32)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "happyVillager":
                    areaEffectCloud["Particle"] = TAG_String("happyVillager")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "fireworksSpark":
                    areaEffectCloud["Particle"] = TAG_Int(33)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "fireworksSpark":
                    areaEffectCloud["Particle"] = TAG_String("fireworksSpark")

                if options["Console Edtition"] and ItemsSmokeBox == "splash":
                    areaEffectCloud["Particle"] = TAG_Int(34)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "splash":
                    areaEffectCloud["Particle"] = TAG_String("splash")

                if options["Console Edtition"] and ItemsSmokeBox == "magicCrit":
                    areaEffectCloud["Particle"] = TAG_Int(35)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "magicCrit":
                    areaEffectCloud["Particle"] = TAG_String("magicCrit")

                if options["Console Edtition"] and ItemsSmokeBox == "cloud":
                    areaEffectCloud["Particle"] = TAG_Int(37)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "cloud":
                    areaEffectCloud["Particle"] = TAG_String("cloud")

                if options["Console Edtition"] and ItemsSmokeBox == "barrier":
                    areaEffectCloud["Particle"] = TAG_Int(38)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "barrier":
                    areaEffectCloud["Particle"] = TAG_String("barrier")

                if options["Console Edtition"] and ItemsSmokeBox == "iconcrack":
                    areaEffectCloud["Particle"] = TAG_Int(39)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "iconcrack":
                    areaEffectCloud["Particle"] = TAG_String("iconcrack")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "blockcrack":
                    areaEffectCloud["Particle"] = TAG_Int(40)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "blockcrack":
                    areaEffectCloud["Particle"] = TAG_String("blockcrack")

                if options["Console Edtition"] and ItemsSmokeBox == "Invisible":
                    areaEffectCloud["Particle"] = TAG_Int(43)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "Invisible":
                    areaEffectCloud["Particle"] = TAG_String("Invisible")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "dragonbreath":
                    areaEffectCloud["Particle"] = TAG_Int(44)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "dragonbreath":
                    areaEffectCloud["Particle"] = TAG_String("dragonbreath")

                if options["Console Edtition"] and ItemsSmokeBox == "endRod":
                    areaEffectCloud["Particle"] = TAG_Int(45)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "endRod":
                    areaEffectCloud["Particle"] = TAG_String("endRod")

                if options[
                        "Console Edtition"] and ItemsSmokeBox == "damageIndicator":
                    areaEffectCloud["Particle"] = TAG_Int(46)

                if options[
                        "Console Edtition"] != True and ItemsSmokeBox == "damageIndicator":
                    areaEffectCloud["Particle"] = TAG_String("damageIndicator")

                customPotionEffects = TAG_List()
                customPotionEffect = TAG_Compound()
                customPotionEffect["ShowParticles"] = TAG_Byte(
                    options["ShowParticles"])
                customPotionEffect["Duration"] = TAG_Int(
                    options["Effect Duration"])
                customPotionEffect["Id"] = TAG_Int(options["Effect ID"])
                customPotionEffect["Amplifier"] = TAG_Int(
                    options["Effect Amplifier"])
                customPotionEffects.append(customPotionEffect)
                areaEffectCloud["Effects"] = customPotionEffects

                areaEffectCloud["FallDistance"] = TAG_Float(0.0)

                #**************************************#
                #1.11+ Support Changes ID To New Format#
                #**************************************#
                if options["1.11-1.12+Plus"]:
                    AreaEffectCloud["id"] = TAG_String(u'area_effect_cloud')

                else:
                    areaEffectCloud["id"] = TAG_String(u'AreaEffectCloud')

                areaEffectCloud["ParticleParam1"] = TAG_Int(
                    options["ParticleParam1"])
                areaEffectCloud["ParticleParam2"] = TAG_Int(
                    options["ParticleParam2"])
                areaEffectCloud["Age"] = TAG_Int(options["Age"])

                #********************************************#
                #Custom ColorValue Option Aplies To Particles#
                #********************************************#
                if options["Custom ColorValue"]:

                    areaEffectCloud["Color"] = TAG_Int(colorvalue)

                else:
                    areaEffectCloud["Color"] = TAG_Int(0)

                motion = TAG_List()
                motion.append(TAG_Double(0))
                motion.append(TAG_Double(0))
                motion.append(TAG_Double(0))
                areaEffectCloud["Motion"] = motion

                areaEffectCloud["ReapplicationDelay"] = TAG_Int(
                    options["ReapplicationDelay"])
                areaEffectCloud["Potion"] = TAG_String("minecraft:potion")

                #********************************************#
                #Changes Durantion To The Max Value When True#
                #********************************************#
                if options["Last-Forever/No-Despawn"]:
                    areaEffectCloud["Duration"] = TAG_Int(2147483647)

                else:
                    areaEffectCloud["Duration"] = TAG_Int(options["Duration"])

                areaEffectCloud["Air"] = TAG_Short(300)
                areaEffectCloud["OnGround"] = TAG_Byte(0)
                areaEffectCloud["Dimension"] = TAG_Int(0)
                rotation = TAG_List()
                rotation.append(TAG_Float(0.0))
                rotation.append(TAG_Float(0.0))
                areaEffectCloud["Rotation"] = rotation
                areaEffectCloud["RadiusPerTick"] = TAG_Float(
                    options["RadiusPerTick"])
                pos = TAG_List()
                pos.append(TAG_Double(x + 0.5))
                pos.append(TAG_Double(y))
                pos.append(TAG_Double(z + 0.5))
                areaEffectCloud["Pos"] = pos
                areaEffectCloud["Fire"] = TAG_Short(0)
                areaEffectCloud["RadiusOnUse"] = TAG_Float(
                    options["RadiusOnUse"])
                areaEffectCloud["WaitTime"] = TAG_Int(options["WaitTime"])
                chunk.Entities.append(areaEffectCloud)

                #********************************************#
                #Marks The Chunks As Dirty/ReLights Selection#
                #********************************************#
                chunk.dirty = True

                #********************************************************#
                #Prints Out Particle ID & Coordinates That Were Generated#
                #********************************************************#
                print "Created AreaEffectCloud " + str(
                    ItemsSmokeBox) + " At X:" + str(x) + " Y:" + str(
                        y) + " Z:" + str(z)

    #***************************************#
    #Prints Out Completed Generation Message#
    #***************************************#
    print "Completed Generation"
Ejemplo n.º 28
0
def perform(level, box, options):
    for x in xrange(box.minx, box.maxx):
        for y in xrange(box.miny, box.maxy):
            for z in xrange(box.minz, box.maxz):
                block = level.blockAt(x, y, z)
                data = level.blockDataAt(x, y, z)
                extrab = options["Use Slime Blocks"]
                ItemsSmokeBox2 = Smokeboxs2[options["Minecraft Type"]]

                chunk = level.getChunk(x / 16, z / 16)

                areaEffectCloud = TAG_Compound()
                if options["1.11+ or 1.11.2+"]:
                    areaEffectCloud["id"] = TAG_String(u'area_effect_cloud')
                if options["1.11+ or 1.11.2+"] != True:
                    areaEffectCloud["id"] = TAG_String(u'AreaEffectCloud')
                areaEffectCloud["ownerUUID"] = TAG_String(u'')
                areaEffectCloud["OnGround"] = TAG_Byte(0)
                areaEffectCloud["Dimension"] = TAG_Int(0)
                areaEffectCloud["Air"] = TAG_Short(300)
                areaEffectCloud["ParticleParam2"] = TAG_Int(0)
                areaEffectCloud["ParticleParam1"] = TAG_Int(0)
                if ItemsSmokeBox2 == "PC":
                    areaEffectCloud["Particle"] = TAG_String(u"take")
                if ItemsSmokeBox2 != "PC":
                    areaEffectCloud["Particle"] = TAG_Int(0)
                areaEffectCloud["ReapplicationDelay"] = TAG_Int(0)
                rotation = TAG_List()
                rotation.append(TAG_Float(0.0))
                rotation.append(TAG_Float(0.0))
                areaEffectCloud["Rotation"] = rotation
                areaEffectCloud["FallDistance"] = TAG_Float(0.0)
                effects = TAG_List()
                effect = TAG_Compound()
                effect["Amplifier"] = TAG_Byte(15)
                effect["Id"] = TAG_Byte(25)
                effect["Duration"] = TAG_Int(10)
                effect["Ambient"] = TAG_Byte(0)
                effect["ShowParticles"] = TAG_Byte(0)
                effects.append(effect)
                effect2 = TAG_Compound()
                effect2["Amplifier"] = TAG_Byte(100)
                effect2["Id"] = TAG_Byte(11)
                effect2["Duration"] = TAG_Int(100)
                effect2["Ambient"] = TAG_Byte(0)
                effect2["ShowParticles"] = TAG_Byte(0)
                effects.append(effect2)
                effect3 = TAG_Compound()
                effect3["Amplifier"] = TAG_Byte(20)
                effect3["Id"] = TAG_Byte(8)
                effect3["Duration"] = TAG_Int(40)
                effect3["Ambient"] = TAG_Byte(0)
                effect3["ShowParticles"] = TAG_Byte(0)
                effects.append(effect3)
                areaEffectCloud["Effects"] = effects
                areaEffectCloud["Fire"] = TAG_Short(0)
                areaEffectCloud["Invulnerable"] = TAG_Byte(0)
                areaEffectCloud["PortalCooldown"] = TAG_Int(0)
                areaEffectCloud["CustomName"] = TAG_String(u'')
                areaEffectCloud["createdOnHost"] = TAG_Byte(0)
                areaEffectCloud["Silent"] = TAG_Byte(1)
                areaEffectCloud["NoGravity"] = TAG_Byte(1)
                areaEffectCloud["Glowing"] = TAG_Byte(0)
                areaEffectCloud["Age"] = TAG_Int(1)
                areaEffectCloud["RadiusOnUse"] = TAG_Float(0.0)
                areaEffectCloud["Duration"] = TAG_Int(2147483647)
                areaEffectCloud["DurationOnUse"] = TAG_Int(0)
                areaEffectCloud["WaitTime"] = TAG_Int(0)
                areaEffectCloud["RadiusPerTick"] = TAG_Float(0.0)
                areaEffectCloud["Radius"] = TAG_Float(2.5)
                areaEffectCloud["Color"] = TAG_Int(0)
                areaEffectCloud["Potion"] = TAG_String(u'minecraft:leaping')
                pos = TAG_List()
                pos.append(TAG_Double(x + 0.5))
                pos.append(TAG_Double(y + 5))
                pos.append(TAG_Double(z + 0.5))
                areaEffectCloud["Pos"] = pos
                motion = TAG_List()
                motion.append(TAG_Double(0.0))
                motion.append(TAG_Double(0.0))
                motion.append(TAG_Double(0.0))
                areaEffectCloud["Motion"] = motion

                areaEffectCloud2 = TAG_Compound()
                if options["1.11+ or 1.11.2+"]:
                    areaEffectCloud2["id"] = TAG_String(u'area_effect_cloud')
                if options["1.11+ or 1.11.2+"] != True:
                    areaEffectCloud2["id"] = TAG_String(u'AreaEffectCloud')
                areaEffectCloud2["ownerUUID"] = TAG_String(u'')
                areaEffectCloud2["OnGround"] = TAG_Byte(0)
                areaEffectCloud2["Dimension"] = TAG_Int(0)
                areaEffectCloud2["Air"] = TAG_Short(300)
                areaEffectCloud2["ParticleParam2"] = TAG_Int(0)
                areaEffectCloud2["ParticleParam1"] = TAG_Int(0)
                if ItemsSmokeBox2 == "PC":
                    areaEffectCloud2["Particle"] = TAG_String(u"take")
                if ItemsSmokeBox2 != "PC":
                    areaEffectCloud2["Particle"] = TAG_Int(0)
                areaEffectCloud2["ReapplicationDelay"] = TAG_Int(0)
                rotation2 = TAG_List()
                rotation2.append(TAG_Float(0.0))
                rotation2.append(TAG_Float(0.0))
                areaEffectCloud2["Rotation"] = rotation2
                areaEffectCloud2["FallDistance"] = TAG_Float(0.0)
                effects2 = TAG_List()
                effect4 = TAG_Compound()
                effect4["Amplifier"] = TAG_Byte(15)
                effect4["Id"] = TAG_Byte(25)
                effect4["Duration"] = TAG_Int(10)
                effect4["Ambient"] = TAG_Byte(0)
                effect4["ShowParticles"] = TAG_Byte(0)
                effects2.append(effect4)
                effect5 = TAG_Compound()
                effect5["Amplifier"] = TAG_Byte(100)
                effect5["Id"] = TAG_Byte(11)
                effect5["Duration"] = TAG_Int(100)
                effect5["Ambient"] = TAG_Byte(0)
                effect5["ShowParticles"] = TAG_Byte(0)
                effects2.append(effect5)
                effect6 = TAG_Compound()
                effect6["Amplifier"] = TAG_Byte(20)
                effect6["Id"] = TAG_Byte(8)
                effect6["Duration"] = TAG_Int(40)
                effect6["Ambient"] = TAG_Byte(0)
                effect6["ShowParticles"] = TAG_Byte(0)
                effects2.append(effect6)
                areaEffectCloud2["Effects"] = effects2
                areaEffectCloud2["Fire"] = TAG_Short(0)
                areaEffectCloud2["Invulnerable"] = TAG_Byte(0)
                areaEffectCloud2["PortalCooldown"] = TAG_Int(0)
                areaEffectCloud2["CustomName"] = TAG_String(u'')
                areaEffectCloud2["createdOnHost"] = TAG_Byte(0)
                areaEffectCloud2["Silent"] = TAG_Byte(1)
                areaEffectCloud2["NoGravity"] = TAG_Byte(1)
                areaEffectCloud2["Glowing"] = TAG_Byte(0)
                areaEffectCloud2["Age"] = TAG_Int(1)
                areaEffectCloud2["RadiusOnUse"] = TAG_Float(0.0)
                areaEffectCloud2["Duration"] = TAG_Int(2147483647)
                areaEffectCloud2["DurationOnUse"] = TAG_Int(0)
                areaEffectCloud2["WaitTime"] = TAG_Int(0)
                areaEffectCloud2["RadiusPerTick"] = TAG_Float(0.0)
                areaEffectCloud2["Radius"] = TAG_Float(2.5)
                areaEffectCloud2["Color"] = TAG_Int(0)
                areaEffectCloud2["Potion"] = TAG_String(u'minecraft:leaping')
                pos2 = TAG_List()
                pos2.append(TAG_Double(x + 0.5))
                pos2.append(TAG_Double(y + 1.1))
                pos2.append(TAG_Double(z + 0.5))
                areaEffectCloud2["Pos"] = pos2
                motion2 = TAG_List()
                motion2.append(TAG_Double(0.0))
                motion2.append(TAG_Double(0.0))
                motion2.append(TAG_Double(0.0))
                areaEffectCloud2["Motion"] = motion2

                chunk.Entities.append(areaEffectCloud2)
                chunk.Entities.append(areaEffectCloud)
                print "Created Trampoline! Successfully"
                chunk.dirty = True

                #Blackwool #3x3

                level.setBlockAt(x, y + 1, z, 171)
                level.setBlockDataAt(x, y + 1, z, 15)

                level.setBlockAt(x + 1, y + 1, z, 171)
                level.setBlockDataAt(x + 1, y + 1, z, 15)

                level.setBlockAt(x, y + 1, z + 1, 171)
                level.setBlockDataAt(x, y + 1, z + 1, 15)

                level.setBlockAt(x + 1, y + 1, z + 1, 171)
                level.setBlockDataAt(x + 1, y + 1, z + 1, 15)

                level.setBlockAt(x, y + 1, z - 1, 171)
                level.setBlockDataAt(x, y + 1, z - 1, 15)

                level.setBlockAt(x - 1, y + 1, z, 171)
                level.setBlockDataAt(x - 1, y + 1, z, 15)

                level.setBlockAt(x - 1, y + 1, z - 1, 171)
                level.setBlockDataAt(x - 1, y + 1, z - 1, 15)

                level.setBlockAt(x + 1, y + 1, z - 1, 171)
                level.setBlockDataAt(x + 1, y + 1, z - 1, 15)

                level.setBlockAt(x - 1, y + 1, z + 1, 171)
                level.setBlockDataAt(x - 1, y + 1, z + 1, 15)

                #Blackwool #2 3x3 Empty Circle

                level.setBlockAt(x + 2, y + 1, z, 171)
                level.setBlockDataAt(x + 2, y + 1, z, 15)

                level.setBlockAt(x - 2, y + 1, z, 171)
                level.setBlockDataAt(x - 2, y + 1, z, 15)

                level.setBlockAt(x, y + 1, z + 2, 171)
                level.setBlockDataAt(x, y + 1, z + 2, 15)

                level.setBlockAt(x, y + 1, z - 2, 171)
                level.setBlockDataAt(x, y + 1, z - 2, 15)

                level.setBlockAt(x + 2, y + 1, z - 1, 171)
                level.setBlockDataAt(x + 2, y + 1, z - 1, 15)

                level.setBlockAt(x - 1, y + 1, z + 2, 171)
                level.setBlockDataAt(x - 1, y + 1, z + 2, 15)

                level.setBlockAt(x + 1, y + 1, z + 2, 171)
                level.setBlockDataAt(x + 1, y + 1, z + 2, 15)

                level.setBlockAt(x + 2, y + 1, z + 1, 171)
                level.setBlockDataAt(x + 2, y + 1, z + 1, 15)

                level.setBlockAt(x + 1, y + 1, z + -2, 171)
                level.setBlockDataAt(x + 1, y + 1, z - 2, 15)

                level.setBlockAt(x - 2, y + 1, z + 1, 171)
                level.setBlockDataAt(x - 2, y + 1, z + 1, 15)

                level.setBlockAt(x - 2, y + 1, z - 1, 171)
                level.setBlockDataAt(x - 2, y + 1, z - 1, 15)

                level.setBlockAt(x - 1, y + 1, z - 2, 171)
                level.setBlockDataAt(x - 1, y + 1, z - 2, 15)

                #Blue Wool 5x5 / 3x3

                level.setBlockAt(x + 3, y + 1, z, 171)
                level.setBlockDataAt(x + 3, y + 1, z, 11)

                level.setBlockAt(x - 3, y + 1, z, 171)
                level.setBlockDataAt(x - 3, y + 1, z, 11)

                level.setBlockAt(x, y + 1, z + 3, 171)
                level.setBlockDataAt(x, y + 1, z + 3, 11)

                level.setBlockAt(x, y + 1, z - 3, 171)
                level.setBlockDataAt(x, y + 1, z - 3, 11)

                level.setBlockAt(x + 1, y + 1, z - 3, 171)
                level.setBlockDataAt(x + 1, y + 1, z - 3, 11)

                level.setBlockAt(x - 1, y + 1, z - 3, 171)
                level.setBlockDataAt(x - 1, y + 1, z - 3, 11)

                level.setBlockAt(x + 3, y + 1, z - 1, 171)
                level.setBlockDataAt(x + 3, y + 1, z - 1, 11)

                level.setBlockAt(x - 3, y + 1, z - 1, 171)
                level.setBlockDataAt(x - 3, y + 1, z - 1, 11)

                level.setBlockAt(x + 3, y + 1, z + 1, 171)
                level.setBlockDataAt(x + 3, y + 1, z + 1, 11)

                level.setBlockAt(x - 3, y + 1, z + 1, 171)
                level.setBlockDataAt(x - 3, y + 1, z + 1, 11)

                level.setBlockAt(x + 1, y + 1, z + 3, 171)
                level.setBlockDataAt(x + 1, y + 1, z + 3, 11)

                level.setBlockAt(x - 1, y + 1, z + 3, 171)
                level.setBlockDataAt(x - 1, y + 1, z + 3, 11)
                #
                level.setBlockAt(x - 2, y + 1, z + 2, 171)
                level.setBlockDataAt(x - 2, y + 1, z + 2, 11)

                level.setBlockAt(x + 2, y + 1, z - 2, 171)
                level.setBlockDataAt(x + 2, y + 1, z - 2, 11)

                level.setBlockAt(x + 2, y + 1, z + 2, 171)
                level.setBlockDataAt(x + 2, y + 1, z + 2, 11)

                level.setBlockAt(x + 2, y + 1, z - 2, 171)
                level.setBlockDataAt(x + 2, y + 1, z - 2, 11)

                level.setBlockAt(x - 2, y + 1, z - 2, 171)
                level.setBlockDataAt(x - 2, y + 1, z - 2, 11)

                if extrab == True:

                    #Slime Block #3x3

                    level.setBlockAt(x, y, z, 165)
                    level.setBlockDataAt(x, y, z, 0)

                    level.setBlockAt(x + 1, y, z, 165)
                    level.setBlockDataAt(x + 1, y, z, 0)

                    level.setBlockAt(x, y, z + 1, 165)
                    level.setBlockDataAt(x, y, z + 1, 0)

                    level.setBlockAt(x + 1, y, z + 1, 165)
                    level.setBlockDataAt(x + 1, y, z + 1, 0)

                    level.setBlockAt(x, y, z - 1, 165)
                    level.setBlockDataAt(x, y, z - 1, 0)

                    level.setBlockAt(x - 1, y, z, 165)
                    level.setBlockDataAt(x - 1, y, z, 0)

                    level.setBlockAt(x - 1, y, z - 1, 165)
                    level.setBlockDataAt(x - 1, y, z - 1, 0)

                    level.setBlockAt(x + 1, y, z - 1, 165)
                    level.setBlockDataAt(x + 1, y, z - 1, 0)

                    level.setBlockAt(x - 1, y, z + 1, 165)
                    level.setBlockDataAt(x - 1, y, z + 1, 0)

                    #Part 2 Slime 3x3 Empty Circle

                    level.setBlockAt(x + 2, y, z, 165)
                    level.setBlockDataAt(x + 2, y, z, 0)

                    level.setBlockAt(x - 2, y, z, 165)
                    level.setBlockDataAt(x - 2, y, z, 0)

                    level.setBlockAt(x, y, z + 2, 165)
                    level.setBlockDataAt(x, y, z + 2, 0)

                    level.setBlockAt(x, y, z - 2, 165)
                    level.setBlockDataAt(x, y, z - 2, 0)

                    level.setBlockAt(x + 2, y, z - 1, 165)
                    level.setBlockDataAt(x + 2, y, z - 1, 0)

                    level.setBlockAt(x - 1, y, z + 2, 165)
                    level.setBlockDataAt(x - 1, y, z + 2, 0)

                    level.setBlockAt(x + 1, y, z + 2, 165)
                    level.setBlockDataAt(x + 1, y, z + 2, 0)

                    level.setBlockAt(x + 2, y, z + 1, 165)
                    level.setBlockDataAt(x + 2, y, z + 1, 0)

                    level.setBlockAt(x + 1, y, z + -2, 165)
                    level.setBlockDataAt(x + 1, y, z - 2, 0)

                    level.setBlockAt(x - 2, y, z + 1, 165)
                    level.setBlockDataAt(x - 2, y, z + 1, 0)

                    level.setBlockAt(x - 2, y, z - 1, 165)
                    level.setBlockDataAt(x - 2, y, z - 1, 0)

                    level.setBlockAt(x - 1, y, z - 2, 165)
                    level.setBlockDataAt(x - 1, y, z - 2, 0)

                    #Part 3 Slime Outer Ring

                    level.setBlockAt(x + 3, y, z, 165)
                    level.setBlockDataAt(x + 3, y, z, 0)

                    level.setBlockAt(x - 3, y, z, 165)
                    level.setBlockDataAt(x - 3, y, z, 0)

                    level.setBlockAt(x, y, z + 3, 165)
                    level.setBlockDataAt(x, y, z + 3, 0)

                    level.setBlockAt(x, y, z - 3, 165)
                    level.setBlockDataAt(x, y, z - 3, 0)

                    level.setBlockAt(x + 1, y, z - 3, 165)
                    level.setBlockDataAt(x + 1, y, z - 3, 0)

                    level.setBlockAt(x - 1, y, z - 3, 165)
                    level.setBlockDataAt(x - 1, y, z - 3, 0)

                    level.setBlockAt(x + 3, y, z - 1, 165)
                    level.setBlockDataAt(x + 3, y, z - 1, 0)

                    level.setBlockAt(x - 3, y, z - 1, 165)
                    level.setBlockDataAt(x - 3, y, z - 1, 0)

                    level.setBlockAt(x + 3, y, z + 1, 165)
                    level.setBlockDataAt(x + 3, y, z + 1, 0)

                    level.setBlockAt(x - 3, y, z + 1, 165)
                    level.setBlockDataAt(x - 3, y, z + 1, 0)

                    level.setBlockAt(x + 1, y, z + 3, 165)
                    level.setBlockDataAt(x + 1, y, z + 3, 0)

                    level.setBlockAt(x - 1, y, z + 3, 165)
                    level.setBlockDataAt(x - 1, y, z + 3, 0)

                    level.setBlockAt(x - 2, y, z + 2, 165)
                    level.setBlockDataAt(x - 2, y, z + 2, 0)

                    level.setBlockAt(x + 2, y, z - 2, 165)
                    level.setBlockDataAt(x + 2, y, z - 2, 0)

                    level.setBlockAt(x + 2, y, z + 2, 165)
                    level.setBlockDataAt(x + 2, y, z + 2, 0)

                    level.setBlockAt(x + 2, y, z - 2, 165)
                    level.setBlockDataAt(x + 2, y, z - 2, 0)

                    level.setBlockAt(x - 2, y, z - 2, 165)
                    level.setBlockDataAt(x - 2, y, z - 2, 0)
                else:
                    #String Middle Block #3x3

                    level.setBlockAt(x, y, z, 166)
                    level.setBlockDataAt(x, y, z, 0)

                    level.setBlockAt(x + 1, y, z, 166)
                    level.setBlockDataAt(x + 1, y, z, 0)

                    level.setBlockAt(x, y, z + 1, 166)
                    level.setBlockDataAt(x, y, z + 1, 0)

                    level.setBlockAt(x + 1, y, z + 1, 166)
                    level.setBlockDataAt(x + 1, y, z + 1, 0)

                    level.setBlockAt(x, y, z - 1, 166)
                    level.setBlockDataAt(x, y, z - 1, 0)

                    level.setBlockAt(x - 1, y, z, 166)
                    level.setBlockDataAt(x - 1, y, z, 0)

                    level.setBlockAt(x - 1, y, z - 1, 166)
                    level.setBlockDataAt(x - 1, y, z - 1, 0)

                    level.setBlockAt(x + 1, y, z - 1, 166)
                    level.setBlockDataAt(x + 1, y, z - 1, 0)

                    level.setBlockAt(x - 1, y, z + 1, 166)
                    level.setBlockDataAt(x - 1, y, z + 1, 0)

                    #String Block Inner #3x3

                    level.setBlockAt(x + 2, y, z, 166)
                    level.setBlockDataAt(x + 2, y, z, 0)

                    level.setBlockAt(x - 2, y, z, 166)
                    level.setBlockDataAt(x - 2, y, z, 0)

                    level.setBlockAt(x, y, z + 2, 166)
                    level.setBlockDataAt(x, y, z + 2, 0)

                    level.setBlockAt(x, y, z - 2, 166)
                    level.setBlockDataAt(x, y, z - 2, 0)

                    level.setBlockAt(x + 2, y, z - 1, 166)
                    level.setBlockDataAt(x + 2, y, z - 1, 0)

                    level.setBlockAt(x - 1, y, z + 2, 166)
                    level.setBlockDataAt(x - 1, y, z + 2, 0)

                    level.setBlockAt(x + 1, y, z + 2, 166)
                    level.setBlockDataAt(x + 1, y, z + 2, 0)

                    level.setBlockAt(x + 2, y, z + 1, 166)
                    level.setBlockDataAt(x + 2, y, z + 1, 0)

                    level.setBlockAt(x + 1, y, z + -2, 166)
                    level.setBlockDataAt(x + 1, y, z - 2, 0)

                    level.setBlockAt(x - 2, y, z + 1, 166)
                    level.setBlockDataAt(x - 2, y, z + 1, 0)

                    level.setBlockAt(x - 2, y, z - 1, 166)
                    level.setBlockDataAt(x - 2, y, z - 1, 0)

                    level.setBlockAt(x - 1, y, z - 2, 166)
                    level.setBlockDataAt(x - 1, y, z - 2, 0)

                    #Iron Fence Block #3x3 Outer

                    level.setBlockAt(x + 3, y, z, 101)
                    level.setBlockDataAt(x + 3, y, z, 0)

                    level.setBlockAt(x - 3, y, z, 101)
                    level.setBlockDataAt(x - 3, y, z, 0)

                    level.setBlockAt(x, y, z + 3, 101)
                    level.setBlockDataAt(x, y, z + 3, 0)

                    level.setBlockAt(x, y, z - 3, 101)
                    level.setBlockDataAt(x, y, z - 3, 0)

                    level.setBlockAt(x + 1, y, z - 3, 101)
                    level.setBlockDataAt(x + 1, y, z - 3, 0)

                    level.setBlockAt(x - 1, y, z - 3, 101)
                    level.setBlockDataAt(x - 1, y, z - 3, 0)

                    level.setBlockAt(x + 3, y, z - 1, 101)
                    level.setBlockDataAt(x + 3, y, z - 1, 0)

                    level.setBlockAt(x - 3, y, z - 1, 101)
                    level.setBlockDataAt(x - 3, y, z - 1, 0)

                    level.setBlockAt(x + 3, y, z + 1, 101)
                    level.setBlockDataAt(x + 3, y, z + 1, 0)

                    level.setBlockAt(x - 3, y, z + 1, 101)
                    level.setBlockDataAt(x - 3, y, z + 1, 0)

                    level.setBlockAt(x + 1, y, z + 3, 101)
                    level.setBlockDataAt(x + 1, y, z + 3, 0)

                    level.setBlockAt(x - 1, y, z + 3, 101)
                    level.setBlockDataAt(x - 1, y, z + 3, 0)

                    level.setBlockAt(x - 2, y, z + 2, 101)
                    level.setBlockDataAt(x - 2, y, z + 2, 0)

                    level.setBlockAt(x + 2, y, z - 2, 101)
                    level.setBlockDataAt(x + 2, y, z - 2, 0)

                    level.setBlockAt(x + 2, y, z + 2, 101)
                    level.setBlockDataAt(x + 2, y, z + 2, 0)

                    level.setBlockAt(x + 2, y, z - 2, 101)
                    level.setBlockDataAt(x + 2, y, z - 2, 0)

                    level.setBlockAt(x - 2, y, z - 2, 101)
                    level.setBlockDataAt(x - 2, y, z - 2, 0)
Ejemplo n.º 29
0
def createShop(level, x, y, z, emptyTrade, invincible, profession, unlimited):
    chest = level.tileEntityAt(x, y, z)
    if chest == None:
        return

    priceList = {}
    priceListB = {}
    saleList = {}

    for item in chest["Items"]:
        slot = item["Slot"].value
        if slot >= 0 and slot <= 8:
            priceList[slot] = item
        elif slot >= 9 and slot <= 17:
            priceListB[slot - 9] = item
        elif slot >= 18 and slot <= 26:
            saleList[slot - 18] = item

    villager = TAG_Compound()
    villager["OnGround"] = TAG_Byte(1)
    villager["Air"] = TAG_Short(300)
    villager["AttackTime"] = TAG_Short(0)
    villager["DeathTime"] = TAG_Short(0)
    villager["Fire"] = TAG_Short(-1)
    villager["Health"] = TAG_Short(20)
    villager["HurtTime"] = TAG_Short(0)
    villager["Age"] = TAG_Int(0)
    villager["Profession"] = TAG_Int(profession)
    villager["Riches"] = TAG_Int(0)
    villager["FallDistance"] = TAG_Float(0)
    villager["id"] = TAG_String("Villager")
    villager["Motion"] = TAG_List()
    villager["Motion"].append(TAG_Double(0))
    villager["Motion"].append(TAG_Double(0))
    villager["Motion"].append(TAG_Double(0))
    villager["Pos"] = TAG_List()
    villager["Pos"].append(TAG_Double(x + 0.5))
    villager["Pos"].append(TAG_Double(y))
    villager["Pos"].append(TAG_Double(z + 0.5))
    villager["Rotation"] = TAG_List()
    villager["Rotation"].append(TAG_Float(0))
    villager["Rotation"].append(TAG_Float(0))

    villager["Offers"] = TAG_Compound()
    villager["Offers"]["Recipes"] = TAG_List()
    for i in range(9):
        if (i in priceList or i in priceListB) and i in saleList:
            offer = TAG_Compound()
            if unlimited:
                offer["uses"] = TAG_Int(-2000000000)
            else:
                offer["uses"] = TAG_Int(0)

            if i in priceList:
                offer["buy"] = priceList[i]
            if i in priceListB:
                if i in priceList:
                    offer["buyB"] = priceListB[i]
                else:
                    offer["buy"] = priceListB[i]

            offer["sell"] = saleList[i]
            villager["Offers"]["Recipes"].append(offer)

    if emptyTrade:
        offer = TAG_Compound()
        offer["buy"] = TAG_Compound()
        offer["buy"]["Count"] = TAG_Byte(1)
        offer["buy"]["Damage"] = TAG_Short(0)
        offer["buy"]["id"] = TAG_Short(36)
        offer["sell"] = TAG_Compound()
        offer["sell"]["Count"] = TAG_Byte(1)
        offer["sell"]["Damage"] = TAG_Short(0)
        offer["sell"]["id"] = TAG_Short(36)
        villager["Offers"]["Recipes"].append(offer)

    if invincible:
        if "ActiveEffects" not in villager:
            villager["ActiveEffects"] = TAG_List()

            resist = TAG_Compound()
            resist["Amplifier"] = TAG_Byte(4)
            resist["Id"] = TAG_Byte(11)
            resist["Duration"] = TAG_Int(2000000000)
            villager["ActiveEffects"].append(resist)

    level.setBlockAt(x, y, z, 0)

    chunk = level.getChunk(x / 16, z / 16)
    chunk.Entities.append(villager)
    chunk.TileEntities.remove(chest)
    chunk.dirty = True
Ejemplo n.º 30
0
    spawner["MinSpawnDelay"] = TAG_Short(loopTicks)
    spawner["MaxSpawnDelay"] = TAG_Short(loopTicks)
    spawner["SpawnCount"] = TAG_Short(1)
    spawner["MaxNearbyEntities"] = TAG_Short(10000)
    spawner["RequiredPlayerRange"] = TAG_Short(range)
    # Creates a spawner with certain aspects

    return spawner


def createPotion((x, y, z), (vx, vy, vz), effect, duration, amp, potionId):
    thrownPotion = TAG_Compound()
    thrownPotion["yTile"] = TAG_Short(-1)

    motion = TAG_List()
    motion.append(TAG_Double(vx))
    motion.append(TAG_Double(vy))
    motion.append(TAG_Double(vz))
    thrownPotion["Motion"] = motion

    thrownPotion["OnGround"] = TAG_Byte(0)
    thrownPotion["inGround"] = TAG_Byte(0)
    thrownPotion["shake"] = TAG_Byte(0)
    thrownPotion["Dimension"] = TAG_Int(0)
    thrownPotion["inTile"] = TAG_Byte(0)
    thrownPotion["Air"] = TAG_Short(300)
    thrownPotion["id"] = TAG_String(u'ThrownPotion')

    pos = TAG_List()
    pos.append(TAG_Double(x))
    pos.append(TAG_Double(y))