コード例 #1
0
ファイル: mce.py プロジェクト: DominicDV/MCEdit-Unified
    def loadWorld(self, world):

        worldpath = os.path.expanduser(world)
        if os.path.exists(worldpath):
            self.level = mclevel.fromFile(worldpath)
        else:
            self.level = mclevel.loadWorld(world)
コード例 #2
0
ファイル: mce.py プロジェクト: Alexhb61/MCEdit-Unified
    def loadWorld(self, world):

        worldpath = os.path.expanduser(world)
        if os.path.exists(worldpath):
            self.level = mclevel.fromFile(worldpath)
        else:
            self.level = mclevel.loadWorld(world)
コード例 #3
0
    def find_marked_area(self):
        self.world = mclevel.loadWorld(self.level_name)

        #Load chunks and determine minimize indexes
        self.chunk_positions = list(self.world.allChunks)
        self.num_chunks = len(self.chunk_positions)

        #Just a little user feedback on the progress
        print "Processing level: " + self.level_name
        print "Scanning level for markers..."
        self.chunk_counter = 1
        
        self.find_markers()
        
        print '100%'
コード例 #4
0
def main(argv):
    print "* SAVE FILE DIR = \"" + saveFileDir +"\""

    print "* SAVE(S) AVAILABLE = "
    for save in getAvailSave():
        print save
    
    if len(argv) > 1:
         try:
             filename = os.path.join(saveFileDir, argv[1])
             print "FULL FILENAME = \"" + filename +"\""
             world = mclevel.loadWorld(argv[1]);
             print "* MAP SUCCESSFULLY LOADED *"
             print "SEED = " + str(world.RandomSeed)
             print "NUMBER OF LOADED CHUNKS = " + str(len(list(world.allChunks)))

             testModifyMap(world)
             # testCapacity(world)
             world.close()
         except IOError, e:
             print "ERROR = {0} {1}".format(type(e), e.strerror)
コード例 #5
0
ファイル: blockchart.py プロジェクト: MestreLion/blockchart
 def openworld(name):
     if osp.isfile(name):
         return mclevel.fromFile(name, readonly=True)
     else:
         return mclevel.loadWorld(name)
コード例 #6
0
ファイル: helloworld.py プロジェクト: donyu/minetime
"""

import logging
import os
import sys
from pymclevel import mclevel, box

MC_DIR = "~/.minecraft/saves"

if __name__ == "__main__":
    world = sys.argv[1]
    saves = os.path.expanduser(MC_DIR)
    worldpath = os.path.join(saves, world)

    # Creates a map if doesn't exist, else loads pre-existing map
    if not os.path.exists(worldpath):
        level = mclevel.MCInfdevOldLevel(worldpath, create=True)
    else:
        level = mclevel.loadWorld(worldpath)
    
    # Empty chunk dimensions
    chunk_box = box.BoundingBox((-32, 0, -32), (64, 64, 64))
    level.createChunksInBox(chunk_box)

    # Diamond ore
    dblock =  level.materials.blockWithID(57)
    dblock_box = box.BoundingBox(origin=(5,5,5), size=(1,1,1)) 
    level.fillBlocks(dblock_box, dblock)
    
    level.saveInPlace()
コード例 #7
0
ファイル: FindEntity.py プロジェクト: MikeyCarter/ItemSorter
import sys
import unicodedata
import re
from pymclevel import mclevel
from pymclevel import nbt
from pymclevel.schematic import MCSchematic
from pymclevel.box import BoundingBox

from pymclevel.nbt import TAG_Compound, TAG_Byte, TAG_List, TAG_Int_Array, TAG_Short, TAG_String, TAG_Int
from pymclevel.box import Vector

def printf(format, *args):
    sys.stdout.write(format % args)

#level = mclevel.fromFile("/home/mcarter/.minecraft/saves/MikeyWorld-Backup/")
world1 = mclevel.loadWorld("Metazoa-Backup");

# The root tag must have a name, and so must any tag within a TAG_Compound
#print level



chunkPositions = list(world1.allChunks)
#xPos, zPos = chunkPositions[10];
#print chunkPositions
sorterArr = {}

#-5    -   -15
# 6    -    11

name_array = { (20 ,0): "Glass",
コード例 #8
0
ファイル: blockchart.py プロジェクト: MestreLion/blockchart
 def openworld(name):
     if osp.isfile(name):
         return mclevel.fromFile(name, readonly=True)
     else:
         return mclevel.loadWorld(name)