def list_worlds(): for i, world in enumerate(minecraft.getWorlds()): name, path = world print(" - %s" % (name)) for j, dimension in enumerate(minecraft.getDimensions(world)): dimension_name, dimension_id = dimension print(" %s (%s)" % (dimension_id, dimension_name))
def createComboWorld(self): combo = QtGui.QComboBox() combo.currentIndexChanged.connect(self.selectWorld) self.modelWorld = QtGui.QStandardItemModel() combo.setModel(self.modelWorld) for i, world in enumerate(minecraft.getWorlds()): name, path = world item = QtGui.QStandardItem(name) item.setData(path) self.modelWorld.setItem(i, 0, item) combo.setCurrentIndex(0) return combo